This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
MUDFLAP: Suppress dir functions when dirent.h is not present
- From: Nick Clifton <nickc at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 Jun 2004 11:34:23 +0100
- Subject: MUDFLAP: Suppress dir functions when dirent.h is not present
Hi Guys,
I am applying the patch below, pre-approved by Frank Eigler, to the
libmudflap sources to suppress the use of dirent.h when it is not
present in the build environment.
Cheers
Nick
libmudflap/ChangeLog
2004-06-29 Nick Clifton <nickc@redhat.com>
* configure.ac (AC_CHECK_HEADERS): Add dirent.h
* configure: Regenerate.
* mf-hooks2.c: Surround uses of dirent.h with #ifdef
HAVE_DIRENT_H.
Remove spurious inclusion of <strings.h>.
Index: libmudflap/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/configure.ac,v
retrieving revision 1.1
diff -c -3 -p -r1.1 configure.ac
*** libmudflap/configure.ac 15 Jun 2004 14:46:56 -0000 1.1
--- libmudflap/configure.ac 29 Jun 2004 10:22:22 -0000
*************** AC_TRY_COMPILE([
*** 63,69 ****
[AC_MSG_RESULT(no)
enable_shared=no])
! AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h \
netdb.h sys/ipc.h sys/sem.h sys/shm.h sys/wait.h sys/socket.h ctype.h)
AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal)
--- 63,69 ----
[AC_MSG_RESULT(no)
enable_shared=no])
! AC_CHECK_HEADERS(stdint.h execinfo.h signal.h dlfcn.h dirent.h \
netdb.h sys/ipc.h sys/sem.h sys/shm.h sys/wait.h sys/socket.h ctype.h)
AC_CHECK_FUNCS(backtrace backtrace_symbols gettimeofday signal)
Index: libmudflap/mf-hooks2.c
===================================================================
RCS file: /cvs/gcc/gcc/libmudflap/mf-hooks2.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 mf-hooks2.c
*** libmudflap/mf-hooks2.c 24 Jun 2004 21:12:16 -0000 1.7
--- libmudflap/mf-hooks2.c 29 Jun 2004 10:22:23 -0000
*************** Software Foundation, 59 Temple Place - S
*** 52,58 ****
#include <string.h>
#include <stdarg.h>
- #include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
--- 52,57 ----
*************** Software Foundation, 59 Temple Place - S
*** 64,70 ****
--- 63,71 ----
#include <limits.h>
#include <time.h>
#include <ctype.h>
+ #ifdef HAVE_DIRENT_H
#include <dirent.h>
+ #endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
*************** WRAPPER2(void, setbuf, FILE *stream, cha
*** 1075,1080 ****
--- 1076,1082 ----
}
+ #ifdef HAVE_DIRENT_H
WRAPPER2(DIR *, opendir, const char *path)
{
DIR *p;
*************** WRAPPER2(struct dirent *, readdir, DIR *
*** 1121,1126 ****
--- 1123,1129 ----
}
return p;
}
+ #endif
#ifdef HAVE_SYS_SOCKET_H