-
Notifications
You must be signed in to change notification settings - Fork 0
/
deftest.c
executable file
·11278 lines (9868 loc) · 286 KB
/
deftest.c
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2007-22 Detlef Riekenberg
*
* newest version:
* https://www.github.com/winspool/deftest
*
* A program to check for predefined macros/defines
* for various C and C++ compiler
*
* ############################## */
#ifdef __cplusplus
extern "C" {
#endif
#define BUFFERSIZE 16384
#define NO_GUI
/* ################################## */
/* STDC headers */
/* default is C11 */
#ifdef USE_POSIX
#ifndef USE_C11
#define USE_C11
#endif
#endif
#ifdef USE_C23
#ifndef USE_C17
#define USE_C17
#endif
#endif
#ifdef USE_C18
#ifndef USE_C17
#define USE_C17
#endif
#endif
#ifdef USE_C17
#ifndef USE_C11
#define USE_C11
#endif
#endif
#ifdef USE_C11
#ifndef USE_C99
#define USE_C99
#endif
#endif
#ifdef USE_C99
#ifndef USE_C95
#define USE_C95
#endif
#endif
#ifdef USE_C95
#ifndef USE_C90
#define USE_C90
#endif
#endif
#ifdef USE_C90
#ifndef USE_C89
#define USE_C89
#endif
#endif
#ifdef USE_C89
#ifndef USE_ANSI_C
#define USE_ANSI_C
#endif
#endif
#ifdef __cplusplus
#include <cstdio>
#include <cstdarg>
#include <cstring>
#else
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
/* use all ANSI C (c89) header */
#ifdef USE_ANSI_C
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#endif
/* ANSI C (c89) header */
#ifdef USE_ASSERT_H
#include <assert.h>
#endif
#ifdef USE_CTYPE_H
#include <ctype.h>
#endif
#ifdef USE_ERRNO_H
#include <errno.h>
#endif
#ifdef USE_FLOAT_H
#include <float.h>
#endif
#ifdef USE_LIMITS_H
#include <limits.h>
#endif
#ifdef USE_LOCALE_H
#include <locale.h>
#endif
#ifdef USE_MATH_H
#include <math.h>
#endif
#ifdef USE_SETJMP_H
#include <setjmp.h>
#endif
#ifdef USE_SIGNAL_H
#include <signal.h>
#endif
#ifdef USE_STDARG_H
#include <stdarg.h>
#endif
#ifdef USE_STDDEF_H
#include <stddef.h>
#endif
#ifdef USE_STDIO_H
#include <stdio.h>
#endif
#ifdef USE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef USE_STRING_H
#include <string.h>
#endif
#ifdef USE_TIME_H
#include <time.h>
#endif
/* use all c95 (c90 NA1) header */
#ifdef USE_C95
#ifndef __TINYC__
#include <iso646.h>
#endif
#include <wchar.h>
#include <wctype.h>
#endif
/* c95 header */
#ifdef USE_ISO646_H
#include <iso646.h>
#endif
#ifdef USE_WCHAR_H
#include <wchar.h>
#endif
#ifdef USE_WCTYPE_H
#include <wctype.h>
#endif
/* use all c99 header */
#ifdef USE_C99
#ifndef __TINYC__
/* does not compile with tiny c compiler */
#include <complex.h>
#endif
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#endif
/* c99 headers */
#ifdef USE_COMPLEX_H
#include <complex.h>
#endif
#ifdef USE_FENV_H
#include <fenv.h>
#endif
#ifdef USE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef USE_STDBOOL_H
#include <stdbool.h>
#endif
#ifdef USE_STDINT_H
#include <stdint.h>
#endif
#ifdef USE_TGMATH_H
#include <tgmath.h>
#endif
/* use all c11 header */
#ifdef USE_C11
#include <stdalign.h>
#include <stdatomic.h>
#include <stdnoreturn.h>
// #include <threads.h>
#include <uchar.h>
#endif
/* c11 headers */
#ifdef USE_STDALIGN_H
#include <stdalign.h>
#endif
#ifdef USE_STDATOMIC_H
#include <stdatomic.h>
#endif
#ifdef USE_STDNORETURN_H
#include <stdnoreturn.h>
#endif
#ifdef USE_THREADS_H
#include <threads.h>
#endif
#ifdef USE_UCHAR_H
#include <uchar.h>
#endif
/* POSIX header */
#ifdef USE_POSIX
#include <aio.h>
#include <arpa/inet.h>
#include <cpio.h>
#include <dirent.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <fmtmsg.h>
#include <fnmatch.h>
#include <ftw.h>
#include <glob.h>
#include <grp.h>
#include <iconv.h>
#include <langinfo.h>
#include <libgen.h>
#include <monetary.h>
#include <mqueue.h>
//#include <ndbm.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <nl_types.h>
#include <poll.h>
#include <pthread.h>
#include <pwd.h>
#include <regex.h>
#include <sched.h>
#include <search.h>
#include <semaphore.h>
#include <spawn.h>
#include <strings.h>
#include <stropts.h>
#include <sys/ipc.h>
#include <sys/mman.h>
#include <sys/msg.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <syslog.h>
#include <tar.h>
#include <termios.h>
//#include <trace.h>
#include <ulimit.h>
#include <unistd.h>
#include <utime.h>
#include <utmpx.h>
#include <wordexp.h>
#endif
#ifdef USE_AIO_H
#include <aio.h>
#endif
#ifdef USE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef USE_CPIO_H
#include <cpio.h>
#endif
#ifdef USE_DIRENT_H
#include <dirent.h>
#endif
#ifdef USE_DLFCN_H
#include <dlfcn.h>
#endif
#ifdef USE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef USE_FMTMSG_H
#include <fmtmsg.h>
#endif
#ifdef USE_FNMATCH_H
#include <fnmatch.h>
#endif
#ifdef USE_FTW_H
#include <ftw.h>
#endif
#ifdef USE_GLOB_H
#include <glob.h>
#endif
#ifdef USE_GRP_H
#include <grp.h>
#endif
#ifdef USE_ICONV_H
#include <iconv.h>
#endif
#ifdef USE_LANGINFO_H
#include <langinfo.h>
#endif
#ifdef USE_LIBGEN_H
#include <libgen.h>
#endif
#ifdef USE_MONETARY_H
#include <monetary.h>
#endif
#ifdef USE_MQUEUE_H
#include <mqueue.h>
#endif
#ifdef USE_NDBM_H
#include <ndbm.h>
#endif
#ifdef USE_NET_IF_H
#include <net/if.h>
#endif
#ifdef USE_NETDB_H
#include <netdb.h>
#endif
#ifdef USE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef USE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
#ifdef USE_NL_TYPES_H
#include <nl_types.h>
#endif
#ifdef USE_POLL_H
#include <poll.h>
#endif
#ifdef USE_PTHREAD_H
#include <pthread.h>
#endif
#ifdef USE_PWD_H
#include <pwd.h>
#endif
#ifdef USE_REGEX_H
#include <regex.h>
#endif
#ifdef USE_SCHED_H
#include <sched.h>
#endif
#ifdef USE_SEARCH_H
#include <search.h>
#endif
#ifdef USE_SEMAPHORE_H
#include <semaphore.h>
#endif
#ifdef USE_SPAWN_H
#include <spawn.h>
#endif
#ifdef USE_STRINGS_H
#include <strings.h>
#endif
#ifdef USE_STROPTS_H
#include <stropts.h>
#endif
#ifdef USE_SYS_IPC_H
#include <sys/ipc.h>
#endif
#ifdef USE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef USE_SYS_MSG_H
#include <sys/msg.h>
#endif
#ifdef USE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#ifdef USE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef USE_SYS_SEM_H
#include <sys/sem.h>
#endif
#ifdef USE_SYS_SHM_H
#include <sys/shm.h>
#endif
#ifdef USE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef USE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef USE_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif
#ifdef USE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef USE_SYS_TIMES_H
#include <sys/times.h>
#endif
#ifdef USE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef USE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef USE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef USE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#ifdef USE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef USE_SYSLOG_H
#include <syslog.h>
#endif
#ifdef USE_TAR_H
#include <tar.h>
#endif
#ifdef USE_TERMIOS_H
#include <termios.h>
#endif
#ifdef USE_TRACE_H
#include <trace.h>
#endif
#ifdef USE_ULIMIT_H
#include <ulimit.h>
#endif
#ifdef USE_UNISTD_H
#include <unistd.h>
#endif
#ifdef USE_UTIME_H
#include <utime.h>
#endif
#ifdef USE_UTMPX_H
#include <utmpx.h>
#endif
#ifdef USE_WORDEXP_H
#include <wordexp.h>
#endif
/* for #ifdef __cplusplus */
#endif
/* ################################## */
/* windows headers */
#ifndef NO_WINDOWS
#ifndef USE_WINDOWS
# ifdef __NT__
# define USE_WINDOWS __NT__
# endif
#endif
#ifndef USE_WINDOWS
# ifdef _WIN32
# define USE_WINDOWS _WIN32
# endif
#endif
#ifndef USE_WINDOWS
# ifdef __WIN32__
# define USE_WINDOWS __WIN32__
# endif
#endif
#ifndef USE_WINDOWS
# ifdef __WIN32
# define USE_WINDOWS __WIN32
# endif
#endif
#ifndef USE_WINDOWS
# ifdef _WIN32_
# define USE_WINDOWS _WIN32_
# endif
#endif
#ifndef USE_WINDOWS
# ifdef WIN32
# define USE_WINDOWS WIN32
# endif
#endif
#ifndef USE_WINDOWS
# ifdef __WINNT_WIN32
# define USE_WINDOWS __WINNT_WIN32
# endif
#endif
#ifndef USE_WINDOWS
# ifdef _WIN32_WINNT
# define USE_WINDOWS _WIN32_WINNT
# endif
#endif
#ifndef USE_WINDOWS
# ifdef WINVER
# define USE_WINDOWS WINVER
# endif
#endif
#ifndef USE_WINDOWS
# ifdef __WINDOWS__
# define USE_WINDOWS __WINDOWS__
# endif
#endif
#ifndef USE_WINDOWS
# ifdef _WIN32_WCE
# define USE_WINDOWS _WIN32_WCE
# endif
#endif
#endif
/* ################################## */
#ifndef NO_WINMAIN
#ifdef NO_WINDOWS
#define NO_WINMAIN NO_WINDOWS
#endif
#endif
#ifndef NO_WINDOWS
#ifdef USE_WINDOWS
#include <windows.h>
#endif
#ifdef _WINNT_WIN32
#include <winuser.h>
#endif
#ifdef _WIN32
#include <winuser.h>
#endif
#ifdef __WIN32__
#include <winuser.h>
#endif
#ifdef __NT__
#include <winuser.h>
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
#ifdef USE_WINSOCK2
#include <winsock2.h>
#endif
#endif
/* ########################################## */
#define __my_stringify_1(x) #x
#define __my_stringify(x) __my_stringify_1(x)
char *get_txt(char * buffer)
{
buffer[0] = 0;
#ifndef NO_STDIO
/* ################### */
/* DATE FILE LINE func */
#ifdef __LINE__
sprintf(buffer+strlen(buffer), "__LINE__\t\t => %d\n", __LINE__ );
#endif
#ifdef __BASE_FILE__
sprintf(buffer+strlen(buffer), "__BASE_FILE__\t\t => '%s'\n", __BASE_FILE__ );
#endif
#ifdef __FILE__
sprintf(buffer+strlen(buffer), "__FILE__\t\t => '%s'\n", __FILE__ );
#endif
/* used by MSVC: function name */
#ifdef __FUNCNAME__
sprintf(buffer+strlen(buffer), "__FUNCNAME__\t\t => '%s'\n", __FUNCNAME__ );
#endif
/* used by MSVC: decorated function name */
#ifdef __FUNCDNAME__
sprintf(buffer+strlen(buffer), "__FUNCDNAME__\t\t => '%s'\n", __FUNCDNAME__ );
#endif
/* used by MSVC: function signature */
#ifdef __FUNCSIG__
sprintf(buffer+strlen(buffer), "__FUNCSIG__\t\t => '%s'\n", __FUNCSIG__ );
#endif
#ifdef __FUNCTION__
sprintf(buffer+strlen(buffer), "__FUNCTION__\t\t => '%s'\n", __FUNCTION__ );
#endif
#ifdef __func__
sprintf(buffer+strlen(buffer), "__func__\t\t => '%s'\n", __func__ );
#endif
#ifdef __PRETTY_FUNCTION__
sprintf(buffer+strlen(buffer), "__PRETTY_FUNCTION__\t => '%s'\n", __PRETTY_FUNCTION__ );
#endif
#ifdef __DATE__
sprintf(buffer+strlen(buffer), "__DATE__\t\t => '%s'\n", __DATE__ );
#endif
#ifdef __TIME__
sprintf(buffer+strlen(buffer), "__TIME__\t\t => '%s'\n", __TIME__ );
#endif
#ifdef __TIMESTAMP__
sprintf(buffer+strlen(buffer), "__TIMESTAMP__\t\t => '%s'\n", __TIMESTAMP__ );
#endif
/* ################## */
/* compiler-detection */
/* Borland C, TurboC */
#ifdef __BORLANDC__
sprintf(buffer + strlen(buffer), "__BORLANDC__\t\t => 0x%x (%d.%x)\n",
__BORLANDC__, __BORLANDC__ >>8, __BORLANDC__ & 0xff);
#endif
/* what is ARC? includes mwdth.h after __CCAC__ check */
#ifdef __CCAC__
if ( (__CCAC__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CCAC__\t\t => %d\n", __CCAC__ + 0);
} else {
strcat(buffer, "__CCAC__\n");
}
#endif
/* armcc */
#ifdef __CC_ARM
if ( (__CC_ARM + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CC_ARM\t\t => 0x%x\n", __CC_ARM + 0);
} else {
strcat(buffer, "__CC_ARM\n");
}
#endif
/* NORCROFT C */
#ifdef __CC_NORCROFT
if ( (__CC_NORCROFT + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CC_NORCROFT\t\t => 0x%x\n", __CC_NORCROFT + 0);
} else {
strcat(buffer, "__CC_NORCROFT\n");
}
#endif
/* chibicc is a small c11 compiler to assist a book for compiler development */
#ifdef __chibicc__
if ( (__chibicc__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__chibicc__\t\t => %d\n", __chibicc__ + 0);
} else {
strcat(buffer, "__chibicc__\n");
}
#endif
#ifdef __CODEGEARC__
sprintf(buffer + strlen(buffer), "__CODEGEARC__\t\t => 0x%x (%d.%x)\n",
__CODEGEARC__, __CODEGEARC__ >>8, __CODEGEARC__ & 0xff);
#endif
/* clang */
#ifdef __clang__
if ( (__clang__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__clang__ \t\t => %d\n", __clang__ + 0);
} else {
strcat(buffer, "__clang__\n");
}
#endif
#ifdef __clang_major__
if ( (__clang_major__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__clang_major__ \t => %d\n", __clang_major__ + 0);
} else {
strcat(buffer, "__clang_major__\n");
}
#endif
#ifdef __clang_minor__
if ( (__clang_minor__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__clang_minor__ \t => %d\n", __clang_minor__ + 0);
} else {
strcat(buffer, "__clang_minor__\n");
}
#endif
#ifdef __clang_patchlevel__
if ( (__clang_patchlevel__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__clang_patchlevel__ \t => %d\n", __clang_patchlevel__ + 0);
} else {
strcat(buffer, "__clang_patchlevel__\n");
}
#endif
#ifdef __clang_version__
sprintf(buffer + strlen(buffer), "__clang_version__\t => '%s'\n", __clang_version__ );
#endif
/* comeau C++ */
#ifdef __COMO__
if ( (__COMO__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__COMO__ \t\t => %d\n", __COMO__ + 0);
} else {
strcat(buffer, "__COMO__\n");
}
#endif
#ifdef __COMO_VERSION__
sprintf(buffer + strlen(buffer), "__COMO_VERSION__\t\t => 0x%d (%d.%d)\n",
__COMO_VERSION__, __COMO_VERSION__ /100, __COMO_VERSION__ % 100 );
#endif
/* cray C/C++ */
#ifdef _CRAYC
if ( (_CRAYC + 1) > 1) {
sprintf(buffer + strlen(buffer), "_CRAYC\t\t => %x (%d)\n", _CRAYC , __CRAYC/1000);
} else {
strcat(buffer, "_CRAYC\n");
}
#endif
/* cygwin: gcc for DOS */
#ifdef __CYGWIN__
if ( (__CYGWIN__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CYGWIN__\t\t => %d\n", __CYGWIN__ + 0);
} else {
strcat(buffer, "__CYGWIN__\n");
}
#endif
#ifdef __CYGWIN32
if ( (__CYGWIN32 + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CYGWIN32\t\t => %d\n", __CYGWIN32 + 0);
} else {
strcat(buffer, "__CYGWIN32\n");
}
#endif
#ifdef __CYGWIN32__
if ( (__CYGWIN32__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__CYGWIN32__\t\t => %d\n", __CYGWIN32__ + 0);
} else {
strcat(buffer, "__CYGWIN32__\n");
}
#endif
/* Compa1 C++, decstation, vax, .... */
#ifdef __DECC
if ( (__DECC + 1) > 1) {
sprintf(buffer + strlen(buffer), "__DECC\t\t => %d\n", __DECC + 0);
} else {
strcat(buffer, "__DECC\n");
}
#endif
#ifdef __DECCXX
if ( (__DECCXX + 1) > 1) {
sprintf(buffer + strlen(buffer), "__DECCXX\t\t => %d\n", __DECCXX + 0);
} else {
strcat(buffer, "__DECCXX\n");
}
#endif
/* Digital Mars, Symantec C, Zortech C, (Datalight C: missing) */
#ifdef __DMC__
sprintf(buffer + strlen(buffer), "__DMC__ \t\t => 0x%x (DMC %d.%d)\n", __DMC__,
__DMC__ / 256, (__DMC__ & 0xf0 ) / 16 * 10 + (__DMC__ & 0x0f));
#endif
/* edg based compiler */
#ifdef __EDG__
if ( (__EDG__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__EDG__\t\t\t => %d\n", __EDG__ + 0);
} else {
strcat(buffer, "__EDG__\n");
}
#endif
/* edg versions are direct after EDG */
#ifdef __EDG_VERSION__
if ( (__EDG_VERSION__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__EDG_VERSION__\t\t => %d\n", __EDG_VERSION__ + 0);
} else {
strcat(buffer, "__EDG_VERSION__\n");
}
#endif
/* GNU C */
#ifdef __GNUC__
#ifdef __GNUC_MINOR__
#ifdef __GNUC_PATCHLEVEL__
sprintf(buffer + strlen(buffer), "__GNUC__ \t\t => %d (GCC %d.%d.%d)\n",
__GNUC__ , __GNUC__ , __GNUC_MINOR__ + 0, __GNUC_PATCHLEVEL__ + 0 );
#else
sprintf(buffer + strlen(buffer), "__GNUC__ \t\t => %d (GCC %d.%d)\n",
__GNUC__ , __GNUC__ , __GNUC_MINOR__ + 0 );
#endif
#else
if ( (__GNUC__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUC__\t\t => %d\n", __GNUC__ + 0);
} else {
strcat(buffer, "__GNUC__\n");
}
#endif
#endif
/* GCC versions are direct after GCC */
#ifdef __GNUC_MAJOR__
if ( (__GNUC_MAJOR__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUC_MAJOR__\t\t => %d\n", __GNUC_MAJOR__ + 0);
} else {
strcat(buffer, "__GNUC_MAJOR__\n");
}
#endif
#ifdef __GNUC_MINOR__
if ( (__GNUC_MINOR__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUC_MINOR__\t\t => %d\n", __GNUC_MINOR__ + 0);
} else {
strcat(buffer, "__GNUC_MINOR__\n");
}
#endif
#ifdef __GNUC_PATCHLEVEL__
if ( (__GNUC_PATCHLEVEL__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUC_PATCHLEVEL__ \t => %d\n", __GNUC_PATCHLEVEL__ + 0);
} else {
strcat(buffer, "__GNUC_PATCHLEVEL__\n");
}
#endif
/* GNU c++ */
#ifdef __GNUG__
if ( (__GNUG__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUG__\t\t => %d\n", __GNUG__ + 0);
} else {
strcat(buffer, "__GNUG__\n");
}
#endif
/* GNUG versions are direct after GNUG */
/* GNU C++ Compiler */
#ifdef __GNUG_MAJOR__
if ( (__GNUG_MAJOR__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUG_MAJOR__\t\t => %d\n", __GNUG_MAJOR__ + 0);
} else {
strcat(buffer, "__GNUG_MAJOR__\n");
}
#endif
#ifdef __GNUG_MINOR__
if ( (__GNUG_MINOR__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUG_MINOR__\t\t => %d\n", __GNUG_MINOR__ + 0);
} else {
strcat(buffer, "__GNUG_MINOR__\n");
}
#endif
#ifdef __GNUG_PATCHLEVEL__
if ( (__GNUG_PATCHLEVEL__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__GNUG_PATCHLEVEL__ \t => %d\n", __GNUG_PATCHLEVEL__ + 0);
} else {
strcat(buffer, "__GNUG_PATCHLEVEL__\n");
}
#endif
/* HP C++: latest for PA-RISC is 38000, for HP-UX/ia64 is 61300 */
#ifdef __HP_aCC
if ( (__HP_aCC + 1) > 1) {
sprintf(buffer + strlen(buffer), "__HP_aCC\t\t => %ld (A.%2d.%2d)\n", __HP_aCC ,
__HP_aCC / 10000, (__HP_aCC % 10000) / 100);
} else {
strcat(buffer, "__HP_aCC\n");
}
#endif
#ifdef __HP_cc
if ( (__HP_cc + 1) > 1) {
sprintf(buffer + strlen(buffer), "__HP_cc\t\t => %d\n", __HP_cc + 0);
} else {
strcat(buffer, "__HP_cc\n");
}
#endif
#ifdef __hpux
if ( (__hpux + 1) > 1) {
sprintf(buffer + strlen(buffer), "__hpux\t\t => %d\n", __hpux + 0);
} else {
strcat(buffer, "__hpux\n");
}
#endif
/* IBM C / IBM CPP, xlC */
#ifdef __IBMC__
sprintf(buffer + strlen(buffer), "__IBMC__ \t\t => %d\n", __IBMC__, __IBMC__);
#endif
#ifdef __IBMCPP__
sprintf(buffer + strlen(buffer), "__IBMCPP__ \t\t => %d\n", __IBMCPP__, __IBMCPP__);
#endif
/* Intel CC */
#ifdef __ICC__
if ( (__ICC__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__ICC__\t\t => %d\n", __ICC__ + 0);
} else {
strcat(buffer, "__ICC__\n");
}
#endif
/* Is this an ARM compiler from Intel ?*/
/* used in microcontroller related source */
#ifdef __ICCARM__
if ( (__ICCARM__ + 1) > 1) {
sprintf(buffer + strlen(buffer), "__ICCARM__\t\t => %d\n", __ICCARM__ + 0);
} else {
strcat(buffer, "__ICCARM__\n");
}
#endif
/* Intel CC */
#ifdef __INTEL_COMPILER
if (__INTEL_COMPILER < 2020)
{
sprintf(buffer + strlen(buffer), "__INTEL_COMPILER\t => %d (ICC %d.%d.%d)\n",
__INTEL_COMPILER,
__INTEL_COMPILER/100, (__INTEL_COMPILER %100) /10, __INTEL_COMPILER % 10);
}
else
{
sprintf(buffer + strlen(buffer), "__INTEL_COMPILER\t => %d (ICC %d)\n",
__INTEL_COMPILER, __INTEL_COMPILER);
}
#endif
/* KAI C++ */
#ifdef __KCC
if ( (__KCC + 1) > 1) {
sprintf(buffer + strlen(buffer), "__KCC\t\t => %d\n", __KCC + 0);
} else {
strcat(buffer, "__KCC\n");
}
#endif