Module: kamailio
Branch: 5.1
Commit: 4b5a889cf438138d0846ee9adcd8785ea2b94a95
URL:
https://github.com/kamailio/kamailio/commit/4b5a889cf438138d0846ee9adcd8785…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: 2017-11-25T17:51:33-05:00
xmlrpc: define _XOPEN_SOURCE to 600
- needed for snprintf() and variants
- reported by GH #1312
(cherry picked from commit 6e680c71b6a5d1571a38023427335922946a4160)
---
Modified: src/modules/xmlrpc/xmlrpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4b5a889cf438138d0846ee9adcd8785…
Patch:
https://github.com/kamailio/kamailio/commit/4b5a889cf438138d0846ee9adcd8785…
---
diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c
index 2e7c644279..7b0066d988 100644
--- a/src/modules/xmlrpc/xmlrpc.c
+++ b/src/modules/xmlrpc/xmlrpc.c
@@ -18,16 +18,28 @@
* with this program; if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*This define breaks on Solaris OS */
+
+/**
+ * make strptime available
+ * use 600 for 'Single UNIX Specification, Version 3'
+ * _XOPEN_SOURCE creates conflict in header definitions in Solaris
+ */
#ifndef __OS_solaris
-#define _XOPEN_SOURCE 4 /* strptime */
+ #define _XOPEN_SOURCE 600 /* glibc2 on linux, bsd */
+ #define _BSD_SOURCE 1 /* needed on linux to "fix" the effect
+ * of the above define on
+ * features.h/unistd.h syscall() */
+ #define _DEFAULT_SOURCE 1 /* _BSD_SOURCE is deprecated */
+ #define _DARWIN_C_SOURCE 1
+
+ #define _SVID_SOURCE 1 /* timegm for old glib */
+#else
+ #define _XOPEN_SOURCE_EXTENDED 1 /* solaris */
#endif
-#define _XOPEN_SOURCE_EXTENDED 1 /* solaris */
-#define _SVID_SOURCE 1 /* timegm */
-#define _DEFAULT_SOURCE 1 /* _SVID_SOURCE is deprecated */
-#include <strings.h>
#include <time.h>
+
+#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>