Skip to content
Newer
Older
100644 61 lines (47 sloc) 804 Bytes
e41e81e More header file portability for Windows.
Brian Ford authored
1 #include "config.h"
2
6e77e74 Some OpenBSD fixes from Jeremy Evans.
Brian Ford authored
3 #include <stdint.h>
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
4 #include <stdlib.h>
5 #include <sys/types.h>
e41e81e More header file portability for Windows.
Brian Ford authored
6 #ifdef RBX_WINDOWS
7 #include <winsock2.h>
8 #else
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
9 #include <sys/socket.h>
10 #include <sys/un.h>
11 #include <netinet/in.h>
12 #include <netdb.h>
e41e81e More header file portability for Windows.
Brian Ford authored
13 #endif
14 #include <sys/stat.h>
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
15 #include <errno.h>
16 #include <time.h>
0cec846 @jfirebaugh Attach signbit via FFI
jfirebaugh authored
17 #include <math.h>
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
18
fb9d925 Fixes to compile ffi_util.cpp.
Brian Ford authored
19 #include "windows_compat.h"
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
20 #include "ffi_util.hpp"
21
6bb384d @brixen Use _NSGetEnviron on OSX. Fixes #3446.
brixen authored
22 #ifdef __APPLE__
23 #include <crt_externs.h>
24 #endif
25
a80299b @rue Make ffi_util functions extern "C" to avoid dlsym name mangling problem.
rue authored
26 extern "C" {
27
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
28 extern char** environ;
29
30 int ffi_errno() { return errno; }
31
6bb384d @brixen Use _NSGetEnviron on OSX. Fixes #3446.
brixen authored
32 char** ffi_environ() {
33 #ifdef __APPLE__
34 return *_NSGetEnviron();
35 #else
36 return environ;
37 #endif
38 }
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
39
40 void ffi_set_errno(int n) {
41 errno = n;
42 }
43
19ec01c @leavengood Haiku specific fix: add major and minor defines if they aren't there.
leavengood authored
44 #ifndef major
45 #define major(x) x
46 #endif
47
48 #ifndef minor
49 #define minor(x) 0
50 #endif
51
f71b97b @dgtized converted everything to cpp files to fix -Wno-deprecated error on gcc…
dgtized authored
52 long ffi_major(dev_t n) {
53 return major(n);
54 }
55
56 long ffi_minor(dev_t n) {
57 return minor(n);
58 }
59
a80299b @rue Make ffi_util functions extern "C" to avoid dlsym name mangling problem.
rue authored
60 }
Something went wrong with that request. Please try again.