Try to fix FreeBSD build by avoiding name conflict

pull/7/head
Anton Smirnov 4 years ago
parent 9ae0efc831
commit 47a388c827

@ -92,7 +92,7 @@ static VALUE jdl_native_send(int argc, VALUE* argv, VALUE self)
}
/* allocate memory after all checks to avoid possible memory leak */
struct iovec* msgs = xcalloc(argc, sizeof(struct iovec));
iovec_t* msgs = xcalloc(argc, sizeof(iovec_t));
for (int i = 0; i < argc; i++) {
VALUE v = argv[i];

@ -53,6 +53,9 @@
/* include systemd-journal headers */
#include <systemd/sd-journal.h>
/* use alias for iovec to avoid name conflicts in dummy version*/
typedef struct iovec iovec_t;
#else
#define JOURNALD_NATIVE_SD_JOURNAL_DUMMY true

@ -21,22 +21,26 @@
#include <stdlib.h>
/* syslog constants */
#define LOG_EMERG 0
#define LOG_ALERT 1
#define LOG_CRIT 2
#define LOG_ERR 3
#define LOG_WARNING 4
#define LOG_NOTICE 5
#define LOG_INFO 6
#define LOG_DEBUG 7
#ifndef LOG_EMERG
/* syslog constants */
#define LOG_EMERG 0
#define LOG_ALERT 1
#define LOG_CRIT 2
#define LOG_ERR 3
#define LOG_WARNING 4
#define LOG_NOTICE 5
#define LOG_INFO 6
#define LOG_DEBUG 7
#endif
typedef struct jdn_dummy_iovec iovec_t;
/* iovec */
struct iovec {
struct jdn_dummy_iovec {
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes to transfer */
};
inline int sd_journal_print(int priority, const char *format, ...) { return 0; }
inline int sd_journal_sendv(const struct iovec *iov, int n) { return 0; }
inline int sd_journal_sendv(const iovec_t *iov, int n) { return 0; }
inline int sd_journal_perror(const char *message) { return 0; }

Loading…
Cancel
Save