Skip to content

Conversation

@docEdub
Copy link
Contributor

@docEdub docEdub commented Apr 3, 2024

Without explicit calling convention modifers, consumers are required to compile with the same calling convention used in the released binaries. If a consumer compiles with the __stdcall calling convention, the linker won't resolve the function calls because the released binaries are built with the default __cdecl calling convention.

This change fixes the issue using an overridable BABYLON_API macro defined as __cdecl by default on Windows platforms or defined as empty on non-Windows platforms.

Copy link
Contributor

@SergioRZMasson SergioRZMasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@docEdub docEdub enabled auto-merge (squash) April 10, 2024 14:02
@docEdub docEdub merged commit 66c863b into BabylonJS:main Apr 10, 2024
docEdub added a commit to BabylonJS/BabylonNative that referenced this pull request Apr 10, 2024
Without explicit calling convention modifers, consumers are required to
compile with the same calling convention used in the released binaries.
If a consumer compiles with the `__stdcall` calling convention, the
linker won't resolve the function calls because the released binaries
are built with the default `__cdecl` calling convention.

This change fixes the issue using an overridable `BABYLON_API` macro
defined as `__cdecl` by default on Windows platforms or defined as empty
on non-Windows platforms.

See also BabylonJS/JsRuntimeHost#86.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants