diff --git a/include/openlibm_defs.h b/include/openlibm_defs.h new file mode 100644 index 0000000..8a6fa6b --- /dev/null +++ b/include/openlibm_defs.h @@ -0,0 +1,14 @@ +#ifndef OPENLIBM_DEFS_H_ +#define OPENLIBM_DEFS_H_ + +#ifdef _WIN32 +# ifdef IMPORT_EXPORTS +# define OLM_DLLEXPORT __declspec(dllimport) +# else +# define OLM_DLLEXPORT __declspec(dllexport) +# endif +#else +#define OLM_DLLEXPORT __attribute__ ((visibility("default"))) +#endif + +#endif // OPENLIBM_DEFS_H_ diff --git a/include/openlibm_fenv_amd64.h b/include/openlibm_fenv_amd64.h index 9e302bd..c6db210 100644 --- a/include/openlibm_fenv_amd64.h +++ b/include/openlibm_fenv_amd64.h @@ -29,11 +29,10 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include "cdefs-compat.h" #include "types-compat.h" -#include "math_private.h" - #ifndef __fenv_static #define __fenv_static static #endif diff --git a/include/openlibm_math.h b/include/openlibm_math.h index ec3b030..272721d 100644 --- a/include/openlibm_math.h +++ b/include/openlibm_math.h @@ -18,6 +18,8 @@ #include #else /* !OPENLIBM_USE_HOST_MATH_H */ +#include + #ifndef OPENLIBM_MATH_H #define OPENLIBM_MATH_H @@ -33,16 +35,6 @@ #define __pure2 #endif -#ifdef _WIN32 -# ifdef IMPORT_EXPORTS -# define OLM_DLLEXPORT __declspec(dllimport) -# else -# define OLM_DLLEXPORT __declspec(dllexport) -# endif -#else -#define OLM_DLLEXPORT __attribute__ ((visibility("default"))) -#endif - /* * ANSI/POSIX */ diff --git a/src/math_private.h b/src/math_private.h index 5c98046..17027d6 100644 --- a/src/math_private.h +++ b/src/math_private.h @@ -18,7 +18,7 @@ #define _MATH_PRIVATE_H_ #include - +#include #include "cdefs-compat.h" #include "types-compat.h" #include "fpmath.h" @@ -355,16 +355,4 @@ long double __kernel_sinl(long double, long double, int); long double __kernel_cosl(long double, long double); long double __kernel_tanl(long double, long double, int); -#undef OLM_DLLEXPORT -#ifdef _WIN32 -# ifdef IMPORT_EXPORTS -# define OLM_DLLEXPORT __declspec(dllimport) -# else -# define OLM_DLLEXPORT __declspec(dllexport) -# endif -#else -#define OLM_DLLEXPORT __attribute__ ((visibility("default"))) -#endif - - #endif /* !_MATH_PRIVATE_H_ */