v0.15.0
Loading...
Searching...
No Matches
Macros | Functions | Variables
CMakeCCompilerId.c File Reference

Go to the source code of this file.

Macros

#define COMPILER_ID   ""
 
#define STRINGIFY_HELPER(X)   #X
 
#define STRINGIFY(X)   STRINGIFY_HELPER(X)
 
#define PLATFORM_ID   ""
 
#define ARCHITECTURE_ID   ""
 
#define DEC(n)
 
#define HEX(n)
 

Functions

int main (int argc, char *argv[])
 

Variables

char const * info_compiler = "INFO" ":" "compiler[" "" "]"
 
char const * info_platform = "INFO" ":" "platform[" "" "]"
 
char const * info_arch = "INFO" ":" "arch[" "" "]"
 
const char * info_language_dialect_default
 

Macro Definition Documentation

◆ ARCHITECTURE_ID

#define ARCHITECTURE_ID   ""

Definition at line 416 of file CMakeCCompilerId.c.

◆ COMPILER_ID

#define COMPILER_ID   ""

Definition at line 253 of file CMakeCCompilerId.c.

◆ DEC

#define DEC (   n)
Value:
('0' + (((n) / 10000000)%10)), \
('0' + (((n) / 1000000)%10)), \
('0' + (((n) / 100000)%10)), \
('0' + (((n) / 10000)%10)), \
('0' + (((n) / 1000)%10)), \
('0' + (((n) / 100)%10)), \
('0' + (((n) / 10)%10)), \
('0' + ((n) % 10))
const double n
refractive index of diffusive medium

Definition at line 420 of file CMakeCCompilerId.c.

442 {
443 'I', 'N', 'F', 'O', ':',
444 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
445 COMPILER_VERSION_MAJOR,
446# ifdef COMPILER_VERSION_MINOR
447 '.', COMPILER_VERSION_MINOR,
448# ifdef COMPILER_VERSION_PATCH
449 '.', COMPILER_VERSION_PATCH,
450# ifdef COMPILER_VERSION_TWEAK
451 '.', COMPILER_VERSION_TWEAK,
452# endif
453# endif
454# endif
455 ']','\0'};
456#endif
457
458/* Construct a string literal encoding the version number components. */
459#ifdef SIMULATE_VERSION_MAJOR
460char const info_simulate_version[] = {
461 'I', 'N', 'F', 'O', ':',
462 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
463 SIMULATE_VERSION_MAJOR,
464# ifdef SIMULATE_VERSION_MINOR
465 '.', SIMULATE_VERSION_MINOR,
466# ifdef SIMULATE_VERSION_PATCH
467 '.', SIMULATE_VERSION_PATCH,
468# ifdef SIMULATE_VERSION_TWEAK
469 '.', SIMULATE_VERSION_TWEAK,
470# endif
471# endif
472# endif
473 ']','\0'};
474#endif
475
476/* Construct the string literal in pieces to prevent the source from
477 getting matched. Store it in a pointer rather than an array
478 because some compilers will just produce instructions to fill the
479 array rather than assigning a pointer to a static array. */
480char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
481char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
482
483
484
485
486const char* info_language_dialect_default = "INFO" ":" "dialect_default["
487#if !defined(__STDC_VERSION__)
488 "90"
489#elif __STDC_VERSION__ >= 201000L
490 "11"
491#elif __STDC_VERSION__ >= 199901L
492 "99"
493#else
494#endif
495"]";
496
497/*--------------------------------------------------------------------------*/
498
499#ifdef ID_VOID_MAIN
500void main() {}
501#else
502int main(int argc, char* argv[])
503{
504 int require = 0;
505 require += info_compiler[argc];
506 require += info_platform[argc];
507 require += info_arch[argc];
508#ifdef COMPILER_VERSION_MAJOR
509 require += info_version[argc];
510#endif
511#ifdef SIMULATE_ID
512 require += info_simulate[argc];
513#endif
514#ifdef SIMULATE_VERSION_MAJOR
515 require += info_simulate_version[argc];
516#endif
517 require += info_language_dialect_default[argc];
518 (void)argv;
519 return require;
520}
521#endif
const char * info_language_dialect_default
char const * info_platform
char const * info_compiler
char const * info_arch
#define ARCHITECTURE_ID
#define PLATFORM_ID
int main()

◆ HEX

#define HEX (   n)
Value:
('0' + ((n)>>28 & 0xF)), \
('0' + ((n)>>24 & 0xF)), \
('0' + ((n)>>20 & 0xF)), \
('0' + ((n)>>16 & 0xF)), \
('0' + ((n)>>12 & 0xF)), \
('0' + ((n)>>8 & 0xF)), \
('0' + ((n)>>4 & 0xF)), \
('0' + ((n) & 0xF))

Definition at line 431 of file CMakeCCompilerId.c.

◆ PLATFORM_ID

#define PLATFORM_ID   ""

Definition at line 366 of file CMakeCCompilerId.c.

◆ STRINGIFY

#define STRINGIFY (   X)    STRINGIFY_HELPER(X)

Definition at line 270 of file CMakeCCompilerId.c.

◆ STRINGIFY_HELPER

#define STRINGIFY_HELPER (   X)    #X

Definition at line 269 of file CMakeCCompilerId.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 503 of file CMakeCCompilerId.c.

504{
505 int require = 0;
506 require += info_compiler[argc];
507 require += info_platform[argc];
508 require += info_arch[argc];
509#ifdef COMPILER_VERSION_MAJOR
510 require += info_version[argc];
511#endif
512#ifdef SIMULATE_ID
513 require += info_simulate[argc];
514#endif
515#ifdef SIMULATE_VERSION_MAJOR
516 require += info_simulate_version[argc];
517#endif
518 require += info_language_dialect_default[argc];
519 (void)argv;
520 return require;
521}

Variable Documentation

◆ info_arch

char const* info_arch = "INFO" ":" "arch[" "" "]"

Definition at line 482 of file CMakeCCompilerId.c.

◆ info_compiler

char const* info_compiler = "INFO" ":" "compiler[" "" "]"

Definition at line 260 of file CMakeCCompilerId.c.

◆ info_language_dialect_default

const char* info_language_dialect_default
Initial value:
= "INFO" ":" "dialect_default["
"90"
"]"

Definition at line 487 of file CMakeCCompilerId.c.

◆ info_platform

char const* info_platform = "INFO" ":" "platform[" "" "]"

Definition at line 481 of file CMakeCCompilerId.c.