1#ifndef __SYS_CONFIG_H__ 2#define __SYS_CONFIG_H__ 3 4#include <machine/ieeefp.h> /* floating point macros */ 5#include <sys/features.h> /* POSIX defs */ 6 7/* exceptions first */ 8#if defined(__H8500__) || defined(__W65__) 9#define __SMALL_BITFIELDS 10/* ??? This conditional is true for the h8500 and the w65, defining H8300 11 in those cases probably isn't the right thing to do. */ 12#define H8300 1 13#endif 14 15/* 16 bit integer machines */ 16#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__) 17 18#undef INT_MAX 19#undef UINT_MAX 20#define INT_MAX 32767 21#define UINT_MAX 65535 22#endif 23 24#if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__) 25#define __SMALL_BITFIELDS 26#define H8300 1 27#undef INT_MAX 28#undef UINT_MAX 29#define INT_MAX __INT_MAX__ 30#define UINT_MAX (__INT_MAX__ * 2U + 1) 31#endif 32 33#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) 34#define __SMALL_BITFIELDS 35#endif 36 37#ifdef __W65__ 38#define __SMALL_BITFIELDS 39#endif 40 41#if defined(__D10V__) 42#define __SMALL_BITFIELDS 43#undef INT_MAX 44#undef UINT_MAX 45#define INT_MAX __INT_MAX__ 46#define UINT_MAX (__INT_MAX__ * 2U + 1) 47#define _POINTER_INT short 48#endif 49 50#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) 51#undef INT_MAX 52#undef UINT_MAX 53#define INT_MAX __INT_MAX__ 54#define UINT_MAX (__INT_MAX__ * 2U + 1) 55#define _POINTER_INT short 56#endif 57 58#ifdef ___AM29K__ 59#define _FLOAT_RET double 60#endif 61 62#ifdef __i386__ 63#ifndef __unix__ 64/* in other words, go32 */ 65#define _FLOAT_RET double 66#endif 67#if defined(__linux__) || defined(__RDOS__) 68/* we want the reentrancy structure to be returned by a function */ 69#define __DYNAMIC_REENT__ 70#define HAVE_GETDATE 71#define _HAVE_SYSTYPES 72#define _READ_WRITE_RETURN_TYPE _ssize_t 73#define __LARGE64_FILES 1 74/* we use some glibc header files so turn on glibc large file feature */ 75#define _LARGEFILE64_SOURCE 1 76#endif 77#endif 78 79#ifdef __mn10200__ 80#define __SMALL_BITFIELDS 81#endif 82 83#ifdef __AVR__ 84#define __SMALL_BITFIELDS 85#define _POINTER_INT short 86#endif 87 88#ifdef __v850 89#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) 90#endif 91 92/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ 93#if defined(__PPC__) 94#if defined(_CALL_SYSV) 95#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) 96#endif 97#ifdef __SPE__ 98#define _LONG_DOUBLE double 99#endif 100#endif 101 102/* Configure small REENT structure for Xilinx MicroBlaze platforms */ 103#if defined (__MICROBLAZE__) 104#ifndef _REENT_SMALL 105#define _REENT_SMALL 106#endif 107/* Xilinx XMK uses Unix98 mutex */ 108#ifdef __XMK__ 109#define _UNIX98_THREAD_MUTEX_ATTRIBUTES 110#endif 111#endif 112 113#if defined(__mips__) && !defined(__rtems__) 114#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) 115#endif 116 117#ifdef __xstormy16__ 118#define __SMALL_BITFIELDS 119#undef INT_MAX 120#undef UINT_MAX 121#define INT_MAX __INT_MAX__ 122#define UINT_MAX (__INT_MAX__ * 2U + 1) 123#define MALLOC_ALIGNMENT 8 124#define _POINTER_INT short 125#define __BUFSIZ__ 16 126#define _REENT_SMALL 127#endif 128#ifdef __m32c__ 129#define __SMALL_BITFIELDS 130#undef INT_MAX 131#undef UINT_MAX 132#define INT_MAX __INT_MAX__ 133#define UINT_MAX (__INT_MAX__ * 2U + 1) 134#define MALLOC_ALIGNMENT 8 135#if defined(__r8c_cpu__) || defined(__m16c_cpu__) 136#define _POINTER_INT short 137#else 138#define _POINTER_INT long 139#endif 140#define __BUFSIZ__ 16 141#define _REENT_SMALL 142#endif /* __m32c__ */ 143 144/* CSL LOCAL */ 145#ifdef __thumb2__ 146/* Thumb-2 based ARMv7M devices are really small, and that's where we 147 build the library as Thumb-2. */ 148#define _REENT_SMALL 149#endif 150 151#ifdef __SPU__ 152#define MALLOC_ALIGNMENT 16 153#define __CUSTOM_FILE_IO__ 154#endif 155 156/* This block should be kept in sync with GCC's limits.h. The point 157 of having these definitions here is to not include limits.h, which 158 would pollute the user namespace, while still using types of the 159 the correct widths when deciding how to define __int32_t and 160 __int64_t. */ 161#ifndef __INT_MAX__ 162# ifdef INT_MAX 163# define __INT_MAX__ INT_MAX 164# else 165# define __INT_MAX__ 2147483647 166# endif 167#endif 168 169#ifndef __LONG_MAX__ 170# ifdef LONG_MAX 171# define __LONG_MAX__ LONG_MAX 172# else 173# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \ 174 || defined (__sparcv9) 175# define __LONG_MAX__ 9223372036854775807L 176# else 177# define __LONG_MAX__ 2147483647L 178# endif /* __alpha__ || sparc64 */ 179# endif 180#endif 181/* End of block that should be kept in sync with GCC's limits.h. */ 182 183#ifndef _POINTER_INT 184#define _POINTER_INT long 185#endif 186 187#ifdef __frv__ 188#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) 189#endif 190#undef __RAND_MAX 191#if __INT_MAX__ == 32767 192#define __RAND_MAX 32767 193#else 194#define __RAND_MAX 0x7fffffff 195#endif 196 197#if defined(__CYGWIN__) 198#include <cygwin/config.h> 199#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) 200#define __USE_XOPEN2K 1 201#endif 202#endif 203 204#if defined(__rtems__) 205#define __FILENAME_MAX__ 255 206#define _READ_WRITE_RETURN_TYPE _ssize_t 207#endif 208 209#ifndef __EXPORT 210#define __EXPORT 211#endif 212 213#ifndef __IMPORT 214#define __IMPORT 215#endif 216 217/* Define return type of read/write routines. In POSIX, the return type 218 for read()/write() is "ssize_t" but legacy newlib code has been using 219 "int" for some time. If not specified, "int" is defaulted. */ 220#ifndef _READ_WRITE_RETURN_TYPE 221#define _READ_WRITE_RETURN_TYPE int 222#endif 223 224#ifndef __WCHAR_MAX__ 225#if __INT_MAX__ == 32767 || defined (_WIN32) 226#define __WCHAR_MAX__ 0xffffu 227#endif 228#endif 229 230/* See if small reent asked for at configuration time and 231 is not chosen by the platform by default. */ 232#ifdef _WANT_REENT_SMALL 233#ifndef _REENT_SMALL 234#define _REENT_SMALL 235#endif 236#endif 237 238/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended 239 charsets. The extended charsets add a few functions and a couple 240 of tables of a few K each. */ 241#ifdef _MB_EXTENDED_CHARSETS_ALL 242#define _MB_EXTENDED_CHARSETS_ISO 1 243#define _MB_EXTENDED_CHARSETS_WINDOWS 1 244#endif 245 246#endif /* __SYS_CONFIG_H__ */ 247