Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flagarde committed May 14, 2024
1 parent 6a8f3a9 commit 38a7e7b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ foreach(C_STANDARD IN LISTS C_STANDARDS)
set_target_properties("Language_${C_STANDARD}_extensions_${C_EXTENSION}.test" PROPERTIES C_STANDARD "${C_STANDARD_NUMBER}")
set_target_properties("Language_${C_STANDARD}_extensions_${C_EXTENSION}.test" PROPERTIES C_STANDARD_REQUIRED TRUE)
set_target_properties("Language_${C_STANDARD}_extensions_${C_EXTENSION}.test" PROPERTIES C_EXTENSIONS "${C_EXTENSION}")
if(NOT "${C_STANDARD_NUMBER}" STREQUAL "17")
if(NOT "${C_STANDARD_NUMBER}" STREQUAL "17" AND NOT "${C_STANDARD_NUMBER}" STREQUAL "11")
set(EXTENSSION_OFF "/Za")
else()
set(EXTENSSION_OFF "")
Expand Down
63 changes: 28 additions & 35 deletions tests/LanguageCXX.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,61 @@

#include "Khaos/Language.h"

#include <string>

#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
#pragma warning(disable : 4702 4805)
#endif

int CXX98()
#if CPP_STANDARD == 98
const int standard = 8; //HACK to simplify he check
const char standard_str[] = "C++98";
static int CXX98()
{
#if LANGUAGE_IS_GREATER(CXX98)
#if LANGUAGE_IS_GREATER(CXX98)
return -1;
#endif
#endif

#if !LANGUAGE_IS_GREATER_EQUAL(CXX98)
#if !LANGUAGE_IS_GREATER_EQUAL(CXX98)
return -1;
#endif
#endif

#if !LANGUAGE_IS_EQUAL(CXX98)
#if !LANGUAGE_IS_EQUAL(CXX98)
return -1;
#endif
#endif

#if !LANGUAGE_IS_LOWER_EQUAL(CXX98)
#if !LANGUAGE_IS_LOWER_EQUAL(CXX98)
return -1;
#endif
#endif

#if LANGUAGE_IS_LOWER(CXX98)
#if LANGUAGE_IS_LOWER(CXX98)
return -1;
#endif
#endif

#if LANGUAGE_IS(C) || LANGUAGE_IS(Cuda) || LANGUAGE_IS(ClangCuda) || LANGUAGE_IS(ObjCPP) || LANGUAGE_IS(ObjC) || LANGUAGE_IS(Assembler) || LANGUAGE_IS(Fortran)
#if LANGUAGE_IS(C) || LANGUAGE_IS(Cuda) || LANGUAGE_IS(ClangCuda) || LANGUAGE_IS(ObjCPP) || LANGUAGE_IS(ObjC) || LANGUAGE_IS(Assembler) || LANGUAGE_IS(Fortran)
return -1;
#endif
#endif

#if !LANGUAGE_IS(CXX)
#if !LANGUAGE_IS(CXX)
return -1;
#endif
#endif

#if CPP_EXTENSIONS == 0
#if !LANGUAGE_IS(ISO)
#if CPP_EXTENSIONS == 0
#if !LANGUAGE_IS(ISO)
return -1;
#endif
#endif

#if LANGUAGE_IS(Extensions)
#if LANGUAGE_IS(Extensions)
return -1;
#endif
#else
#if LANGUAGE_IS(ISO)
#endif
#else
#if LANGUAGE_IS(ISO)
return -1;
#endif
#if !LANGUAGE_IS(Extensions)
#endif
#if !LANGUAGE_IS(Extensions)
return -1;
#endif
#endif
#endif
return 0;
}

#if CPP_STANDARD == 98
const int standard = 8; //HACK to simplify he check
const char standard_str[] = "C++98";
#elif CPP_STANDARD == 11
const int standard = 11;
const char standard_str[] = "C++11";
Expand All @@ -95,11 +92,7 @@ const char str[] = "(Extension)";
#endif

#if CPP_STANDARD == 98
#if(!defined(_MSC_VER) && !defined(__clang__)) || defined(__MINGW32__) || defined(__MINGW64__)
int main() { return CXX98(); }
#else
int main() { return 0; }
#endif
#else
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
// NOLINTBEGIN
Expand Down

0 comments on commit 38a7e7b

Please sign in to comment.