summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/build/cmake/CheckHeaderSTDC.c
blob: cba081041fe6a5c625fb8038b50c81083222e25e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}