Second stab at reorganizing standard/gcc headers. This time it not only

builds on Linux with gcc 2 and 4, but the images do even run. :-) Not
tested on BeOS.

* Removed stddef.h and stdarg.h. They are provided by the compiler.
* Adjusted size_t.h, wchar_t.h, and wchar.h accordingly.
* Made stdio.h avoid gcc 2.95.3's fixincludes hack stdio_va_list
* Added gcc 2.95.3 headers to the repository. They are used instead of
  the headers of the gcc 2.95.3's we use to compile Haiku with. Should
  avoid build problems with the BeOS native compiler.

For sake of personal recreation you can rebuild the cross gcc 2.95.3,
but the only thing that changed is its header directory
(lib/gcc-lib/.../include), which isn't used anymore. Replacing it with
headers/build/gcc-2.95.3 should have the same effect as rebuilding, BTW.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24413 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-03-16 17:21:37 +00:00
parent 0cfb40d0dc
commit 404a0fea46
41 changed files with 3400 additions and 61 deletions
+8 -2
View File
@@ -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_ */
-12
View File
@@ -1,12 +0,0 @@
/*
** Distributed under the terms of the OpenBeOS License.
*/
/* GCC's stdarg.h defines _STDARG_H - and we intend to include
* this header with the line below.
* It contains the actual platform dependent varargs definitions.
*/
#ifndef _STDARG_H
# include_next <stdarg.h>
#endif
-19
View File
@@ -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_ */
+4
View File
@@ -10,6 +10,10 @@
#include <stdarg.h>
// Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:
// __gnuc_va_list
#define BUFSIZ 1024
#define _IOFBF 0 /* fully buffered */
#define _IOLBF 1 /* line buffered */
+13 -3
View File
@@ -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
View File
@@ -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>