Move even more includes to common/include.

This patch moves more includes (most of them, to tell the truth) to
common/include directory. This completes the list of includes needed
to compile current trunk with the new libc (but to do that you need
more patches in queue).

This patch also contains some modification (for compilation with new
headers) to the common includes under __NBSD_LIBC, the define used
in mk script to specialize compilation with new includes.
This commit is contained in:
Gianluca Guida 2011-03-03 16:39:02 +00:00
parent 493ea15714
commit f4814901af
67 changed files with 66 additions and 36 deletions

View file

@ -2,16 +2,23 @@
.PATH: ${MINIXSRCDIR}/common/include .PATH: ${MINIXSRCDIR}/common/include
INCS+= lib.h INCS+= curses.h env.h fetch.h hgfs.h lib.h libutil.h timers.h
INCS+= minix/ansi.h minix/bitmap.h minix/callnr.h minix/com.h \ INCS+= minix/acpi.h minix/ansi.h minix/audio_fw.h minix/bitmap.h \
minix/compiler.h minix/config.h minix/const.h minix/debug.h \ minix/callnr.h minix/com.h minix/compiler.h minix/config.h \
minix/devio.h minix/ds.h minix/endpoint.h minix/gcov.h \ minix/const.h minix/cpufeature.h minix/crtso.h minix/debug.h \
minix/ioctl.h minix/ipc.h minix/ipcconst.h minix/keymap.h \ minix/devio.h minix/devman.h minix/dir.h minix/dmap.h \
minix/limits.h minix/minlib.h minix/portio.h minix/priv.h \ minix/driver.h minix/drivers.h minix/drvlib.h minix/ds.h \
minix/profile.h minix/rs.h minix/safecopies.h minix/sef.h \ minix/endpoint.h minix/fslib.h minix/gcov.h minix/hash.h \
minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \ minix/ioctl.h minix/input.h minix/ipc.h minix/ipcconst.h \
minix/sysutil.h minix/timers.h minix/type.h minix/u64.h minix/vm.h minix/keymap.h minix/limits.h minix/mthread.h minix/minlib.h \
minix/mq.h minix/netdriver.h minix/partition.h minix/portio.h \
minix/priv.h minix/procfs.h minix/profile.h minix/queryparam.h \
minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h \
minix/sound.h minix/spin.h minix/sys_config.h minix/sysinfo.h \
minix/syslib.h minix/sysutil.h minix/timers.h minix/type.h \
minix/tty.h minix/u64.h minix/usb.h minix/usb_ch9.h minix/vm.h \
minix/vfsif.h minix/vtreefs.h
INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \ INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \ net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \
@ -23,3 +30,10 @@ INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \ net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \
net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \ net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \
net/gen/vjhc.h net/gen/vjhc.h
INCS+= ddekit/assert.h ddekit/initcall.h ddekit/memory.h ddekit/pgtab.h \
ddekit/thread.h ddekit/attribs.h ddekit/inline.h ddekit/printf.h \
ddekit/timer.h ddekit/condvar.h ddekit/interrupt.h ddekit/panic.h \
ddekit/resources.h ddekit/types.h ddekit/debug.h ddekit/lock.h \
ddekit/pci.h ddekit/semaphore.h ddekit/usb.h ddekit/minix/pci.h \
ddekit/minix/msg_queue.h ddekit/ddekit.h

View file

@ -1,3 +1,6 @@
#ifdef __NBSD_LIBC
#include <minix/ansi.h>
#endif
_PROTOTYPE( int env_parse, (char *env, char *fmt, int field, _PROTOTYPE( int env_parse, (char *env, char *fmt, int field,
long *param, long min, long max) ); long *param, long min, long max) );
_PROTOTYPE( void env_panic, (char *env) ); _PROTOTYPE( void env_panic, (char *env) );

View file

@ -6,7 +6,12 @@
#define _LIB_H #define _LIB_H
/* First come the defines. */ /* First come the defines. */
#ifdef __NBSD_LIBC
#include <sys/featuretest.h> /* tell headers to include NetBSD stuff. */
#else /* !__NBSD_LIBC */
#define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */ #define _POSIX_SOURCE 1 /* tell headers to include POSIX stuff */
#endif
#define _MINIX 1 /* tell headers to include MINIX stuff */ #define _MINIX 1 /* tell headers to include MINIX stuff */
/* The following are so basic, all the lib files get them automatically. */ /* The following are so basic, all the lib files get them automatically. */

View file

@ -61,6 +61,15 @@
/* This should be defined as restrict when a C99 compiler is used. */ /* This should be defined as restrict when a C99 compiler is used. */
#define _RESTRICT #define _RESTRICT
#ifdef __NBSD_LIBC
/* Setting of _POSIX_SOURCE (or _NETBSD_SOURCE) in NBSD headers is
* done in <sys/featuretest.h> */
#include <sys/featuretest.h>
/* Also, do not redefine _BSD_VA_LIST */
#else /* !__NBSD_LIBC */
/* Setting any of _MINIX, _POSIX_C_SOURCE or _POSIX2_SOURCE implies /* Setting any of _MINIX, _POSIX_C_SOURCE or _POSIX2_SOURCE implies
* _POSIX_SOURCE. (Seems wrong to put this here in ANSI space.) * _POSIX_SOURCE. (Seems wrong to put this here in ANSI space.)
*/ */
@ -69,7 +78,6 @@
#define _POSIX_SOURCE 1 #define _POSIX_SOURCE 1
#endif #endif
#ifndef __NBSD_LIBC
/* What is a va_list? */ /* What is a va_list? */
#include <stdarg.h> #include <stdarg.h>
#define _BSD_VA_LIST_ va_list #define _BSD_VA_LIST_ va_list

View file

@ -3,6 +3,9 @@
#ifndef _DIR_H #ifndef _DIR_H
#define _DIR_H #define _DIR_H
#ifdef __NBSD_LIBC
#include <sys/cdefs.h>
#endif
#include <minix/types.h> #include <minix/types.h>
#define DIRBLKSIZ 512 /* size of directory block */ #define DIRBLKSIZ 512 /* size of directory block */
@ -14,6 +17,10 @@
struct direct { struct direct {
ino_t d_ino; ino_t d_ino;
char d_name[DIRSIZ]; char d_name[DIRSIZ];
#ifdef __NBSD_LIBC
} __packed;
#else
}; };
#endif
#endif /* _DIR_H */ #endif /* _DIR_H */

View file

@ -1,6 +1,9 @@
#ifndef _IPC_H #ifndef _IPC_H
#define _IPC_H #define _IPC_H
#ifdef __NBSD_LIBC
#include <minix/ansi.h>
#endif
#include <minix/ipcconst.h> #include <minix/ipcconst.h>
#include <minix/type.h> #include <minix/type.h>

View file

@ -6,9 +6,11 @@
#endif #endif
/* Miscellaneous BSD. */ /* Miscellaneous BSD. */
_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
_PROTOTYPE(char *itoa, (int _n)); _PROTOTYPE(char *itoa, (int _n));
#ifndef __NBSD_LIBC
_PROTOTYPE(char *getpass, (const char *_prompt)); _PROTOTYPE(char *getpass, (const char *_prompt));
_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
#endif /* !_NBSD_LIBC */
/* Miscellaneous MINIX. */ /* Miscellaneous MINIX. */
_PROTOTYPE(void std_err, (const char *_s)); _PROTOTYPE(void std_err, (const char *_s));

View file

@ -9,8 +9,13 @@
#include <ucontext.h> #include <ucontext.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef __NBSD_LIBC
#include <alloca.h> #include <alloca.h>
#endif
#include <limits.h> #include <limits.h>
#ifdef __NBSD_LIBC
#include <sys/signal.h>
#endif
typedef int mthread_thread_t; typedef int mthread_thread_t;
typedef int mthread_once_t; typedef int mthread_once_t;

View file

@ -32,7 +32,11 @@ typedef struct dhcp {
#define DHCP_FLAGS_BCAST 0x8000U /* Reply must be broadcast to client. */ #define DHCP_FLAGS_BCAST 0x8000U /* Reply must be broadcast to client. */
/* "Magic" first four option bytes. */ /* "Magic" first four option bytes. */
#ifdef __NBSD_LIBC
#define DHCP_MAGIC htonl(0x63825363UL)
#else
#define DHCP_MAGIC HTONL(0x63825363UL) #define DHCP_MAGIC HTONL(0x63825363UL)
#endif
/* DHCP common tags: */ /* DHCP common tags: */
#define DHCP_TAG_NETMASK 1 /* Netmask. */ #define DHCP_TAG_NETMASK 1 /* Netmask. */

View file

@ -3,5 +3,6 @@
.PATH: ${MINIXSRCDIR}/common/include/sys .PATH: ${MINIXSRCDIR}/common/include/sys
INCS+= ioc_cmos.h ioc_file.h ioc_scsi.h ioc_tape.h \ INCS+= ioc_cmos.h ioc_file.h ioc_scsi.h ioc_tape.h \
ioc_disk.h ioc_memory.h ioc_sound.h ioc_tty.h ioc_disk.h ioc_memory.h ioc_sound.h ioc_tty.h \
kbdio.h mtio.h svrctl.h video.h vm.h

View file

@ -12,34 +12,12 @@ INCS= alloca.h a.out.h ar.h assert.h configfile.h ctype.h \
hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \ hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \
memory.h paths.h libexec.h complex.h memory.h paths.h libexec.h complex.h
INCS+= arpa/inet.h arpa/nameser.h INCS+= arpa/inet.h arpa/nameser.h
INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \ INCS+= minix/a.out.h minix/cdrom.h minix/compiler-ack.h minix/dirent.h \
minix/crtso.h minix/dirent.h \ minix/dl_eth.h minix/md5.h minix/sha1.h minix/sha2.h minix/types.h
minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \
minix/acpi.h \
minix/drivers.h minix/drvlib.h \
minix/fslib.h \
minix/mq.h minix/mthread.h \
minix/netdriver.h minix/partition.h \
minix/procfs.h \
minix/queryparam.h \
minix/sched.h minix/sound.h \
minix/tty.h minix/types.h \
minix/vfsif.h minix/vtreefs.h \
minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
minix/audio_fw.h minix/hash.h minix/input.h \
minix/devman.h minix/usb.h minix/usb_ch9.h
INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h
INCS+= ddekit/assert.h ddekit/initcall.h ddekit/memory.h ddekit/pgtab.h \
ddekit/thread.h ddekit/attribs.h ddekit/inline.h ddekit/printf.h \
ddekit/timer.h ddekit/condvar.h ddekit/interrupt.h ddekit/panic.h \
ddekit/resources.h ddekit/types.h ddekit/debug.h ddekit/lock.h \
ddekit/pci.h ddekit/semaphore.h ddekit/usb.h ddekit/minix/pci.h \
ddekit/minix/msg_queue.h ddekit/ddekit.h
.include <bsd.own.mk> .include <bsd.own.mk>
INCSDIR= /usr/include INCSDIR= /usr/include