By my knowledge there is no overall way to do this. If you look at the headers of cross platform/multiple compiler supporting libraries you’ll always find a lot of defines that use compiler specific constructs to determine such things:
/*Define Microsoft Visual C++ .NET (32-bit) compiler */ #if (defined(_M_IX86) && defined(_MSC_VER) && (_MSC_VER >= 1300) ... #endif /*Define Borland 5.0 C++ (16-bit) compiler */ #if defined(__BORLANDC__) && !defined(__WIN32__) ... #endif
You probably will have to do such defines yourself for all compilers you use.
Related Posts:
- Is “argv[0] = name-of-executable” an accepted standard or just a common convention?
- Is std::stoi actually safe to use?
- Is std::stoi actually safe to use?
- Is there a standard C++ grammar?
- error: ISO C++ forbids in-class initialization of non-const static member
- How to determine the version of the C++ standard used by the compiler?
- How to dynamically allocate arrays in C++
- How to convert string to char array in C++?
- How can I convert a std::string to int?
- Why is “using namespace std;” considered bad practice?
- What is a lambda expression in C++11?
- How to convert string to char array in C++?
- ld: symbol(s) not found for architecture x86_64 error
- C++ string to double conversion
- How do I print out the contents of a vector?
- ‘was not declared in this scope’ error
- C++ Vector of pointers
- How do I reverse a C++ vector?
- Is there a C++ decompiler?
- What is a dangling pointer?
- undefined reference to WinMain@16 (codeblocks)
- Why use ‘glad’ library for opengl initialization? [duplicate]
- What does `*&` in a function declaration mean?
- (->) arrow operator and (.) dot operator , class pointer
- How to reverse an std::string? [duplicate]
- What is the C version of RMI
- Difference between ‘strcpy’ and ‘strcpy_s’?
- Difference between const reference and normal parameter
- Why am I getting this redefinition of class error?
- error: redefinition of class
- How to convert a std::string to const char* or char*
- What is the difference between a static and const variable?
- What is move semantics?
- unsigned int vs. size_t
- error: expected primary-expression before ‘)’ token (C)
- C++ forbids converting a `string` constant to `char*` – Alphabets to Morse converting program
- What is activation record in the context of C and C++?
- Static array vs. dynamic array in C++
- C++ terminate called after throwing an instance of ‘std::out_of_range’ Simple Averaging code
- Error “C++ requires a type specifier for all declarations whilst defining methods”
- How to create a dynamically-allocated array of const objects, but have values assigned to them?
- Why doesn’t std::vector::push_front() exist?
- Fastest way to check if a file exist using standard C++/C++11,14,17/C?
- Invalid use of non-static member function c++
- C++ #include guards
- C++ forbids variable-size array
- Fill array with random numbers within a specified range (C++)
- Remove an array element and shift the remaining ones
- Right way to split an std::string into a vector
- string subscript out of range error
- push_back vs emplace_back
- No operator << matches these operands
- Returning an empty string : efficient way in c++
- How to find the size of an int[]?
- Append an int to a std::string
- Decimal to hex conversion c++ built-in function
- C++ IDE with repl?
- pthread sleep linux
- 2D array vs array of arrays
- C++ error: definition of implicitly-declared
- Already defined in .obj – no double inclusions
- expected unqualified-id before string constant
- C++: Access violation writing location
- error: strcpy was not declared in this scope
- how to print a string to console in c++
- How to call a parent class function from derived class function?
- Error: No instance of constructor matches the argument list
- How can I get the list of files in a directory using C or C++?
- RPN Calculator for C++
- What does `Fatal Python error: PyThreadState_Get: no current thread` mean?
- What are the different versions of exec used for in C and C++?
- C++ – include unistd.h: why not cunistd?
- Dynamically allocated string array, then change it’s value?
- Use the auto keyword in C++ STL
- c++ –
- C++ – statement cannot resolve address for overloaded function
- What’s the difference between * and & in C?
- In C++ can constructor and destructor be inline functions?
- What’s the meaning of exception code “EXC_I386_GPFLT”?
- how to convert from int to char*?
- When is it safe to call this-> in constructor and destructor
- Stray ‘\342’ in C++ program
- gcc -g :what will happen
- QByteArray to QString
- Bitwise Less than or Equal to
- ASCII art in C++
- How do you append an int to a string in C++?
- C++ correct way to return pointer to array from function
- Understanding error “terminate called after throwing an instance of ‘std::length_error’ what(): basic_string::_S_create Aborted (core dumped)”
- how to find 2d array size in c++
- Getting error “array bound is not an integer constant before ‘]’ token”
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- error C2995: function template has already been defined
- C++ equivalent of StringBuffer/StringBuilder?
- Why are there two different getline() functions (if indeed there are)?
- Whats the difference between UInt8 and uint8_t
- Struct with template variables in C++
- error: no member function declared in class
- Why does my program give “NULL used in arithmetic”
- no matching function to call for “getline”