FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

make it possible to explicitly disable the legacy `TokenList` constructors by firewave · Pull Request #621 · cppcheck-opensource/simplecpp · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
1 change: 1 addition & 0 deletions main.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2016-2023 simplecpp team
*/

#define SIMPLECPP_TOKENLIST_ALLOW_PTR 0
#include "simplecpp.h"

#include <cstdlib>
Expand Down
6 changes: 4 additions & 2 deletions simplecpp.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -267,7 +269,7 @@ namespace simplecpp {
TokenList(const unsigned char (&data)[size], std::vector<std::string> &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
Comment thread
danmar marked this conversation as resolved.
/** generates a token list from the given buffer */
TokenList(const unsigned char* data, std::size_t size, std::vector<std::string> &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr)
: TokenList(data, size, filenames, filename, outputList, 0)
Expand Down

Back | FazBrowse Home | New Git URL