summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2023-04-20 20:08:45 +0200
committerGitHub <noreply@github.com>2023-04-20 20:08:45 +0200
commit98cce6a671e333fcb6b6eeeb821885f03d0e2fa5 (patch)
treeb9a2938952ce2a777b523eccc4a732653f4a0eda
parent82c018810d8bbd72428606ec4fd3b0fcf42caa5a (diff)
parent2589b0a4b931be9e61e1c279d1a577a492f18dfc (diff)
downloadffi-98cce6a671e333fcb6b6eeeb821885f03d0e2fa5.tar.gz
Merge pull request #1028 from cfis/master
MSVC Test Support
-rw-r--r--spec/ffi/fixtures/ClosureTest.c12
-rw-r--r--spec/ffi/fixtures/PipeHelperWindows.c4
-rw-r--r--spec/ffi/fixtures/PointerTest.c2
3 files changed, 10 insertions, 8 deletions
diff --git a/spec/ffi/fixtures/ClosureTest.c b/spec/ffi/fixtures/ClosureTest.c
index 16f72c4..47273e8 100644
--- a/spec/ffi/fixtures/ClosureTest.c
+++ b/spec/ffi/fixtures/ClosureTest.c
@@ -16,10 +16,10 @@
double testClosureVrDva(double d, ...) {
va_list args;
- double (*closure)(void);
+ typedef double (*closure_fun)(void);
va_start(args, d);
- closure = va_arg(args, double (*)(void));
+ closure_fun closure = va_arg(args, closure_fun);
va_end(args);
return d + closure();
@@ -27,12 +27,12 @@ double testClosureVrDva(double d, ...) {
long testClosureVrILva(int i, long l, ...) {
va_list args;
- int (*cl1)(int);
- long (*cl2)(long);
+ typedef int (*cl1_fun)(int);
+ typedef long (*cl2_fun)(long);
va_start(args, l);
- cl1 = va_arg(args, int (*)(int));
- cl2 = va_arg(args, long (*)(long));
+ cl1_fun cl1 = va_arg(args, cl1_fun);
+ cl2_fun cl2 = va_arg(args, cl2_fun);
va_end(args);
return cl1(i) + cl2(l);
diff --git a/spec/ffi/fixtures/PipeHelperWindows.c b/spec/ffi/fixtures/PipeHelperWindows.c
index 0bdbd2e..31b4a2a 100644
--- a/spec/ffi/fixtures/PipeHelperWindows.c
+++ b/spec/ffi/fixtures/PipeHelperWindows.c
@@ -16,7 +16,7 @@ int pipeHelperCreatePipe(FD_TYPE pipefd[2])
sprintf( name, "\\\\.\\Pipe\\pipeHelper-%u-%i",
(unsigned int)GetCurrentProcessId(), pipe_idx++ );
- pipefd[0] = CreateNamedPipe( name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
+ pipefd[0] = CreateNamedPipeA( name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE | PIPE_WAIT,
1, // Number of pipes
5, // Out buffer size
@@ -26,7 +26,7 @@ int pipeHelperCreatePipe(FD_TYPE pipefd[2])
if(pipefd[0] == INVALID_HANDLE_VALUE)
return -1;
- pipefd[1] = CreateFile( name, GENERIC_WRITE, 0, NULL,
+ pipefd[1] = CreateFileA( name, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
diff --git a/spec/ffi/fixtures/PointerTest.c b/spec/ffi/fixtures/PointerTest.c
index a7f392a..02dbc27 100644
--- a/spec/ffi/fixtures/PointerTest.c
+++ b/spec/ffi/fixtures/PointerTest.c
@@ -5,7 +5,9 @@
*/
#include <sys/types.h>
+#ifndef _MSC_VER
#include <sys/param.h>
+#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>