mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-14 18:51:47 -07:00
Removed thirdparty dir, updated docs, removed banned.define/undef files
This commit is contained in:
@ -1,35 +0,0 @@
|
||||
// Standard Allocation
|
||||
#define new static_assert( false, "Banned keyword used: new" )
|
||||
#define delete static_assert( false, "Banned keyword used: delete" )
|
||||
|
||||
// Standard Coroutines
|
||||
#define co_await static_assert( false, "Banned keyword used: co_await" )
|
||||
#define co_return static_assert( false, "Banned keyword used: co_return" )
|
||||
#define co_yield static_assert( false, "Banned keyword used: co_yield" )
|
||||
|
||||
// Standard Exceptions
|
||||
#define atomic_cancel static_assert( false, "Banned keyword used: atomic_cancel" )
|
||||
#define atomic_commit static_assert( false, "Banned keyword used: atomic_commit" )
|
||||
#define atomic_noexcept static_assert( false, "Banned keyword used: atomic_noexcept" )
|
||||
#define catch static_assert( false, "Banned keyword used: catch" )
|
||||
#define noexcept static_assert( false, "Banned keyword used: noexcept" )
|
||||
#define throw static_assert( false, "Banned keyword used: throw" )
|
||||
#define try static_assert( false, "Banned keyword used: try" )
|
||||
|
||||
// Standard RTTI
|
||||
#define decltype static_assert( false, "Banned keyword used: decltype" )
|
||||
#define reflexpr static_assert( false, "Banned keyword used: reflexpr" )
|
||||
#define typeid static_assert( false, "Banned keyword used: typeid" )
|
||||
|
||||
// Object-Oriented Dynamic Dispatch
|
||||
#define final static_assert( false, "Banned keyword used: final" )
|
||||
#define override static_assert( false, "Banned keyword used: override" )
|
||||
#define virtual static_assert( false, "Banned keyword used: virtual" )
|
||||
|
||||
// Private Access Specifier
|
||||
#define private static_assert( false, "Banned keyword used: private" )
|
||||
|
||||
// Template Meta-programming
|
||||
#define concept static_assert( false, "Banned keyword used: concept" )
|
||||
#define requires static_assert( false, "Banned keyword used: requires" )
|
||||
#define template static_assert( false, "Banned keyword used: template" )
|
@ -1,35 +0,0 @@
|
||||
// Standard Allocation
|
||||
#undef new
|
||||
#undef delete
|
||||
|
||||
// Standard Coroutines
|
||||
#undef co_await
|
||||
#undef co_return
|
||||
#undef co_yield
|
||||
|
||||
// Standard Exceptions
|
||||
#undef atomic_cancel
|
||||
#undef atomic_commit
|
||||
#undef atomic_noexcept
|
||||
#undef catch
|
||||
#undef noexcept
|
||||
#undef throw
|
||||
#undef try
|
||||
|
||||
// Standard RTTI
|
||||
#undef decltype
|
||||
#undef reflexpr
|
||||
#undef typeid
|
||||
|
||||
// Object-Oriented Dynamic Dispatch
|
||||
#undef final
|
||||
#undef override
|
||||
#undef virtual
|
||||
|
||||
// Private Access Specifier
|
||||
#undef private
|
||||
|
||||
// Template Meta-programming
|
||||
#undef concept
|
||||
#undef requires
|
||||
#undef template
|
@ -32,6 +32,7 @@ While getting fleshed out, all feature macros are defined on the top of the head
|
||||
|
||||
These macros are:
|
||||
|
||||
* `GENCPP_ROLL_OWN_DEPENDENCIES` : Optional override so that user may define the dependencies themselves.
|
||||
* `GEN_DEFINE_LIBRARY_CORE_CONSTANTS` : Optional typename codes as they are non-standard to C/C++ and not necessary to library usage
|
||||
* `GEN_FEATURE_PARSING` : Defines the parse constructors
|
||||
* `GEN_FEATURE_EDITOR` : Defines the file editing features for changing definitions based on ASTs
|
||||
@ -44,6 +45,8 @@ This can be used to auto-queue generation of dependent definitions for the symbo
|
||||
|
||||
### Organization
|
||||
|
||||
Dependencies : Mostly from the c-zpl library.
|
||||
|
||||
log_failure definition : based on whether to always use fatal on all errors
|
||||
|
||||
Major enum definitions and their associated functions used with the AST data
|
||||
@ -86,6 +89,7 @@ Inlined functions related to the AST datatype that required forwards for gen int
|
||||
|
||||
## gen.cpp
|
||||
|
||||
* Dependencies
|
||||
* Static data
|
||||
* AST Body case macros are next.
|
||||
* AST implementation
|
||||
|
@ -5,45 +5,46 @@
|
||||
|
||||
#pragma region GENCPP DEPENDENCIES
|
||||
//! If its desired to roll your own dependencies, define GENCPP_PROVIDE_DEPENDENCIES before including this file.
|
||||
//! Dependencies are derived from the c-zpl library: https://github.com/zpl-c/zpl
|
||||
#ifndef GENCPP_PROVIDE_DEPENDENCIES
|
||||
|
||||
#pragma region Macros
|
||||
# include <stdio.h>
|
||||
// NOTE: Ensure we use standard methods for these calls if we use GEN_PICO
|
||||
# if ! defined( GEN_PICO_CUSTOM_ROUTINES )
|
||||
# if ! defined( GEN_MODULE_CORE )
|
||||
# define _strlen strlen
|
||||
# define _printf_err( fmt, ... ) fprintf( stderr, fmt, __VA_ARGS__ )
|
||||
# define _printf_err_va( fmt, va ) vfprintf( stderr, fmt, va )
|
||||
# else
|
||||
# define _strlen str_len
|
||||
# define _printf_err( fmt, ... ) str_fmt_out_err( fmt, __VA_ARGS__ )
|
||||
# define _printf_err_va( fmt, va ) str_fmt_out_err_va( fmt, va )
|
||||
# endif
|
||||
#pragma region Macros
|
||||
# include <stdio.h>
|
||||
# if ! defined( GEN_PICO_CUSTOM_ROUTINES )
|
||||
# if ! defined( GEN_MODULE_CORE )
|
||||
# define _strlen strlen
|
||||
# define _printf_err( fmt, ... ) fprintf( stderr, fmt, __VA_ARGS__ )
|
||||
# define _printf_err_va( fmt, va ) vfprintf( stderr, fmt, va )
|
||||
# else
|
||||
# define _strlen str_len
|
||||
# define _printf_err( fmt, ... ) str_fmt_out_err( fmt, __VA_ARGS__ )
|
||||
# define _printf_err_va( fmt, va ) str_fmt_out_err_va( fmt, va )
|
||||
# endif
|
||||
|
||||
# include <errno.h>
|
||||
|
||||
# if defined( GEN_SYSTEM_UNIX ) || defined( GEN_SYSTEM_MACOS )
|
||||
# include <unistd.h>
|
||||
# elif defined( GEN_SYSTEM_WINDOWS )
|
||||
# if ! defined( GEN_NO_WINDOWS_H )
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_MEAN_AND_LEAN
|
||||
# define VC_EXTRALEAN
|
||||
# endif
|
||||
#
|
||||
# include <errno.h>
|
||||
#
|
||||
# if defined( GEN_SYSTEM_UNIX ) || defined( GEN_SYSTEM_MACOS )
|
||||
# include <unistd.h>
|
||||
# elif defined( GEN_SYSTEM_WINDOWS )
|
||||
# if ! defined( GEN_NO_WINDOWS_H )
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# ifndef NOMINMAX
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# undef NOMINMAX
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# undef WIN32_MEAN_AND_LEAN
|
||||
# undef VC_EXTRALEAN
|
||||
#
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_MEAN_AND_LEAN
|
||||
# define VC_EXTRALEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# undef NOMINMAX
|
||||
# undef WIN32_LEAN_AND_MEAN
|
||||
# undef WIN32_MEAN_AND_LEAN
|
||||
# undef VC_EXTRALEAN
|
||||
# endif
|
||||
# endif
|
||||
#pragma endregion Macros
|
||||
|
||||
namespace gen
|
||||
|
@ -11,7 +11,8 @@
|
||||
#ifdef gen_time
|
||||
#pragma region GENCPP DEPENDENCIES
|
||||
//! If its desired to roll your own dependencies, define GENCPP_PROVIDE_DEPENDENCIES before including this file.
|
||||
#ifndef GENCPP_PROVIDE_DEPENDENCIES
|
||||
// Dependencies are derived from the c-zpl library: https://github.com/zpl-c/zpl
|
||||
#ifndef GENCPP_ROLL_OWN_DEPENDENCIES
|
||||
|
||||
#if __clang__
|
||||
# pragma clang diagnostic ignored "-Wunused-const-variable"
|
||||
@ -116,19 +117,19 @@
|
||||
# error Unknown compiler
|
||||
#endif
|
||||
|
||||
# ifndef GEN_DEF_INLINE
|
||||
# if defined( GEN_STATIC )
|
||||
# define GEN_DEF_INLINE
|
||||
# define GEN_IMPL_INLINE
|
||||
# else
|
||||
# define GEN_DEF_INLINE static
|
||||
# define GEN_IMPL_INLINE static inline
|
||||
# endif
|
||||
#ifndef GEN_DEF_INLINE
|
||||
# if defined( GEN_STATIC )
|
||||
# define GEN_DEF_INLINE
|
||||
# define GEN_IMPL_INLINE
|
||||
# else
|
||||
# define GEN_DEF_INLINE static
|
||||
# define GEN_IMPL_INLINE static inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# if defined( GEN_ALWAYS_INLINE )
|
||||
# undef GEN_ALWAYS_INLINE
|
||||
# endif
|
||||
#if defined( GEN_ALWAYS_INLINE )
|
||||
# undef GEN_ALWAYS_INLINE
|
||||
#endif
|
||||
|
||||
#ifdef GEN_COMPILER_MSVC
|
||||
# define forceinline __forceinline
|
||||
@ -144,7 +145,6 @@
|
||||
# define forceinline inline
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef GEN_COMPILER_MSVC
|
||||
# define neverinline __declspec( noinline )
|
||||
#elif defined(GEN_COMPILER_GCC)
|
||||
@ -278,8 +278,6 @@ while(0);
|
||||
# endif
|
||||
#pragma endregion Mandatory Includes
|
||||
|
||||
// #include "Banned.define.hpp"
|
||||
|
||||
namespace gen
|
||||
{
|
||||
constexpr
|
||||
@ -3075,6 +3073,9 @@ namespace gen
|
||||
Code def_specifiers ( s32 num, SpecifierT* specs );
|
||||
Code def_struct_body ( s32 num, Code* codes );
|
||||
Code def_union_body ( s32 num, Code* codes );
|
||||
|
||||
// Use this to manually populate the entries on demand (will not be checked for validity).
|
||||
Code def_empty_body( CodeT body_type );
|
||||
# pragma endregion Upfront
|
||||
|
||||
# pragma region Parsing
|
||||
@ -3105,7 +3106,7 @@ namespace gen
|
||||
//! Do not use directly. Use the token_fmt macro instead.
|
||||
// Takes a format string (char const*) and a list of tokens (StrC) and returns a StrC of the formatted string.
|
||||
inline
|
||||
StrC _token_fmt( sw num, ... )
|
||||
StrC token_fmt_impl( sw num, ... )
|
||||
{
|
||||
local_persist thread_local
|
||||
char buf[GEN_PRINTF_MAXLEN] = { 0 };
|
||||
@ -3260,7 +3261,7 @@ namespace gen
|
||||
# define args( ... ) macro_num_args( __VA_ARGS__ ), __VA_ARGS__
|
||||
|
||||
// Takes a format string (char const*) and a list of tokens (StrC) and returns a StrC of the formatted string.
|
||||
# define token_fmt( ... ) _token_fmt( (macro_num_args( __VA_ARGS__ ) + 1) / 2, __VA_ARGS__ )
|
||||
# define token_fmt( ... ) token_fmt_impl( (macro_num_args( __VA_ARGS__ ) + 1) / 2, __VA_ARGS__ )
|
||||
#pragma endregion Macros
|
||||
|
||||
#pragma region Constants
|
||||
|
@ -17,12 +17,5 @@
|
||||
#undef gigabytes
|
||||
#undef terabytes
|
||||
|
||||
#undef global
|
||||
#undef internal
|
||||
#undef local_persist
|
||||
#undef forceinline
|
||||
|
||||
#undef txt
|
||||
|
||||
// gen_time
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user