Skip to content

Commit da15a56

Browse files
committed
Enhance C++20 views support by refining preprocessor directives
- Updated `config.h` and `cxx_compiler_quirks.h` to conditionally define `SQLITE_ORM_CPP20_VIEWS_SUPPORTED` based on the presence of `SQLITE_ORM_BROKEN_CPP20_VIEWS` for better compatibility with Clang versions. - Ensured that the definition of `SQLITE_ORM_CPP20_VIEWS_SUPPORTED` is only active when the necessary conditions are met, improving overall code robustness.
1 parent a6f2fbb commit da15a56

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

dev/functional/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#define SQLITE_ORM_CPP20_RANGES_SUPPORTED
5656
#endif
5757

58-
#if __cpp_lib_ranges >= 202110L
58+
#if __cpp_lib_ranges >= 202110L && !defined(SQLITE_ORM_BROKEN_CPP20_VIEWS)
5959
#define SQLITE_ORM_CPP20_VIEWS_SUPPORTED
6060
#endif
6161

dev/functional/cxx_compiler_quirks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@
7373
#define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS
7474
#endif
7575

76-
#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15))
77-
#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED
76+
#if defined(__clang__) && (__clang_major__ <= 15)
77+
#define SQLITE_ORM_BROKEN_CPP20_VIEWS
7878
#endif

include/sqlite_orm/sqlite_orm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ using std::nullptr_t;
221221
#define SQLITE_ORM_BROKEN_NONTEMPLATE_CONCEPTS
222222
#endif
223223

224-
#if defined(SQLITE_ORM_CPP20_VIEWS_SUPPORTED) && (defined(__clang__) && (__clang_major__ <= 15))
225-
#undef SQLITE_ORM_CPP20_VIEWS_SUPPORTED
224+
#if defined(__clang__) && (__clang_major__ <= 15)
225+
#define SQLITE_ORM_BROKEN_CPP20_VIEWS
226226
#endif
227227

228228
// #include "platform_definitions.h"
@@ -317,7 +317,7 @@ using std::nullptr_t;
317317
#define SQLITE_ORM_CPP20_RANGES_SUPPORTED
318318
#endif
319319

320-
#if __cpp_lib_ranges >= 202110L
320+
#if __cpp_lib_ranges >= 202110L && !defined(SQLITE_ORM_BROKEN_CPP20_VIEWS)
321321
#define SQLITE_ORM_CPP20_VIEWS_SUPPORTED
322322
#endif
323323

0 commit comments

Comments
 (0)