modelon-community / fmi-library

C library for importing FMUs
Other
115 stars 34 forks source link

Add missing include in jm_locale_test.c #95

Open joakimono opened 1 year ago

joakimono commented 1 year ago

One some platforms (Macos), compilation of Test/jm_locale_test.c fails, since exit() is undefined. The solution is to #include <stdlib.h>, as is done in e.g. Test/fmi_zip_zip_test.c

modelonrobinandersson commented 1 year ago

Hi @joakimono, what is the error you see on MacOS?

joakimono commented 1 year ago

On MacOS the following error occurs: ../build/src/Test/jm_locale_test.c:30:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit(CTEST_RETURN_FAIL); ../build/src/Test/jm_locale_test.c:30:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 error generated.

Below are the build settings, which were used: MacOSX11.3.sdk os=Macos arch=x86_64 compiler=apple-clang compiler.version=13 compiler.libcxx=libc++ build_type=Release