aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2018-07-23 15:35:35 +0200
committerAndre Weissflog <floooh@gmail.com>2018-07-23 15:35:35 +0200
commitf1efc6de17dd0147717f159bfe7f7d30397728b4 (patch)
tree5e333b69defc7dfa4f029c8bedb22620475e3d45
parent1f028a7ad76e3c1957ce5cadfa4e599e5128b085 (diff)
extern C only around the declaration, not the implementation
-rw-r--r--sokol_app.h8
-rw-r--r--sokol_audio.h8
-rw-r--r--sokol_gfx.h40
-rw-r--r--sokol_time.h7
4 files changed, 4 insertions, 59 deletions
diff --git a/sokol_app.h b/sokol_app.h
index 6929b8eb..525777b8 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -656,10 +656,6 @@ extern const void* sapp_d3d11_get_depth_stencil_view(void);
#define _SOKOL_UNUSED(x) (void)(x)
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* helper macros */
#define _sapp_def(val, def) (((val) == 0) ? (def) : (val))
#define _sapp_absf(a) (((a)<0.0f)?-(a):(a))
@@ -5521,10 +5517,6 @@ const void* sapp_d3d11_get_depth_stencil_view(void) {
#undef _sapp_def
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
#ifdef _MSC_VER
#pragma warning(pop)
#endif
diff --git a/sokol_audio.h b/sokol_audio.h
index 0d59257f..0cd30508 100644
--- a/sokol_audio.h
+++ b/sokol_audio.h
@@ -194,10 +194,6 @@ extern int saudio_push(const float* frames, int num_frames);
#endif
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define _saudio_def(val, def) (((val) == 0) ? (def) : (val))
#define _saudio_def_flt(val, def) (((val) == 0.0f) ? (def) : (val))
@@ -679,10 +675,6 @@ int saudio_push(const float* frames, int num_frames) {
#undef _saudio_def
#undef _saudio_def_flt
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
#ifdef _MSC_VER
#pragma warning(pop)
#endif
diff --git a/sokol_gfx.h b/sokol_gfx.h
index 28bd9d9b..5125f855 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -1624,10 +1624,6 @@ extern void sg_discard_context(sg_context ctx_id);
#define SG_DEFAULT_CLEAR_STENCIL (0)
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
enum {
_SG_SLOT_SHIFT = 16,
_SG_SLOT_MASK = (1<<_SG_SLOT_SHIFT)-1,
@@ -1864,19 +1860,11 @@ _SOKOL_PRIVATE int _sg_slot_index(uint32_t id) {
return id & _SG_SLOT_MASK;
}
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
/*== GL BACKEND ==============================================================*/
#if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3)
/* strstr(), memset() */
#include <string.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#ifndef GL_UNSIGNED_INT_2_10_10_10_REV
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
#endif
@@ -4080,10 +4068,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
}
}
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
/*== D3D11 BACKEND ===========================================================*/
#elif defined(SOKOL_D3D11)
@@ -4116,10 +4100,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
#endif
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*-- enum translation functions ----------------------------------------------*/
_SOKOL_PRIVATE D3D11_USAGE _sg_d3d11_usage(sg_usage usg) {
switch (usg) {
@@ -5636,10 +5616,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
}
}
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
/*== METAL BACKEND ===========================================================*/
#elif defined(SOKOL_METAL)
@@ -5652,10 +5628,6 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
#include <TargetConditionals.h>
#import <Metal/Metal.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
enum {
_SG_MTL_DEFAULT_UB_SIZE = 4 * 1024 * 1024,
#if !TARGET_OS_IPHONE
@@ -7383,17 +7355,9 @@ _SOKOL_PRIVATE void _sg_update_image(_sg_image* img, const sg_image_content* dat
_sg_mtl_copy_image_content(img, mtl_tex, data);
}
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
#else
#error "No rendering backend selected"
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*== RESOURCE POOLS ==========================================================*/
typedef struct {
int size;
@@ -9025,10 +8989,6 @@ void sg_update_image(sg_image img_id, const sg_image_content* data) {
img->upd_frame_index = _sg.frame_index;
}
}
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
#ifdef _MSC_VER
#pragma warning(pop)
#endif
diff --git a/sokol_time.h b/sokol_time.h
index ee207a27..ef1b0692 100644
--- a/sokol_time.h
+++ b/sokol_time.h
@@ -93,6 +93,10 @@ extern double stm_ms(uint64_t ticks);
extern double stm_us(uint64_t ticks);
extern double stm_ns(uint64_t ticks);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
/*-- IMPLEMENTATION ----------------------------------------------------------*/
#ifdef SOKOL_IMPL
#ifndef SOKOL_ASSERT
@@ -205,6 +209,3 @@ double stm_ns(uint64_t ticks) {
}
#endif /* SOKOL_IMPL */
-#ifdef __cplusplus
-} /* extern "C" */
-#endif