Skip to content

Commit 0276147

Browse files
authored
Merge pull request #209 from embeddedartistry/master
Refactor: OLM_DLLEXPORT definition now lives in a standalone header.
2 parents f2a8b36 + 0418324 commit 0276147

File tree

4 files changed

+18
-25
lines changed

4 files changed

+18
-25
lines changed

include/openlibm_defs.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef OPENLIBM_DEFS_H_
2+
#define OPENLIBM_DEFS_H_
3+
4+
#ifdef _WIN32
5+
# ifdef IMPORT_EXPORTS
6+
# define OLM_DLLEXPORT __declspec(dllimport)
7+
# else
8+
# define OLM_DLLEXPORT __declspec(dllexport)
9+
# endif
10+
#else
11+
#define OLM_DLLEXPORT __attribute__ ((visibility("default")))
12+
#endif
13+
14+
#endif // OPENLIBM_DEFS_H_

include/openlibm_fenv_amd64.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
#ifndef _FENV_H_
3030
#define _FENV_H_
3131

32+
#include <openlibm_defs.h>
3233
#include "cdefs-compat.h"
3334
#include "types-compat.h"
3435

35-
#include "math_private.h"
36-
3736
#ifndef __fenv_static
3837
#define __fenv_static static
3938
#endif

include/openlibm_math.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <math.h>
1919
#else /* !OPENLIBM_USE_HOST_MATH_H */
2020

21+
#include <openlibm_defs.h>
22+
2123
#ifndef OPENLIBM_MATH_H
2224
#define OPENLIBM_MATH_H
2325

@@ -33,16 +35,6 @@
3335
#define __pure2
3436
#endif
3537

36-
#ifdef _WIN32
37-
# ifdef IMPORT_EXPORTS
38-
# define OLM_DLLEXPORT __declspec(dllimport)
39-
# else
40-
# define OLM_DLLEXPORT __declspec(dllexport)
41-
# endif
42-
#else
43-
#define OLM_DLLEXPORT __attribute__ ((visibility("default")))
44-
#endif
45-
4638
/*
4739
* ANSI/POSIX
4840
*/

src/math_private.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define _MATH_PRIVATE_H_
1919

2020
#include <openlibm_complex.h>
21-
21+
#include <openlibm_defs.h>
2222
#include "cdefs-compat.h"
2323
#include "types-compat.h"
2424
#include "fpmath.h"
@@ -355,16 +355,4 @@ long double __kernel_sinl(long double, long double, int);
355355
long double __kernel_cosl(long double, long double);
356356
long double __kernel_tanl(long double, long double, int);
357357

358-
#undef OLM_DLLEXPORT
359-
#ifdef _WIN32
360-
# ifdef IMPORT_EXPORTS
361-
# define OLM_DLLEXPORT __declspec(dllimport)
362-
# else
363-
# define OLM_DLLEXPORT __declspec(dllexport)
364-
# endif
365-
#else
366-
#define OLM_DLLEXPORT __attribute__ ((visibility("default")))
367-
#endif
368-
369-
370358
#endif /* !_MATH_PRIVATE_H_ */

0 commit comments

Comments
 (0)