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 /sokol_fetch.h | |
| parent | 91529a79792ba669c9451c659e65e643540700bf (diff) | |
make SOKOL_IMPL vs SOKOL_xxx_IMPL consistent across all headers (both are supported)
Diffstat (limited to 'sokol_fetch.h')
| -rw-r--r-- | sokol_fetch.h | 15 |
1 files changed, 9 insertions, 6 deletions
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 */ |