Skip to content

Commit

Permalink
build: Simplify visibility logic
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jun 27, 2023
1 parent 0c0d192 commit a61ca80
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions include/secp256k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,15 @@ typedef int (*secp256k1_nonce_function)(
# define SECP256K1_API __declspec (dllimport)
# define SECP256K1_API_VAR extern __declspec (dllimport)
# endif
#endif
#ifndef SECP256K1_API
# if defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD)
/* Building libsecp256k1 on non-Windows using GCC or compatible. */
# define SECP256K1_API __attribute__ ((visibility ("default")))
# define SECP256K1_API_VAR extern __attribute__ ((visibility ("default")))
# else
#elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD)
/* Building libsecp256k1 on non-Windows using GCC or compatible. */
# define SECP256K1_API __attribute__ ((visibility ("default")))
# define SECP256K1_API_VAR extern __attribute__ ((visibility ("default")))
#else
/* Linking against libsecp256k1,
or building libsecp256k1 using an unknown compiler. */
# define SECP256K1_API
# define SECP256K1_API_VAR extern
# endif
# define SECP256K1_API
# define SECP256K1_API_VAR extern
#endif

/* Warning attributes
Expand Down

0 comments on commit a61ca80

Please sign in to comment.