Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions spec/ffi/fixtures/ClosureTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@

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();
}

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);
Expand Down
4 changes: 2 additions & 2 deletions spec/ffi/fixtures/PipeHelperWindows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions spec/ffi/fixtures/PointerTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down