ソースを参照

Actual minimal patch to compile goyaml with mingw32

John Arbash Meinel 13 年 前
コミット
b01920c75e
3 ファイル変更3 行追加5 行削除
  1. 0 1
      api.c
  2. 1 1
      decode.go
  3. 2 3
      helpers.h

+ 0 - 1
api.c

@@ -1,6 +1,5 @@
 
 #include "yaml_private.h"
-#include "helpers.h"
 
 /*
  * Get the library version.

+ 1 - 1
decode.go

@@ -1,7 +1,7 @@
 package goyaml
 
 // #cgo LDFLAGS: -lm -lpthread
-// #cgo windows CFLAGS: -DYAML_DECLARE_STATIC=1
+// #cgo windows CFLAGS: -DYAML_DECLARE_STATIC=1 -Dstrdup=_strdup
 // #cgo CFLAGS: -I. -DHAVE_CONFIG_H=1
 //
 // #include "helpers.h"

+ 2 - 3
helpers.h

@@ -1,9 +1,8 @@
 #ifndef helpers_h
 #define helpers_h
 
-#ifdef _WIN32
-#define strdup _strdup
-#endif
+#define CGO_LDFLAGS "-lm -lpthread"
+#define CGO_CFLAGS "-I. -DHAVE_CONFIG_H=1"
 
 #include <yaml.h>