summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c')
-rw-r--r--Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c b/Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c
new file mode 100644
index 0000000..cba0810
--- /dev/null
+++ b/Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c
@@ -0,0 +1,20 @@
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+
+int
+main()
+{
+ int i;
+
+ for (i = 0; i < 256; i++) {
+ if (XOR(islower(i), ISLOWER(i)) || toupper(i) != TOUPPER(i))
+ return 2;
+ }
+ return 0;
+}