on master help sign in
Fixed problem of "strdup" not found in mingw-w64

Modified api.c to work with mingw-w64 on windows.

commitb9eaa40ec2fe1aeee057e1d500988a7fe02cc244 authorStuart Mills <smills@systems-dev.com> dateTue 17 Jun 2014, 14:55 (12 years ago) parent406f086
1 file changed+9−1
libyaml/api.c+9−1
libyaml/api.c+9−1
@@ -5,6 +5,14 @@
55 * Get the library version.
66 */
77
8+#if __x86_64__
9+#define STRDUP _strdup
10+#pragma message ("64 bits")
11+#else
12+#define STRDUP strdup
13+#pragma message "32 bits"
14+#endif
15+
816YAML_DECLARE(const char *)
917yaml_get_version_string(void)
1018{
@@ -63,7 +71,7 @@ yaml_strdup(const yaml_char_t *str)
6371 if (!str)
6472 return NULL;
6573
66− return (yaml_char_t *)strdup((char *)str);
74+ return (yaml_char_t *) STRDUP((char *)str);
6775}
6876
6977/*