blob: 1612986ff14817bc9f78fccfa77b1ca66daf213c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/*
* File: uint32.c
* Purpose: determine proper type definition for UINT32
*
* Version 1.0: Aug. 1995
*/
#include <stdio.h>
#define TEST(type) \
{ type s; \
s = 1; bits = 0; \
while (s != 0) { s <<= 1; bits++; } \
if (bits == 32) { \
printf("typedef %s UINT32;\n", #type); \
exit(0); \
} \
}
main() {
int bits;
TEST(unsigned int); /* 32 bits? */
TEST(unsigned long); /* 16 bits? */
TEST(unsigned short); /* 64 bits? */
/* What else? */
fprintf(stderr, "No proper unsigned 32 bit type found\n");
exit(1);
}
|