|
| 1 | +#include <iostream> |
| 2 | +#include "basic.h" |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +void basic(){ |
| 7 | + |
| 8 | + |
| 9 | + #ifdef NDEBUG |
| 10 | + std::cout << "basic/1.0: Hello World Release!\n"; |
| 11 | + #else |
| 12 | + std::cout << "basic/1.0: Hello World Debug!\n"; |
| 13 | + #endif |
| 14 | + |
| 15 | + // ARCHITECTURES |
| 16 | + #ifdef _M_X64 |
| 17 | + std::cout << " basic/1.0: _M_X64 defined\n"; |
| 18 | + #endif |
| 19 | + |
| 20 | + #ifdef _M_IX86 |
| 21 | + std::cout << " basic/1.0: _M_IX86 defined\n"; |
| 22 | + #endif |
| 23 | + |
| 24 | + #ifdef _M_ARM64 |
| 25 | + std::cout << " basic/1.0: _M_ARM64 defined\n"; |
| 26 | + #endif |
| 27 | + |
| 28 | + #if __i386__ |
| 29 | + std::cout << " basic/1.0: __i386__ defined\n"; |
| 30 | + #endif |
| 31 | + |
| 32 | + #if __x86_64__ |
| 33 | + std::cout << " basic/1.0: __x86_64__ defined\n"; |
| 34 | + #endif |
| 35 | + |
| 36 | + #if __aarch64__ |
| 37 | + std::cout << " basic/1.0: __aarch64__ defined\n"; |
| 38 | + #endif |
| 39 | + |
| 40 | + // Libstdc++ |
| 41 | + #if defined _GLIBCXX_USE_CXX11_ABI |
| 42 | + std::cout << " basic/1.0: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n"; |
| 43 | + #endif |
| 44 | + |
| 45 | + // MSVC runtime |
| 46 | + #if defined(_DEBUG) |
| 47 | + #if defined(_MT) && defined(_DLL) |
| 48 | + std::cout << " basic/1.0: MSVC runtime: MultiThreadedDebugDLL\n"; |
| 49 | + #elif defined(_MT) |
| 50 | + std::cout << " basic/1.0: MSVC runtime: MultiThreadedDebug\n"; |
| 51 | + #endif |
| 52 | + #else |
| 53 | + #if defined(_MT) && defined(_DLL) |
| 54 | + std::cout << " basic/1.0: MSVC runtime: MultiThreadedDLL\n"; |
| 55 | + #elif defined(_MT) |
| 56 | + std::cout << " basic/1.0: MSVC runtime: MultiThreaded\n"; |
| 57 | + #endif |
| 58 | + #endif |
| 59 | + |
| 60 | + // COMPILER VERSIONS |
| 61 | + #if _MSC_VER |
| 62 | + std::cout << " basic/1.0: _MSC_VER" << _MSC_VER<< "\n"; |
| 63 | + #endif |
| 64 | + |
| 65 | + #if _MSVC_LANG |
| 66 | + std::cout << " basic/1.0: _MSVC_LANG" << _MSVC_LANG<< "\n"; |
| 67 | + #endif |
| 68 | + |
| 69 | + #if __cplusplus |
| 70 | + std::cout << " basic/1.0: __cplusplus" << __cplusplus<< "\n"; |
| 71 | + #endif |
| 72 | + |
| 73 | + #if __INTEL_COMPILER |
| 74 | + std::cout << " basic/1.0: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n"; |
| 75 | + #endif |
| 76 | + |
| 77 | + #if __GNUC__ |
| 78 | + std::cout << " basic/1.0: __GNUC__" << __GNUC__<< "\n"; |
| 79 | + #endif |
| 80 | + |
| 81 | + #if __GNUC_MINOR__ |
| 82 | + std::cout << " basic/1.0: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n"; |
| 83 | + #endif |
| 84 | + |
| 85 | + #if __clang_major__ |
| 86 | + std::cout << " basic/1.0: __clang_major__" << __clang_major__<< "\n"; |
| 87 | + #endif |
| 88 | + |
| 89 | + #if __clang_minor__ |
| 90 | + std::cout << " basic/1.0: __clang_minor__" << __clang_minor__<< "\n"; |
| 91 | + #endif |
| 92 | + |
| 93 | + #if __apple_build_version__ |
| 94 | + std::cout << " basic/1.0: __apple_build_version__" << __apple_build_version__<< "\n"; |
| 95 | + #endif |
| 96 | + |
| 97 | + // SUBSYSTEMS |
| 98 | + |
| 99 | + #if __MSYS__ |
| 100 | + std::cout << " basic/1.0: __MSYS__" << __MSYS__<< "\n"; |
| 101 | + #endif |
| 102 | + |
| 103 | + #if __MINGW32__ |
| 104 | + std::cout << " basic/1.0: __MINGW32__" << __MINGW32__<< "\n"; |
| 105 | + #endif |
| 106 | + |
| 107 | + #if __MINGW64__ |
| 108 | + std::cout << " basic/1.0: __MINGW64__" << __MINGW64__<< "\n"; |
| 109 | + #endif |
| 110 | + |
| 111 | + #if __CYGWIN__ |
| 112 | + std::cout << " basic/1.0: __CYGWIN__" << __CYGWIN__<< "\n"; |
| 113 | + #endif |
| 114 | +} |
| 115 | + |
| 116 | +void basic_print_vector(const std::vector<std::string> &strings) { |
| 117 | + for(std::vector<std::string>::const_iterator it = strings.begin(); it != strings.end(); ++it) { |
| 118 | + std::cout << "basic/1.0 " << *it << std::endl; |
| 119 | + } |
| 120 | +} |
0 commit comments