Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMirzayanov committed Sep 22, 2024
1 parent 4df0ed8 commit 5c1ee38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
16 changes: 3 additions & 13 deletions testlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6225,20 +6225,10 @@ std::string testlib_format_(const std::string fmt, ...) {
return result;
}

#if __cplusplus >= 202002L && __has_include(<format>)
#if (__cplusplus >= 202002L && __has_include(<format>)) || __cpp_lib_format
# include <format>
#else
# ifndef __cpp_lib_format
std::string format(const char *fmt, ...) {
FMT_TO_RESULT(fmt, fmt, result);
return result;
}

std::string format(const std::string fmt, ...) {
FMT_TO_RESULT(fmt, fmt.c_str(), result);
return result;
}
#endif
#endif

#define format testlib_format_

#endif
10 changes: 9 additions & 1 deletion tests/scripts/compile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ rm -f "$exe_file"
EXTRA_ARGS=""

if [[ -z "${TESTLIB_COMPILER_OPTIMIZATION_OPT}" ]]; then
OPTIMIZATION="2"
if [[ "$2" == "--check-only" ]]; then
if [[ "$CPP" == "cl.exe" ]]; then
OPTIMIZATION="d"
else
OPTIMIZATION="0"
fi
else
OPTIMIZATION="2"
fi
else
OPTIMIZATION="${TESTLIB_COMPILER_OPTIMIZATION_OPT}"
fi
Expand Down

0 comments on commit 5c1ee38

Please sign in to comment.