diff --git a/headers/posix/malloc.h b/headers/posix/malloc.h index a7fe5f8c76..ce2cfd902e 100644 --- a/headers/posix/malloc.h +++ b/headers/posix/malloc.h @@ -4,8 +4,7 @@ ** Distributed under the terms of the OpenBeOS License. */ -#include - +#include // ToDo: there are some BeOS specific things missing, most // things are only rarely or almost never used, though. diff --git a/headers/posix/sys/param.h b/headers/posix/sys/param.h index 05d42aad51..5c12d88828 100644 --- a/headers/posix/sys/param.h +++ b/headers/posix/sys/param.h @@ -11,10 +11,16 @@ #define NOFILE OPEN_MAX -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#ifndef MIN + #define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#endif /* maximum possible length of this machine's hostname */ -#define MAXHOSTNAMELEN 256 +#ifndef MAXHOSTNAMELEN + #define MAXHOSTNAMELEN 256 +#endif #endif /* _SYS_PARAM_H */ diff --git a/headers/posix/sys/uio.h b/headers/posix/sys/uio.h index 7a7baafad7..d8642a36c0 100644 --- a/headers/posix/sys/uio.h +++ b/headers/posix/sys/uio.h @@ -3,7 +3,7 @@ #ifndef _SYS_UIO_H #define _SYS_UIO_H -#include +#include typedef struct iovec { void *iov_base; diff --git a/headers/private/kernel/ktypes.h b/headers/private/kernel/ktypes.h index 26313813ed..be7cf8ec9f 100755 --- a/headers/private/kernel/ktypes.h +++ b/headers/private/kernel/ktypes.h @@ -11,43 +11,13 @@ extern "C" { #include -typedef uint16 mode_t; -typedef int pid_t; typedef int32 region_id; typedef int32 aspace_id; -typedef int32 image_id; -typedef uint32 dev_t; -typedef uint64 ino_t; -typedef uint16 nlink_t; -typedef uint32 uid_t; -typedef uint32 gid_t; - -#ifndef NULL -#define NULL 0 +#ifndef _IMAGE_H + typedef int32 image_id; #endif -/* - * XXX serious hack that doesn't really solve the problem. - * As of right now, some versions of the toolchain expect size_t to - * be unsigned long (newer ones than 2.95.2 and beos), and the older - * ones need it to be unsigned int. It's an actual failure when - * operator new is declared. This will have to be resolved in the future. - */ - -#ifdef __BEOS__ -typedef unsigned long size_t; -typedef signed long ssize_t; -#else -typedef unsigned int size_t; -typedef signed int ssize_t; -#endif -typedef int64 off_t; - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; typedef unsigned long addr; diff --git a/headers/private/storage/kernel_interface.h b/headers/private/storage/kernel_interface.h index f24d02a264..48e725f23e 100644 --- a/headers/private/storage/kernel_interface.h +++ b/headers/private/storage/kernel_interface.h @@ -33,7 +33,7 @@ namespace Storage { // Type aliases typedef dirent DirEntry; -typedef flock FileLock; +typedef struct flock FileLock; typedef struct stat Stat; typedef uint32 StatMember; typedef attr_info AttrInfo; diff --git a/src/apps/bin/clipboard.cpp b/src/apps/bin/clipboard.cpp index cfe56ea2ae..4b2b0adabb 100644 --- a/src/apps/bin/clipboard.cpp +++ b/src/apps/bin/clipboard.cpp @@ -3,7 +3,7 @@ **=============================================================== ** 24 June 2002 - Mathew Hounsell - Created */ -#include "be/app/Clipboard.h" +#include #include #include diff --git a/src/kernel/boot/Jamfile b/src/kernel/boot/Jamfile index 79c7816f78..fbb6b4f7f4 100644 --- a/src/kernel/boot/Jamfile +++ b/src/kernel/boot/Jamfile @@ -1,8 +1,21 @@ SubDir OBOS_TOP src kernel boot ; + +oldccflags = $(CCFLAGS) ; +{ + CCFLAGS = ; + local x ; + for x in $(CCFLAGS) { + if $(x) != --nostdinc { + CCFLAGS += $(x) ; + } + } +} SystemMain bootmaker : bootmaker.c ; SystemMain bin2h : bin2h.c ; SystemMain bin2asm : bin2asm.c ; SystemMain makeflop : makeflop.c ; +CCFLAGS = $(oldccflags) ; + SubInclude OBOS_TOP src kernel boot arch ; diff --git a/src/kits/game/GameSoundDevice.cpp b/src/kits/game/GameSoundDevice.cpp index 6eab3723d8..c7acc5ffe7 100644 --- a/src/kits/game/GameSoundDevice.cpp +++ b/src/kits/game/GameSoundDevice.cpp @@ -35,6 +35,7 @@ #include #include +#include "GSUtility.h" #include "GameSoundDevice.h" #include "GameSoundBuffer.h" #include "GameProducer.h" diff --git a/src/kits/media/SystemTimeSource.cpp b/src/kits/media/SystemTimeSource.cpp index 401554cbc9..8d22add616 100644 --- a/src/kits/media/SystemTimeSource.cpp +++ b/src/kits/media/SystemTimeSource.cpp @@ -26,7 +26,7 @@ _SysTimeSource::SnoozeUntil( bigtime_t time = performance_time - with_latency; status_t err; do { - err = snooze_until(time,B_SYSTEM_TIMEBASE); + err = snooze_until(time, B_SYSTEM_TIMEBASE); } while (err == B_INTERRUPTED && retry_signals); return err; } diff --git a/src/kits/network/libnet/Jamfile b/src/kits/network/libnet/Jamfile index b454437f30..83060fc7d5 100644 --- a/src/kits/network/libnet/Jamfile +++ b/src/kits/network/libnet/Jamfile @@ -1,9 +1,6 @@ SubDir OBOS_TOP src kits net libnet ; -UsePosixHeaders ; UsePrivateHeaders net ; -SetupIncludes ; -SubDirCcFlags -nostdinc ; SharedLibrary net : socket.c diff --git a/src/kits/network/libnetapi/Jamfile b/src/kits/network/libnetapi/Jamfile index a403dfda36..8ce02be6ca 100644 --- a/src/kits/network/libnetapi/Jamfile +++ b/src/kits/network/libnetapi/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kits net libnetapi ; -UsePosixHeaders ; +UsePrivateHeaders net ; SharedLibrary netapi : NetEndpoint.cpp diff --git a/src/prefs/keymap/KeymapApplication.cpp b/src/prefs/keymap/KeymapApplication.cpp index b13f4ff770..82278f83f4 100644 --- a/src/prefs/keymap/KeymapApplication.cpp +++ b/src/prefs/keymap/KeymapApplication.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include +#include +#include +#include +#include #if DEBUG - #include + #include #include #endif //DEBUG #include "KeymapWindow.h" diff --git a/src/prefs/keymap/KeymapApplication.h b/src/prefs/keymap/KeymapApplication.h index a8421b36ea..09d3e65ade 100644 --- a/src/prefs/keymap/KeymapApplication.h +++ b/src/prefs/keymap/KeymapApplication.h @@ -1,8 +1,8 @@ #ifndef OBOS_KEYMAP_APPLICATION_H #define OBOS_KEYMAP_APPLICATION_H -#include -#include +#include +#include #define APP_SIGNATURE "application/x-vnd.OpenBeOS-Keymap" #define COPY_BUFFER_SIZE 1 * 1024 diff --git a/src/prefs/keymap/KeymapListItem.h b/src/prefs/keymap/KeymapListItem.h index 9a5607e649..5d1325e0a8 100644 --- a/src/prefs/keymap/KeymapListItem.h +++ b/src/prefs/keymap/KeymapListItem.h @@ -6,8 +6,8 @@ #ifndef OBOS_KEYMAP_LIST_ITEM_H #define OBOS_KEYMAP_LIST_ITEM_H -#include -#include +#include +#include class KeymapListItem : public BStringItem { diff --git a/src/prefs/keymap/KeymapWindow.cpp b/src/prefs/keymap/KeymapWindow.cpp index 6ae2f29f5b..d77f50710e 100644 --- a/src/prefs/keymap/KeymapWindow.cpp +++ b/src/prefs/keymap/KeymapWindow.cpp @@ -1,12 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef DEBUG #include #endif //DEBUG diff --git a/src/prefs/keymap/KeymapWindow.h b/src/prefs/keymap/KeymapWindow.h index b0774a502b..1a320458e3 100644 --- a/src/prefs/keymap/KeymapWindow.h +++ b/src/prefs/keymap/KeymapWindow.h @@ -2,9 +2,9 @@ #define OBOS_KEYMAP_WINDOW_H -#include -#include -#include +#include +#include +#include #if !DEBUG diff --git a/src/prefs/keymap/main.cpp b/src/prefs/keymap/main.cpp index a2f5414eb3..4cb6fe0e30 100644 --- a/src/prefs/keymap/main.cpp +++ b/src/prefs/keymap/main.cpp @@ -4,7 +4,7 @@ * Creation: Sandor Vroemisse */ -#include +#include #include "KeymapApplication.h" diff --git a/src/servers/print/Jobs.cpp b/src/servers/print/Jobs.cpp index ee2af531b9..9bc746a681 100644 --- a/src/servers/print/Jobs.cpp +++ b/src/servers/print/Jobs.cpp @@ -39,7 +39,7 @@ #include // BeOS -#include +#include #include #include #include