* Removed our stddef.h. We don't need it, since gcc comes with one that
under Haiku overrides ours anyway. * Adjusted size_t.h, wchar_t.h, wchar.h accordingly. This should fix the annoying "ssize_t redefined" warnings when compiling under Haiku. * When building Haiku the gcc headers come first in the include search path now, as it should be. The respective TODO suggested that this might break the build depending on compiler version and host platform. I've tested with Linux gcc 2 and gcc 4, which work fine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24406 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
/*
|
||||
* Copyright 2008, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SIZE_T_H_
|
||||
#define _SIZE_T_H_
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef signed long ssize_t;
|
||||
#include <stddef.h>
|
||||
|
||||
// TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.
|
||||
//typedef long signed int ssize_t;
|
||||
|
||||
#endif /* _SIZE_T_H_ */
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef _STDDEF_H_
|
||||
#define _STDDEF_H_
|
||||
/*
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
*/
|
||||
#include <null.h>
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ > 3
|
||||
#define offsetof(type,member) __builtin_offsetof(type, member)
|
||||
#else
|
||||
#define offsetof(type,member) ((size_t)&((type*)0)->member)
|
||||
#endif
|
||||
|
||||
typedef long ptrdiff_t;
|
||||
|
||||
#include <wchar_t.h>
|
||||
#include <size_t.h>
|
||||
|
||||
#endif /* _STDDEF_H_ */
|
||||
+13
-3
@@ -7,11 +7,22 @@
|
||||
#ifndef _WCHAR_H
|
||||
#define _WCHAR_H
|
||||
|
||||
#include <wchar_t.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
|
||||
// In all other cases we will do that.
|
||||
#ifndef _WINT_T
|
||||
#define _WINT_T
|
||||
typedef unsigned int wint_t;
|
||||
|
||||
#ifndef __WINT_TYPE__
|
||||
#define __WINT_TYPE__ unsigned int
|
||||
#endif
|
||||
|
||||
typedef __WINT_TYPE__ wint_t;
|
||||
|
||||
#endif // _WINT_T
|
||||
|
||||
typedef int wctype_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -19,7 +30,6 @@ typedef struct {
|
||||
wint_t __value;
|
||||
} mbstate_t;
|
||||
|
||||
#include <size_t.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
+4
-12
@@ -1,15 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2002 Marcus Overhagen
|
||||
* All rights reserved.
|
||||
*
|
||||
* Distributed under the terms of the MIT license
|
||||
* Copyright 2008, Haiku Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _WCHAR_T_H
|
||||
#define _WCHAR_T_H
|
||||
|
||||
#if !defined(__cplusplus) || __GNUC__ < 3
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
|
||||
#endif /* _WCHAR_T_H */
|
||||
|
||||
// Include GCC's stddef.h. It defines wchar_t.
|
||||
#include <stddef.h>
|
||||
|
||||
Reference in New Issue
Block a user