Fix appveyor windows build (#420)

* Fix msvcc dll build by adding dllexport decorations to all API declarations

* Fix appveyor build for VS 2013

Use the new -DFFI_BUILDING_DLL for producing a working DLL. Update the
msvcc.sh wrapper script to successfully compile the testsuite files.

* MSVC build: suppress warnings in testsuite

* fix testsuite on appveyor
This commit is contained in:
fwg
2018-04-02 06:55:31 -05:00
committed by Anthony Green
parent 48bdb02867
commit af6773d6ab
8 changed files with 138 additions and 52 deletions
+9 -1
View File
@@ -25,7 +25,15 @@ global compiler_vendor
# flags to disable warnings for now.
if { [string match $compiler_vendor "gnu"] } {
set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-uninitialized";
} else {
}
if { [string match $compiler_vendor "microsoft"] } {
# -wd4996 suggest use of vsprintf_s instead of vsprintf
# -wd4116 unnamed type definition
# -wd4101 unreferenced local variable
# -wd4244 warning about implicit double to float conversion
set warning_options "-wd4996 -wd4116 -wd4101 -wd4244";
}
if { ![string match $compiler_vendor "microsoft"] && ![string match $compiler_vendor "gnu"] } {
set warning_options "-Wno-unused-variable -Wno-unused-parameter -Wno-uninitialized";
}
+4 -3
View File
@@ -25,8 +25,6 @@
#include "alignof.h"
#include <stdarg.h>
#include "testcases.c"
/* libffi testsuite local changes -------------------------------- */
#ifdef DGTEST
/* Redefine exit(1) as a test failure */
@@ -34,7 +32,7 @@
int count = 0;
char rbuf1[2048];
char rbuf2[2048];
int fprintf(FILE *stream, const char *format, ...)
int _fprintf(FILE *stream, const char *format, ...)
{
va_list args;
va_start(args, format);
@@ -60,9 +58,12 @@ int fprintf(FILE *stream, const char *format, ...)
return 0;
}
#define fprintf _fprintf
#endif
/* --------------------------------------------------------------- */
#include "testcases.c"
#ifndef ABI_NUM
#define ABI_NUM FFI_DEFAULT_ABI
#endif
+4 -3
View File
@@ -25,8 +25,6 @@
#include "alignof.h"
#include <stdarg.h>
#include "testcases.c"
/* libffi testsuite local changes -------------------------------- */
#ifdef DGTEST
/* Redefine exit(1) as a test failure */
@@ -34,7 +32,7 @@
int count = 0;
char rbuf1[2048];
char rbuf2[2048];
int fprintf(FILE *stream, const char *format, ...)
int _fprintf(FILE *stream, const char *format, ...)
{
va_list args;
va_start(args, format);
@@ -60,9 +58,12 @@ int fprintf(FILE *stream, const char *format, ...)
return 0;
}
#define fprintf _fprintf
#endif
/* --------------------------------------------------------------- */
#include "testcases.c"
#ifndef ABI_NUM
#define ABI_NUM FFI_DEFAULT_ABI
#endif
+14 -1
View File
@@ -19,9 +19,22 @@ libffi-init
global srcdir subdir
if { [string match $compiler_vendor "microsoft"] } {
# -wd4005 macro redefinition
# -wd4244 implicit conversion to type of smaller size
# -wd4305 truncation to smaller type
# -wd4477 printf %lu of uintptr_t
# -wd4312 implicit conversion to type of greater size
# -wd4311 pointer truncation to unsigned long
# -EHsc C++ Exception Handling (no SEH exceptions)
set additional_options "-wd4005 -wd4244 -wd4305 -wd4477 -wd4312 -wd4311 -EHsc";
} else {
set additional_options "";
}
set tlist [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]]
run-many-tests $tlist ""
run-many-tests $tlist $additional_options
dg-finish