Coder Social home page Coder Social logo

config-8's Introduction

C++ Config (predefined cross-platform macros)

As we know there is no standard way in compilers to standardize macros with compilers and different operating systems

So I created this library that contains standardized macros and built-in functions and more.


Contents :

  • Compiler
    This section contains some macros that can detect 26 compiler and its version.

  • Standard Library
    This section contains some macros that can detect 3 standard libraries and its version.

  • Platform
    This section contains some macros that can detect 28 platform.

  • Architecture
    This section contains some macros that can detect 16 architecture and its info.

  • Attributes
    This section contains some macros that can detect 17 attribute.

  • Compiler

    See Online Test to test 5 different compiler's online.

    /*                    Print compiler info                     */
    cout << XEERX_COMPILER              << endl; // ๐Ÿ‘‰ "GCC"
    cout << XEERX_COMPILER_MAJOR        << endl; // ๐Ÿ‘‰ 12
    cout << XEERX_COMPILER_MINOR        << endl; // ๐Ÿ‘‰ 1
    cout << XEERX_COMPILER_PATCH        << endl; // ๐Ÿ‘‰ 0
    cout << XEERX_COMPILER_VERSION      << endl; // ๐Ÿ‘‰ 201392128
    
    /*         Check for specific compiler using ID/Macro         */
    #ifdef XEERX_COMPILER_<ID> // for example <ID> = GCC
    ...
  • Standard Library

    See Online Test to test 3 different stdlib's online.

    /*                     Print stdlib info                      */
    cout << XEERX_STDLIB                << endl; // ๐Ÿ‘‰ "GNU libstdc++"
    cout << XEERX_STDLIB_MAJOR          << endl; // ๐Ÿ‘‰ 2022
    cout << XEERX_STDLIB_MINOR          << endl; // ๐Ÿ‘‰ 8
    cout << XEERX_STDLIB_PATCH          << endl; // ๐Ÿ‘‰ 19
    cout << XEERX_STDLIB_VERSION        << endl; // ๐Ÿ‘‰ 3859283987
    
    /*          Check for specific stdlib using ID/Macro          */
    #ifdef XEERX_STDLIB_<ID> // for example <ID> = GNU
    ...
  • Platform

    See Online Test to test 3 different platform's online.

    /*                    Print platform info                     */
    cout << XEERX_PLATFORM              << endl; // ๐Ÿ‘‰ "Linux"
    cout << XEERX_PLATFORM_FAMILY       << endl; // ๐Ÿ‘‰ "POSIX"
    
    /*         Check for specific platform using ID/Macro         */
    #ifdef XEERX_PLATFORM_<ID> // for example <ID> = LINUX
    ...
    
    /*     Check for specific platform family using ID/Macro      */
    #ifdef XEERX_PLATFORM_FAMILY_<ID> // for example <ID> = POSIX
    /* this platform is belong from POSIX */
    ...
  • Architecture

    See Online Test to test 2 different architecture's online.

    /*                  Print architecture info                   */
    cout << XEERX_ARCH          << endl; // ๐Ÿ‘‰ "x86_64"
    cout << XEERX_ARCH_SIZE     << endl; // ๐Ÿ‘‰ 64
    cout << XEERX_ARCH_ENDIAN   << endl; // ๐Ÿ‘‰ "LITTLE"
    
    /*       Check for specific architecture using ID/Macro       */
    #ifdef XEERX_ARCH_<ID> // for example <ID> = XEERX_ARCH_X86_64
    ...
    
    /*   Check for specific architecture family using ID/Macro    */
    #ifdef XEERX_ARCH_FAMILY_<ID> // for example <ID> = X86
    /* this architecture is belong from X86 */
    ...
  • Attributes

    XEERX_ATTR_INLINE
    XEERX_ATTR_HIDDEN
    XEERX_ATTR_DEPRECATED("old version")
    void func(int x, int y)
    ...

See User-Configuration and Utility-Macros for more information.

config-8's People

Contributors

xeerx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.