Skip to content

Commit 5af99c9

Browse files
committed
make it possible to explicitly disable the legacy TokenList constructors
1 parent 15f8335 commit 5af99c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

simplecpp.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
#ifndef SIMPLECPP_TOKENLIST_ALLOW_PTR
5858
// still provide the legacy API in case we lack the performant wrappers
5959
# if !defined(__cpp_lib_string_view) && !defined(__cpp_lib_span)
60-
# define SIMPLECPP_TOKENLIST_ALLOW_PTR
60+
# define SIMPLECPP_TOKENLIST_ALLOW_PTR 1
61+
# else
62+
# define SIMPLECPP_TOKENLIST_ALLOW_PTR 0
6163
# endif
6264
#endif
6365

@@ -267,7 +269,7 @@ namespace simplecpp {
267269
TokenList(const unsigned char (&data)[size], std::vector<std::string> &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr)
268270
: TokenList(data, size-1, filenames, filename, outputList, 0)
269271
{}
270-
#ifdef SIMPLECPP_TOKENLIST_ALLOW_PTR
272+
#if SIMPLECPP_TOKENLIST_ALLOW_PTR
271273
/** generates a token list from the given buffer */
272274
TokenList(const unsigned char* data, std::size_t size, std::vector<std::string> &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr)
273275
: TokenList(data, size, filenames, filename, outputList, 0)

0 commit comments

Comments
 (0)