WIP : Fixes and other changes

* Number literals weren't getting properly lexed
* Fixes for compiler errors with Unreal Engine configuration.
* Support for "post-name" macros in parameters
* Support for variables initializing directly using constructor syntax.
* Explicitly added inline keyword to header inlines for compiling compile library in multiple translation units.
This commit is contained in:
2024-10-25 01:04:17 -04:00
parent e1592ba410
commit b8e1aa6eb7
20 changed files with 248 additions and 94 deletions

View File

@ -13,6 +13,7 @@
#define internal static // Internal linkage
#define local_persist static // Local Persisting variables
#pragma region ForceInline_Definition
#ifdef GEN_COMPILER_MSVC
# define forceinline __forceinline
# define neverinline __declspec( noinline )
@ -31,18 +32,23 @@
# define forceinline
# define neverinline
#endif
#pragma endregion ForceInline_Definition
// Bits
#ifndef bit
#define bit( Value ) ( 1 << Value )
#define bitfield_is_equal( Type, Field, Mask ) ( (Type(Mask) & Type(Field)) == Type(Mask) )
#endif
// Casting
#ifndef ccast
#define ccast( Type, Value ) ( * const_cast< Type* >( & (Value) ) )
#define pcast( Type, Value ) ( * reinterpret_cast< Type* >( & ( Value ) ) )
#define rcast( Type, Value ) reinterpret_cast< Type >( Value )
#define scast( Type, Value ) static_cast< Type >( Value )
#endif
// Num Arguments (Varadics)
// #if defined(__GNUC__) || defined(__clang__)