boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

00212.c (773B)


      1 #include <stdio.h>
      2 
      3 int
      4 main()
      5 {
      6 #if defined(__LLP64__)
      7 	if (sizeof(short) == 2
      8 	    && sizeof(int) == 4
      9 	    && sizeof(long int) == 4
     10 	    && sizeof(long long int) == 8
     11 	    && sizeof(void*) == 8) {
     12 		(void)printf("Ok\n");
     13 	} else {
     14 		(void)printf("KO __LLP64__\n");
     15 	}
     16 #elif defined(__LP64__)
     17 	if (sizeof(short) == 2
     18 	    && sizeof(int) == 4
     19 	    && sizeof(long int) == 8
     20 	    && sizeof(long long int) == 8
     21 	    && sizeof(void*) == 8) {
     22 		(void)printf("Ok\n");
     23 	} else {
     24 		(void)printf("KO __LP64__\n");
     25 	}
     26 #elif defined(__ILP32__)
     27 	if (sizeof(short) == 2
     28 	    && sizeof(int) == 4
     29 	    && sizeof(long int) == 4
     30 	    && sizeof(void*) == 4) {
     31 		(void)printf("Ok\n");
     32 	} else {
     33 		(void)printf("KO __ILP32__\n");
     34 	}
     35 #else
     36 	(void)printf("KO no __*LP*__ defined.\n");
     37 #endif
     38 }