summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/kwsysPlatformTestsC.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/kwsys/kwsysPlatformTestsC.c')
-rw-r--r--Source/kwsys/kwsysPlatformTestsC.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/kwsys/kwsysPlatformTestsC.c b/Source/kwsys/kwsysPlatformTestsC.c
index 36c5f4d..58b22f3 100644
--- a/Source/kwsys/kwsysPlatformTestsC.c
+++ b/Source/kwsys/kwsysPlatformTestsC.c
@@ -1,5 +1,7 @@
-/* Macros to define main() in a cross-platform way.
- Usage:
+/*
+ Macros to define main() in a cross-platform way.
+
+ Usage:
int KWSYS_PLATFORM_TEST_C_MAIN()
{
@@ -23,3 +25,27 @@
# define KWSYS_PLATFORM_TEST_C_MAIN_ARGS(argc, argv) \
main(int argc, char* argv[])
#endif
+
+/*--------------------------------------------------------------------------*/
+#ifdef TEST_KWSYS_C_HAS_PTRDIFF_T
+#include <stddef.h>
+int f(ptrdiff_t n) { return n > 0; }
+int KWSYS_PLATFORM_TEST_C_MAIN()
+{
+ char* p = 0;
+ ptrdiff_t d = p - p;
+ (void)d;
+ return f(p - p);
+}
+#endif
+
+/*--------------------------------------------------------------------------*/
+#ifdef TEST_KWSYS_C_HAS_SSIZE_T
+#include <unistd.h>
+int f(ssize_t n) { return (int)n; }
+int KWSYS_PLATFORM_TEST_C_MAIN()
+{
+ ssize_t n = 0;
+ return f(n);
+}
+#endif