aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/include/test.h12
-rw-r--r--tests/tnimterop_c.nim9
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/include/test.h b/tests/include/test.h
index 6a3d9a4..741fa97 100644
--- a/tests/include/test.h
+++ b/tests/include/test.h
@@ -8,6 +8,18 @@ extern "C" {
#define TEST_FLOAT 5.12
#define TEST_HEX 0x512
+#ifdef __APPLE__
+#define OSDEF 10
+#endif
+
+#ifdef _WIN32
+#define OSDEF 20
+#endif
+
+#ifdef __linux__
+#define OSDEF 30
+#endif
+
typedef uint8_t PRIMTYPE;
typedef PRIMTYPE CUSTTYPE;
diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim
index 69f8105..74e1afa 100644
--- a/tests/tnimterop_c.nim
+++ b/tests/tnimterop_c.nim
@@ -13,6 +13,13 @@ check TEST_INT == 512
check TEST_FLOAT == 5.12
check TEST_HEX == 0x512
+when defined(osx):
+ check OSDEF == 10
+elif defined(windows):
+ check OSDEF == 20
+else:
+ check OSDEF == 30
+
var
pt: PRIMTYPE
ct: CUSTTYPE
@@ -34,7 +41,7 @@ var
u: UNION1
u2: UNION2
- i: int
+ i: cint
pt = 3
ct = 4