Added support for predefining preprocessor defines before parsing strings of code.

This prevents issues for preprocessor defines not getting treated properly for specific circumstances (such as macro wrappers for specifiers).
This commit is contained in:
2023-11-21 20:09:14 -05:00
parent be023325a9
commit 772db608be
6 changed files with 57 additions and 18 deletions

View File

@ -5,6 +5,14 @@
#pragma region Containers
template<class TType> struct RemoveConst { typedef TType Type; };
template<class TType> struct RemoveConst<const TType> { typedef TType Type; };
template<class TType> struct RemoveConst<const TType[]> { typedef TType Type[]; };
template<class TType, uw Size> struct RemoveConst<const TType[Size]> { typedef TType Type[Size]; };
template<class TType>
using TRemoveConst = typename RemoveConst<TType>::Type;
template<class Type>
struct Array
{
@ -167,7 +175,8 @@ struct Array
Header* get_header( void )
{
return rcast( Header*, Data ) - 1 ;
using NonConstType = TRemoveConst< Type >;
return rcast( Header*, const_cast<NonConstType*>(Data) ) - 1 ;
}
bool grow( uw min_capacity )