arduino-0018-windows
This commit is contained in:
parent
157fd6f1a1
commit
f39fc49523
5182 changed files with 950586 additions and 0 deletions
|
@ -0,0 +1,6 @@
|
|||
if {![package vsatisfies [package provide Tcl] 8]} {return}
|
||||
if {[info exists tcl_platform(debug)]} {
|
||||
package ifneeded dde 1.2 [list load [file join $dir tcldde12d.dll] dde]
|
||||
} else {
|
||||
package ifneeded dde 1.2 [list load [file join $dir tcldde12.dll] dde]
|
||||
}
|
BIN
arduino-0018-windows/hardware/tools/avr/lib/dde1.2/tcldde12.dll
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/dde1.2/tcldde12.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
This README file is copied into the directory for GCC-only header files
|
||||
when fixincludes is run by the makefile for GCC.
|
||||
|
||||
Many of the files in this directory were automatically edited from the
|
||||
standard system header files by the fixincludes process. They are
|
||||
system-specific, and will not work on any other kind of system. They
|
||||
are also not part of GCC. The reason we have to do this is because
|
||||
GCC requires ANSI C headers and many vendors supply ANSI-incompatible
|
||||
headers.
|
||||
|
||||
Because this is an automated process, sometimes headers get "fixed"
|
||||
that do not, strictly speaking, need a fix. As long as nothing is broken
|
||||
by the process, it is just an unfortunate collateral inconvenience.
|
||||
We would like to rectify it, if it is not "too inconvenient".
|
|
@ -0,0 +1 @@
|
|||
timestamp
|
|
@ -0,0 +1,103 @@
|
|||
#ifndef _LIMITS_H___
|
||||
#define _LIMITS_H___
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
#undef CHAR_BIT
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
/* Maximum length of a multibyte character. */
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
#undef SCHAR_MIN
|
||||
#define SCHAR_MIN (-SCHAR_MAX - 1)
|
||||
#undef SCHAR_MAX
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
#undef UCHAR_MAX
|
||||
#if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
|
||||
#else
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define CHAR_MIN 0U
|
||||
# else
|
||||
# define CHAR_MIN 0
|
||||
# endif
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
#undef SHRT_MIN
|
||||
#define SHRT_MIN (-SHRT_MAX - 1)
|
||||
#undef SHRT_MAX
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
#undef USHRT_MAX
|
||||
#if __SHRT_MAX__ == __INT_MAX__
|
||||
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
|
||||
#else
|
||||
# define USHRT_MAX (SHRT_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
#undef INT_MIN
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
#undef INT_MAX
|
||||
#define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
#undef UINT_MAX
|
||||
#define UINT_MAX (INT_MAX * 2U + 1U)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
#undef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1L)
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#endif /* _LIMITS_H___ */
|
|
@ -0,0 +1,8 @@
|
|||
/* syslimits.h stands for the system's own limits.h file.
|
||||
If we can use it ok unmodified, then we install this text.
|
||||
If fixincludes fixes it, then the fixed version is installed
|
||||
instead of this text. */
|
||||
|
||||
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
|
||||
#include_next <limits.h>
|
||||
#undef _GCC_NEXT_LIMITS_H
|
|
@ -0,0 +1,241 @@
|
|||
/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
|
||||
*/
|
||||
|
||||
#ifndef _FLOAT_H___
|
||||
#define _FLOAT_H___
|
||||
|
||||
/* Radix of exponent representation, b. */
|
||||
#undef FLT_RADIX
|
||||
#define FLT_RADIX __FLT_RADIX__
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand, p. */
|
||||
#undef FLT_MANT_DIG
|
||||
#undef DBL_MANT_DIG
|
||||
#undef LDBL_MANT_DIG
|
||||
#define FLT_MANT_DIG __FLT_MANT_DIG__
|
||||
#define DBL_MANT_DIG __DBL_MANT_DIG__
|
||||
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
|
||||
|
||||
/* Number of decimal digits, q, such that any floating-point number with q
|
||||
decimal digits can be rounded into a floating-point number with p radix b
|
||||
digits and back again without change to the q decimal digits,
|
||||
|
||||
p * log10(b) if b is a power of 10
|
||||
floor((p - 1) * log10(b)) otherwise
|
||||
*/
|
||||
#undef FLT_DIG
|
||||
#undef DBL_DIG
|
||||
#undef LDBL_DIG
|
||||
#define FLT_DIG __FLT_DIG__
|
||||
#define DBL_DIG __DBL_DIG__
|
||||
#define LDBL_DIG __LDBL_DIG__
|
||||
|
||||
/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
|
||||
#undef FLT_MIN_EXP
|
||||
#undef DBL_MIN_EXP
|
||||
#undef LDBL_MIN_EXP
|
||||
#define FLT_MIN_EXP __FLT_MIN_EXP__
|
||||
#define DBL_MIN_EXP __DBL_MIN_EXP__
|
||||
#define LDBL_MIN_EXP __LDBL_MIN_EXP__
|
||||
|
||||
/* Minimum negative integer such that 10 raised to that power is in the
|
||||
range of normalized floating-point numbers,
|
||||
|
||||
ceil(log10(b) * (emin - 1))
|
||||
*/
|
||||
#undef FLT_MIN_10_EXP
|
||||
#undef DBL_MIN_10_EXP
|
||||
#undef LDBL_MIN_10_EXP
|
||||
#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
|
||||
#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
|
||||
#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
|
||||
|
||||
/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
|
||||
#undef FLT_MAX_EXP
|
||||
#undef DBL_MAX_EXP
|
||||
#undef LDBL_MAX_EXP
|
||||
#define FLT_MAX_EXP __FLT_MAX_EXP__
|
||||
#define DBL_MAX_EXP __DBL_MAX_EXP__
|
||||
#define LDBL_MAX_EXP __LDBL_MAX_EXP__
|
||||
|
||||
/* Maximum integer such that 10 raised to that power is in the range of
|
||||
representable finite floating-point numbers,
|
||||
|
||||
floor(log10((1 - b**-p) * b**emax))
|
||||
*/
|
||||
#undef FLT_MAX_10_EXP
|
||||
#undef DBL_MAX_10_EXP
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
|
||||
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
|
||||
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
|
||||
|
||||
/* Maximum representable finite floating-point number,
|
||||
|
||||
(1 - b**-p) * b**emax
|
||||
*/
|
||||
#undef FLT_MAX
|
||||
#undef DBL_MAX
|
||||
#undef LDBL_MAX
|
||||
#define FLT_MAX __FLT_MAX__
|
||||
#define DBL_MAX __DBL_MAX__
|
||||
#define LDBL_MAX __LDBL_MAX__
|
||||
|
||||
/* The difference between 1 and the least value greater than 1 that is
|
||||
representable in the given floating point type, b**1-p. */
|
||||
#undef FLT_EPSILON
|
||||
#undef DBL_EPSILON
|
||||
#undef LDBL_EPSILON
|
||||
#define FLT_EPSILON __FLT_EPSILON__
|
||||
#define DBL_EPSILON __DBL_EPSILON__
|
||||
#define LDBL_EPSILON __LDBL_EPSILON__
|
||||
|
||||
/* Minimum normalized positive floating-point number, b**(emin - 1). */
|
||||
#undef FLT_MIN
|
||||
#undef DBL_MIN
|
||||
#undef LDBL_MIN
|
||||
#define FLT_MIN __FLT_MIN__
|
||||
#define DBL_MIN __DBL_MIN__
|
||||
#define LDBL_MIN __LDBL_MIN__
|
||||
|
||||
/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
|
||||
/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
|
||||
#undef FLT_ROUNDS
|
||||
#define FLT_ROUNDS 1
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* The floating-point expression evaluation method.
|
||||
-1 indeterminate
|
||||
0 evaluate all operations and constants just to the range and
|
||||
precision of the type
|
||||
1 evaluate operations and constants of type float and double
|
||||
to the range and precision of the double type, evaluate
|
||||
long double operations and constants to the range and
|
||||
precision of the long double type
|
||||
2 evaluate all operations and constants to the range and
|
||||
precision of the long double type
|
||||
|
||||
??? This ought to change with the setting of the fp control word;
|
||||
the value provided by the compiler assumes the widest setting. */
|
||||
#undef FLT_EVAL_METHOD
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
|
||||
/* Number of decimal digits, n, such that any floating-point number in the
|
||||
widest supported floating type with pmax radix b digits can be rounded
|
||||
to a floating-point number with n decimal digits and back again without
|
||||
change to the value,
|
||||
|
||||
pmax * log10(b) if b is a power of 10
|
||||
ceil(1 + pmax * log10(b)) otherwise
|
||||
*/
|
||||
#undef DECIMAL_DIG
|
||||
#define DECIMAL_DIG __DECIMAL_DIG__
|
||||
|
||||
#endif /* C99 */
|
||||
|
||||
#ifdef __STDC_WANT_DEC_FP__
|
||||
/* Draft Technical Report 24732, extension for decimal floating-point
|
||||
arithmetic: Characteristic of decimal floating types <float.h>. */
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand, p. */
|
||||
#undef DEC32_MANT_DIG
|
||||
#undef DEC64_MANT_DIG
|
||||
#undef DEC128_MANT_DIG
|
||||
#define DEC32_MANT_DIG __DEC32_MANT_DIG__
|
||||
#define DEC64_MANT_DIG __DEC64_MANT_DIG__
|
||||
#define DEC128_MANT_DIG __DEC128_MANT_DIG__
|
||||
|
||||
/* Minimum exponent. */
|
||||
#undef DEC32_MIN_EXP
|
||||
#undef DEC64_MIN_EXP
|
||||
#undef DEC128_MIN_EXP
|
||||
#define DEC32_MIN_EXP __DEC32_MIN_EXP__
|
||||
#define DEC64_MIN_EXP __DEC64_MIN_EXP__
|
||||
#define DEC128_MIN_EXP __DEC128_MIN_EXP__
|
||||
|
||||
/* Maximum exponent. */
|
||||
#undef DEC32_MAX_EXP
|
||||
#undef DEC64_MAX_EXP
|
||||
#undef DEC128_MAX_EXP
|
||||
#define DEC32_MAX_EXP __DEC32_MAX_EXP__
|
||||
#define DEC64_MAX_EXP __DEC64_MAX_EXP__
|
||||
#define DEC128_MAX_EXP __DEC128_MAX_EXP__
|
||||
|
||||
/* Maximum representable finite decimal floating-point number
|
||||
(there are 6, 15, and 33 9s after the decimal points respectively). */
|
||||
#undef DEC32_MAX
|
||||
#undef DEC64_MAX
|
||||
#undef DEC128_MAX
|
||||
#define DEC32_MAX __DEC32_MAX__
|
||||
#define DEC64_MAX __DEC64_MAX__
|
||||
#define DEC128_MAX __DEC128_MAX__
|
||||
|
||||
/* The difference between 1 and the least value greater than 1 that is
|
||||
representable in the given floating point type. */
|
||||
#undef DEC32_EPSILON
|
||||
#undef DEC64_EPSILON
|
||||
#undef DEC128_EPSILON
|
||||
#define DEC32_EPSILON __DEC32_EPSILON__
|
||||
#define DEC64_EPSILON __DEC64_EPSILON__
|
||||
#define DEC128_EPSILON __DEC128_EPSILON__
|
||||
|
||||
/* Minimum normalized positive floating-point number. */
|
||||
#undef DEC32_MIN
|
||||
#undef DEC64_MIN
|
||||
#undef DEC128_MIN
|
||||
#define DEC32_MIN __DEC32_MIN__
|
||||
#define DEC64_MIN __DEC64_MIN__
|
||||
#define DEC128_MIN __DEC128_MIN__
|
||||
|
||||
/* Minimum denormalized positive floating-point number. */
|
||||
#undef DEC32_DEN
|
||||
#undef DEC64_DEN
|
||||
#undef DEC128_DEN
|
||||
#define DEC32_DEN __DEC32_DEN__
|
||||
#define DEC64_DEN __DEC64_DEN__
|
||||
#define DEC128_DEN __DEC128_DEN__
|
||||
|
||||
/* The floating-point expression evaluation method.
|
||||
-1 indeterminate
|
||||
0 evaluate all operations and constants just to the range and
|
||||
precision of the type
|
||||
1 evaluate operations and constants of type _Decimal32
|
||||
and _Decimal64 to the range and precision of the _Decimal64
|
||||
type, evaluate _Decimal128 operations and constants to the
|
||||
range and precision of the _Decimal128 type;
|
||||
2 evaluate all operations and constants to the range and
|
||||
precision of the _Decimal128 type. */
|
||||
|
||||
#undef DECFLT_EVAL_METHOD
|
||||
#define DECFLT_EVAL_METHOD __DECFLT_EVAL_METHOD__
|
||||
|
||||
#endif /* __STDC_WANT_DEC_FP__ */
|
||||
|
||||
#endif /* _FLOAT_H___ */
|
|
@ -0,0 +1,48 @@
|
|||
/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.9 Alternative spellings <iso646.h>
|
||||
*/
|
||||
|
||||
#ifndef _ISO646_H
|
||||
#define _ISO646_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
/* Interface for the NXConstantString class for Objective-C.
|
||||
Copyright (C) 1995, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Pieter J. Schoenmakers <tiggr@es.ele.tue.nl>
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __nxconstantstring_INCLUDE_GNU
|
||||
#define __nxconstantstring_INCLUDE_GNU
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@interface NXConstantString: Object
|
||||
{
|
||||
char *c_string;
|
||||
unsigned int len;
|
||||
}
|
||||
|
||||
-(const char *) cString;
|
||||
-(unsigned int) length;
|
||||
|
||||
@end
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,132 @@
|
|||
/* Interface for the Object class for Objective-C.
|
||||
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files compiled
|
||||
with GCC to produce an executable, this does not cause the resulting
|
||||
executable to be covered by the GNU General Public License. This
|
||||
exception does not however invalidate any other reasons why the
|
||||
executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __object_INCLUDE_GNU
|
||||
#define __object_INCLUDE_GNU
|
||||
|
||||
#include "objc.h"
|
||||
#include "typedstream.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All classes are derived from Object. As such,
|
||||
* this is the overhead tacked onto those objects.
|
||||
*/
|
||||
@interface Object
|
||||
{
|
||||
Class isa; /* A pointer to the instance's class structure */
|
||||
}
|
||||
|
||||
/* Initializing classes and instances */
|
||||
+ initialize;
|
||||
- init;
|
||||
|
||||
/* Creating, freeing, and copying instances */
|
||||
+ new;
|
||||
+ alloc;
|
||||
- free;
|
||||
- copy;
|
||||
- shallowCopy;
|
||||
- deepen;
|
||||
- deepCopy;
|
||||
|
||||
/* Identifying classes */
|
||||
- (Class)class;
|
||||
- (Class)superClass;
|
||||
- (MetaClass)metaClass;
|
||||
- (const char *)name;
|
||||
|
||||
/* Identifying and comparing objects */
|
||||
- self;
|
||||
- (unsigned int)hash;
|
||||
- (BOOL)isEqual:anObject;
|
||||
- (int)compare:anotherObject;
|
||||
|
||||
/* Testing object type */
|
||||
- (BOOL)isMetaClass;
|
||||
- (BOOL)isClass;
|
||||
- (BOOL)isInstance;
|
||||
|
||||
/* Testing inheritance relationships */
|
||||
- (BOOL)isKindOf:(Class)aClassObject;
|
||||
- (BOOL)isMemberOf:(Class)aClassObject;
|
||||
- (BOOL)isKindOfClassNamed:(const char *)aClassName;
|
||||
- (BOOL)isMemberOfClassNamed:(const char *)aClassName;
|
||||
|
||||
/* Testing class functionality */
|
||||
+ (BOOL)instancesRespondTo:(SEL)aSel;
|
||||
- (BOOL)respondsTo:(SEL)aSel;
|
||||
|
||||
/* Testing protocol conformance */
|
||||
- (BOOL)conformsTo:(Protocol*)aProtocol;
|
||||
|
||||
/* Introspection */
|
||||
+ (IMP)instanceMethodFor:(SEL)aSel;
|
||||
- (IMP)methodFor:(SEL)aSel;
|
||||
+ (struct objc_method_description *)descriptionForInstanceMethod:(SEL)aSel;
|
||||
- (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
|
||||
|
||||
/* Sending messages determined at run time */
|
||||
- perform:(SEL)aSel;
|
||||
- perform:(SEL)aSel with:anObject;
|
||||
- perform:(SEL)aSel with:anObject1 with:anObject2;
|
||||
|
||||
/* Forwarding */
|
||||
- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
|
||||
- (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
|
||||
|
||||
/* Posing */
|
||||
+ poseAs:(Class)aClassObject;
|
||||
- (Class)transmuteClassTo:(Class)aClassObject;
|
||||
|
||||
/* Enforcing intentions */
|
||||
- subclassResponsibility:(SEL)aSel;
|
||||
- notImplemented:(SEL)aSel;
|
||||
- shouldNotImplement:(SEL)aSel;
|
||||
|
||||
/* Error handling */
|
||||
- doesNotRecognize:(SEL)aSel;
|
||||
- error:(const char *)aString, ...;
|
||||
|
||||
/* Archiving */
|
||||
+ (int)version;
|
||||
+ setVersion:(int)aVersion;
|
||||
+ (int)streamVersion: (TypedStream*)aStream;
|
||||
|
||||
- read: (TypedStream*)aStream;
|
||||
- write: (TypedStream*)aStream;
|
||||
- awake;
|
||||
|
||||
@end
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,63 @@
|
|||
/* Declare the class Protocol for Objective C programs.
|
||||
Copyright (C) 1993, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __Protocol_INCLUDE_GNU
|
||||
#define __Protocol_INCLUDE_GNU
|
||||
|
||||
#include "Object.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@interface Protocol : Object
|
||||
{
|
||||
@private
|
||||
char *protocol_name;
|
||||
struct objc_protocol_list *protocol_list;
|
||||
struct objc_method_description_list *instance_methods, *class_methods;
|
||||
}
|
||||
|
||||
/* Obtaining attributes intrinsic to the protocol */
|
||||
|
||||
- (const char *)name;
|
||||
|
||||
/* Testing protocol conformance */
|
||||
|
||||
- (BOOL) conformsTo: (Protocol *)aProtocolObject;
|
||||
|
||||
/* Looking up information specific to a protocol */
|
||||
|
||||
- (struct objc_method_description *) descriptionForInstanceMethod:(SEL)aSel;
|
||||
- (struct objc_method_description *) descriptionForClassMethod:(SEL)aSel;
|
||||
|
||||
@end
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not __Protocol_INCLUDE_GNU */
|
|
@ -0,0 +1,107 @@
|
|||
/* Encoding of types for Objective C.
|
||||
Copyright (C) 1993, 1997, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
Author: Kresten Krab Thorup
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __encoding_INCLUDE_GNU
|
||||
#define __encoding_INCLUDE_GNU
|
||||
|
||||
#include "objc-api.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define _C_CONST 'r'
|
||||
#define _C_IN 'n'
|
||||
#define _C_INOUT 'N'
|
||||
#define _C_OUT 'o'
|
||||
#define _C_BYCOPY 'O'
|
||||
#define _C_BYREF 'R'
|
||||
#define _C_ONEWAY 'V'
|
||||
#define _C_GCINVISIBLE '!'
|
||||
|
||||
#define _F_CONST 0x01
|
||||
#define _F_IN 0x01
|
||||
#define _F_OUT 0x02
|
||||
#define _F_INOUT 0x03
|
||||
#define _F_BYCOPY 0x04
|
||||
#define _F_BYREF 0x08
|
||||
#define _F_ONEWAY 0x10
|
||||
#define _F_GCINVISIBLE 0x20
|
||||
|
||||
int objc_aligned_size (const char *type);
|
||||
int objc_sizeof_type (const char *type);
|
||||
int objc_alignof_type (const char *type);
|
||||
int objc_aligned_size (const char *type);
|
||||
int objc_promoted_size (const char *type);
|
||||
|
||||
const char *objc_skip_type_qualifiers (const char *type);
|
||||
const char *objc_skip_typespec (const char *type);
|
||||
const char *objc_skip_offset (const char *type);
|
||||
const char *objc_skip_argspec (const char *type);
|
||||
int method_get_number_of_arguments (struct objc_method *);
|
||||
int method_get_sizeof_arguments (struct objc_method *);
|
||||
|
||||
char *method_get_first_argument (struct objc_method *,
|
||||
arglist_t argframe,
|
||||
const char **type);
|
||||
char *method_get_next_argument (arglist_t argframe,
|
||||
const char **type);
|
||||
char *method_get_nth_argument (struct objc_method *m,
|
||||
arglist_t argframe,
|
||||
int arg,
|
||||
const char **type);
|
||||
|
||||
unsigned objc_get_type_qualifiers (const char *type);
|
||||
|
||||
|
||||
struct objc_struct_layout
|
||||
{
|
||||
const char *original_type;
|
||||
const char *type;
|
||||
const char *prev_type;
|
||||
unsigned int record_size;
|
||||
unsigned int record_align;
|
||||
};
|
||||
|
||||
void objc_layout_structure (const char *type,
|
||||
struct objc_struct_layout *layout);
|
||||
BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
|
||||
void objc_layout_finish_structure (struct objc_struct_layout *layout,
|
||||
unsigned int *size,
|
||||
unsigned int *align);
|
||||
void objc_layout_structure_get_info (struct objc_struct_layout *layout,
|
||||
unsigned int *offset,
|
||||
unsigned int *align,
|
||||
const char **type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __encoding_INCLUDE_GNU */
|
|
@ -0,0 +1,216 @@
|
|||
/* Hash tables for Objective C method dispatch.
|
||||
Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
|
||||
#ifndef __hash_INCLUDE_GNU
|
||||
#define __hash_INCLUDE_GNU
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include "objc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* This data structure is used to hold items
|
||||
* stored in a hash table. Each node holds
|
||||
* a key/value pair.
|
||||
*
|
||||
* Items in the cache are really of type void *.
|
||||
*/
|
||||
typedef struct cache_node
|
||||
{
|
||||
struct cache_node *next; /* Pointer to next entry on the list.
|
||||
NULL indicates end of list. */
|
||||
const void *key; /* Key used to locate the value. Used
|
||||
to locate value when more than one
|
||||
key computes the same hash
|
||||
value. */
|
||||
void *value; /* Value stored for the key. */
|
||||
} *node_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* This data type is the function that computes a hash code given a key.
|
||||
* Therefore, the key can be a pointer to anything and the function specific
|
||||
* to the key type.
|
||||
*
|
||||
* Unfortunately there is a mutual data structure reference problem with this
|
||||
* typedef. Therefore, to remove compiler warnings the functions passed to
|
||||
* objc_hash_new will have to be casted to this type.
|
||||
*/
|
||||
typedef unsigned int (*hash_func_type) (void *, const void *);
|
||||
|
||||
/*
|
||||
* This data type is the function that compares two hash keys and returns an
|
||||
* integer greater than, equal to, or less than 0, according as the first
|
||||
* parameter is lexicographically greater than, equal to, or less than the
|
||||
* second.
|
||||
*/
|
||||
|
||||
typedef int (*compare_func_type) (const void *, const void *);
|
||||
|
||||
|
||||
/*
|
||||
* This data structure is the cache.
|
||||
*
|
||||
* It must be passed to all of the hashing routines
|
||||
* (except for new).
|
||||
*/
|
||||
typedef struct cache
|
||||
{
|
||||
/* Variables used to implement the hash itself. */
|
||||
node_ptr *node_table; /* Pointer to an array of hash nodes. */
|
||||
/* Variables used to track the size of the hash table so to determine
|
||||
when to resize it. */
|
||||
unsigned int size; /* Number of buckets allocated for the hash table
|
||||
(number of array entries allocated for
|
||||
"node_table"). Must be a power of two. */
|
||||
unsigned int used; /* Current number of entries in the hash table. */
|
||||
unsigned int mask; /* Precomputed mask. */
|
||||
|
||||
/* Variables used to implement indexing through the hash table. */
|
||||
|
||||
unsigned int last_bucket; /* Tracks which entry in the array where
|
||||
the last value was returned. */
|
||||
/* Function used to compute a hash code given a key.
|
||||
This function is specified when the hash table is created. */
|
||||
hash_func_type hash_func;
|
||||
/* Function used to compare two hash keys to see if they are equal. */
|
||||
compare_func_type compare_func;
|
||||
} *cache_ptr;
|
||||
|
||||
|
||||
/* Two important hash tables. */
|
||||
extern cache_ptr module_hash_table, class_hash_table;
|
||||
|
||||
/* Allocate and initialize a hash table. */
|
||||
|
||||
cache_ptr objc_hash_new (unsigned int size,
|
||||
hash_func_type hash_func,
|
||||
compare_func_type compare_func);
|
||||
|
||||
/* Deallocate all of the hash nodes and the cache itself. */
|
||||
|
||||
void objc_hash_delete (cache_ptr cache);
|
||||
|
||||
/* Add the key/value pair to the hash table. If the
|
||||
hash table reaches a level of fullness then it will be resized.
|
||||
|
||||
assert if the key is already in the hash. */
|
||||
|
||||
void objc_hash_add (cache_ptr *cachep, const void *key, void *value);
|
||||
|
||||
/* Remove the key/value pair from the hash table.
|
||||
assert if the key isn't in the table. */
|
||||
|
||||
void objc_hash_remove (cache_ptr cache, const void *key);
|
||||
|
||||
/* Used to index through the hash table. Start with NULL
|
||||
to get the first entry.
|
||||
|
||||
Successive calls pass the value returned previously.
|
||||
** Don't modify the hash during this operation ***
|
||||
|
||||
Cache nodes are returned such that key or value can
|
||||
be extracted. */
|
||||
|
||||
node_ptr objc_hash_next (cache_ptr cache, node_ptr node);
|
||||
|
||||
/* Used to return a value from a hash table using a given key. */
|
||||
|
||||
void *objc_hash_value_for_key (cache_ptr cache, const void *key);
|
||||
|
||||
/* Used to determine if the given key exists in the hash table */
|
||||
|
||||
BOOL objc_hash_is_key_in_hash (cache_ptr cache, const void *key);
|
||||
|
||||
/************************************************
|
||||
|
||||
Useful hashing functions.
|
||||
|
||||
Declared inline for your pleasure.
|
||||
|
||||
************************************************/
|
||||
|
||||
/* Calculate a hash code by performing some
|
||||
manipulation of the key pointer. (Use the lowest bits
|
||||
except for those likely to be 0 due to alignment.) */
|
||||
|
||||
static inline unsigned int
|
||||
objc_hash_ptr (cache_ptr cache, const void *key)
|
||||
{
|
||||
return ((size_t)key / sizeof (void *)) & cache->mask;
|
||||
}
|
||||
|
||||
|
||||
/* Calculate a hash code by iterating over a NULL
|
||||
terminate string. */
|
||||
static inline unsigned int
|
||||
objc_hash_string (cache_ptr cache, const void *key)
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
unsigned int ctr = 0;
|
||||
const char *ckey = (const char *) key;
|
||||
|
||||
while (*ckey) {
|
||||
ret ^= *ckey++ << ctr;
|
||||
ctr = (ctr + 1) % sizeof (void *);
|
||||
}
|
||||
|
||||
return ret & cache->mask;
|
||||
}
|
||||
|
||||
|
||||
/* Compare two pointers for equality. */
|
||||
static inline int
|
||||
objc_compare_ptrs (const void *k1, const void *k2)
|
||||
{
|
||||
return (k1 == k2);
|
||||
}
|
||||
|
||||
|
||||
/* Compare two strings. */
|
||||
static inline int
|
||||
objc_compare_strings (const void *k1, const void *k2)
|
||||
{
|
||||
if (k1 == k2)
|
||||
return 1;
|
||||
else if (k1 == 0 || k2 == 0)
|
||||
return 0;
|
||||
else
|
||||
return ! strcmp ((const char *) k1, (const char *) k2);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* not __hash_INCLUDE_GNU */
|
|
@ -0,0 +1,619 @@
|
|||
/* GNU Objective-C Runtime API.
|
||||
Copyright (C) 1993, 1995, 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files compiled
|
||||
with GCC to produce an executable, this does not cause the resulting
|
||||
executable to be covered by the GNU General Public License. This
|
||||
exception does not however invalidate any other reasons why the
|
||||
executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __objc_api_INCLUDE_GNU
|
||||
#define __objc_api_INCLUDE_GNU
|
||||
|
||||
#include "objc.h"
|
||||
#include "hash.h"
|
||||
#include "thr.h"
|
||||
#include "objc-decls.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For functions which return Method_t */
|
||||
#define METHOD_NULL (Method_t)0
|
||||
/* Boolean typedefs */
|
||||
/* Method descriptor returned by introspective Object methods.
|
||||
This is really just the first part of the more complete objc_method
|
||||
structure defined below and used internally by the runtime. */
|
||||
struct objc_method_description
|
||||
{
|
||||
SEL name; /* this is a selector, not a string */
|
||||
char *types; /* type encoding */
|
||||
};
|
||||
|
||||
/* Filer types used to describe Ivars and Methods. */
|
||||
#define _C_ID '@'
|
||||
#define _C_CLASS '#'
|
||||
#define _C_SEL ':'
|
||||
#define _C_CHR 'c'
|
||||
#define _C_UCHR 'C'
|
||||
#define _C_SHT 's'
|
||||
#define _C_USHT 'S'
|
||||
#define _C_INT 'i'
|
||||
#define _C_UINT 'I'
|
||||
#define _C_LNG 'l'
|
||||
#define _C_ULNG 'L'
|
||||
#define _C_LNG_LNG 'q'
|
||||
#define _C_ULNG_LNG 'Q'
|
||||
#define _C_FLT 'f'
|
||||
#define _C_DBL 'd'
|
||||
#define _C_BFLD 'b'
|
||||
#define _C_BOOL 'B'
|
||||
#define _C_VOID 'v'
|
||||
#define _C_UNDEF '?'
|
||||
#define _C_PTR '^'
|
||||
#define _C_CHARPTR '*'
|
||||
#define _C_ATOM '%'
|
||||
#define _C_ARY_B '['
|
||||
#define _C_ARY_E ']'
|
||||
#define _C_UNION_B '('
|
||||
#define _C_UNION_E ')'
|
||||
#define _C_STRUCT_B '{'
|
||||
#define _C_STRUCT_E '}'
|
||||
#define _C_VECTOR '!'
|
||||
#define _C_COMPLEX 'j'
|
||||
|
||||
|
||||
/* Error handling
|
||||
|
||||
Call objc_error() or objc_verror() to record an error; this error
|
||||
routine will generally exit the program but not necessarily if the
|
||||
user has installed his own error handler.
|
||||
|
||||
Call objc_set_error_handler to assign your own function for
|
||||
handling errors. The function should return YES if it is ok
|
||||
to continue execution, or return NO or just abort if the
|
||||
program should be stopped. The default error handler is just to
|
||||
print a message on stderr.
|
||||
|
||||
The error handler function should be of type objc_error_handler
|
||||
The first parameter is an object instance of relevance.
|
||||
The second parameter is an error code.
|
||||
The third parameter is a format string in the printf style.
|
||||
The fourth parameter is a variable list of arguments. */
|
||||
extern void objc_error(id object, int code, const char* fmt, ...);
|
||||
extern void objc_verror(id object, int code, const char* fmt, va_list ap);
|
||||
typedef BOOL (*objc_error_handler)(id, int code, const char *fmt, va_list ap);
|
||||
extern objc_error_handler objc_set_error_handler(objc_error_handler func);
|
||||
|
||||
/* Error codes
|
||||
These are used by the runtime library, and your
|
||||
error handling may use them to determine if the error is
|
||||
hard or soft thus whether execution can continue or abort. */
|
||||
#define OBJC_ERR_UNKNOWN 0 /* Generic error */
|
||||
|
||||
#define OBJC_ERR_OBJC_VERSION 1 /* Incorrect runtime version */
|
||||
#define OBJC_ERR_GCC_VERSION 2 /* Incorrect compiler version */
|
||||
#define OBJC_ERR_MODULE_SIZE 3 /* Bad module size */
|
||||
#define OBJC_ERR_PROTOCOL_VERSION 4 /* Incorrect protocol version */
|
||||
|
||||
#define OBJC_ERR_MEMORY 10 /* Out of memory */
|
||||
|
||||
#define OBJC_ERR_RECURSE_ROOT 20 /* Attempt to archive the root
|
||||
object more than once. */
|
||||
#define OBJC_ERR_BAD_DATA 21 /* Didn't read expected data */
|
||||
#define OBJC_ERR_BAD_KEY 22 /* Bad key for object */
|
||||
#define OBJC_ERR_BAD_CLASS 23 /* Unknown class */
|
||||
#define OBJC_ERR_BAD_TYPE 24 /* Bad type specification */
|
||||
#define OBJC_ERR_NO_READ 25 /* Cannot read stream */
|
||||
#define OBJC_ERR_NO_WRITE 26 /* Cannot write stream */
|
||||
#define OBJC_ERR_STREAM_VERSION 27 /* Incorrect stream version */
|
||||
#define OBJC_ERR_BAD_OPCODE 28 /* Bad opcode */
|
||||
|
||||
#define OBJC_ERR_UNIMPLEMENTED 30 /* Method is not implemented */
|
||||
|
||||
#define OBJC_ERR_BAD_STATE 40 /* Bad thread state */
|
||||
|
||||
/* Set this variable nonzero to print a line describing each
|
||||
message that is sent. (this is currently disabled) */
|
||||
extern BOOL objc_trace;
|
||||
|
||||
|
||||
/* For every class which happens to have statically allocated instances in
|
||||
this module, one OBJC_STATIC_INSTANCES is allocated by the compiler.
|
||||
INSTANCES is NULL terminated and points to all statically allocated
|
||||
instances of this class. */
|
||||
struct objc_static_instances
|
||||
{
|
||||
char *class_name;
|
||||
#ifdef __cplusplus
|
||||
id instances[1];
|
||||
#else
|
||||
id instances[0];
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Whereas a Module (defined further down) is the root (typically) of a file,
|
||||
a Symtab is the root of the class and category definitions within the
|
||||
module.
|
||||
|
||||
A Symtab contains a variable length array of pointers to classes and
|
||||
categories defined in the module. */
|
||||
typedef struct objc_symtab {
|
||||
unsigned long sel_ref_cnt; /* Unknown. */
|
||||
SEL refs; /* Unknown. */
|
||||
unsigned short cls_def_cnt; /* Number of classes compiled
|
||||
(defined) in the module. */
|
||||
unsigned short cat_def_cnt; /* Number of categories
|
||||
compiled (defined) in the
|
||||
module. */
|
||||
|
||||
void *defs[1]; /* Variable array of pointers.
|
||||
cls_def_cnt of type Class
|
||||
followed by cat_def_cnt of
|
||||
type Category_t, followed
|
||||
by a NULL terminated array
|
||||
of objc_static_instances. */
|
||||
} Symtab, *Symtab_t;
|
||||
|
||||
|
||||
/*
|
||||
** The compiler generates one of these structures for each module that
|
||||
** composes the executable (eg main.m).
|
||||
**
|
||||
** This data structure is the root of the definition tree for the module.
|
||||
**
|
||||
** A collect program runs between ld stages and creates a ObjC ctor array.
|
||||
** That array holds a pointer to each module structure of the executable.
|
||||
*/
|
||||
typedef struct objc_module {
|
||||
unsigned long version; /* Compiler revision. */
|
||||
unsigned long size; /* sizeof(Module). */
|
||||
const char* name; /* Name of the file where the
|
||||
module was generated. The
|
||||
name includes the path. */
|
||||
|
||||
Symtab_t symtab; /* Pointer to the Symtab of
|
||||
the module. The Symtab
|
||||
holds an array of
|
||||
pointers to
|
||||
the classes and categories
|
||||
defined in the module. */
|
||||
} Module, *Module_t;
|
||||
|
||||
|
||||
/*
|
||||
** The compiler generates one of these structures for a class that has
|
||||
** instance variables defined in its specification.
|
||||
*/
|
||||
typedef struct objc_ivar {
|
||||
const char* ivar_name; /* Name of the instance
|
||||
variable as entered in the
|
||||
class definition. */
|
||||
const char* ivar_type; /* Description of the Ivar's
|
||||
type. Useful for
|
||||
debuggers. */
|
||||
int ivar_offset; /* Byte offset from the base
|
||||
address of the instance
|
||||
structure to the variable. */
|
||||
} *Ivar_t;
|
||||
|
||||
typedef struct objc_ivar_list {
|
||||
int ivar_count; /* Number of structures (Ivar)
|
||||
contained in the list. One
|
||||
structure per instance
|
||||
variable defined in the
|
||||
class. */
|
||||
struct objc_ivar ivar_list[1]; /* Variable length
|
||||
structure. */
|
||||
} IvarList, *IvarList_t;
|
||||
|
||||
|
||||
/*
|
||||
** The compiler generates one (or more) of these structures for a class that
|
||||
** has methods defined in its specification.
|
||||
**
|
||||
** The implementation of a class can be broken into separate pieces in a file
|
||||
** and categories can break them across modules. To handle this problem is a
|
||||
** singly linked list of methods.
|
||||
*/
|
||||
typedef struct objc_method {
|
||||
SEL method_name; /* This variable is the method's
|
||||
name. It is a char*.
|
||||
The unique integer passed to
|
||||
objc_msg_send is a char* too.
|
||||
It is compared against
|
||||
method_name using strcmp. */
|
||||
const char* method_types; /* Description of the method's
|
||||
parameter list. Useful for
|
||||
debuggers. */
|
||||
IMP method_imp; /* Address of the method in the
|
||||
executable. */
|
||||
} Method, *Method_t;
|
||||
|
||||
typedef struct objc_method_list {
|
||||
struct objc_method_list* method_next; /* This variable is used to link
|
||||
a method list to another. It
|
||||
is a singly linked list. */
|
||||
int method_count; /* Number of methods defined in
|
||||
this structure. */
|
||||
Method method_list[1]; /* Variable length
|
||||
structure. */
|
||||
} MethodList, *MethodList_t;
|
||||
|
||||
struct objc_protocol_list {
|
||||
struct objc_protocol_list *next;
|
||||
size_t count;
|
||||
Protocol *list[1];
|
||||
};
|
||||
|
||||
/*
|
||||
** This is used to assure consistent access to the info field of
|
||||
** classes
|
||||
*/
|
||||
#ifndef HOST_BITS_PER_LONG
|
||||
#define HOST_BITS_PER_LONG (sizeof(long)*8)
|
||||
#endif
|
||||
|
||||
#define __CLS_INFO(cls) ((cls)->info)
|
||||
#define __CLS_ISINFO(cls, mask) ((__CLS_INFO(cls)&mask)==mask)
|
||||
#define __CLS_SETINFO(cls, mask) (__CLS_INFO(cls) |= mask)
|
||||
|
||||
/* The structure is of type MetaClass */
|
||||
#define _CLS_META 0x2L
|
||||
#define CLS_ISMETA(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_META))
|
||||
|
||||
|
||||
/* The structure is of type Class */
|
||||
#define _CLS_CLASS 0x1L
|
||||
#define CLS_ISCLASS(cls) ((cls)&&__CLS_ISINFO(cls, _CLS_CLASS))
|
||||
|
||||
/*
|
||||
** The class is initialized within the runtime. This means that
|
||||
** it has had correct super and sublinks assigned
|
||||
*/
|
||||
#define _CLS_RESOLV 0x8L
|
||||
#define CLS_ISRESOLV(cls) __CLS_ISINFO(cls, _CLS_RESOLV)
|
||||
#define CLS_SETRESOLV(cls) __CLS_SETINFO(cls, _CLS_RESOLV)
|
||||
|
||||
/*
|
||||
** The class has been send a +initialize message or a such is not
|
||||
** defined for this class
|
||||
*/
|
||||
#define _CLS_INITIALIZED 0x04L
|
||||
#define CLS_ISINITIALIZED(cls) __CLS_ISINFO(cls, _CLS_INITIALIZED)
|
||||
#define CLS_SETINITIALIZED(cls) __CLS_SETINFO(cls, _CLS_INITIALIZED)
|
||||
|
||||
/*
|
||||
** The class number of this class. This must be the same for both the
|
||||
** class and its meta class object
|
||||
*/
|
||||
#define CLS_GETNUMBER(cls) (__CLS_INFO(cls) >> (HOST_BITS_PER_LONG/2))
|
||||
#define CLS_SETNUMBER(cls, num) \
|
||||
({ (cls)->info <<= (HOST_BITS_PER_LONG/2); \
|
||||
(cls)->info >>= (HOST_BITS_PER_LONG/2); \
|
||||
__CLS_SETINFO(cls, (((unsigned long)num) << (HOST_BITS_PER_LONG/2))); })
|
||||
|
||||
/*
|
||||
** The compiler generates one of these structures for each category. A class
|
||||
** may have many categories and contain both instance and factory methods.
|
||||
*/
|
||||
typedef struct objc_category {
|
||||
const char* category_name; /* Name of the category. Name
|
||||
contained in the () of the
|
||||
category definition. */
|
||||
const char* class_name; /* Name of the class to which
|
||||
the category belongs. */
|
||||
MethodList_t instance_methods; /* Linked list of instance
|
||||
methods defined in the
|
||||
category. NULL indicates no
|
||||
instance methods defined. */
|
||||
MethodList_t class_methods; /* Linked list of factory
|
||||
methods defined in the
|
||||
category. NULL indicates no
|
||||
class methods defined. */
|
||||
struct objc_protocol_list *protocols; /* List of Protocols
|
||||
conformed to */
|
||||
} Category, *Category_t;
|
||||
|
||||
/*
|
||||
** Structure used when a message is send to a class's super class. The
|
||||
** compiler generates one of these structures and passes it to
|
||||
** objc_msg_super.
|
||||
*/
|
||||
typedef struct objc_super {
|
||||
id self; /* Id of the object sending
|
||||
the message. */
|
||||
#ifdef __cplusplus
|
||||
Class super_class;
|
||||
#else
|
||||
Class class; /* Object's super class. */
|
||||
#endif
|
||||
} Super, *Super_t;
|
||||
|
||||
IMP objc_msg_lookup_super(Super_t super, SEL sel);
|
||||
|
||||
retval_t objc_msg_sendv(id, SEL, arglist_t);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** This is a hook which is called by objc_lookup_class and
|
||||
** objc_get_class if the runtime is not able to find the class.
|
||||
** This may e.g. try to load in the class using dynamic loading.
|
||||
** The function is guaranteed to be passed a non-NULL name string.
|
||||
*/
|
||||
objc_EXPORT Class (*_objc_lookup_class)(const char *name);
|
||||
|
||||
/*
|
||||
** This is a hook which is called by __objc_exec_class every time a class
|
||||
** or a category is loaded into the runtime. This may e.g. help a
|
||||
** dynamic loader determine the classes that have been loaded when
|
||||
** an object file is dynamically linked in.
|
||||
*/
|
||||
objc_EXPORT void (*_objc_load_callback)(Class _class, Category* category);
|
||||
|
||||
/*
|
||||
** Hook functions for allocating, copying and disposing of instances
|
||||
*/
|
||||
objc_EXPORT id (*_objc_object_alloc)(Class _class);
|
||||
objc_EXPORT id (*_objc_object_copy)(id object);
|
||||
objc_EXPORT id (*_objc_object_dispose)(id object);
|
||||
|
||||
/*
|
||||
** Standard functions for memory allocation and disposal.
|
||||
** Users should use these functions in their ObjC programs so
|
||||
** that they work properly with garbage collectors as well as
|
||||
** can take advantage of the exception/error handling available.
|
||||
*/
|
||||
void *
|
||||
objc_malloc(size_t size);
|
||||
|
||||
void *
|
||||
objc_atomic_malloc(size_t size);
|
||||
|
||||
void *
|
||||
objc_valloc(size_t size);
|
||||
|
||||
void *
|
||||
objc_realloc(void *mem, size_t size);
|
||||
|
||||
void *
|
||||
objc_calloc(size_t nelem, size_t size);
|
||||
|
||||
void
|
||||
objc_free(void *mem);
|
||||
|
||||
/*
|
||||
** Hook functions for memory allocation and disposal.
|
||||
** This makes it easy to substitute garbage collection systems
|
||||
** such as Boehm's GC by assigning these function pointers
|
||||
** to the GC's allocation routines. By default these point
|
||||
** to the ANSI standard malloc, realloc, free, etc.
|
||||
**
|
||||
** Users should call the normal objc routines above for
|
||||
** memory allocation and disposal within their programs.
|
||||
*/
|
||||
objc_EXPORT void *(*_objc_malloc)(size_t);
|
||||
objc_EXPORT void *(*_objc_atomic_malloc)(size_t);
|
||||
objc_EXPORT void *(*_objc_valloc)(size_t);
|
||||
objc_EXPORT void *(*_objc_realloc)(void *, size_t);
|
||||
objc_EXPORT void *(*_objc_calloc)(size_t, size_t);
|
||||
objc_EXPORT void (*_objc_free)(void *);
|
||||
|
||||
/*
|
||||
** Hooks for method forwarding. This makes it easy to substitute a
|
||||
** library, such as ffcall, that implements closures, thereby avoiding
|
||||
** gcc's __builtin_apply problems. __objc_msg_forward2's result will
|
||||
** be preferred over that of __objc_msg_forward if both are set and
|
||||
** return non-NULL.
|
||||
*/
|
||||
objc_EXPORT IMP (*__objc_msg_forward)(SEL);
|
||||
objc_EXPORT IMP (*__objc_msg_forward2)(id, SEL);
|
||||
|
||||
Method_t class_get_class_method(MetaClass _class, SEL aSel);
|
||||
|
||||
Method_t class_get_instance_method(Class _class, SEL aSel);
|
||||
|
||||
Class class_pose_as(Class impostor, Class superclass);
|
||||
|
||||
Class objc_get_class(const char *name);
|
||||
|
||||
Class objc_lookup_class(const char *name);
|
||||
|
||||
Class objc_next_class(void **enum_state);
|
||||
|
||||
const char *sel_get_name(SEL selector);
|
||||
|
||||
const char *sel_get_type(SEL selector);
|
||||
|
||||
SEL sel_get_uid(const char *name);
|
||||
|
||||
SEL sel_get_any_uid(const char *name);
|
||||
|
||||
SEL sel_get_any_typed_uid(const char *name);
|
||||
|
||||
SEL sel_get_typed_uid(const char *name, const char*);
|
||||
|
||||
SEL sel_register_name(const char *name);
|
||||
|
||||
SEL sel_register_typed_name(const char *name, const char*type);
|
||||
|
||||
|
||||
BOOL sel_is_mapped (SEL aSel);
|
||||
|
||||
extern id class_create_instance(Class _class);
|
||||
|
||||
static inline const char *
|
||||
class_get_class_name(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class)?_class->name:((_class==Nil)?"Nil":0);
|
||||
}
|
||||
|
||||
static inline long
|
||||
class_get_instance_size(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class)?_class->instance_size:0;
|
||||
}
|
||||
|
||||
static inline MetaClass
|
||||
class_get_meta_class(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class)?_class->class_pointer:Nil;
|
||||
}
|
||||
|
||||
static inline Class
|
||||
class_get_super_class(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class)?_class->super_class:Nil;
|
||||
}
|
||||
|
||||
static inline int
|
||||
class_get_version(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class)?_class->version:-1;
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
class_is_class(Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class);
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
class_is_meta_class(Class _class)
|
||||
{
|
||||
return CLS_ISMETA(_class);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
class_set_version(Class _class, long version)
|
||||
{
|
||||
if (CLS_ISCLASS(_class))
|
||||
_class->version = version;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
class_get_gc_object_type (Class _class)
|
||||
{
|
||||
return CLS_ISCLASS(_class) ? _class->gc_object_type : NULL;
|
||||
}
|
||||
|
||||
/* Mark the instance variable as innaccessible to the garbage collector */
|
||||
extern void class_ivar_set_gcinvisible (Class _class,
|
||||
const char* ivarname,
|
||||
BOOL gcInvisible);
|
||||
|
||||
static inline IMP
|
||||
method_get_imp(Method_t method)
|
||||
{
|
||||
return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
|
||||
}
|
||||
|
||||
IMP get_imp (Class _class, SEL sel);
|
||||
|
||||
/* Redefine on NeXTSTEP so as not to conflict with system function */
|
||||
#ifdef __NeXT__
|
||||
#define object_copy gnu_object_copy
|
||||
#define object_dispose gnu_object_dispose
|
||||
#endif
|
||||
|
||||
id object_copy(id object);
|
||||
|
||||
id object_dispose(id object);
|
||||
|
||||
static inline Class
|
||||
object_get_class(id object)
|
||||
{
|
||||
return ((object!=nil)
|
||||
? (CLS_ISCLASS(object->class_pointer)
|
||||
? object->class_pointer
|
||||
: (CLS_ISMETA(object->class_pointer)
|
||||
? (Class)object
|
||||
: Nil))
|
||||
: Nil);
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
object_get_class_name(id object)
|
||||
{
|
||||
return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
|
||||
?object->class_pointer->name
|
||||
:((Class)object)->name)
|
||||
:"Nil");
|
||||
}
|
||||
|
||||
static inline MetaClass
|
||||
object_get_meta_class(id object)
|
||||
{
|
||||
return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
|
||||
?object->class_pointer->class_pointer
|
||||
:(CLS_ISMETA(object->class_pointer)
|
||||
?object->class_pointer
|
||||
:Nil))
|
||||
:Nil);
|
||||
}
|
||||
|
||||
static inline Class
|
||||
object_get_super_class
|
||||
(id object)
|
||||
{
|
||||
return ((object!=nil)?(CLS_ISCLASS(object->class_pointer)
|
||||
?object->class_pointer->super_class
|
||||
:(CLS_ISMETA(object->class_pointer)
|
||||
?((Class)object)->super_class
|
||||
:Nil))
|
||||
:Nil);
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
object_is_class (id object)
|
||||
{
|
||||
return ((object != nil) && CLS_ISMETA (object->class_pointer));
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
object_is_instance (id object)
|
||||
{
|
||||
return ((object != nil) && CLS_ISCLASS (object->class_pointer));
|
||||
}
|
||||
|
||||
static inline BOOL
|
||||
object_is_meta_class (id object)
|
||||
{
|
||||
return ((object != nil)
|
||||
&& !object_is_instance (object)
|
||||
&& !object_is_class (object));
|
||||
}
|
||||
|
||||
struct sarray*
|
||||
objc_get_uninstalled_dtable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* not __objc_api_INCLUDE_GNU */
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/* GNU Objective-C Extern helpers for Win32.
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files compiled
|
||||
with GCC to produce an executable, this does not cause the resulting
|
||||
executable to be covered by the GNU General Public License. This
|
||||
exception does not however invalidate any other reasons why the
|
||||
executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __objc_decls_INCLUDE_GNU
|
||||
#define __objc_decls_INCLUDE_GNU
|
||||
|
||||
#if defined (_WIN32) || defined (__WIN32__) || defined (WIN32)
|
||||
|
||||
# ifdef DLL_EXPORT /* defined by libtool (if required) */
|
||||
# define objc_EXPORT __declspec(dllexport)
|
||||
# define objc_DECLARE __declspec(dllexport)
|
||||
#else
|
||||
# define objc_EXPORT extern __declspec(dllimport)
|
||||
# define objc_DECLARE extern __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
# define objc_EXPORT extern
|
||||
# define objc_DECLARE
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __objc_decls_INCLUDE_GNU */
|
|
@ -0,0 +1,156 @@
|
|||
/* Generic single linked list to keep various information
|
||||
Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Kresten Krab Thorup.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files compiled with
|
||||
GCC to produce an executable, this does not cause the resulting executable
|
||||
to be covered by the GNU General Public License. This exception does not
|
||||
however invalidate any other reasons why the executable file might be
|
||||
covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __GNU_OBJC_LIST_H
|
||||
#define __GNU_OBJC_LIST_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
struct objc_list {
|
||||
void *head;
|
||||
struct objc_list *tail;
|
||||
};
|
||||
|
||||
/* Return a cons cell produced from (head . tail) */
|
||||
|
||||
static inline struct objc_list*
|
||||
list_cons(void* head, struct objc_list* tail)
|
||||
{
|
||||
struct objc_list* cell;
|
||||
|
||||
cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
|
||||
cell->head = head;
|
||||
cell->tail = tail;
|
||||
return cell;
|
||||
}
|
||||
|
||||
/* Return the length of a list, list_length(NULL) returns zero */
|
||||
|
||||
static inline int
|
||||
list_length(struct objc_list* list)
|
||||
{
|
||||
int i = 0;
|
||||
while(list)
|
||||
{
|
||||
i += 1;
|
||||
list = list->tail;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Return the Nth element of LIST, where N count from zero. If N
|
||||
larger than the list length, NULL is returned */
|
||||
|
||||
static inline void*
|
||||
list_nth(int indx, struct objc_list* list)
|
||||
{
|
||||
while(indx-- != 0)
|
||||
{
|
||||
if(list->tail)
|
||||
list = list->tail;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
return list->head;
|
||||
}
|
||||
|
||||
/* Remove the element at the head by replacing it by its successor */
|
||||
|
||||
static inline void
|
||||
list_remove_head(struct objc_list** list)
|
||||
{
|
||||
if ((*list)->tail)
|
||||
{
|
||||
struct objc_list* tail = (*list)->tail; /* fetch next */
|
||||
*(*list) = *tail; /* copy next to list head */
|
||||
objc_free(tail); /* free next */
|
||||
}
|
||||
else /* only one element in list */
|
||||
{
|
||||
objc_free(*list);
|
||||
(*list) = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Remove the element with `car' set to ELEMENT */
|
||||
|
||||
static inline void
|
||||
list_remove_elem(struct objc_list** list, void* elem)
|
||||
{
|
||||
while (*list) {
|
||||
if ((*list)->head == elem)
|
||||
list_remove_head(list);
|
||||
list = &((*list)->tail);
|
||||
}
|
||||
}
|
||||
|
||||
/* Map FUNCTION over all elements in LIST */
|
||||
|
||||
static inline void
|
||||
list_mapcar(struct objc_list* list, void(*function)(void*))
|
||||
{
|
||||
while(list)
|
||||
{
|
||||
(*function)(list->head);
|
||||
list = list->tail;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return element that has ELEM as car */
|
||||
|
||||
static inline struct objc_list**
|
||||
list_find(struct objc_list** list, void* elem)
|
||||
{
|
||||
while(*list)
|
||||
{
|
||||
if ((*list)->head == elem)
|
||||
return list;
|
||||
list = &((*list)->tail);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Free list (backwards recursive) */
|
||||
|
||||
static inline void
|
||||
list_free(struct objc_list* list)
|
||||
{
|
||||
if(list)
|
||||
{
|
||||
list_free(list->tail);
|
||||
objc_free(list);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* not __GNU_OBJC_LIST_H */
|
|
@ -0,0 +1,165 @@
|
|||
/* Basic data types for Objective C.
|
||||
Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __objc_INCLUDE_GNU
|
||||
#define __objc_INCLUDE_GNU
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*
|
||||
** Definition of the boolean type.
|
||||
*/
|
||||
#ifdef __vxworks
|
||||
typedef int BOOL;
|
||||
#else
|
||||
typedef unsigned char BOOL;
|
||||
#endif
|
||||
#define YES (BOOL)1
|
||||
#define NO (BOOL)0
|
||||
|
||||
/*
|
||||
** Definition of a selector. Selectors themselves are not unique, but
|
||||
** the sel_id is a unique identifier.
|
||||
*/
|
||||
typedef const struct objc_selector
|
||||
{
|
||||
void *sel_id;
|
||||
const char *sel_types;
|
||||
} *SEL;
|
||||
|
||||
inline static BOOL
|
||||
sel_eq (SEL s1, SEL s2)
|
||||
{
|
||||
if (s1 == 0 || s2 == 0)
|
||||
return s1 == s2;
|
||||
else
|
||||
return s1->sel_id == s2->sel_id;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** ObjC uses this typedef for untyped instances.
|
||||
*/
|
||||
typedef struct objc_object {
|
||||
struct objc_class* class_pointer;
|
||||
} *id;
|
||||
|
||||
/*
|
||||
** Definition of method type. When retrieving the implementation of a
|
||||
** method, this is type of the pointer returned. The idea of the
|
||||
** definition of IMP is to represent a 'pointer to a general function
|
||||
** taking an id, a SEL, followed by other unspecified arguments'. You
|
||||
** must always cast an IMP to a pointer to a function taking the
|
||||
** appropriate, specific types for that function, before calling it -
|
||||
** to make sure the appropriate arguments are passed to it. The code
|
||||
** generated by the compiler to perform method calls automatically
|
||||
** does this cast inside method calls.
|
||||
*/
|
||||
typedef id (*IMP)(id, SEL, ...);
|
||||
|
||||
/*
|
||||
** More simple types...
|
||||
*/
|
||||
#define nil (id)0 /* id of Nil instance */
|
||||
#define Nil (Class)0 /* id of Nil class */
|
||||
typedef char *STR; /* String alias */
|
||||
|
||||
/*
|
||||
** The compiler generates one of these structures for each class.
|
||||
**
|
||||
** This structure is the definition for classes.
|
||||
**
|
||||
** This structure is generated by the compiler in the executable and used by
|
||||
** the run-time during normal messaging operations. Therefore some members
|
||||
** change type. The compiler generates "char* const" and places a string in
|
||||
** the following member variables: super_class.
|
||||
*/
|
||||
typedef struct objc_class *MetaClass;
|
||||
typedef struct objc_class *Class;
|
||||
struct objc_class {
|
||||
MetaClass class_pointer; /* Pointer to the class's
|
||||
meta class. */
|
||||
struct objc_class* super_class; /* Pointer to the super
|
||||
class. NULL for class
|
||||
Object. */
|
||||
const char* name; /* Name of the class. */
|
||||
long version; /* Unknown. */
|
||||
unsigned long info; /* Bit mask. See class masks
|
||||
defined above. */
|
||||
long instance_size; /* Size in bytes of the class.
|
||||
The sum of the class
|
||||
definition and all super
|
||||
class definitions. */
|
||||
struct objc_ivar_list* ivars; /* Pointer to a structure that
|
||||
describes the instance
|
||||
variables in the class
|
||||
definition. NULL indicates
|
||||
no instance variables. Does
|
||||
not include super class
|
||||
variables. */
|
||||
struct objc_method_list* methods; /* Linked list of instance
|
||||
methods defined for the
|
||||
class. */
|
||||
struct sarray * dtable; /* Pointer to instance
|
||||
method dispatch table. */
|
||||
struct objc_class* subclass_list; /* Subclasses */
|
||||
struct objc_class* sibling_class;
|
||||
|
||||
struct objc_protocol_list *protocols; /* Protocols conformed to */
|
||||
void* gc_object_type;
|
||||
};
|
||||
|
||||
#ifndef __OBJC__
|
||||
typedef struct objc_protocol {
|
||||
struct objc_class* class_pointer;
|
||||
char *protocol_name;
|
||||
struct objc_protocol_list *protocol_list;
|
||||
struct objc_method_description_list *instance_methods, *class_methods;
|
||||
} Protocol;
|
||||
|
||||
#else /* __OBJC__ */
|
||||
@class Protocol;
|
||||
#endif
|
||||
|
||||
typedef void* retval_t; /* return value */
|
||||
typedef void(*apply_t)(void); /* function pointer */
|
||||
typedef union arglist {
|
||||
char *arg_ptr;
|
||||
char arg_regs[sizeof (char*)];
|
||||
} *arglist_t; /* argument frame */
|
||||
|
||||
|
||||
IMP objc_msg_lookup(id receiver, SEL op);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not __objc_INCLUDE_GNU */
|
|
@ -0,0 +1,244 @@
|
|||
/* Sparse Arrays for Objective C dispatch tables
|
||||
Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Kresten Krab Thorup.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __sarray_INCLUDE_GNU
|
||||
#define __sarray_INCLUDE_GNU
|
||||
|
||||
#include "thr.h"
|
||||
|
||||
#define OBJC_SPARSE2 /* 2-level sparse array */
|
||||
/* #define OBJC_SPARSE3 */ /* 3-level sparse array */
|
||||
|
||||
#ifdef OBJC_SPARSE2
|
||||
extern const char* __objc_sparse2_id;
|
||||
#endif
|
||||
|
||||
#ifdef OBJC_SPARSE3
|
||||
extern const char* __objc_sparse3_id;
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern int nbuckets; /* for stats */
|
||||
extern int nindices;
|
||||
extern int narrays;
|
||||
extern int idxsize;
|
||||
|
||||
/* An unsigned integer of same size as a pointer */
|
||||
#define SIZET_BITS (sizeof(size_t)*8)
|
||||
|
||||
#if defined(__sparc__) || defined(OBJC_SPARSE2)
|
||||
#define PRECOMPUTE_SELECTORS
|
||||
#endif
|
||||
|
||||
#ifdef OBJC_SPARSE3
|
||||
|
||||
/* Buckets are 8 words each */
|
||||
#define BUCKET_BITS 3
|
||||
#define BUCKET_SIZE (1<<BUCKET_BITS)
|
||||
#define BUCKET_MASK (BUCKET_SIZE-1)
|
||||
|
||||
/* Indices are 16 words each */
|
||||
#define INDEX_BITS 4
|
||||
#define INDEX_SIZE (1<<INDEX_BITS)
|
||||
#define INDEX_MASK (INDEX_SIZE-1)
|
||||
|
||||
#define INDEX_CAPACITY (BUCKET_SIZE*INDEX_SIZE)
|
||||
|
||||
#else /* OBJC_SPARSE2 */
|
||||
|
||||
/* Buckets are 32 words each */
|
||||
#define BUCKET_BITS 5
|
||||
#define BUCKET_SIZE (1<<BUCKET_BITS)
|
||||
#define BUCKET_MASK (BUCKET_SIZE-1)
|
||||
|
||||
#endif /* OBJC_SPARSE2 */
|
||||
|
||||
typedef size_t sidx;
|
||||
|
||||
#ifdef PRECOMPUTE_SELECTORS
|
||||
|
||||
struct soffset {
|
||||
#ifdef OBJC_SPARSE3
|
||||
unsigned int unused : SIZET_BITS/4;
|
||||
unsigned int eoffset : SIZET_BITS/4;
|
||||
unsigned int boffset : SIZET_BITS/4;
|
||||
unsigned int ioffset : SIZET_BITS/4;
|
||||
#else /* OBJC_SPARSE2 */
|
||||
#ifdef __sparc__
|
||||
unsigned long boffset : (SIZET_BITS - 2) - BUCKET_BITS;
|
||||
unsigned int eoffset : BUCKET_BITS;
|
||||
unsigned int unused : 2;
|
||||
#else
|
||||
unsigned int boffset : SIZET_BITS/2;
|
||||
unsigned int eoffset : SIZET_BITS/2;
|
||||
#endif
|
||||
#endif /* OBJC_SPARSE2 */
|
||||
};
|
||||
|
||||
union sofftype {
|
||||
struct soffset off;
|
||||
sidx idx;
|
||||
};
|
||||
|
||||
#endif /* not PRECOMPUTE_SELECTORS */
|
||||
|
||||
union sversion {
|
||||
int version;
|
||||
void *next_free;
|
||||
};
|
||||
|
||||
struct sbucket {
|
||||
void* elems[BUCKET_SIZE]; /* elements stored in array */
|
||||
union sversion version; /* used for copy-on-write */
|
||||
};
|
||||
|
||||
#ifdef OBJC_SPARSE3
|
||||
|
||||
struct sindex {
|
||||
struct sbucket* buckets[INDEX_SIZE];
|
||||
union sversion version; /* used for copy-on-write */
|
||||
};
|
||||
|
||||
#endif /* OBJC_SPARSE3 */
|
||||
|
||||
struct sarray {
|
||||
#ifdef OBJC_SPARSE3
|
||||
struct sindex** indices;
|
||||
struct sindex* empty_index;
|
||||
#else /* OBJC_SPARSE2 */
|
||||
struct sbucket** buckets;
|
||||
#endif /* OBJC_SPARSE2 */
|
||||
struct sbucket* empty_bucket;
|
||||
union sversion version; /* used for copy-on-write */
|
||||
short ref_count;
|
||||
struct sarray* is_copy_of;
|
||||
size_t capacity;
|
||||
};
|
||||
|
||||
struct sarray* sarray_new(int, void* default_element);
|
||||
void sarray_free(struct sarray*);
|
||||
struct sarray* sarray_lazy_copy(struct sarray*);
|
||||
void sarray_realloc(struct sarray*, int new_size);
|
||||
void sarray_at_put(struct sarray*, sidx indx, void* elem);
|
||||
void sarray_at_put_safe(struct sarray*, sidx indx, void* elem);
|
||||
|
||||
struct sarray* sarray_hard_copy(struct sarray*); /* ... like the name? */
|
||||
void sarray_remove_garbage(void);
|
||||
|
||||
|
||||
#ifdef PRECOMPUTE_SELECTORS
|
||||
/* Transform soffset values to ints and vica verca */
|
||||
static inline unsigned int
|
||||
soffset_decode(sidx indx)
|
||||
{
|
||||
union sofftype x;
|
||||
x.idx = indx;
|
||||
#ifdef OBJC_SPARSE3
|
||||
return x.off.eoffset
|
||||
+ (x.off.boffset*BUCKET_SIZE)
|
||||
+ (x.off.ioffset*INDEX_CAPACITY);
|
||||
#else /* OBJC_SPARSE2 */
|
||||
return x.off.eoffset + (x.off.boffset*BUCKET_SIZE);
|
||||
#endif /* OBJC_SPARSE2 */
|
||||
}
|
||||
|
||||
static inline sidx
|
||||
soffset_encode(size_t offset)
|
||||
{
|
||||
union sofftype x;
|
||||
x.off.eoffset = offset%BUCKET_SIZE;
|
||||
#ifdef OBJC_SPARSE3
|
||||
x.off.boffset = (offset/BUCKET_SIZE)%INDEX_SIZE;
|
||||
x.off.ioffset = offset/INDEX_CAPACITY;
|
||||
#else /* OBJC_SPARSE2 */
|
||||
x.off.boffset = offset/BUCKET_SIZE;
|
||||
#endif
|
||||
return (sidx)x.idx;
|
||||
}
|
||||
|
||||
#else /* not PRECOMPUTE_SELECTORS */
|
||||
|
||||
static inline size_t
|
||||
soffset_decode(sidx indx)
|
||||
{
|
||||
return indx;
|
||||
}
|
||||
|
||||
static inline sidx
|
||||
soffset_encode(size_t offset)
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
#endif /* not PRECOMPUTE_SELECTORS */
|
||||
|
||||
/* Get element from the Sparse array `array' at offset `indx' */
|
||||
|
||||
static inline void* sarray_get(struct sarray* array, sidx indx)
|
||||
{
|
||||
#ifdef PRECOMPUTE_SELECTORS
|
||||
union sofftype x;
|
||||
x.idx = indx;
|
||||
#ifdef OBJC_SPARSE3
|
||||
return
|
||||
array->
|
||||
indices[x.off.ioffset]->
|
||||
buckets[x.off.boffset]->
|
||||
elems[x.off.eoffset];
|
||||
#else /* OBJC_SPARSE2 */
|
||||
return array->buckets[x.off.boffset]->elems[x.off.eoffset];
|
||||
#endif /* OBJC_SPARSE2 */
|
||||
#else /* not PRECOMPUTE_SELECTORS */
|
||||
#ifdef OBJC_SPARSE3
|
||||
return array->
|
||||
indices[indx/INDEX_CAPACITY]->
|
||||
buckets[(indx/BUCKET_SIZE)%INDEX_SIZE]->
|
||||
elems[indx%BUCKET_SIZE];
|
||||
#else /* OBJC_SPARSE2 */
|
||||
return array->buckets[indx/BUCKET_SIZE]->elems[indx%BUCKET_SIZE];
|
||||
#endif /* not OBJC_SPARSE3 */
|
||||
#endif /* not PRECOMPUTE_SELECTORS */
|
||||
}
|
||||
|
||||
static inline void* sarray_get_safe(struct sarray* array, sidx indx)
|
||||
{
|
||||
if(soffset_decode(indx) < array->capacity)
|
||||
return sarray_get(array, indx);
|
||||
else
|
||||
return (array->empty_bucket->elems[0]);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __sarray_INCLUDE_GNU */
|
|
@ -0,0 +1,153 @@
|
|||
/* Thread and mutex controls for Objective C.
|
||||
Copyright (C) 1996, 1997, 2002, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Galen C. Hunt (gchunt@cs.rochester.edu)
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2, or (at your option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
GCC; see the file COPYING. If not, write to the Free Software
|
||||
Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
|
||||
#ifndef __thread_INCLUDE_GNU
|
||||
#define __thread_INCLUDE_GNU
|
||||
|
||||
#include "objc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*************************************************************************
|
||||
* Universal static variables:
|
||||
*/
|
||||
extern int __objc_thread_exit_status; /* Global exit status. */
|
||||
|
||||
/********
|
||||
* Thread safe implementation types and functions.
|
||||
*/
|
||||
|
||||
/* Thread priorities */
|
||||
#define OBJC_THREAD_INTERACTIVE_PRIORITY 2
|
||||
#define OBJC_THREAD_BACKGROUND_PRIORITY 1
|
||||
#define OBJC_THREAD_LOW_PRIORITY 0
|
||||
|
||||
/* A thread */
|
||||
typedef void * objc_thread_t;
|
||||
|
||||
/* This structure represents a single mutual exclusion lock. */
|
||||
struct objc_mutex
|
||||
{
|
||||
volatile objc_thread_t owner; /* Id of thread that owns. */
|
||||
volatile int depth; /* # of acquires. */
|
||||
void * backend; /* Specific to backend */
|
||||
};
|
||||
typedef struct objc_mutex *objc_mutex_t;
|
||||
|
||||
/* This structure represents a single condition mutex */
|
||||
struct objc_condition
|
||||
{
|
||||
void * backend; /* Specific to backend */
|
||||
};
|
||||
typedef struct objc_condition *objc_condition_t;
|
||||
|
||||
/* Frontend mutex functions */
|
||||
objc_mutex_t objc_mutex_allocate (void);
|
||||
int objc_mutex_deallocate (objc_mutex_t mutex);
|
||||
int objc_mutex_lock (objc_mutex_t mutex);
|
||||
int objc_mutex_unlock (objc_mutex_t mutex);
|
||||
int objc_mutex_trylock (objc_mutex_t mutex);
|
||||
|
||||
/* Frontend condition mutex functions */
|
||||
objc_condition_t objc_condition_allocate (void);
|
||||
int objc_condition_deallocate (objc_condition_t condition);
|
||||
int objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex);
|
||||
int objc_condition_signal (objc_condition_t condition);
|
||||
int objc_condition_broadcast (objc_condition_t condition);
|
||||
|
||||
/* Frontend thread functions */
|
||||
objc_thread_t objc_thread_detach (SEL selector, id object, id argument);
|
||||
void objc_thread_yield (void);
|
||||
int objc_thread_exit (void);
|
||||
int objc_thread_set_priority (int priority);
|
||||
int objc_thread_get_priority (void);
|
||||
void * objc_thread_get_data (void);
|
||||
int objc_thread_set_data (void *value);
|
||||
objc_thread_t objc_thread_id (void);
|
||||
void objc_thread_add (void);
|
||||
void objc_thread_remove (void);
|
||||
|
||||
/*
|
||||
Use this to set the hook function that will be called when the
|
||||
runtime initially becomes multi threaded.
|
||||
The hook function is only called once, meaning only when the
|
||||
2nd thread is spawned, not for each and every thread.
|
||||
|
||||
It returns the previous hook function or NULL if there is none.
|
||||
|
||||
A program outside of the runtime could set this to some function so
|
||||
it can be informed; for example, the GNUstep Base Library sets it
|
||||
so it can implement the NSBecomingMultiThreaded notification.
|
||||
*/
|
||||
typedef void (*objc_thread_callback) (void);
|
||||
objc_thread_callback objc_set_thread_callback (objc_thread_callback func);
|
||||
|
||||
/* Backend initialization functions */
|
||||
int __objc_init_thread_system (void);
|
||||
int __objc_fini_thread_system (void);
|
||||
|
||||
/* Backend mutex functions */
|
||||
int __objc_mutex_allocate (objc_mutex_t mutex);
|
||||
int __objc_mutex_deallocate (objc_mutex_t mutex);
|
||||
int __objc_mutex_lock (objc_mutex_t mutex);
|
||||
int __objc_mutex_trylock (objc_mutex_t mutex);
|
||||
int __objc_mutex_unlock (objc_mutex_t mutex);
|
||||
|
||||
/* Backend condition mutex functions */
|
||||
int __objc_condition_allocate (objc_condition_t condition);
|
||||
int __objc_condition_deallocate (objc_condition_t condition);
|
||||
int __objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex);
|
||||
int __objc_condition_broadcast (objc_condition_t condition);
|
||||
int __objc_condition_signal (objc_condition_t condition);
|
||||
|
||||
/* Backend thread functions */
|
||||
objc_thread_t __objc_thread_detach (void (*func) (void *arg), void *arg);
|
||||
int __objc_thread_set_priority (int priority);
|
||||
int __objc_thread_get_priority (void);
|
||||
void __objc_thread_yield (void);
|
||||
int __objc_thread_exit (void);
|
||||
objc_thread_t __objc_thread_id (void);
|
||||
int __objc_thread_set_data (void *value);
|
||||
void * __objc_thread_get_data (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* not __thread_INCLUDE_GNU */
|
|
@ -0,0 +1,141 @@
|
|||
/* GNU Objective-C Typed Streams interface.
|
||||
Copyright (C) 1993, 1995, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with files compiled
|
||||
with GCC to produce an executable, this does not cause the resulting
|
||||
executable to be covered by the GNU General Public License. This
|
||||
exception does not however invalidate any other reasons why the
|
||||
executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifndef __typedstream_INCLUDE_GNU
|
||||
#define __typedstream_INCLUDE_GNU
|
||||
|
||||
#include "objc.h"
|
||||
#include "hash.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
typedef int (*objc_typed_read_func)(void*, char*, int);
|
||||
typedef int (*objc_typed_write_func)(void*, const char*, int);
|
||||
typedef int (*objc_typed_flush_func)(void*);
|
||||
typedef int (*objc_typed_eof_func)(void*);
|
||||
|
||||
#define OBJC_READONLY 0x01
|
||||
#define OBJC_WRITEONLY 0x02
|
||||
|
||||
#define OBJC_MANAGED_STREAM 0x01
|
||||
#define OBJC_FILE_STREAM 0x02
|
||||
#define OBJC_MEMORY_STREAM 0x04
|
||||
|
||||
#define OBJC_TYPED_STREAM_VERSION 0x01
|
||||
|
||||
typedef struct objc_typed_stream {
|
||||
void* physical;
|
||||
cache_ptr object_table; /* read/written objects */
|
||||
cache_ptr stream_table; /* other read/written but shared things.. */
|
||||
cache_ptr class_table; /* class version mapping */
|
||||
cache_ptr object_refs; /* forward references */
|
||||
int mode; /* OBJC_READONLY or OBJC_WRITEONLY */
|
||||
int type; /* MANAGED, FILE, MEMORY etc bit string */
|
||||
int version; /* version used when writing */
|
||||
int writing_root_p;
|
||||
objc_typed_read_func read;
|
||||
objc_typed_write_func write;
|
||||
objc_typed_eof_func eof;
|
||||
objc_typed_flush_func flush;
|
||||
} TypedStream;
|
||||
|
||||
/* opcode masks */
|
||||
#define _B_VALUE 0x1fU
|
||||
#define _B_CODE 0xe0U
|
||||
#define _B_SIGN 0x10U
|
||||
#define _B_NUMBER 0x0fU
|
||||
|
||||
/* standard opcodes */
|
||||
#define _B_INVALID 0x00U
|
||||
#define _B_SINT 0x20U
|
||||
#define _B_NINT 0x40U
|
||||
#define _B_SSTR 0x60U
|
||||
#define _B_NSTR 0x80U
|
||||
#define _B_RCOMM 0xa0U
|
||||
#define _B_UCOMM 0xc0U
|
||||
#define _B_EXT 0xe0U
|
||||
|
||||
/* eXtension opcodes */
|
||||
#define _BX_OBJECT 0x00U
|
||||
#define _BX_CLASS 0x01U
|
||||
#define _BX_SEL 0x02U
|
||||
#define _BX_OBJREF 0x03U
|
||||
#define _BX_OBJROOT 0x04U
|
||||
#define _BX_EXT 0x1fU
|
||||
|
||||
/*
|
||||
** Read and write objects as specified by TYPE. All the `last'
|
||||
** arguments are pointers to the objects to read/write.
|
||||
*/
|
||||
|
||||
int objc_write_type (TypedStream* stream, const char* type, const void* data);
|
||||
int objc_read_type (TypedStream* stream, const char* type, void* data);
|
||||
|
||||
int objc_write_types (TypedStream* stream, const char* type, ...);
|
||||
int objc_read_types (TypedStream* stream, const char* type, ...);
|
||||
|
||||
int objc_write_object_reference (TypedStream* stream, id object);
|
||||
int objc_write_root_object (TypedStream* stream, id object);
|
||||
|
||||
long objc_get_stream_class_version (TypedStream* stream, Class class_type);
|
||||
|
||||
|
||||
/*
|
||||
** Convenience functions
|
||||
*/
|
||||
|
||||
int objc_write_array (TypedStream* stream, const char* type,
|
||||
int count, const void* data);
|
||||
int objc_read_array (TypedStream* stream, const char* type,
|
||||
int count, void* data);
|
||||
|
||||
int objc_write_object (TypedStream* stream, id object);
|
||||
int objc_read_object (TypedStream* stream, id* object);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Open a typed stream for reading or writing. MODE may be either of
|
||||
** OBJC_READONLY or OBJC_WRITEONLY.
|
||||
*/
|
||||
|
||||
TypedStream* objc_open_typed_stream (FILE* physical, int mode);
|
||||
TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode);
|
||||
|
||||
void objc_close_typed_stream (TypedStream* stream);
|
||||
|
||||
BOOL objc_end_of_typed_stream (TypedStream* stream);
|
||||
void objc_flush_typed_stream (TypedStream* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* not __typedstream_INCLUDE_GNU */
|
|
@ -0,0 +1,133 @@
|
|||
/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.15 Variable arguments <stdarg.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#ifndef _ANSI_STDARG_H_
|
||||
#ifndef __need___va_list
|
||||
#define _STDARG_H
|
||||
#define _ANSI_STDARG_H_
|
||||
#endif /* not __need___va_list */
|
||||
#undef __need___va_list
|
||||
|
||||
/* Define __gnuc_va_list. */
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef __builtin_va_list __gnuc_va_list;
|
||||
#endif
|
||||
|
||||
/* Define the standard macros for the user,
|
||||
if this invocation was from the user program. */
|
||||
#ifdef _STDARG_H
|
||||
|
||||
#define va_start(v,l) __builtin_va_start(v,l)
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#define va_arg(v,l) __builtin_va_arg(v,l)
|
||||
#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
|
||||
#define va_copy(d,s) __builtin_va_copy(d,s)
|
||||
#endif
|
||||
#define __va_copy(d,s) __builtin_va_copy(d,s)
|
||||
|
||||
/* Define va_list, if desired, from __gnuc_va_list. */
|
||||
/* We deliberately do not define va_list when called from
|
||||
stdio.h, because ANSI C says that stdio.h is not supposed to define
|
||||
va_list. stdio.h needs to have access to that data type,
|
||||
but must not use that name. It should use the name __gnuc_va_list,
|
||||
which is safe because it is reserved for the implementation. */
|
||||
|
||||
#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
|
||||
#undef _VA_LIST
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_VA_LIST
|
||||
#undef _BSD_VA_LIST
|
||||
#endif
|
||||
|
||||
#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
|
||||
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
|
||||
so we must avoid testing it and setting it here.
|
||||
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
|
||||
have no conflict with that. */
|
||||
#ifndef _VA_LIST_
|
||||
#define _VA_LIST_
|
||||
#ifdef __i860__
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST va_list
|
||||
#endif
|
||||
#endif /* __i860__ */
|
||||
typedef __gnuc_va_list va_list;
|
||||
#ifdef _SCO_DS
|
||||
#define __VA_LIST
|
||||
#endif
|
||||
#endif /* _VA_LIST_ */
|
||||
#else /* not __svr4__ || _SCO_DS */
|
||||
|
||||
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
|
||||
But on BSD NET2 we must not test or define or undef it.
|
||||
(Note that the comments in NET 2's ansi.h
|
||||
are incorrect for _VA_LIST_--see stdio.h!) */
|
||||
#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
|
||||
/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
/* The macro _VA_LIST is used in SCO Unix 3.2. */
|
||||
#ifndef _VA_LIST
|
||||
/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
|
||||
#ifndef _VA_LIST_T_H
|
||||
/* The macro __va_list__ is used by BeOS. */
|
||||
#ifndef __va_list__
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif /* not __va_list__ */
|
||||
#endif /* not _VA_LIST_T_H */
|
||||
#endif /* not _VA_LIST */
|
||||
#endif /* not _VA_LIST_DEFINED */
|
||||
#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
|
||||
#define _VA_LIST_
|
||||
#endif
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST
|
||||
#endif
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
#define _VA_LIST_DEFINED
|
||||
#endif
|
||||
#ifndef _VA_LIST_T_H
|
||||
#define _VA_LIST_T_H
|
||||
#endif
|
||||
#ifndef __va_list__
|
||||
#define __va_list__
|
||||
#endif
|
||||
|
||||
#endif /* not _VA_LIST_, except on certain systems */
|
||||
|
||||
#endif /* not __svr4__ */
|
||||
|
||||
#endif /* _STDARG_H */
|
||||
|
||||
#endif /* not _ANSI_STDARG_H_ */
|
||||
#endif /* not _STDARG_H */
|
|
@ -0,0 +1,53 @@
|
|||
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.16 Boolean type and values <stdbool.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDBOOL_H
|
||||
#define _STDBOOL_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
/* Supporting <stdbool.h> in C++ is a GCC extension. */
|
||||
#define _Bool bool
|
||||
#define bool bool
|
||||
#define false false
|
||||
#define true true
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Signal that all the definitions are present. */
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* stdbool.h */
|
|
@ -0,0 +1,419 @@
|
|||
/* Copyright (C) 1989, 1997, 1998, 1999, 2000, 2002, 2004
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.17 Common definitions <stddef.h>
|
||||
*/
|
||||
#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
|
||||
&& !defined(__STDDEF_H__)) \
|
||||
|| defined(__need_wchar_t) || defined(__need_size_t) \
|
||||
|| defined(__need_ptrdiff_t) || defined(__need_NULL) \
|
||||
|| defined(__need_wint_t)
|
||||
|
||||
/* Any one of these symbols __need_* means that GNU libc
|
||||
wants us just to define one data type. So don't define
|
||||
the symbols that indicate this file's entire job has been done. */
|
||||
#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
|
||||
&& !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
|
||||
&& !defined(__need_wint_t))
|
||||
#define _STDDEF_H
|
||||
#define _STDDEF_H_
|
||||
/* snaroff@next.com says the NeXT needs this. */
|
||||
#define _ANSI_STDDEF_H
|
||||
/* Irix 5.1 needs this. */
|
||||
#define __STDDEF_H__
|
||||
#endif
|
||||
|
||||
#ifndef __sys_stdtypes_h
|
||||
/* This avoids lossage on SunOS but only if stdtypes.h comes first.
|
||||
There's no way to win with the other order! Sun lossage. */
|
||||
|
||||
/* On 4.3bsd-net2, make sure ansi.h is included, so we have
|
||||
one less case to deal with in the following. */
|
||||
#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
|
||||
#include <machine/ansi.h>
|
||||
#endif
|
||||
/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
||||
#include <sys/_types.h>
|
||||
#endif
|
||||
|
||||
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
|
||||
defined if the corresponding type is *not* defined.
|
||||
FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
|
||||
#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
|
||||
#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
|
||||
#define _SIZE_T
|
||||
#endif
|
||||
#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
|
||||
#define _PTRDIFF_T
|
||||
#endif
|
||||
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
|
||||
instead of _WCHAR_T_. */
|
||||
#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
|
||||
#ifndef _BSD_WCHAR_T_
|
||||
#define _WCHAR_T
|
||||
#endif
|
||||
#endif
|
||||
/* Undef _FOO_T_ if we are supposed to define foo_t. */
|
||||
#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#if defined (__need_size_t) || defined (_STDDEF_H_)
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#if defined (__need_wchar_t) || defined (_STDDEF_H_)
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
|
||||
|
||||
/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
|
||||
Just ignore it. */
|
||||
#if defined (__sequent__) && defined (_PTRDIFF_T_)
|
||||
#undef _PTRDIFF_T_
|
||||
#endif
|
||||
|
||||
/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
|
||||
_TYPE_size_t which will typedef size_t. fixincludes patched the
|
||||
vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
|
||||
not defined, and so that defining this macro defines _GCC_SIZE_T.
|
||||
If we find that the macros are still defined at this point, we must
|
||||
invoke them so that the type is defined as expected. */
|
||||
#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
|
||||
_TYPE_ptrdiff_t;
|
||||
#undef _TYPE_ptrdiff_t
|
||||
#endif
|
||||
#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
|
||||
_TYPE_size_t;
|
||||
#undef _TYPE_size_t
|
||||
#endif
|
||||
#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
|
||||
_TYPE_wchar_t;
|
||||
#undef _TYPE_wchar_t
|
||||
#endif
|
||||
|
||||
/* In case nobody has defined these types, but we aren't running under
|
||||
GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
|
||||
__WCHAR_TYPE__ have reasonable values. This can happen if the
|
||||
parts of GCC is compiled by an older compiler, that actually
|
||||
include gstddef.h, such as collect2. */
|
||||
|
||||
/* Signed type of difference of two pointers. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
|
||||
#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
|
||||
#ifndef _T_PTRDIFF_
|
||||
#ifndef _T_PTRDIFF
|
||||
#ifndef __PTRDIFF_T
|
||||
#ifndef _PTRDIFF_T_
|
||||
#ifndef _BSD_PTRDIFF_T_
|
||||
#ifndef ___int_ptrdiff_t_h
|
||||
#ifndef _GCC_PTRDIFF_T
|
||||
#define _PTRDIFF_T
|
||||
#define _T_PTRDIFF_
|
||||
#define _T_PTRDIFF
|
||||
#define __PTRDIFF_T
|
||||
#define _PTRDIFF_T_
|
||||
#define _BSD_PTRDIFF_T_
|
||||
#define ___int_ptrdiff_t_h
|
||||
#define _GCC_PTRDIFF_T
|
||||
#ifndef __PTRDIFF_TYPE__
|
||||
#define __PTRDIFF_TYPE__ long int
|
||||
#endif
|
||||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
#endif /* _GCC_PTRDIFF_T */
|
||||
#endif /* ___int_ptrdiff_t_h */
|
||||
#endif /* _BSD_PTRDIFF_T_ */
|
||||
#endif /* _PTRDIFF_T_ */
|
||||
#endif /* __PTRDIFF_T */
|
||||
#endif /* _T_PTRDIFF */
|
||||
#endif /* _T_PTRDIFF_ */
|
||||
#endif /* _PTRDIFF_T */
|
||||
|
||||
/* If this symbol has done its job, get rid of it. */
|
||||
#undef __need_ptrdiff_t
|
||||
|
||||
#endif /* _STDDEF_H or __need_ptrdiff_t. */
|
||||
|
||||
/* Unsigned type of `sizeof' something. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_size_t)
|
||||
#ifndef __size_t__ /* BeOS */
|
||||
#ifndef __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
|
||||
#ifndef _SYS_SIZE_T_H
|
||||
#ifndef _T_SIZE_
|
||||
#ifndef _T_SIZE
|
||||
#ifndef __SIZE_T
|
||||
#ifndef _SIZE_T_
|
||||
#ifndef _BSD_SIZE_T_
|
||||
#ifndef _SIZE_T_DEFINED_
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
|
||||
#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
|
||||
#ifndef ___int_size_t_h
|
||||
#ifndef _GCC_SIZE_T
|
||||
#ifndef _SIZET_
|
||||
#ifndef __size_t
|
||||
#define __size_t__ /* BeOS */
|
||||
#define __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#define _SIZE_T
|
||||
#define _SYS_SIZE_T_H
|
||||
#define _T_SIZE_
|
||||
#define _T_SIZE
|
||||
#define __SIZE_T
|
||||
#define _SIZE_T_
|
||||
#define _BSD_SIZE_T_
|
||||
#define _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED
|
||||
#define _BSD_SIZE_T_DEFINED_ /* Darwin */
|
||||
#define _SIZE_T_DECLARED /* FreeBSD 5 */
|
||||
#define ___int_size_t_h
|
||||
#define _GCC_SIZE_T
|
||||
#define _SIZET_
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
||||
/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
|
||||
#else
|
||||
#define __size_t
|
||||
#endif
|
||||
#ifndef __SIZE_TYPE__
|
||||
#define __SIZE_TYPE__ long unsigned int
|
||||
#endif
|
||||
#if !(defined (__GNUG__) && defined (size_t))
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
#ifdef __BEOS__
|
||||
typedef long ssize_t;
|
||||
#endif /* __BEOS__ */
|
||||
#endif /* !(defined (__GNUG__) && defined (size_t)) */
|
||||
#endif /* __size_t */
|
||||
#endif /* _SIZET_ */
|
||||
#endif /* _GCC_SIZE_T */
|
||||
#endif /* ___int_size_t_h */
|
||||
#endif /* _SIZE_T_DECLARED */
|
||||
#endif /* _BSD_SIZE_T_DEFINED_ */
|
||||
#endif /* _SIZE_T_DEFINED */
|
||||
#endif /* _SIZE_T_DEFINED_ */
|
||||
#endif /* _BSD_SIZE_T_ */
|
||||
#endif /* _SIZE_T_ */
|
||||
#endif /* __SIZE_T */
|
||||
#endif /* _T_SIZE */
|
||||
#endif /* _T_SIZE_ */
|
||||
#endif /* _SYS_SIZE_T_H */
|
||||
#endif /* _SIZE_T */
|
||||
#endif /* __SIZE_T__ */
|
||||
#endif /* __size_t__ */
|
||||
#undef __need_size_t
|
||||
#endif /* _STDDEF_H or __need_size_t. */
|
||||
|
||||
|
||||
/* Wide character type.
|
||||
Locale-writers should change this as necessary to
|
||||
be big enough to hold unique values not between 0 and 127,
|
||||
and not (wchar_t) -1, for each defined multibyte character. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_wchar_t)
|
||||
#ifndef __wchar_t__ /* BeOS */
|
||||
#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
|
||||
#ifndef _WCHAR_T
|
||||
#ifndef _T_WCHAR_
|
||||
#ifndef _T_WCHAR
|
||||
#ifndef __WCHAR_T
|
||||
#ifndef _WCHAR_T_
|
||||
#ifndef _BSD_WCHAR_T_
|
||||
#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
|
||||
#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
|
||||
#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
|
||||
#ifndef _WCHAR_T_DEFINED_
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_H
|
||||
#ifndef ___int_wchar_t_h
|
||||
#ifndef __INT_WCHAR_T_H
|
||||
#ifndef _GCC_WCHAR_T
|
||||
#define __wchar_t__ /* BeOS */
|
||||
#define __WCHAR_T__ /* Cray Unicos/Mk */
|
||||
#define _WCHAR_T
|
||||
#define _T_WCHAR_
|
||||
#define _T_WCHAR
|
||||
#define __WCHAR_T
|
||||
#define _WCHAR_T_
|
||||
#define _BSD_WCHAR_T_
|
||||
#define _WCHAR_T_DEFINED_
|
||||
#define _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_H
|
||||
#define ___int_wchar_t_h
|
||||
#define __INT_WCHAR_T_H
|
||||
#define _GCC_WCHAR_T
|
||||
#define _WCHAR_T_DECLARED
|
||||
|
||||
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
|
||||
instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
|
||||
symbols in the _FOO_T_ family, stays defined even after its
|
||||
corresponding type is defined). If we define wchar_t, then we
|
||||
must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
|
||||
we undef _WCHAR_T_, then we must also define rune_t, since
|
||||
headers like runetype.h assume that if machine/ansi.h is included,
|
||||
and _BSD_WCHAR_T_ is not defined, then rune_t is available.
|
||||
machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
|
||||
the same type." */
|
||||
#ifdef _BSD_WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#ifdef _BSD_RUNE_T_
|
||||
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
|
||||
typedef _BSD_RUNE_T_ rune_t;
|
||||
#define _BSD_WCHAR_T_DEFINED_
|
||||
#define _BSD_RUNE_T_DEFINED_ /* Darwin */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
|
||||
/* Why is this file so hard to maintain properly? In contrast to
|
||||
the comment above regarding BSD/386 1.1, on FreeBSD for as long
|
||||
as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
|
||||
redundant typedefs will occur when stdlib.h is included after this file. */
|
||||
#undef _BSD_RUNE_T_
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
/* FreeBSD 5 can't be handled well using "traditional" logic above
|
||||
since it no longer defines _BSD_RUNE_T_ yet still desires to export
|
||||
rune_t in some cases... */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
||||
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
|
||||
#if __BSD_VISIBLE
|
||||
#ifndef _RUNE_T_DECLARED
|
||||
typedef __rune_t rune_t;
|
||||
#define _RUNE_T_DECLARED
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __WCHAR_TYPE__
|
||||
#define __WCHAR_TYPE__ int
|
||||
#endif
|
||||
#ifndef __cplusplus
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* _WCHAR_T_DECLARED */
|
||||
#endif /* _BSD_RUNE_T_DEFINED_ */
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* __WCHAR_T__ */
|
||||
#endif /* __wchar_t__ */
|
||||
#undef __need_wchar_t
|
||||
#endif /* _STDDEF_H or __need_wchar_t. */
|
||||
|
||||
#if defined (__need_wint_t)
|
||||
#ifndef _WINT_T
|
||||
#define _WINT_T
|
||||
|
||||
#ifndef __WINT_TYPE__
|
||||
#define __WINT_TYPE__ unsigned int
|
||||
#endif
|
||||
typedef __WINT_TYPE__ wint_t;
|
||||
#endif
|
||||
#undef __need_wint_t
|
||||
#endif
|
||||
|
||||
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
|
||||
are already defined. */
|
||||
/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
|
||||
#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
|
||||
/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
|
||||
are probably typos and should be removed before 2.8 is released. */
|
||||
#ifdef _GCC_PTRDIFF_T_
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#ifdef _GCC_SIZE_T_
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#ifdef _GCC_WCHAR_T_
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
/* The following ones are the real ones. */
|
||||
#ifdef _GCC_PTRDIFF_T
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#ifdef _GCC_SIZE_T
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#ifdef _GCC_WCHAR_T
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
|
||||
|
||||
#endif /* __sys_stdtypes_h */
|
||||
|
||||
/* A null pointer constant. */
|
||||
|
||||
#if defined (_STDDEF_H) || defined (__need_NULL)
|
||||
#undef NULL /* in case <stdio.h> has defined it. */
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else /* G++ */
|
||||
#ifndef __cplusplus
|
||||
#define NULL ((void *)0)
|
||||
#else /* C++ */
|
||||
#define NULL 0
|
||||
#endif /* C++ */
|
||||
#endif /* G++ */
|
||||
#endif /* NULL not defined and <stddef.h> or need NULL. */
|
||||
#undef __need_NULL
|
||||
|
||||
#ifdef _STDDEF_H
|
||||
|
||||
/* Offset of member MEMBER in a struct of type TYPE. */
|
||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
|
||||
|
||||
#endif /* _STDDEF_H was defined this time */
|
||||
|
||||
#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
|
||||
|| __need_XXX was not defined before */
|
|
@ -0,0 +1,207 @@
|
|||
/* Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/* ISO/IEC JTC1 SC22 WG14 N1169
|
||||
* Date: 2006-04-04
|
||||
* ISO/IEC TR 18037
|
||||
* Programming languages - C - Extensions to support embedded processors
|
||||
*/
|
||||
|
||||
#ifndef _STDFIX_H
|
||||
#define _STDFIX_H
|
||||
|
||||
/* 7.18a.1 Introduction. */
|
||||
|
||||
#undef fract
|
||||
#undef accum
|
||||
#undef sat
|
||||
#define fract _Fract
|
||||
#define accum _Accum
|
||||
#define sat _Sat
|
||||
|
||||
/* 7.18a.3 Precision macros. */
|
||||
|
||||
#undef SFRACT_FBIT
|
||||
#undef SFRACT_MIN
|
||||
#undef SFRACT_MAX
|
||||
#undef SFRACT_EPSILON
|
||||
#define SFRACT_FBIT __SFRACT_FBIT__
|
||||
#define SFRACT_MIN __SFRACT_MIN__
|
||||
#define SFRACT_MAX __SFRACT_MAX__
|
||||
#define SFRACT_EPSILON __SFRACT_EPSILON__
|
||||
|
||||
#undef USFRACT_FBIT
|
||||
#undef USFRACT_MIN
|
||||
#undef USFRACT_MAX
|
||||
#undef USFRACT_EPSILON
|
||||
#define USFRACT_FBIT __USFRACT_FBIT__
|
||||
#define USFRACT_MIN __USFRACT_MIN__ /* GCC extension. */
|
||||
#define USFRACT_MAX __USFRACT_MAX__
|
||||
#define USFRACT_EPSILON __USFRACT_EPSILON__
|
||||
|
||||
#undef FRACT_FBIT
|
||||
#undef FRACT_MIN
|
||||
#undef FRACT_MAX
|
||||
#undef FRACT_EPSILON
|
||||
#define FRACT_FBIT __FRACT_FBIT__
|
||||
#define FRACT_MIN __FRACT_MIN__
|
||||
#define FRACT_MAX __FRACT_MAX__
|
||||
#define FRACT_EPSILON __FRACT_EPSILON__
|
||||
|
||||
#undef UFRACT_FBIT
|
||||
#undef UFRACT_MIN
|
||||
#undef UFRACT_MAX
|
||||
#undef UFRACT_EPSILON
|
||||
#define UFRACT_FBIT __UFRACT_FBIT__
|
||||
#define UFRACT_MIN __UFRACT_MIN__ /* GCC extension. */
|
||||
#define UFRACT_MAX __UFRACT_MAX__
|
||||
#define UFRACT_EPSILON __UFRACT_EPSILON__
|
||||
|
||||
#undef LFRACT_FBIT
|
||||
#undef LFRACT_MIN
|
||||
#undef LFRACT_MAX
|
||||
#undef LFRACT_EPSILON
|
||||
#define LFRACT_FBIT __LFRACT_FBIT__
|
||||
#define LFRACT_MIN __LFRACT_MIN__
|
||||
#define LFRACT_MAX __LFRACT_MAX__
|
||||
#define LFRACT_EPSILON __LFRACT_EPSILON__
|
||||
|
||||
#undef ULFRACT_FBIT
|
||||
#undef ULFRACT_MIN
|
||||
#undef ULFRACT_MAX
|
||||
#undef ULFRACT_EPSILON
|
||||
#define ULFRACT_FBIT __ULFRACT_FBIT__
|
||||
#define ULFRACT_MIN __ULFRACT_MIN__ /* GCC extension. */
|
||||
#define ULFRACT_MAX __ULFRACT_MAX__
|
||||
#define ULFRACT_EPSILON __ULFRACT_EPSILON__
|
||||
|
||||
#undef LLFRACT_FBIT
|
||||
#undef LLFRACT_MIN
|
||||
#undef LLFRACT_MAX
|
||||
#undef LLFRACT_EPSILON
|
||||
#define LLFRACT_FBIT __LLFRACT_FBIT__ /* GCC extension. */
|
||||
#define LLFRACT_MIN __LLFRACT_MIN__ /* GCC extension. */
|
||||
#define LLFRACT_MAX __LLFRACT_MAX__ /* GCC extension. */
|
||||
#define LLFRACT_EPSILON __LLFRACT_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef ULLFRACT_FBIT
|
||||
#undef ULLFRACT_MIN
|
||||
#undef ULLFRACT_MAX
|
||||
#undef ULLFRACT_EPSILON
|
||||
#define ULLFRACT_FBIT __ULLFRACT_FBIT__ /* GCC extension. */
|
||||
#define ULLFRACT_MIN __ULLFRACT_MIN__ /* GCC extension. */
|
||||
#define ULLFRACT_MAX __ULLFRACT_MAX__ /* GCC extension. */
|
||||
#define ULLFRACT_EPSILON __ULLFRACT_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef SACCUM_FBIT
|
||||
#undef SACCUM_IBIT
|
||||
#undef SACCUM_MIN
|
||||
#undef SACCUM_MAX
|
||||
#undef SACCUM_EPSILON
|
||||
#define SACCUM_FBIT __SACCUM_FBIT__
|
||||
#define SACCUM_IBIT __SACCUM_IBIT__
|
||||
#define SACCUM_MIN __SACCUM_MIN__
|
||||
#define SACCUM_MAX __SACCUM_MAX__
|
||||
#define SACCUM_EPSILON __SACCUM_EPSILON__
|
||||
|
||||
#undef USACCUM_FBIT
|
||||
#undef USACCUM_IBIT
|
||||
#undef USACCUM_MIN
|
||||
#undef USACCUM_MAX
|
||||
#undef USACCUM_EPSILON
|
||||
#define USACCUM_FBIT __USACCUM_FBIT__
|
||||
#define USACCUM_IBIT __USACCUM_IBIT__
|
||||
#define USACCUM_MIN __USACCUM_MIN__ /* GCC extension. */
|
||||
#define USACCUM_MAX __USACCUM_MAX__
|
||||
#define USACCUM_EPSILON __USACCUM_EPSILON__
|
||||
|
||||
#undef ACCUM_FBIT
|
||||
#undef ACCUM_IBIT
|
||||
#undef ACCUM_MIN
|
||||
#undef ACCUM_MAX
|
||||
#undef ACCUM_EPSILON
|
||||
#define ACCUM_FBIT __ACCUM_FBIT__
|
||||
#define ACCUM_IBIT __ACCUM_IBIT__
|
||||
#define ACCUM_MIN __ACCUM_MIN__
|
||||
#define ACCUM_MAX __ACCUM_MAX__
|
||||
#define ACCUM_EPSILON __ACCUM_EPSILON__
|
||||
|
||||
#undef UACCUM_FBIT
|
||||
#undef UACCUM_IBIT
|
||||
#undef UACCUM_MIN
|
||||
#undef UACCUM_MAX
|
||||
#undef UACCUM_EPSILON
|
||||
#define UACCUM_FBIT __UACCUM_FBIT__
|
||||
#define UACCUM_IBIT __UACCUM_IBIT__
|
||||
#define UACCUM_MIN __UACCUM_MIN__ /* GCC extension. */
|
||||
#define UACCUM_MAX __UACCUM_MAX__
|
||||
#define UACCUM_EPSILON __UACCUM_EPSILON__
|
||||
|
||||
#undef LACCUM_FBIT
|
||||
#undef LACCUM_IBIT
|
||||
#undef LACCUM_MIN
|
||||
#undef LACCUM_MAX
|
||||
#undef LACCUM_EPSILON
|
||||
#define LACCUM_FBIT __LACCUM_FBIT__
|
||||
#define LACCUM_IBIT __LACCUM_IBIT__
|
||||
#define LACCUM_MIN __LACCUM_MIN__
|
||||
#define LACCUM_MAX __LACCUM_MAX__
|
||||
#define LACCUM_EPSILON __LACCUM_EPSILON__
|
||||
|
||||
#undef ULACCUM_FBIT
|
||||
#undef ULACCUM_IBIT
|
||||
#undef ULACCUM_MIN
|
||||
#undef ULACCUM_MAX
|
||||
#undef ULACCUM_EPSILON
|
||||
#define ULACCUM_FBIT __ULACCUM_FBIT__
|
||||
#define ULACCUM_IBIT __ULACCUM_IBIT__
|
||||
#define ULACCUM_MIN __ULACCUM_MIN__ /* GCC extension. */
|
||||
#define ULACCUM_MAX __ULACCUM_MAX__
|
||||
#define ULACCUM_EPSILON __ULACCUM_EPSILON__
|
||||
|
||||
#undef LLACCUM_FBIT
|
||||
#undef LLACCUM_IBIT
|
||||
#undef LLACCUM_MIN
|
||||
#undef LLACCUM_MAX
|
||||
#undef LLACCUM_EPSILON
|
||||
#define LLACCUM_FBIT __LLACCUM_FBIT__ /* GCC extension. */
|
||||
#define LLACCUM_IBIT __LLACCUM_IBIT__ /* GCC extension. */
|
||||
#define LLACCUM_MIN __LLACCUM_MIN__ /* GCC extension. */
|
||||
#define LLACCUM_MAX __LLACCUM_MAX__ /* GCC extension. */
|
||||
#define LLACCUM_EPSILON __LLACCUM_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef ULLACCUM_FBIT
|
||||
#undef ULLACCUM_IBIT
|
||||
#undef ULLACCUM_MIN
|
||||
#undef ULLACCUM_MAX
|
||||
#undef ULLACCUM_EPSILON
|
||||
#define ULLACCUM_FBIT __ULLACCUM_FBIT__ /* GCC extension. */
|
||||
#define ULLACCUM_IBIT __ULLACCUM_IBIT__ /* GCC extension. */
|
||||
#define ULLACCUM_MIN __ULLACCUM_MIN__ /* GCC extension. */
|
||||
#define ULLACCUM_MAX __ULLACCUM_MAX__ /* GCC extension. */
|
||||
#define ULLACCUM_EPSILON __ULLACCUM_EPSILON__ /* GCC extension. */
|
||||
|
||||
#endif /* _STDFIX_H */
|
|
@ -0,0 +1,174 @@
|
|||
/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Apple, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.22 Type-generic math <tgmath.h>
|
||||
*/
|
||||
|
||||
#ifndef _TGMATH_H
|
||||
#define _TGMATH_H
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <complex.h>
|
||||
|
||||
/* Naming convention: generic macros are defining using
|
||||
__TGMATH_CPLX*, __TGMATH_REAL*, and __TGMATH_CPLX_ONLY. _CPLX
|
||||
means the generic argument(s) may be real or complex, _REAL means
|
||||
real only, _CPLX means complex only. If there is no suffix, we are
|
||||
defining a function of one generic argument. If the suffix is _n
|
||||
it is a function of n generic arguments. If the suffix is _m_n it
|
||||
is a function of n arguments, the first m of which are generic. We
|
||||
only define these macros for values of n and/or m that are needed. */
|
||||
|
||||
/* The general rules for generic macros are given in 7.22 paragraphs 1 and 2.
|
||||
If any generic parameter is complex, we use a complex version. Otherwise
|
||||
we use a real version. If the real part of any generic parameter is long
|
||||
double, we use the long double version. Otherwise if the real part of any
|
||||
generic parameter is double or of integer type, we use the double version.
|
||||
Otherwise we use the float version. */
|
||||
|
||||
#define __tg_cplx(expr) \
|
||||
__builtin_classify_type(expr) == 9
|
||||
|
||||
#define __tg_ldbl(expr) \
|
||||
__builtin_types_compatible_p(__typeof__(expr), long double)
|
||||
|
||||
#define __tg_dbl(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), double) \
|
||||
|| __builtin_classify_type(expr) == 1)
|
||||
|
||||
#define __tg_choose(x,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x), d, \
|
||||
f))
|
||||
|
||||
#define __tg_choose_2(x,y,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y), d, \
|
||||
f))
|
||||
|
||||
#define __tg_choose_3(x,y,z,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y) || __tg_ldbl(z), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y) \
|
||||
|| __tg_dbl(z), d, \
|
||||
f))
|
||||
|
||||
#define __TGMATH_CPLX(z,R,C) \
|
||||
__builtin_choose_expr (__tg_cplx(z), \
|
||||
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), \
|
||||
__tg_choose (z, R##f(z), (R)(z), R##l(z)))
|
||||
|
||||
#define __TGMATH_CPLX_2(z1,z2,R,C) \
|
||||
__builtin_choose_expr (__tg_cplx(z1) || __tg_cplx(z2), \
|
||||
__tg_choose_2 (__real__(z1), __real__(z2), \
|
||||
C##f(z1,z2), (C)(z1,z2), C##l(z1,z2)), \
|
||||
__tg_choose_2 (z1, z2, \
|
||||
R##f(z1,z2), (R)(z1,z2), R##l(z1,z2)))
|
||||
|
||||
#define __TGMATH_REAL(x,R) \
|
||||
__tg_choose (x, R##f(x), (R)(x), R##l(x))
|
||||
#define __TGMATH_REAL_2(x,y,R) \
|
||||
__tg_choose_2 (x, y, R##f(x,y), (R)(x,y), R##l(x,y))
|
||||
#define __TGMATH_REAL_3(x,y,z,R) \
|
||||
__tg_choose_3 (x, y, z, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
|
||||
#define __TGMATH_REAL_1_2(x,y,R) \
|
||||
__tg_choose (x, R##f(x,y), (R)(x,y), R##l(x,y))
|
||||
#define __TGMATH_REAL_2_3(x,y,z,R) \
|
||||
__tg_choose_2 (x, y, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
|
||||
#define __TGMATH_CPLX_ONLY(z,C) \
|
||||
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z))
|
||||
|
||||
/* Functions defined in both <math.h> and <complex.h> (7.22p4) */
|
||||
#define acos(z) __TGMATH_CPLX(z, acos, cacos)
|
||||
#define asin(z) __TGMATH_CPLX(z, asin, casin)
|
||||
#define atan(z) __TGMATH_CPLX(z, atan, catan)
|
||||
#define acosh(z) __TGMATH_CPLX(z, acosh, cacosh)
|
||||
#define asinh(z) __TGMATH_CPLX(z, asinh, casinh)
|
||||
#define atanh(z) __TGMATH_CPLX(z, atanh, catanh)
|
||||
#define cos(z) __TGMATH_CPLX(z, cos, ccos)
|
||||
#define sin(z) __TGMATH_CPLX(z, sin, csin)
|
||||
#define tan(z) __TGMATH_CPLX(z, tan, ctan)
|
||||
#define cosh(z) __TGMATH_CPLX(z, cosh, ccosh)
|
||||
#define sinh(z) __TGMATH_CPLX(z, sinh, csinh)
|
||||
#define tanh(z) __TGMATH_CPLX(z, tanh, ctanh)
|
||||
#define exp(z) __TGMATH_CPLX(z, exp, cexp)
|
||||
#define log(z) __TGMATH_CPLX(z, log, clog)
|
||||
#define pow(z1,z2) __TGMATH_CPLX_2(z1, z2, pow, cpow)
|
||||
#define sqrt(z) __TGMATH_CPLX(z, sqrt, csqrt)
|
||||
#define fabs(z) __TGMATH_CPLX(z, fabs, cabs)
|
||||
|
||||
/* Functions defined in <math.h> only (7.22p5) */
|
||||
#define atan2(x,y) __TGMATH_REAL_2(x, y, atan2)
|
||||
#define cbrt(x) __TGMATH_REAL(x, cbrt)
|
||||
#define ceil(x) __TGMATH_REAL(x, ceil)
|
||||
#define copysign(x,y) __TGMATH_REAL_2(x, y, copysign)
|
||||
#define erf(x) __TGMATH_REAL(x, erf)
|
||||
#define erfc(x) __TGMATH_REAL(x, erfc)
|
||||
#define exp2(x) __TGMATH_REAL(x, exp2)
|
||||
#define expm1(x) __TGMATH_REAL(x, expm1)
|
||||
#define fdim(x,y) __TGMATH_REAL_2(x, y, fdim)
|
||||
#define floor(x) __TGMATH_REAL(x, floor)
|
||||
#define fma(x,y,z) __TGMATH_REAL_3(x, y, z, fma)
|
||||
#define fmax(x,y) __TGMATH_REAL_2(x, y, fmax)
|
||||
#define fmin(x,y) __TGMATH_REAL_2(x, y, fmin)
|
||||
#define fmod(x,y) __TGMATH_REAL_2(x, y, fmod)
|
||||
#define frexp(x,y) __TGMATH_REAL_1_2(x, y, frexp)
|
||||
#define hypot(x,y) __TGMATH_REAL_2(x, y, hypot)
|
||||
#define ilogb(x) __TGMATH_REAL(x, ilogb)
|
||||
#define ldexp(x,y) __TGMATH_REAL_1_2(x, y, ldexp)
|
||||
#define lgamma(x) __TGMATH_REAL(x, lgamma)
|
||||
#define llrint(x) __TGMATH_REAL(x, llrint)
|
||||
#define llround(x) __TGMATH_REAL(x, llround)
|
||||
#define log10(x) __TGMATH_REAL(x, log10)
|
||||
#define log1p(x) __TGMATH_REAL(x, log1p)
|
||||
#define log2(x) __TGMATH_REAL(x, log2)
|
||||
#define logb(x) __TGMATH_REAL(x, logb)
|
||||
#define lrint(x) __TGMATH_REAL(x, lrint)
|
||||
#define lround(x) __TGMATH_REAL(x, lround)
|
||||
#define nearbyint(x) __TGMATH_REAL(x, nearbyint)
|
||||
#define nextafter(x,y) __TGMATH_REAL_2(x, y, nextafter)
|
||||
#define nexttoward(x,y) __TGMATH_REAL_1_2(x, y, nexttoward)
|
||||
#define remainder(x,y) __TGMATH_REAL_2(x, y, remainder)
|
||||
#define remquo(x,y,z) __TGMATH_REAL_2_3(x, y, z, remquo)
|
||||
#define rint(x) __TGMATH_REAL(x, rint)
|
||||
#define round(x) __TGMATH_REAL(x, round)
|
||||
#define scalbn(x,y) __TGMATH_REAL_1_2(x, y, scalbn)
|
||||
#define scalbln(x,y) __TGMATH_REAL_1_2(x, y, scalbln)
|
||||
#define tgamma(x) __TGMATH_REAL(x, tgamma)
|
||||
#define trunc(x) __TGMATH_REAL(x, trunc)
|
||||
|
||||
/* Functions defined in <complex.h> only (7.22p6) */
|
||||
#define carg(z) __TGMATH_CPLX_ONLY(z, carg)
|
||||
#define cimag(z) __TGMATH_CPLX_ONLY(z, cimag)
|
||||
#define conj(z) __TGMATH_CPLX_ONLY(z, conj)
|
||||
#define cproj(z) __TGMATH_CPLX_ONLY(z, cproj)
|
||||
#define creal(z) __TGMATH_CPLX_ONLY(z, creal)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* _TGMATH_H */
|
|
@ -0,0 +1,279 @@
|
|||
/* Exception handling and frame unwind runtime interface routines.
|
||||
Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* As a special exception, if you include this header file into source
|
||||
files compiled by GCC, this header file does not by itself cause
|
||||
the resulting executable to be covered by the GNU General Public
|
||||
License. This exception does not however invalidate any other
|
||||
reasons why the executable file might be covered by the GNU General
|
||||
Public License. */
|
||||
|
||||
/* This is derived from the C++ ABI for IA-64. Where we diverge
|
||||
for cross-architecture compatibility are noted with "@@@". */
|
||||
|
||||
#ifndef _UNWIND_H
|
||||
#define _UNWIND_H
|
||||
|
||||
#ifndef HIDE_EXPORTS
|
||||
#pragma GCC visibility push(default)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Level 1: Base ABI */
|
||||
|
||||
/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
|
||||
inefficient for 32-bit and smaller machines. */
|
||||
typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
|
||||
typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
|
||||
#if defined(__ia64__) && defined(__hpux__)
|
||||
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
|
||||
#else
|
||||
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
|
||||
#endif
|
||||
typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
|
||||
|
||||
/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
|
||||
consumer of an exception. We'll go along with this for now even on
|
||||
32-bit machines. We'll need to provide some other option for
|
||||
16-bit machines and for machines with > 8 bits per byte. */
|
||||
typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
|
||||
|
||||
/* The unwind interface uses reason codes in several contexts to
|
||||
identify the reasons for failures or other actions. */
|
||||
typedef enum
|
||||
{
|
||||
_URC_NO_REASON = 0,
|
||||
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
|
||||
_URC_FATAL_PHASE2_ERROR = 2,
|
||||
_URC_FATAL_PHASE1_ERROR = 3,
|
||||
_URC_NORMAL_STOP = 4,
|
||||
_URC_END_OF_STACK = 5,
|
||||
_URC_HANDLER_FOUND = 6,
|
||||
_URC_INSTALL_CONTEXT = 7,
|
||||
_URC_CONTINUE_UNWIND = 8
|
||||
} _Unwind_Reason_Code;
|
||||
|
||||
|
||||
/* The unwind interface uses a pointer to an exception header object
|
||||
as its representation of an exception being thrown. In general, the
|
||||
full representation of an exception object is language- and
|
||||
implementation-specific, but it will be prefixed by a header
|
||||
understood by the unwind interface. */
|
||||
|
||||
struct _Unwind_Exception;
|
||||
|
||||
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
|
||||
struct _Unwind_Exception *);
|
||||
|
||||
struct _Unwind_Exception
|
||||
{
|
||||
_Unwind_Exception_Class exception_class;
|
||||
_Unwind_Exception_Cleanup_Fn exception_cleanup;
|
||||
_Unwind_Word private_1;
|
||||
_Unwind_Word private_2;
|
||||
|
||||
/* @@@ The IA-64 ABI says that this structure must be double-word aligned.
|
||||
Taking that literally does not make much sense generically. Instead we
|
||||
provide the maximum alignment required by any type for the machine. */
|
||||
} __attribute__((__aligned__));
|
||||
|
||||
|
||||
/* The ACTIONS argument to the personality routine is a bitwise OR of one
|
||||
or more of the following constants. */
|
||||
typedef int _Unwind_Action;
|
||||
|
||||
#define _UA_SEARCH_PHASE 1
|
||||
#define _UA_CLEANUP_PHASE 2
|
||||
#define _UA_HANDLER_FRAME 4
|
||||
#define _UA_FORCE_UNWIND 8
|
||||
#define _UA_END_OF_STACK 16
|
||||
|
||||
/* The target can override this macro to define any back-end-specific
|
||||
attributes required for the lowest-level stack frame. */
|
||||
#ifndef LIBGCC2_UNWIND_ATTRIBUTE
|
||||
#define LIBGCC2_UNWIND_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/* This is an opaque type used to refer to a system-specific data
|
||||
structure used by the system unwinder. This context is created and
|
||||
destroyed by the system, and passed to the personality routine
|
||||
during unwinding. */
|
||||
struct _Unwind_Context;
|
||||
|
||||
/* Raise an exception, passing along the given exception object. */
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_RaiseException (struct _Unwind_Exception *);
|
||||
|
||||
/* Raise an exception for forced unwinding. */
|
||||
|
||||
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
|
||||
(int, _Unwind_Action, _Unwind_Exception_Class,
|
||||
struct _Unwind_Exception *, struct _Unwind_Context *, void *);
|
||||
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
|
||||
|
||||
/* Helper to invoke the exception_cleanup routine. */
|
||||
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
|
||||
|
||||
/* Resume propagation of an existing exception. This is used after
|
||||
e.g. executing cleanup code, and not to implement rethrowing. */
|
||||
extern void LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_Resume (struct _Unwind_Exception *);
|
||||
|
||||
/* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow
|
||||
a normal exception that was handled. */
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
|
||||
|
||||
/* @@@ Use unwind data to perform a stack backtrace. The trace callback
|
||||
is called for every stack frame in the call chain, but no cleanup
|
||||
actions are performed. */
|
||||
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
|
||||
(struct _Unwind_Context *, void *);
|
||||
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_Backtrace (_Unwind_Trace_Fn, void *);
|
||||
|
||||
/* These functions are used for communicating information about the unwind
|
||||
context (i.e. the unwind descriptors and the user register state) between
|
||||
the unwind library and the personality routine and landing pad. Only
|
||||
selected registers may be manipulated. */
|
||||
|
||||
extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
|
||||
extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
|
||||
|
||||
extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
|
||||
extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
|
||||
extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
|
||||
|
||||
/* @@@ Retrieve the CFA of the given context. */
|
||||
extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
|
||||
|
||||
extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
|
||||
|
||||
extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
|
||||
|
||||
|
||||
/* The personality routine is the function in the C++ (or other language)
|
||||
runtime library which serves as an interface between the system unwind
|
||||
library and language-specific exception handling semantics. It is
|
||||
specific to the code fragment described by an unwind info block, and
|
||||
it is always referenced via the pointer in the unwind info block, and
|
||||
hence it has no ABI-specified name.
|
||||
|
||||
Note that this implies that two different C++ implementations can
|
||||
use different names, and have different contents in the language
|
||||
specific data area. Moreover, that the language specific data
|
||||
area contains no version info because name of the function invoked
|
||||
provides more effective versioning by detecting at link time the
|
||||
lack of code to handle the different data format. */
|
||||
|
||||
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
|
||||
(int, _Unwind_Action, _Unwind_Exception_Class,
|
||||
struct _Unwind_Exception *, struct _Unwind_Context *);
|
||||
|
||||
/* @@@ The following alternate entry points are for setjmp/longjmp
|
||||
based unwinding. */
|
||||
|
||||
struct SjLj_Function_Context;
|
||||
extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
|
||||
extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
|
||||
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_SjLj_RaiseException (struct _Unwind_Exception *);
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
|
||||
extern void LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_SjLj_Resume (struct _Unwind_Exception *);
|
||||
extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE
|
||||
_Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
|
||||
|
||||
/* @@@ The following provide access to the base addresses for text
|
||||
and data-relative addressing in the LDSA. In order to stay link
|
||||
compatible with the standard ABI for IA-64, we inline these. */
|
||||
|
||||
#ifdef __ia64__
|
||||
#include <stdlib.h>
|
||||
|
||||
static inline _Unwind_Ptr
|
||||
_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
|
||||
{
|
||||
/* The GP is stored in R1. */
|
||||
return _Unwind_GetGR (_C, 1);
|
||||
}
|
||||
|
||||
static inline _Unwind_Ptr
|
||||
_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__)))
|
||||
{
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* @@@ Retrieve the Backing Store Pointer of the given context. */
|
||||
extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
|
||||
#else
|
||||
extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
|
||||
extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
|
||||
#endif
|
||||
|
||||
/* @@@ Given an address, return the entry point of the function that
|
||||
contains it. */
|
||||
extern void * _Unwind_FindEnclosingFunction (void *pc);
|
||||
|
||||
#ifndef __SIZEOF_LONG__
|
||||
#error "__SIZEOF_LONG__ macro not defined"
|
||||
#endif
|
||||
|
||||
#ifndef __SIZEOF_POINTER__
|
||||
#error "__SIZEOF_POINTER__ macro not defined"
|
||||
#endif
|
||||
|
||||
|
||||
/* leb128 type numbers have a potentially unlimited size.
|
||||
The target of the following definitions of _sleb128_t and _uleb128_t
|
||||
is to have efficient data types large enough to hold the leb128 type
|
||||
numbers used in the unwind code.
|
||||
Mostly these types will simply be defined to long and unsigned long
|
||||
except when a unsigned long data type on the target machine is not
|
||||
capable of storing a pointer. */
|
||||
|
||||
#if __SIZEOF_LONG__ >= __SIZEOF_POINTER__
|
||||
typedef long _sleb128_t;
|
||||
typedef unsigned long _uleb128_t;
|
||||
#elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__
|
||||
typedef long long _sleb128_t;
|
||||
typedef unsigned long long _uleb128_t;
|
||||
#else
|
||||
# error "What type shall we use for _sleb128_t?"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HIDE_EXPORTS
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif /* unwind.h */
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef _VARARGS_H
|
||||
#define _VARARGS_H
|
||||
|
||||
#error "GCC no longer implements <varargs.h>."
|
||||
#error "Revise your code to use <stdarg.h>."
|
||||
|
||||
#endif
|
|
@ -0,0 +1 @@
|
|||
;
|
|
@ -0,0 +1,8 @@
|
|||
/* syslimits.h stands for the system's own limits.h file.
|
||||
If we can use it ok unmodified, then we install this text.
|
||||
If fixincludes fixes it, then the fixed version is installed
|
||||
instead of this text. */
|
||||
|
||||
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
|
||||
#include_next <limits.h>
|
||||
#undef _GCC_NEXT_LIMITS_H
|
|
@ -0,0 +1,14 @@
|
|||
This README file is copied into the directory for GCC-only header files
|
||||
when fixincludes is run by the makefile for GCC.
|
||||
|
||||
Many of the files in this directory were automatically edited from the
|
||||
standard system header files by the fixincludes process. They are
|
||||
system-specific, and will not work on any other kind of system. They
|
||||
are also not part of GCC. The reason we have to do this is because
|
||||
GCC requires ANSI C headers and many vendors supply ANSI-incompatible
|
||||
headers.
|
||||
|
||||
Because this is an automated process, sometimes headers get "fixed"
|
||||
that do not, strictly speaking, need a fix. As long as nothing is broken
|
||||
by the process, it is just an unfortunate collateral inconvenience.
|
||||
We would like to rectify it, if it is not "too inconvenient".
|
|
@ -0,0 +1,103 @@
|
|||
#ifndef _LIMITS_H___
|
||||
#define _LIMITS_H___
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
#undef CHAR_BIT
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
/* Maximum length of a multibyte character. */
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
#undef SCHAR_MIN
|
||||
#define SCHAR_MIN (-SCHAR_MAX - 1)
|
||||
#undef SCHAR_MAX
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
#undef UCHAR_MAX
|
||||
#if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
|
||||
#else
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define CHAR_MIN 0U
|
||||
# else
|
||||
# define CHAR_MIN 0
|
||||
# endif
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
#undef SHRT_MIN
|
||||
#define SHRT_MIN (-SHRT_MAX - 1)
|
||||
#undef SHRT_MAX
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
#undef USHRT_MAX
|
||||
#if __SHRT_MAX__ == __INT_MAX__
|
||||
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
|
||||
#else
|
||||
# define USHRT_MAX (SHRT_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
#undef INT_MIN
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
#undef INT_MAX
|
||||
#define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
#undef UINT_MAX
|
||||
#define UINT_MAX (INT_MAX * 2U + 1U)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
#undef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1L)
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#endif /* _LIMITS_H___ */
|
|
@ -0,0 +1 @@
|
|||
AVR
|
|
@ -0,0 +1,5 @@
|
|||
SYSTEM_HEADER_DIR="/c/WinAVR/avr/sys-include"
|
||||
OTHER_FIXINCLUDES_DIRS=""
|
||||
FIXPROTO_DEFINES=""
|
||||
STMP_FIXPROTO="stmp-fixproto"
|
||||
STMP_FIXINC="stmp-fixinc"
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,30 @@
|
|||
# Only load the rhabout plugin if it was installed.
|
||||
foreach dir $::gdb_plugins {
|
||||
if {[file exists [file join $dir rhabout]]} {
|
||||
package require RHABOUT 1.0
|
||||
$Menu add command Other "About Red Hat" \
|
||||
{ManagedWin::open RHAbout} -underline 0
|
||||
|
||||
# To activate the PlugIn sample, uncomment the next line
|
||||
set plugins_available 1
|
||||
}
|
||||
}
|
||||
|
||||
# Only load the Intel Pentium plugin for x86 targets.
|
||||
if {[string match "i?86-*" $::GDBStartup(target_name)] && ![TargetSelection::native_debugging]} {
|
||||
package require INTELPENTIUM 1.0
|
||||
|
||||
# Add a new cascading-style menu to plugin menu
|
||||
$Menu add cascade intel "Intel Pentium" 0
|
||||
|
||||
# Add MSR selection dialog menu item.
|
||||
$Menu add command None "MSR Selection..." \
|
||||
{ManagedWin::open_dlg MsrSelDlg} -underline 0
|
||||
|
||||
# Add CPU info menu item.
|
||||
$Menu add command None "CPU Information..." \
|
||||
display_cpu_info -underline 0
|
||||
|
||||
# Activate the PlugIn.
|
||||
set plugins_available 1
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itcl 3.2 [list load [file join $dir .. .. bin "itcl32.dll"] Itcl]
|
|
@ -0,0 +1,3 @@
|
|||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itk 3.2 [list load [file join $dir .. .. bin "itk32.dll"] Itk]
|
BIN
arduino-0018-windows/hardware/tools/avr/lib/libiberty.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libiberty.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libitclstub32.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libitclstub32.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libitkstub32.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libitkstub32.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtcl84.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtcl84.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtclstub84.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtclstub84.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtk84.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtk84.a
Normal file
Binary file not shown.
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtkstub84.a
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/libtkstub84.a
Normal file
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
if {![package vsatisfies [package provide Tcl] 8]} {return}
|
||||
if {[info exists tcl_platform(debug)]} {
|
||||
package ifneeded registry 1.1 \
|
||||
[list load [file join $dir tclreg11d.dll] registry]
|
||||
} else {
|
||||
package ifneeded registry 1.1 \
|
||||
[list load [file join $dir tclreg11.dll] registry]
|
||||
}
|
BIN
arduino-0018-windows/hardware/tools/avr/lib/reg1.1/tclreg11.dll
Normal file
BIN
arduino-0018-windows/hardware/tools/avr/lib/reg1.1/tclreg11.dll
Normal file
Binary file not shown.
182
arduino-0018-windows/hardware/tools/avr/lib/tclConfig.sh
Normal file
182
arduino-0018-windows/hardware/tools/avr/lib/tclConfig.sh
Normal file
|
@ -0,0 +1,182 @@
|
|||
# tclConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by Tcl's
|
||||
# configure script. It will create shell variables for most of
|
||||
# the configuration options discovered by the configure script.
|
||||
# This script is intended to be included by the configure scripts
|
||||
# for Tcl extensions so that they don't have to figure this all
|
||||
# out for themselves.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
#
|
||||
# RCS: @(#) $Id: tclConfig.sh.in,v 1.8 2001/11/08 03:07:22 mdejong Exp $
|
||||
|
||||
TCL_DLL_FILE="tcl84.dll"
|
||||
|
||||
# Tcl's version number.
|
||||
TCL_VERSION='8.4'
|
||||
TCL_MAJOR_VERSION='8'
|
||||
TCL_MINOR_VERSION='4'
|
||||
TCL_PATCH_LEVEL='.1'
|
||||
|
||||
# C compiler to use for compilation.
|
||||
TCL_CC='gcc'
|
||||
|
||||
# -D flags for use with the C compiler.
|
||||
TCL_DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_NO_SEH=1 -DEXCEPTION_DISPOSITION=int -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1'
|
||||
|
||||
# If TCL was built with debugging symbols, generated libraries contain
|
||||
# this string at the end of the library name (before the extension).
|
||||
TCL_DBGX=
|
||||
|
||||
# Default flags used in an optimized and debuggable build, respectively.
|
||||
TCL_CFLAGS_DEBUG='-g'
|
||||
TCL_CFLAGS_OPTIMIZE=''
|
||||
|
||||
# Default linker flags used in an optimized and debuggable build, respectively.
|
||||
TCL_LDFLAGS_DEBUG=''
|
||||
TCL_LDFLAGS_OPTIMIZE=''
|
||||
|
||||
# Flag, 1: we built a shared lib, 0 we didn't
|
||||
TCL_SHARED_BUILD=1
|
||||
|
||||
# The name of the Tcl library (may be either a .a file or a shared library):
|
||||
TCL_LIB_FILE='libtcl84.a'
|
||||
|
||||
# Flag to indicate whether shared libraries need export files.
|
||||
TCL_NEEDS_EXP_FILE=
|
||||
|
||||
# String that can be evaluated to generate the part of the export file
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variables
|
||||
# VERSION. On most UNIX systems this is ${VERSION}.exp.
|
||||
TCL_EXPORT_FILE_SUFFIX='${NODOT_VERSION}${DBGX}.a'
|
||||
|
||||
# Additional libraries to use when linking Tcl.
|
||||
TCL_LIBS=''
|
||||
|
||||
# Top-level directory in which Tcl's platform-independent files are
|
||||
# installed.
|
||||
TCL_PREFIX='/c/WinAVR'
|
||||
|
||||
# Top-level directory in which Tcl's platform-specific files (e.g.
|
||||
# executables) are installed.
|
||||
TCL_EXEC_PREFIX='/c/WinAVR'
|
||||
|
||||
# Flags to pass to cc when compiling the components of a shared library:
|
||||
TCL_SHLIB_CFLAGS=''
|
||||
|
||||
# Flags to pass to cc to get warning messages
|
||||
TCL_CFLAGS_WARNING='-Wall -Wconversion'
|
||||
|
||||
# Extra flags to pass to cc:
|
||||
TCL_EXTRA_CFLAGS='-mwin32 '
|
||||
|
||||
# Base command to use for combining object files into a shared library:
|
||||
TCL_SHLIB_LD='${CC} -shared ${CFLAGS}'
|
||||
|
||||
# Base command to use for combining object files into a static library:
|
||||
TCL_STLIB_LD='${AR} cr'
|
||||
|
||||
# Either '$LIBS' (if dependent libraries should be included when linking
|
||||
# shared libraries) or an empty string. See Tcl's configure.in for more
|
||||
# explanation.
|
||||
TCL_SHLIB_LD_LIBS=''
|
||||
|
||||
# Suffix to use for the name of a shared library.
|
||||
TCL_SHLIB_SUFFIX=''
|
||||
|
||||
# Library file(s) to include in tclsh and other base applications
|
||||
# in order to provide facilities needed by DLOBJ above.
|
||||
TCL_DL_LIBS=''
|
||||
|
||||
# Flags to pass to the compiler when linking object files into
|
||||
# an executable tclsh or tcltest binary.
|
||||
TCL_LD_FLAGS='-static'
|
||||
|
||||
# Flags to pass to ld, such as "-R /usr/local/tcl/lib", that tell the
|
||||
# run-time dynamic linker where to look for shared libraries such as
|
||||
# libtcl.so. Used when linking applications. Only works if there
|
||||
# is a variable "LIB_RUNTIME_DIR" defined in the Makefile.
|
||||
TCL_LD_SEARCH_FLAGS=''
|
||||
|
||||
# Additional object files linked with Tcl to provide compatibility
|
||||
# with standard facilities from ANSI C or POSIX.
|
||||
TCL_COMPAT_OBJS=''
|
||||
|
||||
# Name of the ranlib program to use.
|
||||
TCL_RANLIB='ranlib'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tcl library
|
||||
TCL_LIB_FLAG=''
|
||||
|
||||
# String to pass to linker to pick up the Tcl library from its
|
||||
# build directory.
|
||||
TCL_BUILD_LIB_SPEC='-L/c/avrdev/insight/build/tcl/win -ltcl84'
|
||||
|
||||
# String to pass to linker to pick up the Tcl library from its
|
||||
# installed directory.
|
||||
TCL_LIB_SPEC=''
|
||||
|
||||
# String to pass to the compiler so that an extension can
|
||||
# find installed Tcl headers.
|
||||
TCL_INCLUDE_SPEC='-I/c/WinAVR/include'
|
||||
|
||||
# Indicates whether a version numbers should be used in -l switches
|
||||
# ("ok" means it's safe to use switches like -ltcl7.5; "nodots" means
|
||||
# use switches like -ltcl75). SunOS and FreeBSD require "nodots", for
|
||||
# example.
|
||||
TCL_LIB_VERSIONS_OK=''
|
||||
|
||||
# String that can be evaluated to generate the part of a shared library
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variables
|
||||
# VERSION and SHLIB_SUFFIX. On most UNIX systems this is
|
||||
# ${VERSION}${SHLIB_SUFFIX}.
|
||||
TCL_SHARED_LIB_SUFFIX='${NODOT_VERSION}${DBGX}.dll'
|
||||
|
||||
# String that can be evaluated to generate the part of an unshared library
|
||||
# name that comes after the "libxxx" (includes version number, if any,
|
||||
# extension, and anything else needed). May depend on the variable
|
||||
# VERSION. On most UNIX systems this is ${VERSION}.a.
|
||||
TCL_UNSHARED_LIB_SUFFIX='${NODOT_VERSION}${DBGX}.a'
|
||||
|
||||
# Location of the top-level source directory from which Tcl was built.
|
||||
# This is the directory that contains a README file as well as
|
||||
# subdirectories such as generic, unix, etc. If Tcl was compiled in a
|
||||
# different place than the directory containing the source files, this
|
||||
# points to the location of the sources, not the location where Tcl was
|
||||
# compiled.
|
||||
TCL_SRC_DIR='/c/avrdev/insight/insight-6.8/tcl'
|
||||
|
||||
# List of standard directories in which to look for packages during
|
||||
# "package require" commands. Contains the "prefix" directory plus also
|
||||
# the "exec_prefix" directory, if it is different.
|
||||
TCL_PACKAGE_PATH=''
|
||||
|
||||
# Tcl supports stub.
|
||||
TCL_SUPPORTS_STUBS=1
|
||||
|
||||
# The name of the Tcl stub library (.a):
|
||||
TCL_STUB_LIB_FILE='libtclstub84.a'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tcl stub library
|
||||
TCL_STUB_LIB_FLAG='-ltclstub84'
|
||||
|
||||
# String to pass to linker to pick up the Tcl stub library from its
|
||||
# build directory.
|
||||
TCL_BUILD_STUB_LIB_SPEC='-L/c/avrdev/insight/build/tcl/win -ltclstub84'
|
||||
|
||||
# String to pass to linker to pick up the Tcl stub library from its
|
||||
# installed directory.
|
||||
TCL_STUB_LIB_SPEC='-L/c/WinAVR/lib -ltclstub84'
|
||||
|
||||
# Path to the Tcl stub library in the build directory.
|
||||
TCL_BUILD_STUB_LIB_PATH='/c/avrdev/insight/build/tcl/win/libtclstub84.a'
|
||||
|
||||
# Path to the Tcl stub library in the install directory.
|
||||
TCL_STUB_LIB_PATH='/c/WinAVR/lib/libtclstub84.a'
|
||||
|
||||
# Flag, 1: we built Tcl with threads enables, 0 we didn't
|
||||
TCL_THREADS=0
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
if {[package vcompare [package provide Tcl] 8.4] != 0} { return }
|
||||
package ifneeded Tk 8.4 [list load [file join $dir .. .. bin tk84.dll] Tk]
|
90
arduino-0018-windows/hardware/tools/avr/lib/tkConfig.sh
Normal file
90
arduino-0018-windows/hardware/tools/avr/lib/tkConfig.sh
Normal file
|
@ -0,0 +1,90 @@
|
|||
# tkConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by Tk's
|
||||
# configure script. It will create shell variables for most of
|
||||
# the configuration options discovered by the configure script.
|
||||
# This script is intended to be included by the configure scripts
|
||||
# for Tk extensions so that they don't have to figure this all
|
||||
# out for themselves. This file does not duplicate information
|
||||
# already provided by tclConfig.sh, so you may need to use that
|
||||
# file in addition to this one.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
#
|
||||
# RCS: @(#) $Id: tkConfig.sh.in,v 1.2 2001/10/15 21:19:16 hobbs Exp $
|
||||
|
||||
# Tk's version number.
|
||||
TK_VERSION='8.4'
|
||||
TK_MAJOR_VERSION='8'
|
||||
TK_MINOR_VERSION='4'
|
||||
TK_PATCH_LEVEL='.1'
|
||||
|
||||
# -D flags for use with the C compiler.
|
||||
TK_DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1'
|
||||
|
||||
# Flag, 1: we built a shared lib, 0 we didn't
|
||||
TK_SHARED_BUILD=1
|
||||
|
||||
# This indicates if Tk was build with debugging symbols
|
||||
TK_DBGX=
|
||||
|
||||
# The name of the Tk library (may be either a .a file or a shared library):
|
||||
TK_LIB_FILE='libtk84.a'
|
||||
|
||||
# Additional libraries to use when linking Tk.
|
||||
TK_LIBS=' -lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32'
|
||||
|
||||
# Top-level directory in which Tcl's platform-independent files are
|
||||
# installed.
|
||||
TK_PREFIX='/c/WinAVR'
|
||||
|
||||
# Top-level directory in which Tcl's platform-specific files (e.g.
|
||||
# executables) are installed.
|
||||
TK_EXEC_PREFIX='/c/WinAVR'
|
||||
|
||||
# -I switch(es) to use to make all of the X11 include files accessible:
|
||||
TK_XINCLUDES='-I"c:/avrdev/insight/insight-6.8/tk/xlib"'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tcl library
|
||||
TK_LIB_FLAG=''
|
||||
|
||||
# String to pass to linker to pick up the Tk library from its
|
||||
# build directory.
|
||||
TK_BUILD_LIB_SPEC='-L/c/avrdev/insight/build/tk/win -ltk84'
|
||||
|
||||
# String to pass to linker to pick up the Tk library from its
|
||||
# installed directory.
|
||||
TK_LIB_SPEC=''
|
||||
|
||||
# Location of the top-level source directory from which Tk was built.
|
||||
# This is the directory that contains a README file as well as
|
||||
# subdirectories such as generic, unix, etc. If Tk was compiled in a
|
||||
# different place than the directory containing the source files, this
|
||||
# points to the location of the sources, not the location where Tk was
|
||||
# compiled.
|
||||
TK_SRC_DIR='/c/avrdev/insight/insight-6.8/tk'
|
||||
|
||||
# Needed if you want to make a 'fat' shared library library
|
||||
# containing tk objects or link a different wish.
|
||||
TK_CC_SEARCH_FLAGS=''
|
||||
TK_LD_SEARCH_FLAGS=''
|
||||
|
||||
# The name of the Tk stub library (.a):
|
||||
TK_STUB_LIB_FILE='libtkstub84.a'
|
||||
|
||||
# -l flag to pass to the linker to pick up the Tk stub library
|
||||
TK_STUB_LIB_FLAG='-ltkstub84'
|
||||
|
||||
# String to pass to linker to pick up the Tk stub library from its
|
||||
# build directory.
|
||||
TK_BUILD_STUB_LIB_SPEC='-L/c/avrdev/insight/build/tk/win -ltkstub84'
|
||||
|
||||
# String to pass to linker to pick up the Tk stub library from its
|
||||
# installed directory.
|
||||
TK_STUB_LIB_SPEC=''
|
||||
|
||||
# Path to the Tk stub library in the build directory.
|
||||
TK_BUILD_STUB_LIB_PATH=''
|
||||
|
||||
# Path to the Tk stub library in the install directory.
|
||||
TK_STUB_LIB_PATH=''
|
Reference in a new issue