Skip to content

Commit

Permalink
Fix PLIST_API definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Jan 29, 2024
1 parent b3cf5be commit 3daee60
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 17 deletions.
12 changes: 11 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ else
fi
AM_CONDITIONAL([HAVE_CYTHON],[test "x$cython_python_bindings" = "xyes"])

AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Wno-strict-aliasing -fvisibility=hidden $PTHREAD_CFLAGS")
AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Wno-strict-aliasing $PTHREAD_CFLAGS")
GLOBAL_LDFLAGS="$PTHREAD_LIBS"

AC_ARG_ENABLE(debug,
Expand All @@ -192,7 +192,17 @@ if (test "x$debug" = "xyes"); then
GLOBAL_CFLAGS+=" -g"
fi

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

GLOBAL_CXXFLAGS=$GLOBAL_CFLAGS
AS_COMPILER_FLAG([-fvisibility=hidden], [
GLOBAL_CFLAGS+=" -fvisibility=hidden"
], [])

AC_SUBST(GLOBAL_CFLAGS)
AC_SUBST(GLOBAL_CXXFLAGS)
AC_SUBST(GLOBAL_LDFLAGS)

case "$GLOBAL_CFLAGS" in
Expand Down
14 changes: 4 additions & 10 deletions include/plist/plist.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,11 @@ extern "C"
#endif
/*}}}*/

#ifdef LIBPLIST_STATIC
#define PLIST_API
#elif defined(_WIN32)
#ifdef DLL_EXPORT
#define PLIST_API __declspec(dllexport)
#else
#ifndef PLIST_API
#ifdef LIBPLIST_STATIC
#define PLIST_API
#elif defined(_WIN32)
#define PLIST_API __declspec(dllimport)
#endif
#else
#if __GNUC__ >= 4
#define PLIST_API __attribute__((visibility("default")))
#else
#define PLIST_API
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <plist/Array.h>

#include <cstdlib>
#include <algorithm>
#include <climits>
#include <cstdlib>
#include "plist.h"
#include <plist/Array.h>

namespace PList
{
Expand Down
1 change: 1 addition & 0 deletions src/Boolean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Boolean.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Dictionary.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Integer.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Key.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libcnary/include

AM_CFLAGS = $(GLOBAL_CFLAGS)
AM_CXXFLAGS = $(GLOBAL_CXXFLAGS)
AM_LDFLAGS = $(GLOBAL_LDFLAGS)

lib_LTLIBRARIES = \
Expand Down
1 change: 1 addition & 0 deletions src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Node.h>
#include <plist/Structure.h>
#include <plist/Dictionary.h>
Expand Down
1 change: 1 addition & 0 deletions src/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/String.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Structure.h>

namespace PList
Expand Down
1 change: 1 addition & 0 deletions src/Uid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include <cstdlib>
#include "plist.h"
#include <plist/Uid.h>

namespace PList
Expand Down
2 changes: 1 addition & 1 deletion src/bplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
#include <ctype.h>
#include <inttypes.h>

#include <plist/plist.h>
#include "plist.h"
#include "hashtable.h"
#include "bytearray.h"
#include "ptrarray.h"
#include "plist/plist.h"

#include <node.h>

Expand Down
16 changes: 14 additions & 2 deletions src/plist.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <config.h>
#endif

#include "plist/plist.h"

#include <sys/types.h>
#include <sys/stat.h>

Expand All @@ -39,6 +37,20 @@
#include <sys/time.h>
#endif

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

#include "plist/plist.h"

struct plist_data_s
{
union
Expand Down

0 comments on commit 3daee60

Please sign in to comment.