Skip to content

Commit

Permalink
Define _CRT_INTERNAL_NONSTDC_NAMES via CMake rather than preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Nov 9, 2023
1 parent 81bb6e5 commit aae1f14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ endif()
if( MSVC )
target_compile_options( ${TESTS_TARGET} PRIVATE /utf-8 )
target_compile_options( ${TESTS_TARGET_PUBLIC} PRIVATE /utf-8 )

target_compile_definitions( ${TESTS_TARGET} PRIVATE _CRT_INTERNAL_NONSTDC_NAMES=1 )
target_compile_definitions( ${TESTS_TARGET_PUBLIC} PRIVATE _CRT_INTERNAL_NONSTDC_NAMES=1 )
else()
target_compile_options( ${TESTS_TARGET} PRIVATE -Wno-deprecated -Wno-deprecated-declarations )
target_compile_options( ${TESTS_TARGET_PUBLIC} PRIVATE -Wno-deprecated -Wno-deprecated-declarations )
Expand Down
7 changes: 1 addition & 6 deletions tests/src/test_bitarchivereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
#include <internal/stringutil.hpp>
#include <internal/windows.hpp>

// Needed by MSVC for defining the S_XXXX macros.
#ifndef _CRT_INTERNAL_NONSTDC_NAMES // NOLINT(*-reserved-identifier, *-dcl37-c)
#define _CRT_INTERNAL_NONSTDC_NAMES 1
#endif

// For checking posix file attributes.
#include <sys/stat.h>

Expand Down Expand Up @@ -910,7 +905,7 @@ TEMPLATE_TEST_CASE( "BitArchiveReader: Reading an archive with a Unicode file na
const fs::path arcFileName{ BIT7Z_NATIVE_STRING( "αρχείο.7z" ) };

TestType inputArchive{};
getInputArchive( arcFileName, inputArchive );
getInputArchive( arcFileName, inputArchive );
const BitArchiveReader info( test::sevenzip_lib(), inputArchive, BitFormat::SevenZip );
REQUIRE_ITEM_TYPE( info, "¡Porque sí!.doc", fs::file_type::regular );
REQUIRE_ITEM_TYPE( info, "σύννεφα.jpg", fs::file_type::regular );
Expand Down

0 comments on commit aae1f14

Please sign in to comment.