Replace guards with pragma once
This commit is contained in:
10
arena.h
10
arena.h
@@ -9,6 +9,11 @@
|
||||
#define MA_GIB(x) (MA_MIB(x) * 1024ull)
|
||||
#define MA_TIB(x) (MA_GIB(x) * 1024ull)
|
||||
|
||||
typedef struct MV_Memory MV_Memory;
|
||||
typedef struct MA_Checkpoint MA_Checkpoint;
|
||||
typedef struct MA_Arena MA_Arena;
|
||||
typedef struct M_Allocator M_Allocator;
|
||||
|
||||
#ifndef MA_DEFAULT_RESERVE_SIZE
|
||||
#define MA_DEFAULT_RESERVE_SIZE MA_GIB(1)
|
||||
#endif
|
||||
@@ -69,12 +74,7 @@ typedef enum M_AllocatorOp {
|
||||
M_AllocatorOp_Deallocate,
|
||||
} M_AllocatorOp;
|
||||
|
||||
typedef struct MV_Memory MV_Memory;
|
||||
typedef struct MA_Checkpoint MA_Checkpoint;
|
||||
typedef struct MA_Arena MA_Arena;
|
||||
typedef struct M_Allocator M_Allocator;
|
||||
typedef void *M_AllocatorProc(void *allocator, M_AllocatorOp kind, void *p, size_t size);
|
||||
|
||||
struct M_Allocator {
|
||||
void *obj;
|
||||
void *(*p)(void *allocator, M_AllocatorOp kind, void *p, size_t size);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// #define ARRAY_ALLOCATOR_TYPE Allocator
|
||||
#pragma once
|
||||
|
||||
#ifndef ARRAY_PRIVATE_FUNCTION
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
5
clexer.h
5
clexer.h
@@ -1,5 +1,4 @@
|
||||
#ifndef CL_HEADER
|
||||
#define CL_HEADER
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -494,5 +493,3 @@ CL_INLINE CL_Token *CL_MatchIdentifier(CL_Tokens *tokens, char *str) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // CL_HEADER
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef OS_FS_HEADER
|
||||
#define OS_FS_HEADER
|
||||
#pragma once
|
||||
|
||||
#ifndef OS_API
|
||||
#ifdef __cplusplus
|
||||
@@ -63,4 +62,3 @@ OS_API S8_String OS_ListDirRegexAsString(MA_Arena *arena, S8_String path, unsign
|
||||
OS_API bool OS_ExpandIncludesList(MA_Arena *arena, S8_List *out, S8_String filepath);
|
||||
OS_API S8_String OS_ExpandIncludes(MA_Arena *arena, S8_String filepath);
|
||||
OS_API bool WIN_EnableTerminalColors(void);
|
||||
#endif // OS_FS_HEADER
|
||||
|
||||
4
hash.h
4
hash.h
@@ -1,5 +1,4 @@
|
||||
#ifndef HASH_HEADER
|
||||
#define HASH_HEADER
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef HASH_API_FUNCTION
|
||||
@@ -30,4 +29,3 @@ HASH_API_FUNCTION uint64_t HashMix(uint64_t x, uint64_t y);
|
||||
|
||||
#define WRAP_AROUND_POWER_OF_2(x, pow2) (((x) & ((pow2)-1llu)))
|
||||
static inline float GetRandomNormalF(RandomSeed *series) { return (float)GetRandomNormal(series); }
|
||||
#endif
|
||||
|
||||
4
io.h
4
io.h
@@ -1,5 +1,4 @@
|
||||
#ifndef IO_HEADER
|
||||
#define IO_HEADER
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef IO_API
|
||||
@@ -72,4 +71,3 @@ IO_API void IO_OutputMessage(char *str, int len);
|
||||
IO_API IO_ErrorResult IO_OutputError(char *str, int len);
|
||||
IO_API void IO_Exit(int error_code);
|
||||
IO_API bool IO_IsDebuggerPresent(void);
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifndef LINKED_LIST_HEADER
|
||||
#define LINKED_LIST_HEADER
|
||||
|
||||
#pragma once
|
||||
#define SLL_QUEUE_ADD_MOD(f, l, n, next) \
|
||||
do { \
|
||||
(n)->next = 0; \
|
||||
@@ -125,5 +123,3 @@
|
||||
} while (0)
|
||||
#define DLL_INSERT_NEXT(base, new) DLL_INSERT_NEXT_MOD(base, new, next, prev)
|
||||
#define DLL_INSERT_PREV(base, new) DLL_INSERT_NEXT_MOD(base, new, next, prev)
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifndef LIB_LOAD_HEADER
|
||||
#define LIB_LOAD_HEADER
|
||||
|
||||
#pragma once
|
||||
typedef void *LIB_Library;
|
||||
|
||||
LIB_Library LIB_LoadLibrary(char *str);
|
||||
@@ -10,5 +8,3 @@ bool LIB_UnloadLibrary(LIB_Library lib);
|
||||
#ifndef LIB_EXPORT
|
||||
#define LIB_EXPORT __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef MU_HEADER
|
||||
#define MU_HEADER
|
||||
#pragma once
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
@@ -367,5 +366,3 @@ typedef struct MU_Event {
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#endif // MU_HEADER
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#ifndef PREPROC_ENV_HEADER
|
||||
#define PREPROC_ENV_HEADER
|
||||
|
||||
#pragma once
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
@@ -86,5 +84,3 @@
|
||||
// #pragma clang diagnostic push
|
||||
// #pragma clang diagnostic ignored "-Wmicrosoft-enum-forward-reference"
|
||||
// #endif
|
||||
|
||||
#endif // PREPROC_ENV_HEADER
|
||||
5
regex.h
5
regex.h
@@ -1,5 +1,4 @@
|
||||
#ifndef RE_HEADER
|
||||
#define RE_HEADER
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -92,5 +91,3 @@ RE_API RE_Match RE3_FindAgain(RE_Regex *regex, char *string, RE_Int len, RE_Matc
|
||||
RE_API RE_Int RE3_MatchFront(RE_Regex *regex, char *string, RE_Int len, char *string_front);
|
||||
RE_API RE_Regex *RE1_Parse(char *buff, RE_Int buffsize, char *string);
|
||||
RE_API RE_Regex *RE2_Parse(char *buff, RE_Int buffsize, char *string, RE_Int len);
|
||||
|
||||
#endif // RE_HEADER
|
||||
|
||||
5
string.h
5
string.h
@@ -1,5 +1,4 @@
|
||||
#ifndef S8_HEADER
|
||||
#define S8_HEADER
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -115,5 +114,3 @@ S8_API S8_List S8_CopyList(S8_Allocator allocator, S8_List a);
|
||||
S8_API S8_List S8_ConcatLists(S8_Allocator allocator, S8_List a, S8_List b);
|
||||
S8_API S8_Node *S8_AddNode(S8_Allocator allocator, S8_List *list, S8_String string);
|
||||
S8_API S8_String S8_AddF(S8_Allocator allocator, S8_List *list, const char *str, ...);
|
||||
|
||||
#endif // S8_HEADER
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
/*
|
||||
Hash table implementation:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef UTF_HEADER
|
||||
#define UTF_HEADER
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
typedef struct UTF32_Result UTF32_Result;
|
||||
typedef struct UTF8_Result UTF8_Result;
|
||||
@@ -51,4 +50,3 @@ UTF_API UTF8_Iter UTF8_IterateEx(char *str, int len);
|
||||
UTF_API UTF8_Iter UTF8_Iterate(char *str);
|
||||
|
||||
#define UTF8_For(name, str, len) for (UTF8_Iter name = UTF8_IterateEx(str, (int)len); name.item; UTF8_Advance(&name))
|
||||
#endif // UTF_HEADER
|
||||
|
||||
Reference in New Issue
Block a user