Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the b2Rot functions seem to be mssing from the native binary except for b2Rot_IsValid #3

Open
EraYaN opened this issue Sep 1, 2024 · 0 comments

Comments

@EraYaN
Copy link

EraYaN commented Sep 1, 2024

All the b2Rot functions seem to be missing from the native binary except for b2Rot_IsValid for the box2d.dll files.

It's also missing from the released .so files.

EDIT: I see the problem all header only functions are missing.

Change this bit in base.h

// C++ macros
// clang-format off
#ifdef __cplusplus
	#define B2_API extern "C" BOX2D_EXPORT
	#ifndef B2_INLINE
	#define B2_INLINE inline
	#endif
	#define B2_LITERAL(T) T
	#define B2_ZERO_INIT {}
#else
	#define B2_API BOX2D_EXPORT
	#ifndef B2_INLINE
	#define B2_INLINE inline static
	#endif
	/// Used for C literals like (b2Vec2){1.0f, 2.0f} where C++ requires b2Vec2{1.0f, 2.0f}
	#define B2_LITERAL(T) (T)
	#define B2_ZERO_INIT {0}
#endif
// clang-format on

And then add a single file math_functions.c to compile:

#define B2_INLINE 

#include <box2d/math_functions.h>

Or find a way to have zig export the inline and static functions

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

No branches or pull requests

1 participant