diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-11-28 16:06:41 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-11-28 16:06:41 +0100 |
| commit | 8135988629e1a0df4394201284886b038fa8bc5c (patch) | |
| tree | 9608874a52ab33816a332f77a2c0ca5c350557a4 | |
| parent | 91529a79792ba669c9451c659e65e643540700bf (diff) | |
make SOKOL_IMPL vs SOKOL_xxx_IMPL consistent across all headers (both are supported)
| -rw-r--r-- | sokol_app.h | 15 | ||||
| -rw-r--r-- | sokol_args.h | 15 | ||||
| -rw-r--r-- | sokol_audio.h | 15 | ||||
| -rw-r--r-- | sokol_fetch.h | 15 | ||||
| -rw-r--r-- | sokol_gfx.h | 15 | ||||
| -rw-r--r-- | sokol_glue.h | 15 | ||||
| -rw-r--r-- | sokol_time.h | 15 | ||||
| -rw-r--r-- | util/sokol_debugtext.h | 9 | ||||
| -rw-r--r-- | util/sokol_fontstash.h | 10 | ||||
| -rw-r--r-- | util/sokol_gfx_imgui.h | 10 | ||||
| -rw-r--r-- | util/sokol_gl.h | 9 | ||||
| -rw-r--r-- | util/sokol_imgui.h | 10 | ||||
| -rw-r--r-- | util/sokol_memtrack.h | 12 | ||||
| -rw-r--r-- | util/sokol_shape.h | 9 |
14 files changed, 106 insertions, 68 deletions
diff --git a/sokol_app.h b/sokol_app.h index dc1e6a28..2362ff53 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_APP_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -860,12 +861,14 @@ #include <stdint.h> #include <stdbool.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_APP_IMPL) +#define SOKOL_APP_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_APP_API_DECL) - #define SOKOL_APP_API_DECL SOKOL_API_DECL +#define SOKOL_APP_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_APP_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_APP_IMPL) #define SOKOL_APP_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_APP_API_DECL __declspec(dllimport) @@ -1273,7 +1276,7 @@ inline int sapp_run(const sapp_desc& desc) { return sapp_run(&desc); } #endif // SOKOL_APP_INCLUDED /*-- IMPLEMENTATION ----------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_APP_IMPL #define SOKOL_APP_IMPL_INCLUDED (1) #include <string.h> /* memset */ @@ -10573,4 +10576,4 @@ SOKOL_API_IMPL void sapp_html5_ask_leave_site(bool ask) { _sapp.html5_ask_leave_site = ask; } -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_APP_IMPL */ diff --git a/sokol_args.h b/sokol_args.h index 9695c987..b7496ed4 100644 --- a/sokol_args.h +++ b/sokol_args.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_ARGS_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -248,12 +249,14 @@ #include <stdint.h> #include <stdbool.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_ARGS_IMPL) +#define SOKOL_ARGS_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_ARGS_API_DECL) - #define SOKOL_ARGS_API_DECL SOKOL_API_DECL +#define SOKOL_ARGS_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_ARGS_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_ARGS_IMPL) #define SOKOL_ARGS_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_ARGS_API_DECL __declspec(dllimport) @@ -308,7 +311,7 @@ inline void sargs_setup(const sargs_desc& desc) { return sargs_setup(&desc); } #endif // SOKOL_ARGS_INCLUDED /*--- IMPLEMENTATION ---------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_ARGS_IMPL #define SOKOL_ARGS_IMPL_INCLUDED (1) #include <string.h> /* memset, strcmp */ @@ -764,4 +767,4 @@ SOKOL_API_IMPL bool sargs_boolean(const char* key) { (0 == strcmp("on", val)); } -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_ARGS_IMPL */ diff --git a/sokol_audio.h b/sokol_audio.h index d0c118c2..6dad34d9 100644 --- a/sokol_audio.h +++ b/sokol_audio.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_AUDIO_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -375,12 +376,14 @@ #include <stdint.h> #include <stdbool.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_AUDIO_IMPL) +#define SOKOL_AUDIO_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_AUDIO_API_DECL) - #define SOKOL_AUDIO_API_DECL SOKOL_API_DECL +#define SOKOL_AUDIO_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_AUDIO_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_AUDIO_IMPL) #define SOKOL_AUDIO_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_AUDIO_API_DECL __declspec(dllimport) @@ -435,7 +438,7 @@ inline void saudio_setup(const saudio_desc& desc) { return saudio_setup(&desc); #endif // SOKOL_AUDIO_INCLUDED /*=== IMPLEMENTATION =========================================================*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_AUDIO_IMPL #define SOKOL_AUDIO_IMPL_INCLUDED (1) #include <string.h> /* memset, memcpy */ @@ -1914,4 +1917,4 @@ SOKOL_API_IMPL int saudio_push(const float* frames, int num_frames) { #pragma warning(pop) #endif -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_AUDIO_IMPL */ diff --git a/sokol_fetch.h b/sokol_fetch.h index 6b56f258..6b11fd79 100644 --- a/sokol_fetch.h +++ b/sokol_fetch.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_FETCH_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -830,12 +831,14 @@ #include <stdint.h> #include <stdbool.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_FETCH_IMPL) +#define SOKOL_FETCH_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_FETCH_API_DECL) - #define SOKOL_FETCH_API_DECL SOKOL_API_DECL +#define SOKOL_FETCH_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_FETCH_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_FETCH_IMPL) #define SOKOL_FETCH_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_FETCH_API_DECL __declspec(dllimport) @@ -950,7 +953,7 @@ inline sfetch_handle_t sfetch_send(const sfetch_request_t& request) { return sfe #endif // SOKOL_FETCH_INCLUDED /*--- IMPLEMENTATION ---------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_FETCH_IMPL #define SOKOL_FETCH_IMPL_INCLUDED (1) #include <string.h> /* memset, memcpy */ @@ -2510,5 +2513,5 @@ SOKOL_API_IMPL void sfetch_cancel(sfetch_handle_t h) { } } -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_FETCH_IMPL */ diff --git a/sokol_gfx.h b/sokol_gfx.h index 1ffcef2f..cf2eacea 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_GFX_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -574,12 +575,14 @@ #include <stdint.h> #include <stdbool.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_GFX_IMPL) +#define SOKOL_GFX_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_GFX_API_DECL) - #define SOKOL_GFX_API_DECL SOKOL_API_DECL +#define SOKOL_GFX_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_GFX_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GFX_IMPL) #define SOKOL_GFX_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_GFX_API_DECL __declspec(dllimport) @@ -2344,7 +2347,7 @@ inline void sg_init_pass(sg_pass pass_id, const sg_pass_desc& desc) { return sg_ #endif // SOKOL_GFX_INCLUDED /*--- IMPLEMENTATION ---------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_GFX_IMPL #define SOKOL_GFX_IMPL_INCLUDED (1) #if !(defined(SOKOL_GLCORE33)||defined(SOKOL_GLES2)||defined(SOKOL_GLES3)||defined(SOKOL_D3D11)||defined(SOKOL_METAL)||defined(SOKOL_WGPU)||defined(SOKOL_DUMMY_BACKEND)) @@ -14917,4 +14920,4 @@ SOKOL_API_IMPL const void* sg_mtl_render_command_encoder(void) { #pragma warning(pop) #endif -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_GFX_IMPL */ diff --git a/sokol_glue.h b/sokol_glue.h index 7219b5c1..ef379c58 100644 --- a/sokol_glue.h +++ b/sokol_glue.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_GLUE_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -72,12 +73,14 @@ */ #define SOKOL_GLUE_INCLUDED +#if defined(SOKOL_IMPL) && !defined(SOKOL_GLUE_IMPL) +#define SOKOL_GLUE_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_GLUE_API_DECL) - #define SOKOL_GLUE_API_DECL SOKOL_API_DECL +#define SOKOL_GLUE_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_GLUE_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GLUE_IMPL) #define SOKOL_GLUE_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_GLUE_API_DECL __declspec(dllimport) @@ -100,7 +103,7 @@ SOKOL_GLUE_API_DECL sg_context_desc sapp_sgcontext(void); #endif /* SOKOL_GLUE_INCLUDED */ /*-- IMPLEMENTATION ----------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_GLUE_IMPL #define SOKOL_GLUE_IMPL_INCLUDED (1) #include <string.h> /* memset */ @@ -131,4 +134,4 @@ SOKOL_API_IMPL sg_context_desc sapp_sgcontext(void) { } #endif -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_GLUE_IMPL */ diff --git a/sokol_time.h b/sokol_time.h index 6f7db2e6..c1ebf1d5 100644 --- a/sokol_time.h +++ b/sokol_time.h @@ -5,7 +5,8 @@ Project URL: https://github.com/floooh/sokol Do this: - #define SOKOL_IMPL + #define SOKOL_IMPL or + #define SOKOL_TIME_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -102,12 +103,14 @@ #define SOKOL_TIME_INCLUDED (1) #include <stdint.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_TIME_IMPL) +#define SOKOL_TIME_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_TIME_API_DECL) - #define SOKOL_TIME_API_DECL SOKOL_API_DECL +#define SOKOL_TIME_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_TIME_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_TIME_IMPL) #define SOKOL_TIME_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_TIME_API_DECL __declspec(dllimport) @@ -137,7 +140,7 @@ SOKOL_TIME_API_DECL double stm_ns(uint64_t ticks); #endif // SOKOL_TIME_INCLUDED /*-- IMPLEMENTATION ----------------------------------------------------------*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_TIME_IMPL #define SOKOL_TIME_IMPL_INCLUDED (1) #include <string.h> /* memset */ @@ -316,5 +319,5 @@ SOKOL_API_IMPL double stm_us(uint64_t ticks) { SOKOL_API_IMPL double stm_ns(uint64_t ticks) { return (double)ticks; } -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_TIME_IMPL */ diff --git a/util/sokol_debugtext.h b/util/sokol_debugtext.h index 72458984..c88e3065 100644 --- a/util/sokol_debugtext.h +++ b/util/sokol_debugtext.h @@ -5,6 +5,7 @@ Project URL: https://github.com/floooh/sokol Do this: + #define SOKOL_IMPL or #define SOKOL_DEBUGTEXT_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -393,12 +394,14 @@ #error "Please include sokol_gfx.h before sokol_debugtext.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_DEBUGTEXT_IMPL) +#define SOKOL_DEBUGTEXT_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_DEBUGTEXT_API_DECL) - #define SOKOL_DEBUGTEXT_API_DECL SOKOL_API_DECL +#define SOKOL_DEBUGTEXT_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_DEBUGTEXT_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_DEBUGTEXT_IMPL) #define SOKOL_DEBUGTEXT_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_DEBUGTEXT_API_DECL __declspec(dllimport) diff --git a/util/sokol_fontstash.h b/util/sokol_fontstash.h index b018e426..a741c723 100644 --- a/util/sokol_fontstash.h +++ b/util/sokol_fontstash.h @@ -6,7 +6,7 @@ Project URL: https://github.com/floooh/sokol Do this: - + #define SOKOL_IMPL or #define SOKOL_FONTSTASH_IMPL before you include this file in *one* C or C++ file to create the @@ -160,12 +160,14 @@ #error "Please include sokol_gfx.h before sokol_fontstash.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_FONTSTASH_IMPL) +#define SOKOL_FONTSTASH_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_FONTSTASH_API_DECL) - #define SOKOL_FONTSTASH_API_DECL SOKOL_API_DECL +#define SOKOL_FONTSTASH_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_FONTSTASH_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_FONTSTASH_IMPL) #define SOKOL_FONTSTASH_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_FONTSTASH_API_DECL __declspec(dllimport) diff --git a/util/sokol_gfx_imgui.h b/util/sokol_gfx_imgui.h index b76db2fc..1897a75e 100644 --- a/util/sokol_gfx_imgui.h +++ b/util/sokol_gfx_imgui.h @@ -5,7 +5,7 @@ Project URL: https://github.com/floooh/sokol Do this: - + #define SOKOL_IMPL or #define SOKOL_GFX_IMGUI_IMPL before you include this file in *one* C or C++ file to create the @@ -166,12 +166,14 @@ #error "Please include sokol_gfx.h before sokol_gfx_imgui.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_GFX_IMGUI_IMPL) +#define SOKOL_GFX_IMGUI_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_GFX_IMGUI_API_DECL) - #define SOKOL_GFX_IMGUI_API_DECL SOKOL_API_DECL +#define SOKOL_GFX_IMGUI_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_GFX_IMGUI_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GFX_IMGUI_IMPL) #define SOKOL_GFX_IMGUI_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_GFX_IMGUI_API_DECL __declspec(dllimport) diff --git a/util/sokol_gl.h b/util/sokol_gl.h index fa80a9f3..dea8083d 100644 --- a/util/sokol_gl.h +++ b/util/sokol_gl.h @@ -5,6 +5,7 @@ Project URL: https://github.com/floooh/sokol Do this: + #define SOKOL_IMPL or #define SOKOL_GL_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -446,12 +447,14 @@ #error "Please include sokol_gfx.h before sokol_gl.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_GL_IMPL) +#define SOKOL_GL_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_GL_API_DECL) - #define SOKOL_GL_API_DECL SOKOL_API_DECL +#define SOKOL_GL_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_GL_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_GL_IMPL) #define SOKOL_GL_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_GL_API_DECL __declspec(dllimport) diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h index b72e4aa5..a43f4233 100644 --- a/util/sokol_imgui.h +++ b/util/sokol_imgui.h @@ -5,7 +5,7 @@ Project URL: https://github.com/floooh/sokol Do this: - + #define SOKOL_IMPL or #define SOKOL_IMGUI_IMPL before you include this file in *one* C or C++ file to create the @@ -205,12 +205,14 @@ #error "Please include sokol_app.h before sokol_imgui.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_IMGUI_IMPL) +#define SOKOL_IMGUI_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_IMGUI_API_DECL) - #define SOKOL_IMGUI_API_DECL SOKOL_API_DECL +#define SOKOL_IMGUI_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_IMGUI_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMGUI_IMPL) #define SOKOL_IMGUI_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_IMGUI_API_DECL __declspec(dllimport) diff --git a/util/sokol_memtrack.h b/util/sokol_memtrack.h index 127cd384..34319913 100644 --- a/util/sokol_memtrack.h +++ b/util/sokol_memtrack.h @@ -74,12 +74,14 @@ #include <stddef.h> #include <stdint.h> +#if defined(SOKOL_IMPL) && !defined(SOKOL_MEMTRACK_IMPL) +#define SOKOL_MEMTRACK_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_MEMTRACK_API_DECL) - #define SOKOL_MEMTRACK_API_DECL SOKOL_API_DECL +#define SOKOL_MEMTRACK_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_MEMTRACK_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_MEMTRACK_IMPL) #define SOKOL_MEMTRACK_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_MEMTRACK_API_DECL __declspec(dllimport) @@ -105,7 +107,7 @@ SOKOL_MEMTRACK_API_DECL smemtrack_info_t smemtrack_info(void); #endif /* SOKOL_MEMTRACK_INCLUDED */ /*=== IMPLEMENTATION =========================================================*/ -#ifdef SOKOL_IMPL +#ifdef SOKOL_MEMTRACK_IMPL #define SOKOL_MEMTRACK_IMPL_INCLUDED (1) #include <stdlib.h> /* malloc, free, calloc */ #include <string.h> /* memset */ @@ -166,4 +168,4 @@ SOKOL_API_IMPL smemtrack_info_t smemtrack_info(void) { return _smemtrack.state; } -#endif /* SOKOL_IMPL */ +#endif /* SOKOL_MEMTRACK_IMPL */ diff --git a/util/sokol_shape.h b/util/sokol_shape.h index beb39122..7ced17e9 100644 --- a/util/sokol_shape.h +++ b/util/sokol_shape.h @@ -5,6 +5,7 @@ Project URL: https://github.com/floooh/sokol Do this: + #define SOKOL_IMPL or #define SOKOL_SHAPE_IMPL before you include this file in *one* C or C++ file to create the implementation. @@ -365,12 +366,14 @@ #error "Please include sokol_gfx.h before sokol_shape.h" #endif +#if defined(SOKOL_IMPL) && !defined(SOKOL_SHAPE_IMPL) +#define SOKOL_SHAPE_IMPL +#endif #if defined(SOKOL_API_DECL) && !defined(SOKOL_SHAPE_API_DECL) - #define SOKOL_SHAPE_API_DECL SOKOL_API_DECL +#define SOKOL_SHAPE_API_DECL SOKOL_API_DECL #endif - #ifndef SOKOL_SHAPE_API_DECL -#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_SHAPE_IMPL) #define SOKOL_SHAPE_API_DECL __declspec(dllexport) #elif defined(_WIN32) && defined(SOKOL_DLL) #define SOKOL_SHAPE_API_DECL __declspec(dllimport) |