summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-08-15 13:02:53 +0200
committerraysan5 <[email protected]>2021-08-15 13:02:53 +0200
commitaae60e1e440ebd38573195ae81226f01d30f272b (patch)
tree4afee2db02e8fa37623b91af3194b9f51a1ce59d /src/raylib.h
parent848cdb267a7cc52ee0084185eacffdca2e9b3a31 (diff)
downloadraylib-aae60e1e440ebd38573195ae81226f01d30f272b.tar.gz
raylib-aae60e1e440ebd38573195ae81226f01d30f272b.zip
REVIEWED: `extern "C"` definition position for consistency
Note that `extern "C"` calling convention only affects objects that need to be seen by the linker, in our case only functions... but it would also be required by global variables exposed, if any.
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 7f872813..4c05aeed 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -83,17 +83,16 @@
#define RAYLIB_VERSION "3.8-dev"
+#ifndef RLAPI
+ #define RLAPI // We are building or using rlgl as a static library (or Linux shared library)
+#endif
+
#if defined(_WIN32)
- // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll
#if defined(BUILD_LIBTYPE_SHARED)
#define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll)
#elif defined(USE_LIBTYPE_SHARED)
#define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll)
- #else
- #define RLAPI // We are building or using raylib as a static library
#endif
-#else
- #define RLAPI // We are building or using raylib as a static library (or Linux shared library)
#endif
//----------------------------------------------------------------------------------
@@ -894,11 +893,6 @@ typedef bool (*SaveFileDataCallback)(const char *fileName, void *data, unsigned
typedef char *(*LoadFileTextCallback)(const char *fileName); // FileIO: Load text data
typedef bool (*SaveFileTextCallback)(const char *fileName, char *text); // FileIO: Save text data
-
-#if defined(__cplusplus)
-extern "C" { // Prevents name mangling of functions
-#endif
-
//------------------------------------------------------------------------------------
// Global Variables Definition
//------------------------------------------------------------------------------------
@@ -908,6 +902,10 @@ extern "C" { // Prevents name mangling of functions
// Window and Graphics Device Functions (Module: core)
//------------------------------------------------------------------------------------
+#if defined(__cplusplus)
+extern "C" { // Prevents name mangling of functions
+#endif
+
// Window-related functions
RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed