summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Friedt <cfriedt@meta.com>2022-11-24 20:13:21 -0500
committerJens Geyer <Jens-G@users.noreply.github.com>2022-11-25 09:08:21 +0100
commit9c0de2d1eb343910213c62325f73e3bb72361c22 (patch)
treed739a1d22e8cb9c2cd28558a59e0e339e1fdd8e2
parent850c61f6086f3a373de8c588c5b25d0ba37c3618 (diff)
downloadthrift-9c0de2d1eb343910213c62325f73e3bb72361c22.tar.gz
lib: c_glib: fix compile error due to missing unistd.h
Previously, the c_glib library tests failed to compile due to implicit function declarationsn for `sleep()`, `fork()`, and `alarm()`. Include `<unistd.h>` to address all of those issues (on platforms that have `<unistd.h>`). Signed-off-by: Christopher Friedt <cfriedt@meta.com>
-rw-r--r--lib/c_glib/test/testthrifttestclient.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index b8d93095a..77daf3d37 100644
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -19,6 +19,12 @@
/* test a C client with a C++ server (that makes sense...) */
+#include <thrift/config.h>
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>