Define macros for C linkage

This commit is contained in:
2024-10-05 22:06:13 +01:00
parent ffb99a3644
commit 12f182f0cf
19 changed files with 38 additions and 40 deletions

View File

@@ -4,7 +4,7 @@
#include "aliases.h"
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
#define NUMPARTS(...) \
@@ -19,7 +19,7 @@ void join_path(char *dst, u64 count, ...);
void dirup(char *dst, u64 levels, const char *path);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !PATH_UTILS_H

View File

@@ -4,7 +4,7 @@
#include "aliases.h"
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
/***************************************************************************/ //
@@ -49,7 +49,7 @@ void *wapp_mem_allocator_realloc_aligned(const Allocator *allocator, void *ptr,
void wapp_mem_allocator_free(const Allocator *allocator, void **ptr);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !MEM_ALLOCATOR_H

View File

@@ -6,7 +6,7 @@
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
typedef struct arena Arena;
@@ -53,7 +53,7 @@ void wapp_mem_arena_clear(Arena *arena);
void wapp_mem_arena_destroy(Arena **arena);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !MEM_ARENA_H

View File

@@ -7,7 +7,7 @@
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
/***************************************************************************/ //
@@ -51,7 +51,7 @@ void wapp_mem_arena_allocator_clear(Allocator *allocator);
void wapp_mem_arena_allocator_destroy(Allocator *allocator);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !MEM_ARENA_ALLOCATOR_H

View File

@@ -3,13 +3,13 @@
#include "mem_allocator.h"
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
Allocator wapp_mem_libc_allocator(void);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !MEM_LIBC_H

View File

@@ -6,7 +6,7 @@
#include <string.h>
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
typedef struct bstr BasicString;
@@ -28,7 +28,7 @@ struct strvw {
#define wapp_string_print(STR) (printf("%.*s\n", (i32)STR.size, STR.buf))
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !BASIC_STRING_H

View File

@@ -8,7 +8,7 @@
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
BEGIN_C_LINKAGE
#endif // __cplusplus
typedef struct dstr String;
@@ -35,7 +35,7 @@ u64 wapp_dstr_capacity(const String *str);
const char *wapp_dstr_to_cstr(const String *str);
#ifdef __cplusplus
}
END_C_LINKAGE
#endif // __cplusplus
#endif // !DSTR_H