summaryrefslogtreecommitdiffhomepage
path: root/src/go/unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/unit')
-rw-r--r--src/go/unit/darwin-cflags.go13
-rw-r--r--src/go/unit/linux-lrt.go13
-rw-r--r--src/go/unit/nxt_go_array.c4
-rw-r--r--src/go/unit/nxt_go_lib.c56
-rw-r--r--src/go/unit/nxt_go_port.c9
-rw-r--r--src/go/unit/nxt_go_port_memory.c9
-rw-r--r--src/go/unit/nxt_go_process.c6
-rw-r--r--src/go/unit/nxt_go_run_ctx.c9
8 files changed, 34 insertions, 85 deletions
diff --git a/src/go/unit/darwin-cflags.go b/src/go/unit/darwin-cflags.go
new file mode 100644
index 00000000..a5e37c39
--- /dev/null
+++ b/src/go/unit/darwin-cflags.go
@@ -0,0 +1,13 @@
+// +build darwin
+
+/*
+ * Copyright (C) Max Romanov
+ * Copyright (C) NGINX, Inc.
+ */
+
+package unit
+
+/*
+#cgo CFLAGS: -mmacosx-version-min=10.5
+*/
+import "C"
diff --git a/src/go/unit/linux-lrt.go b/src/go/unit/linux-lrt.go
new file mode 100644
index 00000000..37ea4880
--- /dev/null
+++ b/src/go/unit/linux-lrt.go
@@ -0,0 +1,13 @@
+// +build linux
+
+/*
+ * Copyright (C) Max Romanov
+ * Copyright (C) NGINX, Inc.
+ */
+
+package unit
+
+/*
+#cgo LDFLAGS: -lrt
+*/
+import "C"
diff --git a/src/go/unit/nxt_go_array.c b/src/go/unit/nxt_go_array.c
index f409cb10..fea97faf 100644
--- a/src/go/unit/nxt_go_array.c
+++ b/src/go/unit/nxt_go_array.c
@@ -4,8 +4,6 @@
* Copyright (C) NGINX, Inc.
*/
-#ifndef NXT_CONFIGURE
-
#include <stdint.h>
#include <sys/types.h>
@@ -62,5 +60,3 @@ nxt_go_array_add(nxt_array_t *array)
return p;
}
-
-#endif /* NXT_CONFIGURE */
diff --git a/src/go/unit/nxt_go_lib.c b/src/go/unit/nxt_go_lib.c
index 71940461..691688ab 100644
--- a/src/go/unit/nxt_go_lib.c
+++ b/src/go/unit/nxt_go_lib.c
@@ -4,62 +4,13 @@
* Copyright (C) NGINX, Inc.
*/
-#ifdef NXT_CONFIGURE
-
-#include <stdio.h>
-#include "nxt_go_lib.h"
-
-// Stubs to compile during configure process.
-int
-nxt_go_response_write(nxt_go_request_t r, void *buf, size_t len)
-{
- return -1;
-}
-
-int
-nxt_go_request_read(nxt_go_request_t r, void *dst, size_t dst_len)
-{
- return -1;
-}
-
-int
-nxt_go_request_read_from(nxt_go_request_t r, void *dst, size_t dst_len,
- void *src, size_t src_len)
-{
- return -1;
-}
-
-int
-nxt_go_request_close(nxt_go_request_t r)
-{
- return -1;
-}
-
-int
-nxt_go_request_done(nxt_go_request_t r)
-{
- return -1;
-}
-
-void
-nxt_go_ready()
-{
-}
-
-nxt_go_request_t
-nxt_go_process_port_msg(void *buf, size_t buf_len, void *oob, size_t oob_len)
-{
- return 0;
-}
-
-#else
-
#include "nxt_go_run_ctx.h"
#include "nxt_go_log.h"
#include "nxt_go_port.h"
+#include "_cgo_export.h"
+
#include <nxt_main.h>
-#include <nxt_go_gen.h>
int
nxt_go_response_write(nxt_go_request_t r, void *buf, size_t len)
@@ -190,6 +141,3 @@ nxt_go_process_port_msg(void *buf, size_t buf_len, void *oob, size_t oob_len)
{
return nxt_go_port_on_read(buf, buf_len, oob, oob_len);
}
-
-
-#endif /* NXT_CONFIGURE */
diff --git a/src/go/unit/nxt_go_port.c b/src/go/unit/nxt_go_port.c
index e866a242..8ea9a5ca 100644
--- a/src/go/unit/nxt_go_port.c
+++ b/src/go/unit/nxt_go_port.c
@@ -4,16 +4,14 @@
* Copyright (C) NGINX, Inc.
*/
-#ifndef NXT_CONFIGURE
-
-
#include "nxt_go_port.h"
#include "nxt_go_log.h"
#include "nxt_go_process.h"
#include "nxt_go_run_ctx.h"
+#include "_cgo_export.h"
+
#include <nxt_main.h>
-#include <nxt_go_gen.h>
#define nxt_go_str(p) ((nxt_go_str_t *)(p))
@@ -205,6 +203,3 @@ fail:
return 0;
}
-
-
-#endif /* NXT_CONFIGURE */
diff --git a/src/go/unit/nxt_go_port_memory.c b/src/go/unit/nxt_go_port_memory.c
index 2c183161..e1b732d2 100644
--- a/src/go/unit/nxt_go_port_memory.c
+++ b/src/go/unit/nxt_go_port_memory.c
@@ -4,15 +4,13 @@
* Copyright (C) NGINX, Inc.
*/
-#ifndef NXT_CONFIGURE
-
-
#include "nxt_go_port_memory.h"
#include "nxt_go_process.h"
#include "nxt_go_array.h"
#include "nxt_go_log.h"
-#include <nxt_go_gen.h>
+#include "_cgo_export.h"
+
#include <nxt_main.h>
#if (NXT_HAVE_MEMFD_CREATE)
@@ -197,6 +195,3 @@ unlock_return:
return hdr;
}
-
-
-#endif /* NXT_CONFIGURE */
diff --git a/src/go/unit/nxt_go_process.c b/src/go/unit/nxt_go_process.c
index eb29cee1..bb2d279c 100644
--- a/src/go/unit/nxt_go_process.c
+++ b/src/go/unit/nxt_go_process.c
@@ -4,9 +4,6 @@
* Copyright (C) NGINX, Inc.
*/
-#ifndef NXT_CONFIGURE
-
-
#include "nxt_go_process.h"
#include "nxt_go_array.h"
#include "nxt_go_mutex.h"
@@ -149,6 +146,3 @@ fail:
nxt_go_mutex_unlock(&process->incoming_mutex);
}
-
-
-#endif /* NXT_CONFIGURE */
diff --git a/src/go/unit/nxt_go_run_ctx.c b/src/go/unit/nxt_go_run_ctx.c
index 68df8f49..902872ce 100644
--- a/src/go/unit/nxt_go_run_ctx.c
+++ b/src/go/unit/nxt_go_run_ctx.c
@@ -4,9 +4,6 @@
* Copyright (C) NGINX, Inc.
*/
-#ifndef NXT_CONFIGURE
-
-
#include "nxt_go_run_ctx.h"
#include "nxt_go_log.h"
#include "nxt_go_process.h"
@@ -14,9 +11,10 @@
#include "nxt_go_mutex.h"
#include "nxt_go_port_memory.h"
+#include "_cgo_export.h"
+
#include <nxt_port_memory_int.h>
#include <nxt_main.h>
-#include <nxt_go_gen.h>
static nxt_int_t
@@ -530,6 +528,3 @@ nxt_go_ctx_read_raw(nxt_go_run_ctx_t *ctx, void *dst, size_t size)
return res;
}
-
-
-#endif /* NXT_CONFIGURE */