Skip to content

Commit 900fcec

Browse files
committed
fixed #14179 - updated simplecpp to 1.6.1
1 parent 89b948d commit 900fcec

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

externals/simplecpp/simplecpp.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
# ifndef _WIN32_WINNT
88
# define _WIN32_WINNT 0x0602
99
# endif
10-
# define NOMINMAX
11-
# define WIN32_LEAN_AND_MEAN
10+
# ifndef NOMINMAX
11+
# define NOMINMAX
12+
# endif
13+
# ifndef WIN32_LEAN_AND_MEAN
14+
# define WIN32_LEAN_AND_MEAN
15+
# endif
1216
# include <windows.h>
1317
# undef ERROR
1418
#endif
@@ -24,6 +28,7 @@
2428
#include <cctype>
2529
#include <climits>
2630
#include <cstddef> // IWYU pragma: keep
31+
#include <cstdint>
2732
#include <cstdio>
2833
#include <cstdlib>
2934
#include <cstring>
@@ -3366,7 +3371,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
33663371
// True => code in current #if block should be kept
33673372
// ElseIsTrue => code in current #if block should be dropped. the code in the #else should be kept.
33683373
// AlwaysFalse => drop all code in #if and #else
3369-
enum IfState { True, ElseIsTrue, AlwaysFalse };
3374+
enum IfState : std::uint8_t { True, ElseIsTrue, AlwaysFalse };
33703375
std::stack<int> ifstates;
33713376
std::stack<const Token *> iftokens;
33723377
ifstates.push(True);

externals/simplecpp/simplecpp.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define simplecppH
88

99
#include <cctype>
10+
#include <cstdint>
1011
#include <cstring>
1112
#include <iosfwd>
1213
#include <list>
@@ -39,9 +40,7 @@
3940
# define SIMPLECPP_LIB
4041
#endif
4142

42-
#ifdef _WIN32
43-
# include <cstdint>
44-
#else
43+
#ifndef _WIN32
4544
# include <sys/stat.h>
4645
#endif
4746

@@ -63,10 +62,10 @@
6362

6463
namespace simplecpp {
6564
/** C code standard */
66-
enum cstd_t { CUnknown=-1, C89, C99, C11, C17, C23, C2Y };
65+
enum cstd_t : std::int8_t { CUnknown=-1, C89, C99, C11, C17, C23, C2Y };
6766

6867
/** C++ code standard */
69-
enum cppstd_t { CPPUnknown=-1, CPP03, CPP11, CPP14, CPP17, CPP20, CPP23, CPP26 };
68+
enum cppstd_t : std::int8_t { CPPUnknown=-1, CPP03, CPP11, CPP14, CPP17, CPP20, CPP23, CPP26 };
7069

7170
using TokenString = std::string;
7271
class Macro;
@@ -204,7 +203,7 @@ namespace simplecpp {
204203
/** Output from preprocessor */
205204
struct SIMPLECPP_LIB Output {
206205
explicit Output(const std::vector<std::string> &files) : type(ERROR), location(files) {}
207-
enum Type {
206+
enum Type : std::uint8_t {
208207
ERROR, /* #error */
209208
WARNING, /* #warning */
210209
MISSING_HEADER,

0 commit comments

Comments
 (0)