Messages in this thread Patch in this message | | | Date | Thu, 15 Oct 1998 10:37:30 -0700 | From | Bruce Korb <> | Subject | fixincludes needed on linux? |
| |
Attached are unified diffs of the results. Based on the 2.0.35 kernel.
Summary: OS and machine names need to be surrounded with "__" and "#endif" directives ought not have labels.
--- /usr/include/arpa/nameser.h Sun Jan 14 18:37:58 1996 +++ include/arpa/nameser.h Thu Oct 15 08:07:21 1998 @@ -204,14 +204,14 @@ #define __BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ #define __PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/ -#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ - defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ +#if defined(__vax__) || defined(__ns32000__) || defined(__sun386__) || defined(__i386__) || \ + defined(__MIPSEL__) || defined(__MIPSEL__) || defined(BIT_ZERO_ON_RIGHT) || \ defined(__alpha__) || defined(__alpha) #define __BYTE_ORDER __LITTLE_ENDIAN #endif -#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ - defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ +#if defined(__sel__) || defined(__pyr__) || defined(__mc68000__) || defined(__sparc__) || \ + defined(__is68k__) || defined(__tahoe__) || defined(ibm032) || defined(ibm370) || \ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ --- /usr/include/rpc/types.h Fri Feb 17 21:34:09 1995 +++ include/rpc/types.h Thu Oct 15 08:07:35 1998 @@ -1,3 +1,7 @@ +#ifdef __cplusplus +extern "C" { +#endif + /* @(#)types.h 2.3 88/08/15 4.0 RPCSRC */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -76,3 +80,6 @@ #endif #endif /* _RPC_TYPES_H */ +#ifdef __cplusplus +} +#endif --- /usr/include/sys/socketcall.h Sun Sep 10 19:27:29 1995 +++ include/sys/socketcall.h Thu Oct 15 08:07:37 1998 @@ -19,4 +19,4 @@ #define SYS_SENDMSG 16 #define SYS_RECVMSG 17 -#endif _SYS_SOCKETCALL_H +#endif --- /usr/include/bind-4.9.5/arpa/nameser.h Tue Mar 11 07:46:53 1997 +++ include/bind-4.9.5/arpa/nameser.h Thu Oct 15 08:07:38 1998 @@ -265,14 +265,14 @@ #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/ -#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \ - defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \ +#if defined(__vax__) || defined(__ns32000__) || defined(__sun386__) || defined(__i386__) || \ + defined(__MIPSEL__) || defined(__MIPSEL__) || defined(BIT_ZERO_ON_RIGHT) || \ defined(__alpha__) || defined(__alpha) #define BYTE_ORDER LITTLE_ENDIAN #endif -#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ - defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ +#if defined(__sel__) || defined(__pyr__) || defined(__mc68000__) || defined(__sparc__) || \ + defined(__is68k__) || defined(__tahoe__) || defined(ibm032) || defined(ibm370) || \ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\ defined(apollo) || defined(__convex__) || defined(_CRAY) || \ defined(__hppa) || defined(__hp9000) || \ --- /usr/include/bind-4.9.5/netdb.h Tue Mar 11 07:46:53 1997 +++ include/bind-4.9.5/netdb.h Thu Oct 15 08:07:39 1998 @@ -160,7 +160,7 @@ __END_DECLS /* This is nec'y to make this include file properly replace the sun version. */ -#ifdef sun +#ifdef __sun__ #ifdef __GNU_LIBRARY__ #ifdef linux #include <netdb.h> --- /usr/include/snmp/snmp_impl.h Tue Nov 19 09:32:20 1996 +++ include/snmp/snmp_impl.h Thu Oct 15 08:07:40 1998 @@ -26,7 +26,7 @@ ******************************************************************/ -#if (defined vax) || (defined (mips)) +#if (defined __vax__) || (defined (__mips__)) /* * This is a fairly bogus thing to do, but there seems to be no better way for * compilers that don't understand void pointers. --- /usr/include/rpm/header.h Tue Oct 15 12:09:55 1996 +++ include/rpm/header.h Thu Oct 15 08:07:51 1998 @@ -76,4 +76,4 @@ #define BIN_TYPE 7 #define STRING_ARRAY_TYPE 8 -#endif _header_h +#endif --- /usr/include/slang/slang.h Mon Oct 14 22:07:34 1996 +++ include/slang/slang.h Thu Oct 15 08:07:51 1998 @@ -24,7 +24,7 @@ #endif /* __watcomc__ */ #ifndef __GO32__ -# ifdef unix +# ifdef __unix__ # define REAL_UNIX_SYSTEM # endif #endif --- /usr/src/linux/include/linux/a.out.h Sat Aug 17 11:19:28 1996 +++ include/root/usr/src/linux/include/linux/a.out.h Thu Oct 15 08:08:02 1998 @@ -113,16 +113,16 @@ /* Address of data segment in memory after it is loaded. Note that it is up to you to define SEGMENT_SIZE on machines not listed here. */ -#if defined(vax) || defined(hp300) || defined(pyr) +#if defined(__vax__) || defined(hp300) || defined(__pyr__) #define SEGMENT_SIZE page_size #endif #ifdef sony #define SEGMENT_SIZE 0x2000 #endif /* Sony. */ -#ifdef is68k +#ifdef __is68k__ #define SEGMENT_SIZE 0x20000 #endif -#if defined(m68k) && defined(PORTAR) +#if defined(__m68k__) && defined(PORTAR) #define PAGE_SIZE 0x400 #define SEGMENT_SIZE PAGE_SIZE #endif --- /usr/src/linux/include/linux/stddef.h Wed Dec 1 04:44:15 1993 +++ include/root/usr/src/linux/include/linux/stddef.h Thu Oct 15 08:08:02 1998 @@ -3,7 +3,10 @@ #ifndef _SIZE_T #define _SIZE_T -typedef unsigned int size_t; +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ long unsigned int +#endif +typedef __SIZE_TYPE__ size_t; #endif #undef NULL --- /usr/src/linux/include/linux/cdrom.h Fri Sep 20 07:00:36 1996 +++ include/root/usr/src/linux/include/linux/cdrom.h Thu Oct 15 08:08:03 1998 @@ -206,7 +206,7 @@ #define CDROM_MODE1_SIZE 512 #else #define CDROM_MODE1_SIZE 2048 -#endif FIVETWELVE +#endif #define CDROM_MODE2_SIZE 2336 /* @@ -433,7 +433,7 @@ u_char _r2[8]; }; -#endif _LINUX_CDROM_H +#endif /*==========================================================================*/ /* * Overrides for Emacs so that we follow Linus's tabbing style. --- /usr/src/linux/include/linux/cm206.h Wed May 15 00:06:26 1996 +++ include/root/usr/src/linux/include/linux/cm206.h Thu Oct 15 08:08:04 1998 @@ -172,6 +172,6 @@ #undef y #undef x -#endif STATISTICS +#endif -#endif LINUX_CM206_H +#endif --- /usr/src/linux/include/linux/sbpcd.h Mon Sep 2 05:18:26 1996 +++ include/root/usr/src/linux/include/linux/sbpcd.h Thu Oct 15 08:08:07 1998 @@ -119,14 +119,14 @@ #define JUKEBOX 0 #else #define JUKEBOX 1 -#endif DISTRIBUTION +#endif /* tray control: eject tray after last use */ #if DISTRIBUTION #define EJECT 0 #else #define EJECT 1 -#endif DISTRIBUTION +#endif /* max. number of audio frames to read with one */ /* request (allocates n* 2352 bytes kernel memory!) */ @@ -838,7 +838,7 @@ /*==========================================================================*/ /*==========================================================================*/ -#endif _LINUX_SBPCD_H +#endif /*==========================================================================*/ /* * Overrides for Emacs so that we follow Linus's tabbing style. --- /usr/src/linux/include/linux/optcd.h Tue Jun 4 00:53:46 1996 +++ include/root/usr/src/linux/include/linux/optcd.h Thu Oct 15 08:08:12 1998 @@ -49,4 +49,4 @@ #define N_BUFS 6 -#endif _LINUX_OPTCD_H +#endif --- /usr/src/linux/include/linux/blk.h Thu Aug 6 08:14:15 1998 +++ include/root/usr/src/linux/include/linux/blk.h Thu Oct 15 08:08:14 1998 @@ -41,37 +41,37 @@ #ifdef CONFIG_CDU31A extern int cdu31a_init(void); -#endif CONFIG_CDU31A +#endif #ifdef CONFIG_MCD extern int mcd_init(void); -#endif CONFIG_MCD +#endif #ifdef CONFIG_MCDX extern int mcdx_init(void); -#endif CONFIG_MCDX +#endif #ifdef CONFIG_SBPCD extern int sbpcd_init(void); -#endif CONFIG_SBPCD +#endif #ifdef CONFIG_AZTCD extern int aztcd_init(void); -#endif CONFIG_AZTCD +#endif #ifdef CONFIG_CDU535 extern int sony535_init(void); -#endif CONFIG_CDU535 +#endif #ifdef CONFIG_GSCD extern int gscd_init(void); -#endif CONFIG_GSCD +#endif #ifdef CONFIG_CM206 extern int cm206_init(void); -#endif CONFIG_CM206 +#endif #ifdef CONFIG_OPTCD extern int optcd_init(void); -#endif CONFIG_OPTCD +#endif #ifdef CONFIG_SJCD extern int sjcd_init(void); -#endif CONFIG_SJCD +#endif #ifdef CONFIG_CDI_INIT extern int cdi_init(void); -#endif CONFIG_CDI_INIT +#endif #ifdef CONFIG_BLK_DEV_HD extern int hd_init(void); #endif @@ -86,7 +86,7 @@ #endif #ifdef CONFIG_BLK_DEV_MD extern int md_init(void); -#endif CONFIG_BLK_DEV_MD +#endif extern void set_device_ro(kdev_t dev,int flag); void add_blkdev_randomness(int major); --- /usr/src/linux/include/linux/if_frad.h Wed Jun 3 15:17:49 1998 +++ include/root/usr/src/linux/include/linux/if_frad.h Thu Oct 15 08:08:15 1998 @@ -190,6 +190,6 @@ int register_frad(const char *name); int unregister_frad(const char *name); -#endif __KERNEL__ +#endif #endif --- /usr/src/linux/include/linux/md.h Thu Aug 6 08:14:15 1998 +++ include/root/usr/src/linux/include/linux/md.h Thu Oct 15 08:08:15 1998 @@ -271,5 +271,5 @@ extern void md_wakeup_thread(struct md_thread *thread); extern int md_update_sb (int minor); -#endif __KERNEL__ -#endif _MD_H +#endif +#endif --- /usr/X11R6/include/X11/Xalloca.h Fri Nov 8 03:49:43 1996 +++ include/root/usr/X11R6/include/X11/Xalloca.h Thu Oct 15 08:08:42 1998 @@ -102,7 +102,7 @@ * from alloca.h which #defines alloca. */ # ifndef NCR -# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca) +# if defined(__vax__) || defined(__sun__) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca) /* * Some System V boxes extract alloca.o from /lib/libPW.a; if you * decide that you don't want to use alloca, you might want to fix it here. --- /usr/X11R6/include/X11/Xfuncs.h Fri Nov 8 03:49:43 1996 +++ include/root/usr/X11R6/include/X11/Xfuncs.h Thu Oct 15 08:08:43 1998 @@ -40,7 +40,7 @@ void bzero(); int bcmp(); #else -#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_) +#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(__sun__) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_) #include <string.h> #define _XFUNCS_H_INCLUDED_STRING_H #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len)) @@ -72,7 +72,7 @@ /* the new Xfuncs.h */ -#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4)) +#if !defined(X_NOT_STDC_ENV) && (!defined(__sun__) || defined(SVR4)) /* the ANSI C way */ #ifndef _XFUNCS_H_INCLUDED_STRING_H #include <string.h> @@ -80,7 +80,7 @@ #undef bzero #define bzero(b,len) memset(b,0,len) #else /* else X_NOT_STDC_ENV or SunOS 4 */ -#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__) +#if defined(SYSV) || defined(luna) || defined(__sun__) || defined(__sxg__) #include <memory.h> #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len)) #if defined(SYSV) && defined(_XBCOPYFUNC) --- /usr/X11R6/include/X11/Xos.h Fri Nov 8 03:49:43 1996 +++ include/root/usr/X11R6/include/X11/Xos.h Thu Oct 15 08:08:45 1998 @@ -107,7 +107,7 @@ /* * strerror() */ -#if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII) +#if defined(X_NOT_STDC_ENV) || (defined(__sun__) && !defined(SVR4)) || defined(macII) #ifndef strerror extern char *sys_errlist[]; extern int sys_nerr; @@ -121,7 +121,7 @@ */ #ifdef X_NOT_POSIX #include <fcntl.h> -#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__) +#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(__i386__) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__) #include <unistd.h> #endif #ifdef WIN32 --- /usr/X11R6/include/X11/Xosdefs.h Fri Nov 8 03:49:43 1996 +++ include/root/usr/X11R6/include/X11/Xosdefs.h Thu Oct 15 08:08:45 1998 @@ -46,7 +46,7 @@ #endif #ifdef sony -#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) +#if !defined(__SYSTYPE_SYSV__) && !defined(__SYSTYPE_SYSV__) #define X_NOT_POSIX #endif #endif @@ -56,7 +56,7 @@ #define X_NOT_STDC_ENV #endif -#ifdef vax +#ifdef __vax__ #ifndef ultrix /* assume vanilla BSD */ #define X_NOT_POSIX #define X_NOT_STDC_ENV @@ -80,7 +80,7 @@ #endif #endif -#ifdef i386 +#ifdef __i386__ #ifdef SYSV #if !(defined(ISC) && defined(_POSIX_SOURCE)) #ifndef SCO @@ -99,7 +99,7 @@ #endif #endif -#ifdef sun +#ifdef __sun__ #ifdef SVR4 /* define this to whatever it needs to be */ #define X_POSIX_C_SOURCE 199300L --- /usr/X11R6/include/X11/Xthreads.h Fri Nov 8 03:49:43 1996 +++ include/root/usr/X11R6/include/X11/Xthreads.h Thu Oct 15 08:08:46 1998 @@ -78,7 +78,7 @@ #define xthread_yield() thr_yield() #define xthread_exit(v) thr_exit(v) #define xthread_key_create(kp,d) thr_keycreate(kp,d) -#ifdef sun +#ifdef __sun__ #define xthread_key_delete(k) 0 #else #define xthread_key_delete(k) thr_keydelete(k) --- /usr/include/stdio.h Wed May 29 01:39:51 1996 +++ include/stdio.h Thu Oct 15 08:07:45 1998 @@ -1,3 +1,5 @@ +#define __need___va_list +#include <stdarg.h> /* This is part of the iostream/stdio library, providing -*- C -*- I/O. Define ANSI C stdio on top of C++ iostreams. Copyright (C) 1991 Per Bothner. --- /usr/include/values.h Sun Jun 18 12:20:42 1995 +++ include/values.h Thu Oct 15 08:07:45 1998 @@ -128,7 +128,7 @@ #define FMAXEXP ((1 << _FEXPLEN - 1) - 1 + _IEEE) /* from Andrew Klossner <andrew%frip.wv.tek.com@relay.cs.net> */ -#elif defined(m88k) +#elif defined(__m88k__) /* These are "good" guesses ... I'll figure out the true mins and maxes later, at the time I find out the mins and maxes that the compiler can tokenize. */ --- /usr/include/environ.h Wed Nov 20 01:40:28 1996 +++ include/environ.h Thu Oct 15 08:07:53 1998 @@ -14,7 +14,7 @@ #ifndef offsetof #define offsetof(s,m) ((int)&(((s *)0))->m) #endif -#if defined(sparc) || defined(mips) || defined(HPUX) || defined(__alpha) +#if defined(__sparc__) || defined(__mips__) || defined(HPUX) || defined(__alpha) #define RISC 1 #endif #define UNIX 1 --- /usr/include/commonhd.h Sat Oct 14 09:30:22 1995 +++ include/commonhd.h Thu Oct 15 08:07:53 1998 @@ -112,7 +112,7 @@ # endif #endif #else /* defined(luna) */ -#if defined(sun) && !defined(SVR4) +#if defined(__sun__) && !defined(SVR4) # ifndef BSD42 # define BSD42 # endif @@ -135,7 +135,7 @@ # ifndef TERMINFO # define TERMINFO # endif -# ifdef sun +# ifdef __sun__ # define SOLARIS # endif #else @@ -153,7 +153,7 @@ #endif /* sun */ #endif /* luna */ -#if defined(SYSVR2) || defined(sun) +#if defined(SYSVR2) || defined(__sun__) # define SRAND48 #endif #if defined(SVR4) || defined(hpux) --- /usr/include/zconf.h Wed Mar 26 07:20:50 1997 +++ include/zconf.h Thu Oct 15 08:07:54 1998 @@ -80,7 +80,7 @@ # endif #endif -#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */ +#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in __unix__.h */ # include <unix.h> # define NO_DUMMY_DECL /* buggy compiler merges all .h files incorrectly */ #endif | |