Choose the calling convention by platform in the public headers
ci / ubuntu-latest (push) Failing after 15s
ci / macos-latest (push) Canceled after 0s
ci / windows-latest (push) Canceled after 0s
ci / release (push) Canceled after 0s

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.
This commit is contained in:
TheM14 committed 2026-11-08 14:20:36 +08:00
1 parent 0bb82e4115
commit 3f0d5e87fe
2 files changed
+12 -6

No files matched your search

+6 -3
View File
@@ -3,19 +3,22 @@
#include <stdint.h>
/* 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
+6 -3
View File
@@ -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