sim: formally assume unistd.h always exists (via gnulib)
We have many uses of unistd.h that are unprotected by HAVE_UNISTD_H, so this is more formalizing the reality that we require this header. Since we switched to gnulib, it guarantees that a unistd.h exists for us to include, so we're doubly OK.
This commit is contained in:
parent
e9bf6a4a20
commit
4cd7de783b
@ -31,10 +31,7 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* For SEEK_SET etc. */
|
||||
#endif
|
||||
|
||||
#include "armdefs.h"
|
||||
#include "armos.h"
|
||||
|
@ -34,9 +34,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "sim-main.h"
|
||||
#include "hw-main.h"
|
||||
|
@ -29,9 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/select.h>
|
||||
|
@ -21,10 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <stdlib.h>
|
||||
/* For strsignal. */
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
/* For chdir. */
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "bfd.h"
|
||||
#include "environ.h"
|
||||
|
@ -29,9 +29,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#undef open
|
||||
|
||||
|
@ -26,9 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
@ -33,9 +33,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
7
sim/configure
vendored
7
sim/configure
vendored
@ -2797,7 +2797,6 @@ as_fn_append ac_header_list " dlfcn.h"
|
||||
as_fn_append ac_header_list " fcntl.h"
|
||||
as_fn_append ac_header_list " fpu_control.h"
|
||||
as_fn_append ac_header_list " termios.h"
|
||||
as_fn_append ac_header_list " unistd.h"
|
||||
as_fn_append ac_header_list " utime.h"
|
||||
as_fn_append ac_header_list " linux/if_tun.h"
|
||||
as_fn_append ac_header_list " linux/mii.h"
|
||||
@ -5265,8 +5264,6 @@ done
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -12289,7 +12286,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12292 "configure"
|
||||
#line 12289 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12395,7 +12392,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 12398 "configure"
|
||||
#line 12395 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -24,9 +24,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -29,9 +29,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
|
@ -36,10 +36,7 @@ main (int argc, char *argv[])
|
||||
#include "libiberty.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
|
@ -32,9 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
@ -5,9 +5,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "bfd.h"
|
||||
|
@ -18,12 +18,12 @@ AC_DEFUN([SIM_AC_PLATFORM],
|
||||
[dnl
|
||||
dnl Check for common headers.
|
||||
dnl NB: You can assume C11 headers exist.
|
||||
dnl NB: We use gnulib from ../gnulib/, so we don't probe headers it provides.
|
||||
AC_CHECK_HEADERS_ONCE(m4_flatten([
|
||||
dlfcn.h
|
||||
fcntl.h
|
||||
fpu_control.h
|
||||
termios.h
|
||||
unistd.h
|
||||
utime.h
|
||||
linux/if_tun.h
|
||||
linux/mii.h
|
||||
@ -46,6 +46,7 @@ AC_CHECK_HEADERS_ONCE(m4_flatten([
|
||||
]))
|
||||
AC_HEADER_DIRENT
|
||||
|
||||
dnl NB: We use gnulib from ../gnulib/, so we don't probe functions it provides.
|
||||
AC_CHECK_FUNCS_ONCE(m4_flatten([
|
||||
__setfpucw
|
||||
access
|
||||
|
@ -21,9 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "defs.h"
|
||||
|
||||
#include "sim-main.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "m68hc11-sim.h"
|
||||
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -27,9 +27,7 @@
|
||||
#include "emul_generic.h"
|
||||
#include "emul_bugapi.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -28,9 +28,7 @@
|
||||
#include "emul_chirp.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef STATIC_INLINE_EMUL_CHIRP
|
||||
#define STATIC_INLINE_EMUL_CHIRP STATIC_INLINE
|
||||
|
@ -72,10 +72,8 @@ int getrusage();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#undef MAXPATHLEN /* sys/param.h might define this also */
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -115,10 +115,8 @@ int getrusage();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#undef MAXPATHLEN /* sys/param.h might define this also */
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
@ -28,9 +28,7 @@
|
||||
#include "device_table.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
/* DEVICE
|
||||
|
@ -26,10 +26,7 @@
|
||||
#include "pk.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
|
@ -30,9 +30,7 @@
|
||||
#include "cpu.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
@ -36,9 +36,7 @@
|
||||
#include "sim/sim.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -26,9 +26,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
|
@ -29,9 +29,7 @@
|
||||
#include "lf.h"
|
||||
#include "table.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct _open_table open_table;
|
||||
|
@ -25,9 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
|
@ -24,9 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
|
@ -25,9 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_MMAP
|
||||
#include <sys/mman.h>
|
||||
# ifndef MAP_FAILED
|
||||
|
@ -12,9 +12,7 @@
|
||||
#include <utime.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user