mirror of
https://github.com/Ed94/gencpp.git
synced 2025-02-23 21:58:37 -08:00
fixes
This commit is contained in:
parent
b8695a33db
commit
6f2d81434e
@ -134,12 +134,12 @@ GEN_API StrBuilder preprocess_to_strbuilder (CodePreprocessCond cond);
|
||||
StrBuilder template_to_strbuilder (CodeTemplate self);
|
||||
GEN_API void template_to_strbuilder_ref(CodeTemplate self, StrBuilder* result);
|
||||
|
||||
StrBuilder typename_to_strbuilder (CodeTypename self);
|
||||
GEN_API void typename_to_strbuilder_ref(CodeTypename self, StrBuilder* result);
|
||||
|
||||
StrBuilder typedef_to_strbuilder (CodeTypedef self);
|
||||
GEN_API void typedef_to_strbuilder_ref(CodeTypedef self, StrBuilder* result );
|
||||
|
||||
StrBuilder typename_to_strbuilder (CodeTypename self);
|
||||
GEN_API void typename_to_strbuilder_ref(CodeTypename self, StrBuilder* result);
|
||||
|
||||
GEN_API StrBuilder union_to_strbuilder (CodeUnion self);
|
||||
GEN_API void union_to_strbuilder_def(CodeUnion self, StrBuilder* result);
|
||||
GEN_API void union_to_strbuilder_fwd(CodeUnion self, StrBuilder* result);
|
||||
|
@ -52,7 +52,7 @@ void comment_to_strbuilder_ref(CodeComment comment, StrBuilder* result) {
|
||||
inline
|
||||
StrBuilder define_to_strbuilder(CodeDefine define)
|
||||
{
|
||||
GEN_ASSERT(define)
|
||||
GEN_ASSERT(define);
|
||||
StrBuilder result = strbuilder_make_reserve( _ctx->Allocator_Temp, 512 );
|
||||
define_to_strbuilder_ref(define, & result);
|
||||
return result;
|
||||
@ -77,12 +77,10 @@ StrBuilder exec_to_strbuilder(CodeExec exec)
|
||||
}
|
||||
|
||||
inline
|
||||
StrBuilder exec_to_strbuilder_ref(CodeExec exec, StrBuilder* result) {
|
||||
void exec_to_strbuilder_ref(CodeExec exec, StrBuilder* result) {
|
||||
GEN_ASSERT(exec);
|
||||
GEN_ASSERT(result);
|
||||
char* raw = ccast(char*, str_duplicate( exec->Content, get_context()->Allocator_Temp ).Ptr);
|
||||
StrBuilder result = { raw };
|
||||
return result;
|
||||
strbuilder_append_str(result, exec->Content);
|
||||
}
|
||||
|
||||
inline
|
||||
@ -176,6 +174,23 @@ StrBuilder params_to_strbuilder(CodeParams self)
|
||||
return result;
|
||||
}
|
||||
|
||||
inline
|
||||
StrBuilder pragma_to_strbuilder(CodePragma self)
|
||||
{
|
||||
GEN_ASSERT(self);
|
||||
StrBuilder result = strbuilder_make_reserve( _ctx->Allocator_Temp, 256 );
|
||||
pragma_to_strbuilder_ref( self, & result );
|
||||
return result;
|
||||
}
|
||||
|
||||
inline
|
||||
void pragma_to_strbuilder_ref(CodePragma self, StrBuilder* result )
|
||||
{
|
||||
GEN_ASSERT(self);
|
||||
GEN_ASSERT(result);
|
||||
strbuilder_append_fmt( result, "#pragma %S\n", self->Content );
|
||||
}
|
||||
|
||||
inline
|
||||
void preprocess_to_strbuilder_if(CodePreprocessCond cond, StrBuilder* result )
|
||||
{
|
||||
@ -224,27 +239,10 @@ void preprocess_to_strbuilder_endif(CodePreprocessCond cond, StrBuilder* result
|
||||
strbuilder_append_str( result, txt("#endif\n") );
|
||||
}
|
||||
|
||||
inline
|
||||
StrBuilder pragma_to_strbuilder(CodePragma self)
|
||||
{
|
||||
GEN_ASSERT(self);
|
||||
StrBuilder result = strbuilder_make_reserve( _ctx->Allocator_Temp, 256 );
|
||||
pragma_to_strbuilder_ref( self, & result );
|
||||
return result;
|
||||
}
|
||||
|
||||
inline
|
||||
void pragma_to_strbuilder_ref(CodePragma self, StrBuilder* result )
|
||||
{
|
||||
GEN_ASSERT(self)
|
||||
GEN_ASSERT(result)
|
||||
strbuilder_append_fmt( result, "#pragma %S\n", self->Content );
|
||||
}
|
||||
|
||||
inline
|
||||
StrBuilder specifiers_to_strbuilder(CodeSpecifiers self)
|
||||
{
|
||||
GEN_ASSERT(self)
|
||||
GEN_ASSERT(self);
|
||||
StrBuilder result = strbuilder_make_reserve( _ctx->Allocator_Temp, 64 );
|
||||
specifiers_to_strbuilder_ref( self, & result );
|
||||
return result;
|
||||
@ -262,7 +260,7 @@ StrBuilder template_to_strbuilder(CodeTemplate self)
|
||||
inline
|
||||
StrBuilder typedef_to_strbuilder(CodeTypedef self)
|
||||
{
|
||||
GEN_ASSERT(self)
|
||||
GEN_ASSERT(self);
|
||||
StrBuilder result = strbuilder_make_reserve( _ctx->Allocator_Temp, 128 );
|
||||
typedef_to_strbuilder_ref( self, & result );
|
||||
return result;
|
||||
@ -271,7 +269,7 @@ StrBuilder typedef_to_strbuilder(CodeTypedef self)
|
||||
inline
|
||||
StrBuilder typename_to_strbuilder(CodeTypename self)
|
||||
{
|
||||
GEN_ASSERT(self)
|
||||
GEN_ASSERT(self);
|
||||
StrBuilder result = strbuilder_make_str( _ctx->Allocator_Temp, txt("") );
|
||||
typename_to_strbuilder_ref( self, & result );
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user