Skip to content

Commit

Permalink
more fixes for 5.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenBent committed Mar 8, 2024
1 parent c449e37 commit 4780586
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lexers/LexLua.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class LexerLua : public DefaultLexer {
OptionSetLua osLua;
public:
explicit LexerLua() :
DefaultLexer("lua", SCLEX_LUA, lexicalClasses, std::size(lexicalClasses)) {
DefaultLexer("lua", SCLEX_LUA, lexicalClasses, Sci::size(lexicalClasses)) {
}
~LexerLua() override = default;
void SCI_METHOD Release() noexcept override {
Expand Down
2 changes: 1 addition & 1 deletion lexers/LexPython.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class LexerPython : public DefaultLexer {
std::map<Sci_Position, std::vector<SingleFStringExpState> > ftripleStateAtEol;
public:
explicit LexerPython() :
DefaultLexer("python", SCLEX_PYTHON, lexicalClasses, std::size(lexicalClasses)),
DefaultLexer("python", SCLEX_PYTHON, lexicalClasses, Sci::size(lexicalClasses)),
subStyles(styleSubable, 0x80, 0x40, 0) {
}
~LexerPython() override = default;
Expand Down
4 changes: 2 additions & 2 deletions lexlib/LexCharacterSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ using CharacterSet = CharacterSetArray<0x80>;

template <typename T, typename... Args>
bool AnyOf(T t, Args... args) noexcept {
#if wxCHECK_CXX_STD(201703L)
#if defined(__clang__)
static_assert(__is_integral(T) || __is_enum(T), "__is_integral(T) || __is_enum(T)");
static_assert(__is_integral(T) || __is_enum(T));
#endif
#if wxCHECK_CXX_STD(201703L)
return ((t == args) || ...);
#else
std::vector<T> v = { args... };
Expand Down
6 changes: 6 additions & 0 deletions lexlib/OptionSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef OPTIONSET_H
#define OPTIONSET_H

#include "LexillaCompat.h"

namespace Lexilla {

template <typename T>
Expand Down Expand Up @@ -99,9 +101,13 @@ class OptionSet {
}
template <typename E>
void DefineProperty(const char *name, E T::*pe, std::string const& description="") {
#if wxCHECK_CXX_STD(201703L)
static_assert(std::is_enum<E>::value);
#endif
plcoi pi {};
#if wxCHECK_CXX_STD(201703L)
static_assert(sizeof(pe) == sizeof(pi));
#endif
memcpy(&pi, &pe, sizeof(pe));
nameToDef[name] = Option(pi, description);
AppendName(name);
Expand Down

0 comments on commit 4780586

Please sign in to comment.