From 5af99c9a355d575d03c2c95e15d8383af5384b86 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 14 Jan 2026 20:49:04 +0100 Subject: [PATCH 1/2] make it possible to explicitly disable the legacy `TokenList` constructors --- simplecpp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simplecpp.h b/simplecpp.h index 46a43bc4..54f6a90c 100644 --- a/simplecpp.h +++ b/simplecpp.h @@ -57,7 +57,9 @@ #ifndef SIMPLECPP_TOKENLIST_ALLOW_PTR // still provide the legacy API in case we lack the performant wrappers # if !defined(__cpp_lib_string_view) && !defined(__cpp_lib_span) -# define SIMPLECPP_TOKENLIST_ALLOW_PTR +# define SIMPLECPP_TOKENLIST_ALLOW_PTR 1 +# else +# define SIMPLECPP_TOKENLIST_ALLOW_PTR 0 # endif #endif @@ -267,7 +269,7 @@ namespace simplecpp { TokenList(const unsigned char (&data)[size], std::vector &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr) : TokenList(data, size-1, filenames, filename, outputList, 0) {} -#ifdef SIMPLECPP_TOKENLIST_ALLOW_PTR +#if SIMPLECPP_TOKENLIST_ALLOW_PTR /** generates a token list from the given buffer */ TokenList(const unsigned char* data, std::size_t size, std::vector &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr) : TokenList(data, size, filenames, filename, outputList, 0) From 73ab5c101e26277f8853fe134c4cba206371f2eb Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 14 Jan 2026 20:49:22 +0100 Subject: [PATCH 2/2] main.cpp: disabled legacy `TokenList` constructors --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 62ccc022..d67f94c2 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ * Copyright (C) 2016-2023 simplecpp team */ +#define SIMPLECPP_TOKENLIST_ALLOW_PTR 0 #include "simplecpp.h" #include