diff --git a/codegen/datatypes.py b/codegen/datatypes.py index 910039d..40a0f32 100644 --- a/codegen/datatypes.py +++ b/codegen/datatypes.py @@ -233,8 +233,8 @@ class CHeader(CFile): header_guard_open = f"#ifndef {header_guard_name}\n#define {header_guard_name}\n\n" header_guard_close = f"#endif // !{header_guard_name}\n" - c_linkage_open = "#ifdef __cplusplus\nBEGIN_C_LINKAGE\n#endif // !__cplusplus\n\n" - c_linkage_close = "\n#ifdef __cplusplus\nEND_C_LINKAGE\n#endif // !__cplusplus\n\n" + c_linkage_open = "#ifdef WAPP_PLATFORM_CPP\nBEGIN_C_LINKAGE\n#endif // !WAPP_PLATFORM_CPP\n\n" + c_linkage_close = "\n#ifdef WAPP_PLATFORM_CPP\nEND_C_LINKAGE\n#endif // !WAPP_PLATFORM_CPP\n\n" includes = _get_includes_string(self.includes) diff --git a/codegen/dbl_list/make_dbl_list.py b/codegen/dbl_list/make_dbl_list.py index 5524ba4..22476fe 100644 --- a/codegen/dbl_list/make_dbl_list.py +++ b/codegen/dbl_list/make_dbl_list.py @@ -101,7 +101,15 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}): header = CHeader( name="dbl_list", decl_types=[*common_decl_types], - includes=[], + includes=[ + CInclude( + header=str(convert_to_relative( + WAPP_SRC_ROOT / "common" / "platform" / "platform.h", + out_dir + )).replace("\\", "/"), + local=True, + ) + ], types=[], funcs=[] ) diff --git a/src/containers/dbl_list/dbl_list.h b/src/containers/dbl_list/dbl_list.h index 5859683..5098825 100644 --- a/src/containers/dbl_list/dbl_list.h +++ b/src/containers/dbl_list/dbl_list.h @@ -5,12 +5,13 @@ #ifndef DBL_LIST_H #define DBL_LIST_H +#include "../../common/platform/platform.h" #include "../../common/aliases/aliases.h" #include -#ifdef __cplusplus +#ifdef WAPP_PLATFORM_CPP BEGIN_C_LINKAGE -#endif // !__cplusplus +#endif // !WAPP_PLATFORM_CPP #define wapp_str8_list_node(ITEM_PTR) ((Str8Node){.item = ITEM_PTR}) #define wapp_void_ptr_list_node(ITEM_PTR) ((VoidPNode){.item = ITEM_PTR}) @@ -476,8 +477,8 @@ UptrNode *wapp_uptr_list_pop_back(UptrList *list); UptrNode *wapp_uptr_list_remove(UptrList *list, u64 index); void wapp_uptr_list_empty(UptrList *list); -#ifdef __cplusplus +#ifdef WAPP_PLATFORM_CPP END_C_LINKAGE -#endif // !__cplusplus +#endif // !WAPP_PLATFORM_CPP #endif // !DBL_LIST_H