Skip to content

Commit

Permalink
Fix IRECV_API definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Jan 29, 2024
1 parent 4fa4941 commit fec1d79
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ AS_IF([test "x$with_dummy" = "xyes"], [
])

AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden")

if test "x$enable_static" = "xyes" -a "x$enable_shared" = "xno"; then
GLOBAL_CFLAGS+=" -DIRECV_STATIC"
fi

AC_SUBST(GLOBAL_CFLAGS)
AC_SUBST(GLOBAL_LDFLAGS)

Expand Down
14 changes: 4 additions & 10 deletions include/libirecovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,11 @@ extern "C" {

#include <stdint.h>

#ifdef IRECV_STATIC
#define IRECV_API
#elif defined(_WIN32)
#ifdef DLL_EXPORT
#define IRECV_API __declspec(dllexport)
#else
#ifndef IRECV_API
#ifdef IRECV_STATIC
#define IRECV_API
#elif defined(_WIN32)
#define IRECV_API __declspec(dllimport)
#endif
#else
#if __GNUC__ >= 4
#define IRECV_API __attribute__((visibility("default")))
#else
#define IRECV_API
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/libirecovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
#endif
#endif

#ifdef IRECV_STATIC
#define IRECV_API
#elif defined(_WIN32)
#define IRECV_API __declspec( dllexport )
#else
#if __GNUC__ >= 4
#define IRECV_API __attribute__((visibility("default")))
#else
#define IRECV_API
#endif
#endif

#include "libirecovery.h"

struct irecv_client_private {
Expand Down

0 comments on commit fec1d79

Please sign in to comment.