This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] [libmudflap] Fix build failure for Darwin
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Thu, 31 Jul 2003 19:10:26 -0400
- Subject: [tree-ssa] [libmudflap] Fix build failure for Darwin
This fixes Darwin by adding a typedef for socklen_t which really should
be done by configure but I do not have the patience for autoconf and
doing the same thing for _POSIX_SOURCE as is done for FreeBSD.
Thanks,
Andrew Pinski
ChangeLog:
* mf-hooks1.c: Respect Darwin checks. Conditionalize POSIX_SOURCE.
Add socklen_t type for Darwin.
* mf-hooks2.c: Likewise.
* mf-hooks3.c: Likewise.
Patch:
Index: mf-hooks1.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks1.c,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 mf-hooks1.c
--- mf-hooks1.c 29 Jul 2003 18:13:02 -0000 1.1.2.3
+++ mf-hooks1.c 31 Jul 2003 23:08:02 -0000
@@ -8,10 +8,14 @@ XXX: libgcc license?
*/
#include "config.h"
+/* Add definition of socklen_t for Darwin */
+#if defined(__APPLE__)
+typedef int socklen_t;
+#endif
/* These attempt to coax various unix flavours to declare all our
needed tidbits in the system headers. */
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__APPLE__)
#define _POSIX_SOURCE
#endif /* Some BSDs break <sys/socket.h> if this is defined. */
#define _GNU_SOURCE
Index: mf-hooks2.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks2.c,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 mf-hooks2.c
--- mf-hooks2.c 29 Jul 2003 19:32:40 -0000 1.1.2.3
+++ mf-hooks2.c 31 Jul 2003 23:08:02 -0000
@@ -9,9 +9,15 @@ XXX: libgcc license?
#include "config.h"
+
+/* Add definition of socklen_t for Darwin */
+#if defined(__APPLE__)
+typedef int socklen_t;
+#endif
+
/* These attempt to coax various unix flavours to declare all our
needed tidbits in the system headers. */
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__APPLE__)
#define _POSIX_SOURCE
#endif /* Some BSDs break <sys/socket.h> if this is defined. */
#define _GNU_SOURCE
Index: mf-hooks3.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/Attic/mf-hooks3.c,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 mf-hooks3.c
--- mf-hooks3.c 29 Jul 2003 18:13:02 -0000 1.1.2.3
+++ mf-hooks3.c 31 Jul 2003 23:08:03 -0000
@@ -9,9 +9,14 @@ XXX: libgcc license?
#include "config.h"
+/* Add definition of socklen_t for Darwin */
+#if defined(__APPLE__)
+typedef int socklen_t;
+#endif
+
/* These attempt to coax various unix flavours to declare all our
needed tidbits in the system headers. */
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__APPLE__)
#define _POSIX_SOURCE
#endif /* Some BSDs break <sys/socket.h> if this is defined. */
#define _GNU_SOURCE