From 3f0d5e87fe41b90d9350528d2dca2ca82a637a3f Mon Sep 17 00:00:00 2001 From: TheM14 Date: Sun, 8 Nov 2026 14:20:36 +0800 Subject: [PATCH] Choose the calling convention by platform in the public headers JOC_CALL and EJOC_CALL were __cdecl in the JOC_STATIC / EJOC_STATIC branch on every platform. The static archive defines that branch on Linux as well, where GCC does not know __cdecl, so every declaration in eac3joc_core.h failed to compile and the Ubuntu build stopped. clang accepted the spelling off Windows, which is why only the Linux job failed. The calling convention now follows _WIN32, and the API decoration keeps its own static / import-export / visibility branch. Windows output and ctest are unchanged. --- include/eac3joc_core.h | 9 ++++++--- include/joc_core.h | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/eac3joc_core.h b/include/eac3joc_core.h index 4f655bf..1c7f8a3 100644 --- a/include/eac3joc_core.h +++ b/include/eac3joc_core.h @@ -3,19 +3,22 @@ #include /* EJOC_STATIC: this branch exists for building the sources directly into an application, where nothing is imported or exported. */ +#if defined(_WIN32) + #define EJOC_CALL __cdecl +#else + #define EJOC_CALL +#endif + #if defined(EJOC_STATIC) #define EJOC_API - #define EJOC_CALL __cdecl #elif defined(_WIN32) #if defined(EJOC_BUILD_DLL) #define EJOC_API __declspec(dllexport) #else #define EJOC_API __declspec(dllimport) #endif - #define EJOC_CALL __cdecl #else #define EJOC_API __attribute__((visibility("default"))) - #define EJOC_CALL #endif #ifdef __cplusplus diff --git a/include/joc_core.h b/include/joc_core.h index 80975c0..6afcc92 100644 --- a/include/joc_core.h +++ b/include/joc_core.h @@ -44,19 +44,22 @@ #define JOC_EVENT_VERSION 1u /* JOC_STATIC: this branch exists for building the sources directly into an application, where nothing is imported or exported. */ +#if defined(_WIN32) + #define JOC_CALL __cdecl +#else + #define JOC_CALL +#endif + #if defined(JOC_STATIC) #define JOC_API - #define JOC_CALL __cdecl #elif defined(_WIN32) #if defined(JOC_BUILD_DLL) #define JOC_API __declspec(dllexport) #else #define JOC_API __declspec(dllimport) #endif - #define JOC_CALL __cdecl #else #define JOC_API __attribute__((visibility("default"))) - #define JOC_CALL #endif #ifdef __cplusplus