Skip to content

Commit a97f627

Browse files
committed
fix --disable-sockets
1 parent d958f29 commit a97f627

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ set(CMAKE_REQUIRED_LIBRARIES )
108108
set(CMAKE_REQUIRED_DEFINITIONS )
109109

110110
add_definitions(-DDILL_THREADS)
111+
add_definitions(-DDILL_SOCKETS)
111112

112113
check_function_exists(mprotect HAVE_MPROTECT)
113114
if(HAVE_MPROTECT)

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ AC_ARG_ENABLE([sockets], [AS_HELP_STRING([--disable-sockets],
145145
if test "x$enable_sockets" = "xno"; then
146146
AM_CONDITIONAL([DILL_SOCKETS], false)
147147
else
148+
AC_DEFINE(DILL_SOCKETS)
148149
AM_CONDITIONAL([DILL_SOCKETS], true)
149150
fi
150151

ctx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ static void dill_ctx_init_(struct dill_ctx *ctx) {
3535
dill_assert(rc == 0);
3636
rc = dill_ctx_pollset_init(&ctx->pollset);
3737
dill_assert(rc == 0);
38+
#if defined DILL_SOCKETS
3839
rc = dill_ctx_fd_init(&ctx->fd);
3940
dill_assert(rc == 0);
41+
#endif
4042
}
4143

4244
static void dill_ctx_term_(struct dill_ctx *ctx) {
4345
dill_assert(ctx->initialized == 1);
46+
#if defined DILL_SOCKETS
4447
dill_ctx_fd_term(&ctx->fd);
48+
#endif
4549
dill_ctx_pollset_term(&ctx->pollset);
4650
dill_ctx_stack_term(&ctx->stack);
4751
dill_ctx_handle_term(&ctx->handle);

ctx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ struct dill_ctx {
3737
struct dill_ctx_handle handle;
3838
struct dill_ctx_stack stack;
3939
struct dill_ctx_pollset pollset;
40+
#if defined DILL_SOCKETS
4041
struct dill_ctx_fd fd;
42+
#endif
4143
};
4244

4345
struct dill_ctx *dill_ctx_init(void);

0 commit comments

Comments
 (0)