* Introduced new header directory "config", which ATM contains HaikuConfig.h

and types.h. The idea is to provide a basic architecture/compiler
  abstraction by defining types and macros that allow the posix/ and os/
  headers to be mostly architecture/compiler agnostic. 
* Adjusted the posix/ and os/ headers accordingly.
* <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI*
  and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int*
  types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX
  macros. Also the B_PRI* and B_SCN* macros are available unconditionally,
  unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be
  defined in C++ mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-24 19:44:07 +00:00
parent b5504a512c
commit 2222d0559d
27 changed files with 674 additions and 269 deletions
+6 -3
View File
@@ -1,16 +1,19 @@
/*
* Copyright 2008, Haiku Inc. All Rights Reserved.
* Copyright 2008-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_MSG_H
#define _SYS_MSG_H
#include <config/types.h>
#include <sys/cdefs.h>
#include <sys/ipc.h>
#include <sys/types.h>
typedef unsigned long msgqnum_t;
typedef unsigned long msglen_t;
typedef __haiku_uint32 msgqnum_t;
typedef __haiku_uint32 msglen_t;
/* No error if big message */
#define MSG_NOERROR 010000
+4 -1
View File
@@ -5,13 +5,16 @@
#ifndef _SYS_RESOURCE_H
#define _SYS_RESOURCE_H
#include <config/types.h>
#include <sys/cdefs.h>
#include <sys/time.h>
/* getrlimit()/setrlimit() definitions */
typedef unsigned long rlim_t;
typedef __haiku_addr_t rlim_t;
struct rlimit {
rlim_t rlim_cur; /* current soft limit */
+5 -3
View File
@@ -1,11 +1,13 @@
/*
* Copyright 2002-2006, Haiku Inc. All Rights Reserved.
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_SELECT_H
#define _SYS_SELECT_H
#include <config/types.h>
#include <sys/time.h>
#include <signal.h>
@@ -22,7 +24,7 @@
# define FD_SETSIZE 1024
#endif
typedef unsigned long fd_mask;
typedef __haiku_uint32 fd_mask;
#ifndef _howmany
# define _howmany(x, y) (((x) + ((y) - 1)) / (y))
@@ -55,7 +57,7 @@ extern "C" {
extern int pselect(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
struct fd_set *errorBits, const struct timespec *timeout, const sigset_t *sigMask);
extern int select(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
extern int select(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
struct fd_set *errorBits, struct timeval *timeout);
#ifdef __cplusplus
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008, Haiku Inc. All Rights Reserved.
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_STAT_H_
@@ -24,7 +24,7 @@ struct stat {
struct timespec st_mtim; /* last modification time */
struct timespec st_ctim; /* last change time, not creation time */
struct timespec st_crtim; /* creation time */
unsigned int st_type; /* attribute/index type */
__haiku_uint32 st_type; /* attribute/index type */
blkcnt_t st_blocks; /* number of blocks allocated for object */
};
+29 -25
View File
@@ -1,11 +1,13 @@
/*
* Copyright 2002-2006, Haiku Inc. All Rights Reserved.
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
#include <config/types.h>
#include <BeBuild.h>
@@ -17,36 +19,38 @@ typedef unsigned char u_char;
/* sysV compatibility */
#ifndef _SUPPORT_DEFS_H
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned int uint;
#endif
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned char unchar;
typedef long long blkcnt_t;
typedef int blksize_t;
typedef long long fsblkcnt_t;
typedef long long fsfilcnt_t;
typedef long long off_t;
typedef long long ino_t;
typedef int cnt_t;
typedef long dev_t;
typedef long pid_t;
typedef long id_t;
typedef __haiku_int64 blkcnt_t;
typedef __haiku_std_int32 blksize_t;
typedef __haiku_int64 fsblkcnt_t;
typedef __haiku_int64 fsfilcnt_t;
typedef __haiku_int64 off_t;
typedef __haiku_int64 ino_t;
typedef __haiku_std_int32 cnt_t;
typedef __haiku_int32 dev_t;
typedef __haiku_int32 pid_t;
typedef __haiku_int32 id_t;
typedef unsigned int uid_t;
typedef unsigned int gid_t;
typedef unsigned int mode_t;
typedef unsigned int umode_t;
typedef int nlink_t;
typedef __haiku_std_uint32 uid_t;
typedef __haiku_std_uint32 gid_t;
typedef __haiku_std_uint32 mode_t;
typedef __haiku_std_uint32 umode_t;
typedef __haiku_std_int32 nlink_t;
typedef int daddr_t;
typedef char * caddr_t;
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
typedef int daddr_t; /* disk address */
#else
typedef off_t daddr_t; /* disk address */
#endif
typedef char* caddr_t;
typedef unsigned long addr_t;
typedef long key_t;
typedef __haiku_addr_t addr_t;
typedef __haiku_int32 key_t;
#include <null.h>
#include <size_t.h>