Skip to content

ignackodotcom/C83Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C83Compiler

Compiler identification macros for C and C++

3rd edition of the library

part of the C83Project
support for 8.3 file naming conventions with the exception of the main include and code files
support C89 and higher editions


Example of use

    printf("COMPILER test\n\r");
    printf("\n\r");

    printf("C83COMPILER_VERSION()       = %ld\n\r", C83COMPILER_VERSION());
    printf("\n\r");

    printf("First COMPILER              = %d\n\r", COMPILER_8CC);
    printf("First COMPILER NAME         = %s\n\r", COMPILER_8CC_NAME);
    printf("\n\r");

    printf("Last COMPILER               = %d\n\r", COMPILER_ZORTECH_CPP);
    printf("Last COMPILER NAME          = %s\n\r", COMPILER_ZORTECH_CPP_NAME);
    printf("\n\r");

    printf("Current COMPILER            = %d\n\r", COMPILER);
    printf("Current COMPILER NAME       = %s\n\r", COMPILER_NAME);
    printf("\n\r");

Another example of use

    #if COMPILER == 0
        #error "Unknown compiler"
    #endif

    #if COMPILER == COMPILER_GCC_CCPP
        ...
        Gcc compiler code
        ...
    #elif COMPILER == COMPILER_MICROSOFT_VISUAL_CCPP
        ...
        Visual studio compiler code
        ...
    #else
        ...
        other compiler code
        ...
    #endif

Note:

It is completely impossible to fully test all compiler combinations, so this library is not fully tested. If you have any improvements, please feel free to contact me.

Updates

2025 10 30 Compiler.h renamed to PCmplr.h

2025 11 02 Detailed description

About

Compiler identification macros for C and C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages