Skip to content

Commit a1849e2

Browse files
committed
Change preprocessor options for string_view to be more consistent with other options
Also makes it so people can manually define MODERN_SQLITE_STRINGVIEW_SUPPORT if they want
1 parent 9e56736 commit a1849e2

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

hdr/sqlite_modern_cpp/type_wrapper.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77
#ifdef __has_include
88
#if __cplusplus >= 201703 && __has_include(<string_view>)
99
#define MODERN_SQLITE_STRINGVIEW_SUPPORT
10-
#include <string_view>
11-
#define STR_REF std::string_view
12-
#define U16STR_REF std::u16string_view
13-
#else
14-
#define STR_REF std::string
15-
#define U16STR_REF std::u16string
1610
#endif
17-
#else
18-
#define STR_REF std::string
19-
#define U16STR_REF std::u16string
2011
#endif
2112
#ifdef __has_include
2213
#if __cplusplus > 201402 && __has_include(<optional>)
@@ -44,7 +35,14 @@
4435
#ifdef MODERN_SQLITE_STD_VARIANT_SUPPORT
4536
#include <variant>
4637
#endif
47-
38+
#ifdef MODERN_SQLITE_STRINGVIEW_SUPPORT
39+
#include <string_view>
40+
#define STR_REF std::string_view
41+
#define U16STR_REF std::u16string_view
42+
#else
43+
#define STR_REF std::string
44+
#define U16STR_REF std::u16string
45+
#endif
4846
#include <sqlite3.h>
4947
#include "errors.h"
5048

0 commit comments

Comments
 (0)