summaryrefslogtreecommitdiff
path: root/adder.go
diff options
context:
space:
mode:
Diffstat (limited to 'adder.go')
-rw-r--r--adder.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/adder.go b/adder.go
new file mode 100644
index 0000000..351a9f0
--- /dev/null
+++ b/adder.go
@@ -0,0 +1,23 @@
+package main
+
+
+/*
+#cgo CFLAGS: -DWIN32 -ID:/pg18headers -ID:/pg18headers/port/win32
+#cgo LDFLAGS: -LD:/pg18lib
+#include "postgres.h"
+#include "fmgr.h"
+
+
+// Forward declare the C function so cgo compiles add_two.c too.
+extern void init_add_two();
+*/
+import "C"
+
+
+//export Adder
+func Adder(a C.int32) C.int32 {
+ return a + 3
+}
+
+
+func main() {}