Skip to content

Commit 8788204

Browse files
author
Sam Bingner
committed
Update to be compatible with libplist version 2.3.0
1 parent 6219252 commit 8788204

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ PKG_CHECK_MODULES(libplist, libplist >= 2.2.0,
2626
AC_DEFINE([HAVE_LIBPLIST_2_0], [1], [Use libplist-2.0])
2727
])],
2828
)
29+
30+
if test "x$LIBPLIST" != "x"; then
31+
AC_CHECK_DECLS([plist_format_typedef], [], [], [
32+
#include <plist/plist.h>
33+
plist_format_t plist_format_typedef;
34+
])
35+
fi
36+
2937
AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build usbfluxd])])
3038

3139
AC_SEARCH_LIBS([fmin], [m])

usbfluxd/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ int plist_read_from_filename(plist_t *plist, const char *filename)
302302
return 1;
303303
}
304304

305-
int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format)
305+
int plist_write_to_filename(plist_t plist, const char *filename, plist_format_t format)
306306
{
307307
char *buffer = NULL;
308308
uint32_t length;

usbfluxd/utils.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ char *string_concat(const char *str, ...);
8080
int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length);
8181
int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length);
8282

83-
enum plist_format_t {
83+
#if HAVE_DECL_PLIST_FORMAT_TYPEDEF != 1
84+
typedef enum {
8485
PLIST_FORMAT_XML,
8586
PLIST_FORMAT_BINARY
86-
};
87+
} plist_format_t;
88+
#endif
8789

8890
int plist_read_from_filename(plist_t *plist, const char *filename);
89-
int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format);
91+
int plist_write_to_filename(plist_t plist, const char *filename, plist_format_t format);
9092

9193
uint64_t mstime64(void);
9294
void get_tick_count(struct timeval * tv);

0 commit comments

Comments
 (0)