Skip to content

Commit

Permalink
rename #define
Browse files Browse the repository at this point in the history
  • Loading branch information
skottmckay committed Sep 20, 2024
1 parent a98875a commit 45de1ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/onnxruntime/core/common/logging/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ using Timestamp = std::chrono::time_point<std::chrono::system_clock>;
// C++20 has operator<< in std::chrono for Timestamp type but mac builds need additional checks
// to ensure usage is valid.
// TODO: As we enable C++20 on other platforms we may need similar checks.

Check warning on line 63 in include/onnxruntime/core/common/logging/logging.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2] Raw Output: include/onnxruntime/core/common/logging/logging.h:63: Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
#define _USE_CXX20_STD_CHRONO __cplusplus >= 202002L
#define TEMP_USE_CXX20_STD_CHRONO __cplusplus >= 202002L

// Apply constraints for mac builds
#if __APPLE__
Expand All @@ -71,22 +71,22 @@ using Timestamp = std::chrono::time_point<std::chrono::system_clock>;
#if TARGET_OS_MACCATALYST
// maccatalyst requires version 16.3
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 160300)
#undef _USE_CXX20_STD_CHRONO
#undef TEMP_USE_CXX20_STD_CHRONO
#endif

#elif TARGET_OS_MAC
// Xcode added support for C++20's std::chrono::operator<< in SDK version 14.4,
// but the target macOS version must also be >= 13.3 for it to be used.
#if (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED < 140400) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 130300)
#undef _USE_CXX20_STD_CHRONO
#undef TEMP_USE_CXX20_STD_CHRONO
#endif

#endif

#endif // __APPLE__

#if _USE_CXX20_STD_CHRONO
#if TEMP_USE_CXX20_STD_CHRONO
namespace timestamp_ns = std::chrono;
#else
namespace timestamp_ns = ::date;
Expand Down

0 comments on commit 45de1ee

Please sign in to comment.