MCPcopy Create free account
hub / github.com/JACoders/OpenJK / PC_AddBuiltinDefines

Function PC_AddBuiltinDefines

codemp/botlib/l_precomp.cpp:686–719  ·  view source on GitHub ↗

end of the function PC_FreeDefine ============================================================================ Parameter: - Returns: - Changes Globals: - ============================================================================

Source from the content-addressed store, hash-verified

684// Changes Globals: -
685//============================================================================
686void PC_AddBuiltinDefines(source_t *source)
687{
688 int i;
689 define_t *define;
690 struct builtin
691 {
692 char *string;
693 int mBuiltin;
694 } builtin[] = { // bk001204 - brackets
695 { "__LINE__", BUILTIN_LINE },
696 { "__FILE__", BUILTIN_FILE },
697 { "__DATE__", BUILTIN_DATE },
698 { "__TIME__", BUILTIN_TIME },
699// { "__STDC__", BUILTIN_STDC },
700 { NULL, 0 }
701 };
702
703 for (i = 0; builtin[i].string; i++)
704 {
705 define = (define_t *) GetMemory(sizeof(define_t));
706 Com_Memset(define, 0, sizeof(define_t));
707 define->name = (char *) GetMemory(strlen(builtin[i].string) + 1);
708 strcpy(define->name, builtin[i].string);
709 define->flags |= DEFINE_FIXED;
710 define->builtin = builtin[i].mBuiltin;
711 //add the define to the source
712#if DEFINEHASHING
713 PC_AddDefineToHash(define, source->definehash);
714#else
715 define->next = source->defines;
716 source->defines = define;
717#endif //DEFINEHASHING
718 } //end for
719} //end of the function PC_AddBuiltinDefines
720//============================================================================
721//
722// Parameter: -

Callers

nothing calls this directly

Calls 2

GetMemoryFunction · 0.85
PC_AddDefineToHashFunction · 0.85

Tested by

no test coverage detected