Skip to content

Commit

Permalink
Merge branch 'master' of github.com:adjust/schaufel into pluggable
Browse files Browse the repository at this point in the history
  • Loading branch information
zilder committed May 27, 2019
2 parents c55492a + d74718d commit 9efe209
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([schaufel], [0.5])
AC_INIT([schaufel], [0.6])
AC_CONFIG_SRCDIR([src/modules.c])

AC_LANG(C)
Expand Down Expand Up @@ -28,8 +28,8 @@ AC_SEARCH_LIBS([pthread_create], [pthread], [
])

CFLAGS+=" -Wall -Wextra -pedantic"
CFLAGS+=" -D_POSIX_C_SOURCE=200809L"
CFLAGS+=" -D_BSD_SOURCE"
CFLAGS+=" -D_XOPEN_SOURCE=700"
CFLAGS+=" -D_DEFAULT_SOURCE"

AC_CONFIG_HEADERS([src/include/build.h])
AC_OUTPUT([Makefile Makefile.global])
4 changes: 4 additions & 0 deletions contrib/exports/exports.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef __linux__
#include <sys/prctl.h>
#endif

#include "modules.h"
#include "utils/config.h"
#include "utils/helper.h"
#include "utils/logger.h"
#include "utils/scalloc.h"
#include "utils/endian.h"


#define PQ_COPY_TEXT 0
Expand Down
3 changes: 3 additions & 0 deletions contrib/postgres/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef __linux__
#include <sys/prctl.h>
#endif

#include "modules.h"
#include "utils/array.h"
Expand Down
3 changes: 2 additions & 1 deletion src/include/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _SCHAUFEL_QUEUE_H_

#include <stdlib.h>
#include <stdint.h>

#define MAX_QUEUE_SIZE 100000

Expand All @@ -17,7 +18,7 @@ void message_free(Message *msg);
typedef struct Queue *Queue;

Queue queue_init();
int queue_add(Queue q, void *data, size_t datalen, long msgtype);
int queue_add(Queue q, void *data, size_t datalen, int64_t msgtype);
int queue_get(Queue q, Message msg);
long queue_length(Queue q);
long queue_added(Queue q);
Expand Down
1 change: 1 addition & 0 deletions src/queue.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <errno.h>
#include <pthread.h>
#include <sys/time.h>
#include <stdint.h>

#include "queue.h"

Expand Down
15 changes: 15 additions & 0 deletions src/utils/endian.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef _SCHAUFEL_UTILS_ENDIAN_H
#define _SCHAUFEL_UTILS_ENDIAN_H

#if defined(__linux__)
#include <endian.h>
#elif defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) \
|| defined(__NetBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#endif

#endif

0 comments on commit 9efe209

Please sign in to comment.