libc/newlib/libc/include/sys/config.h

301 lines
6.9 KiB
C
Raw Normal View History

2000-02-17 20:39:52 +01:00
#ifndef __SYS_CONFIG_H__
#define __SYS_CONFIG_H__
#include <machine/ieeefp.h> /* floating point macros */
#include <sys/features.h> /* POSIX defs */
2012-09-26 Ian Bolton <ian.bolton@arm.com> Jim MacArthur <jim.macarthur@arm.com> Marcus Shawcroft <marcus.shawcroft@arm.com> Nigel Stephens <nigel.stephens@arm.com> Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> Richard Earnshaw <rearnsha@arm.com> Sofiane Naci <sofiane.naci@arm.com> Tejas Belagod <tejas.belagod@arm.com> Yufeng Zhang <yufeng.zhang@arm.com> * configure.host: Add AArch64. * libc/include/machine/ieeefp.h: Add AArch64. * libc/include/machine/setjmp.h: Add AArch64. * libc/include/machine/time.h: Add AArch64. * libc/include/sys/config.h: Add AArch64. * libc/machine/aarch64/Makefile.am: New file. * libc/machine/aarch64/Makefile.in: Generated. * libc/machine/aarch64/aclocal.m4: Generated. * libc/machine/aarch64/configure: Generated. * libc/machine/aarch64/configure.in: New file. * libc/machine/aarch64/setjmp.S: New file. * libc/machine/configure.in: Add AArch64. * libc/machine/configure: Re-generated. * libm/machine/aarch64/Makefile.am: New file. * libm/machine/aarch64/Makefile.in: Generated. * libm/machine/aarch64/aclocal.m4: Generated. * libm/machine/aarch64/configure: Generated. * libm/machine/aarch64/configure.in: New file. * libm/machine/aarch64/s_ceil.c: New file. * libm/machine/aarch64/s_floor.c: New file. * libm/machine/aarch64/s_fma.c: New file. * libm/machine/aarch64/s_fmax.c: New file. * libm/machine/aarch64/s_fmin.c: New file. * libm/machine/aarch64/s_llrint.c: New file. * libm/machine/aarch64/s_llround.c: New file. * libm/machine/aarch64/s_lrint.c: New file. * libm/machine/aarch64/s_lround.c: New file. * libm/machine/aarch64/s_nearbyint.c: New file. * libm/machine/aarch64/s_rint.c: New file. * libm/machine/aarch64/s_round.c: New file. * libm/machine/aarch64/s_trunc.c: New file. * libm/machine/aarch64/sf_ceil.c: New file. * libm/machine/aarch64/sf_floor.c: New file. * libm/machine/aarch64/sf_fma.c: New file. * libm/machine/aarch64/sf_fmax.c: New file. * libm/machine/aarch64/sf_fmin.c: New file. * libm/machine/aarch64/sf_llrint.c: New file. * libm/machine/aarch64/sf_llround.c: New file. * libm/machine/aarch64/sf_lrint.c: New file. * libm/machine/aarch64/sf_lround.c: New file. * libm/machine/aarch64/sf_nearbyint.c: New file. * libm/machine/aarch64/sf_rint.c: New file. * libm/machine/aarch64/sf_round.c: New file. * libm/machine/aarch64/sf_trunc.c: New file. * libm/machine/configure.in: Add AArch64. * libm/machine/configure: Re-generated.
2012-09-26 22:06:50 +02:00
#ifdef __aarch64__
#define MALLOC_ALIGNMENT 16
#endif
2000-02-17 20:39:52 +01:00
/* exceptions first */
#if defined(__H8500__) || defined(__W65__)
#define __SMALL_BITFIELDS
2000-02-17 20:39:52 +01:00
/* ??? This conditional is true for the h8500 and the w65, defining H8300
in those cases probably isn't the right thing to do. */
#define H8300 1
#endif
/* 16 bit integer machines */
#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__)
2000-02-17 20:39:52 +01:00
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX 32767
#define UINT_MAX 65535
#endif
#if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__)
#define __SMALL_BITFIELDS
#define H8300 1
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#endif
#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
#ifndef __INT32__
#define __SMALL_BITFIELDS
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX 32767
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#else /* INT32 */
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX 2147483647
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#endif /* INT32 */
#endif /* CR16C */
#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__)
#define __SMALL_BITFIELDS
#endif
#ifdef __W65__
#define __SMALL_BITFIELDS
#endif
2000-02-17 20:39:52 +01:00
#if defined(__D10V__)
#define __SMALL_BITFIELDS
2000-02-17 20:39:52 +01:00
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#define _POINTER_INT short
#endif
#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
2000-02-17 20:39:52 +01:00
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#define _POINTER_INT short
#endif
#if defined(__m68k__) || defined(__mc68000__) || defined(__riscv)
#define _READ_WRITE_RETURN_TYPE _ssize_t
#endif
2000-02-17 20:39:52 +01:00
#ifdef ___AM29K__
#define _FLOAT_RET double
#endif
#ifdef __i386__
#ifndef __unix__
/* in other words, go32 */
#define _FLOAT_RET double
#endif
#if defined(__linux__) || defined(__RDOS__)
2002-05-17 Jeff Johnston <jjohnstn@redhat.com> * Makefile.am: Copy and install headers from sys/machine/include directory. Also pass $toollibdir to lower-level directories. * Makefile.in: Regenerated. * libc/include/stdio.h[!_REENT_ONLY]: Change stdin, stdout, and stderr to use _REENT macro instead of _impure_ptr directly. * libc/include/sys/config.h[__i386__][__linux__]: Define __DYNAMIC_REENT__. * libc/include/sys/reent.h[!_REENT_ONLY]: Change _REENT macro to be call to __getreent() function if !__SINGLE_THREAD__ and __DYNAMIC_REENT__ is set. * libc/reent/Makefile.am: Add support for getreent.c. * libc/reent/Makefile.in: Regenerated. * libc/string/strerror.c: Add check if EOPNOTSUPP and ENOTSUP are same. * libc/sys/linux/Makefile.am: Add support for new files. * libc/sys/linux/configure.in: Add $EXTRA_DIRS variable. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/configure: Ditto. * libc/sys/linux/io.c: Add poll syscall. Also weak-alias __close, __read, __write, __poll, __open, __lseek, __fcntl from their __libc_ counterparts. * libc/sys/linux/io64.c: Add __libc_ prefix to lseek64 and open64 and weak-alias to regular names. * libc/sys/linux/pread64.c: Rename to __libc_pread64 and weak-alias to pread64 and __pread64. * libc/sys/linux/process.c: Weak_alias __libc_getpid to __getpid. * libc/sys/linux/pwrite64.c: Rename to __libc_pwrite64 and weak-alias to pwrite64. * libc/sys/linux/sched.c: Weak-alias __libc_sched_getparam, __libc_sched_getscheduler, __libc_sched_get_priority_max, __libc_sched_get_priority_min, and __libc_sched_setschedule to name with __ instead of __libc_. * libc/sys/linux/siglongjmp.c: Include <machine/weakalias.h>. Rename siglongjmp to __libc_siglongjmp and weak-alias to siglongjmp. Call __libc_longjmp instead of longjmp, from __libc_siglongjmp. * libc/sys/linux/signal.c: Rename raise to __libc_raise and weak-alias to raise. * libc/sys/linux/socket.c: Weak-alias __libc_connect to __connect and __libc_send to __send. * libc/sys/linux/time.c: Weak-alias __libc_gettimeofday to __gettimeofday. * libc/sys/linux/wait.c: Rename wait to __libc_wait and weak-alias it to wait. Rename wait3 to __libc_wait3 and weak-alias it to wait3. * libc/sys/linux/include/setjmp.h: Use __jmp_buf in sigjmp_buf type and typedef __jmp_buf to jmp_buf. * libc/sys/linux/machine/i386/Makefile.am: Add syscalls.c and setjmp.S. * libc/sys/linux/machine/i386/Makefile.in: Regenerated. * libc/sys/linux/machine/i386/crt0.c: Add support to clear .bss section. * libc/sys/linux/machine/i386/socketcall.h: Change to use __libc_ prefix for function macros and then use weak_alias() to regular names. * libc/sys/linux/machine/i386/syscall.h: Ditto. * libc/sys/linux/sys/errno.h: Define EOPNOTSUP to be ENOTSUP. * libc/sys/linux/sys/stdio.h: Define _flockfile and _funlockfile to be flockfile() and funlockfile() respectively. * libc/sys/linux/sys/types.h * libc/reent/getreent.c: New file. * libc/sys/linux/flockfile.c: Ditto. * libc/sys/linux/funlockfile.c: Ditto. * libc/sys/linux/getreent.c: Ditto. * libc/sys/linux/pread.c: Ditto. * libc/sys/linux/pwrite.c: Ditto. * libc/sys/linux/raise.c: Ditto. * libc/sys/linux/system.c: Ditto. * libc/sys/linux/tcdrain.c: Ditto. * libc/sys/linux/machine/i386/i386mach.h: Ditto. * libc/sys/linux/machine/i386/setjmp.S: Ditto. * libc/sys/linux/machine/i386/syscalls.c: Ditto. * libc/sys/linux/machine/i386/weakalias.h: Ditto. * libc/sys/linux/machine/i386/include/setjmp.h: Ditto.
2002-05-18 01:39:39 +02:00
/* we want the reentrancy structure to be returned by a function */
#define __DYNAMIC_REENT__
#define HAVE_GETDATE
#define _READ_WRITE_RETURN_TYPE _ssize_t
2002-07-17 Jeff Johnston <jjohnstn@redhat.com> * configure.host(stdio64_dir): New setting that is used to enable building of new stdio64 directory. * libc/Makefile.am[HAVE_STDIO64_DIR]: Add support for large files. (stmp-stdio64,stdio64.texi): New targets to optionally add in stdio64 info to info files. * libc/Makefile.in: Regenerated. * libc/configure: Ditto. * libc/configure.in: Add configuration variables that are set when stdio64 is selected as subdir in configure.host. * libc/libc.texinfo: Add optional menu item for Stdio64, based on whether STDIO64 flag is set or not. * libc/sys.tex: Add optional stdio64 syscalls based on whether STDIO64 flag is set or not. * libc/include/reent.h[__LARGE64_FILES]: Add new stdio64 _r sycall routines. * libc/include/stdio.h[__LARGE64_FILES]: Add new stdio64 prototypes. (FILE): Typedef'd to __FILE instead of struct __sFILE directly. (__SL64): New file flag indicating file is opened via fopen64. * libc/include/sys/_types.h(_off64_t): Added. * libc/include/sys/config.h: For x86-linux, define __LARGE64_FILES. * libc/include/sys/reent.h(struct __sFILE64): New file structure for 64-bit offset large file support. (__FILE): New intermediate type either set to struct __sFILE64 or struct __sFILE, depending on whether __LARGE64_FILES is set or not. * libc/reent/Makefile.am[HAVE_STDIO64_DIR]: Add new files. * libc/reent/Makefile.in: Regenerated. * libc/reent/fstat64r.c: New file. * libc/reent/lseek64r.c: Ditto. * libc/reent/open64r.c: Ditto. * libc/reent/reent.tex: Optionally add stdio64 reentrant syscalls based on whether STDIO64 flag is set. * libc/stdio/stdio.tex: Add blank line. * libc/stdio64/Makefile.am: New file. * libc/stdio64/Makefile.in: Ditto. * libc/stdio64/fgetpos64.c: Ditto. * libc/stdio64/fopen64.: Ditto. * libc/stdio64/freopen64.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/stdio64/fsetpos64.c: Ditto. * libc/stdio64/ftello64.c: Ditto. * libc/stdio64/local64.h: Ditto. * libc/stdio64/stdio64.c: Ditto. * libc/stdio64/stdio64.tex: Ditto. * libc/stdio64/tmpfile64.c: Ditto. * libc/sys/linux/io64.c: Add weak aliases for lseek64, fstat64, and open64.
2002-07-18 01:25:44 +02:00
#define __LARGE64_FILES 1
/* we use some glibc header files so turn on glibc large file feature */
#define _LARGEFILE64_SOURCE 1
2002-05-17 Jeff Johnston <jjohnstn@redhat.com> * Makefile.am: Copy and install headers from sys/machine/include directory. Also pass $toollibdir to lower-level directories. * Makefile.in: Regenerated. * libc/include/stdio.h[!_REENT_ONLY]: Change stdin, stdout, and stderr to use _REENT macro instead of _impure_ptr directly. * libc/include/sys/config.h[__i386__][__linux__]: Define __DYNAMIC_REENT__. * libc/include/sys/reent.h[!_REENT_ONLY]: Change _REENT macro to be call to __getreent() function if !__SINGLE_THREAD__ and __DYNAMIC_REENT__ is set. * libc/reent/Makefile.am: Add support for getreent.c. * libc/reent/Makefile.in: Regenerated. * libc/string/strerror.c: Add check if EOPNOTSUPP and ENOTSUP are same. * libc/sys/linux/Makefile.am: Add support for new files. * libc/sys/linux/configure.in: Add $EXTRA_DIRS variable. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/configure: Ditto. * libc/sys/linux/io.c: Add poll syscall. Also weak-alias __close, __read, __write, __poll, __open, __lseek, __fcntl from their __libc_ counterparts. * libc/sys/linux/io64.c: Add __libc_ prefix to lseek64 and open64 and weak-alias to regular names. * libc/sys/linux/pread64.c: Rename to __libc_pread64 and weak-alias to pread64 and __pread64. * libc/sys/linux/process.c: Weak_alias __libc_getpid to __getpid. * libc/sys/linux/pwrite64.c: Rename to __libc_pwrite64 and weak-alias to pwrite64. * libc/sys/linux/sched.c: Weak-alias __libc_sched_getparam, __libc_sched_getscheduler, __libc_sched_get_priority_max, __libc_sched_get_priority_min, and __libc_sched_setschedule to name with __ instead of __libc_. * libc/sys/linux/siglongjmp.c: Include <machine/weakalias.h>. Rename siglongjmp to __libc_siglongjmp and weak-alias to siglongjmp. Call __libc_longjmp instead of longjmp, from __libc_siglongjmp. * libc/sys/linux/signal.c: Rename raise to __libc_raise and weak-alias to raise. * libc/sys/linux/socket.c: Weak-alias __libc_connect to __connect and __libc_send to __send. * libc/sys/linux/time.c: Weak-alias __libc_gettimeofday to __gettimeofday. * libc/sys/linux/wait.c: Rename wait to __libc_wait and weak-alias it to wait. Rename wait3 to __libc_wait3 and weak-alias it to wait3. * libc/sys/linux/include/setjmp.h: Use __jmp_buf in sigjmp_buf type and typedef __jmp_buf to jmp_buf. * libc/sys/linux/machine/i386/Makefile.am: Add syscalls.c and setjmp.S. * libc/sys/linux/machine/i386/Makefile.in: Regenerated. * libc/sys/linux/machine/i386/crt0.c: Add support to clear .bss section. * libc/sys/linux/machine/i386/socketcall.h: Change to use __libc_ prefix for function macros and then use weak_alias() to regular names. * libc/sys/linux/machine/i386/syscall.h: Ditto. * libc/sys/linux/sys/errno.h: Define EOPNOTSUP to be ENOTSUP. * libc/sys/linux/sys/stdio.h: Define _flockfile and _funlockfile to be flockfile() and funlockfile() respectively. * libc/sys/linux/sys/types.h * libc/reent/getreent.c: New file. * libc/sys/linux/flockfile.c: Ditto. * libc/sys/linux/funlockfile.c: Ditto. * libc/sys/linux/getreent.c: Ditto. * libc/sys/linux/pread.c: Ditto. * libc/sys/linux/pwrite.c: Ditto. * libc/sys/linux/raise.c: Ditto. * libc/sys/linux/system.c: Ditto. * libc/sys/linux/tcdrain.c: Ditto. * libc/sys/linux/machine/i386/i386mach.h: Ditto. * libc/sys/linux/machine/i386/setjmp.S: Ditto. * libc/sys/linux/machine/i386/syscalls.c: Ditto. * libc/sys/linux/machine/i386/weakalias.h: Ditto. * libc/sys/linux/machine/i386/include/setjmp.h: Ditto.
2002-05-18 01:39:39 +02:00
#endif
2000-02-17 20:39:52 +01:00
#endif
#ifdef __mn10200__
#define __SMALL_BITFIELDS
#endif
#ifdef __AVR__
#define __SMALL_BITFIELDS
#define _POINTER_INT short
#endif
2000-02-17 20:39:52 +01:00
#ifdef __v850
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__))
#endif
/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */
#if defined(__PPC__)
#if defined(_CALL_SYSV)
2000-02-17 20:39:52 +01:00
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif
#ifdef __SPE__
#define _LONG_DOUBLE double
#endif
2000-02-17 20:39:52 +01:00
#endif
/* Configure small REENT structure for Xilinx MicroBlaze platforms */
#if defined (__MICROBLAZE__)
#ifndef _REENT_SMALL
#define _REENT_SMALL
#endif
/* Xilinx XMK uses Unix98 mutex */
#ifdef __XMK__
#define _UNIX98_THREAD_MUTEX_ATTRIBUTES
#endif
#endif
#if defined(__mips__) && !defined(__rtems__)
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif
In newlib/: 2001-12-22 Geoffrey Keating <geoffk@redhat.com> Catherine Moore <clm@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * configure.host: Add support for xstormy16. * libc/include/machine/ieeefp.h: Add support for xstormy16. * libc/include/machine/setjmp.h: Add support for xstormy16. * libc/include/sys/config.h: Add support for xstormy16. * libc/machine/xstormy16/Makefile.am: New file. * libc/machine/xstormy16/Makefile.in: New file. * libc/machine/xstormy16/aclocal.m4: New file. * libc/machine/xstormy16/configure: New file. * libc/machine/xstormy16/configure.in: New file. * libc/machine/xstormy16/setjmp.S: New file. In libgloss/: 2001-12-22 Geoffrey Keating <geoffk@redhat.com> Mark Salter <msalter@redhat.com> Catherine Moore <clm@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add xstormy16. * libnosys/configure.in: Add xstormy16. * configure: Regenerated. * libnosys/configure: Regenerated. * xstormy16/Makefile.in: New file. * xstormy16/close.c: New file. * xstormy16/configure: New file. * xstormy16/configure.in: New file. * xstormy16/crt0.s: New file. * xstormy16/crt0_stub.s: New file. * xstormy16/crti.s: New file. * xstormy16/crtn.s: New file. * xstormy16/eva_app.c: New file. * xstormy16/eva_app.ld: New file. * xstormy16/eva_stub.ld: New file. * xstormy16/fstat.c: New file. * xstormy16/getpid.c: New file. * xstormy16/kill.c: New file. * xstormy16/lseek.c: New file. * xstormy16/open.c: New file. * xstormy16/sbrk.c: New file. * xstormy16/sim_high.ld: New file. * xstormy16/stat.c: New file. * xstormy16/syscalls.S: New file. * xstormy16/syscalls.m4: New file. * xstormy16/unlink.c: New file. * xstormy16/xstormy16_stub.c: New file.
2001-12-22 23:47:58 +01:00
#ifdef __xstormy16__
#define __SMALL_BITFIELDS
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#define MALLOC_ALIGNMENT 8
#define _POINTER_INT short
#define __BUFSIZ__ 16
#define _REENT_SMALL
In newlib/: 2001-12-22 Geoffrey Keating <geoffk@redhat.com> Catherine Moore <clm@redhat.com> Richard Henderson <rth@redhat.com> Corinna Vinschen <vinschen@redhat.com> * configure.host: Add support for xstormy16. * libc/include/machine/ieeefp.h: Add support for xstormy16. * libc/include/machine/setjmp.h: Add support for xstormy16. * libc/include/sys/config.h: Add support for xstormy16. * libc/machine/xstormy16/Makefile.am: New file. * libc/machine/xstormy16/Makefile.in: New file. * libc/machine/xstormy16/aclocal.m4: New file. * libc/machine/xstormy16/configure: New file. * libc/machine/xstormy16/configure.in: New file. * libc/machine/xstormy16/setjmp.S: New file. In libgloss/: 2001-12-22 Geoffrey Keating <geoffk@redhat.com> Mark Salter <msalter@redhat.com> Catherine Moore <clm@redhat.com> Richard Henderson <rth@redhat.com> * configure.in: Add xstormy16. * libnosys/configure.in: Add xstormy16. * configure: Regenerated. * libnosys/configure: Regenerated. * xstormy16/Makefile.in: New file. * xstormy16/close.c: New file. * xstormy16/configure: New file. * xstormy16/configure.in: New file. * xstormy16/crt0.s: New file. * xstormy16/crt0_stub.s: New file. * xstormy16/crti.s: New file. * xstormy16/crtn.s: New file. * xstormy16/eva_app.c: New file. * xstormy16/eva_app.ld: New file. * xstormy16/eva_stub.ld: New file. * xstormy16/fstat.c: New file. * xstormy16/getpid.c: New file. * xstormy16/kill.c: New file. * xstormy16/lseek.c: New file. * xstormy16/open.c: New file. * xstormy16/sbrk.c: New file. * xstormy16/sim_high.ld: New file. * xstormy16/stat.c: New file. * xstormy16/syscalls.S: New file. * xstormy16/syscalls.m4: New file. * xstormy16/unlink.c: New file. * xstormy16/xstormy16_stub.c: New file.
2001-12-22 23:47:58 +01:00
#endif
#if defined __MSP430__
#ifndef _REENT_SMALL
#define _REENT_SMALL
#endif
#define __BUFSIZ__ 256
#define __SMALL_BITFIELDS
#ifdef __MSP430X_LARGE__
#define _POINTER_INT long
#else
#define _POINTER_INT int
#endif
#endif
#ifdef __m32c__
#define __SMALL_BITFIELDS
#undef INT_MAX
#undef UINT_MAX
#define INT_MAX __INT_MAX__
#define UINT_MAX (__INT_MAX__ * 2U + 1)
#define MALLOC_ALIGNMENT 8
#if defined(__r8c_cpu__) || defined(__m16c_cpu__)
#define _POINTER_INT short
#else
#define _POINTER_INT long
#endif
#define __BUFSIZ__ 16
#define _REENT_SMALL
#endif /* __m32c__ */
#ifdef __SPU__
#define MALLOC_ALIGNMENT 16
2007-02-01 Joel Schopp <jschopp@austin.ibm.com> Kazunori Asayama <asayama@sm.sony.co.jp> * configure.host: Enable SPU specific stdio directory. * libc/machine/spu/Makefile.am: Add objects. * libc/machine/spu/Makefile.in: Regenerated. * libc/machine/spu/c99ppe.h: Add macros and function declarations to initialize SPU specific stdio stuffs. * libc/machine/spu/stdio.c: Add functions to manage Cell SPU specific FILE structures. * libc/machine/spu/perror.c: Add initialization routine of stdio stuffs. * libc/machine/spu/printf.c: Ditto. * libc/machine/spu/putchar.c: Ditto. * libc/machine/spu/puts.c: Ditto. * libc/machine/spu/vprintf.c: Ditto. * libc/machine/spu/clearerr.c: New file. Add a stdio function implementation. * libc/machine/spu/feof.c: Ditto. * libc/machine/spu/ferror.c: Ditto. * libc/machine/spu/fileno.c: Ditto. * libc/machine/spu/fopen.c: Ditto. * libc/machine/spu/fclose.c: Ditto. * libc/machine/spu/freopen.c: Ditto. * libc/machine/spu/fflush.c: Ditto. * libc/machine/spu/fseek.c: Ditto. * libc/machine/spu/ftell.c: Ditto. * libc/machine/spu/rewind.c: Ditto. * libc/machine/spu/fgetpos.c: Ditto. * libc/machine/spu/fsetpos.c: Ditto. * libc/machine/spu/fread.c: Ditto. * libc/machine/spu/fwrite.c: Ditto. * libc/machine/spu/getc.c: Ditto. * libc/machine/spu/getchar.c: Ditto. * libc/machine/spu/gets.c: Ditto. * libc/machine/spu/fgetc.c: Ditto. * libc/machine/spu/fgets.c: Ditto. * libc/machine/spu/ungetc.c: Ditto. * libc/machine/spu/putc.c: Ditto. * libc/machine/spu/fputc.c: Ditto. * libc/machine/spu/fputs.c: Ditto. * libc/machine/spu/vfprintf.c: Ditto. * libc/machine/spu/vfscanf.c: Ditto. * libc/machine/spu/fprintf.c: Ditto. * libc/machine/spu/fscanf.c: Ditto. * libc/machine/spu/scanf.c: Ditto. * libc/machine/spu/vscanf.c: Ditto. * libc/machine/spu/setbuf.c: Ditto. * libc/machine/spu/setvbuf.c: Ditto. * libc/machine/spu/tmpfile.c: Ditto. 2007-02-01 Jeff Johnston <jjohnstn@redhat.com> * libc/include/sys/config.h[__SPU__]: Define __CUSTOM_FILE_IO__. * libc/include/stdio.h[!__CUSTOM_FILE_IO__]: Add flag check around stdio macros that manipulate fields in the normal file structure. * libc/include/sys/reent.h[__CUSTOM_FILE_IO__]: Include <sys/custom_file.h> to define custom FILE structure. * libc/include/sys/custom_file.h: New default header file that generates error if not overridden when __CUSTOM_FILE_IO__ set. * libc/machine/spu/sys/custom_file.h: New file.
2007-02-01 17:33:05 +01:00
#define __CUSTOM_FILE_IO__
#endif
#if defined(__or1k__) || defined(__or1knd__)
#define __DYNAMIC_REENT__
#endif
/* This block should be kept in sync with GCC's limits.h. The point
of having these definitions here is to not include limits.h, which
would pollute the user namespace, while still using types of the
the correct widths when deciding how to define __int32_t and
__int64_t. */
#ifndef __INT_MAX__
# ifdef INT_MAX
# define __INT_MAX__ INT_MAX
# else
# define __INT_MAX__ 2147483647
# endif
#endif
#ifndef __LONG_MAX__
# ifdef LONG_MAX
# define __LONG_MAX__ LONG_MAX
# else
# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \
|| defined (__sparcv9)
# define __LONG_MAX__ 9223372036854775807L
# else
# define __LONG_MAX__ 2147483647L
# endif /* __alpha__ || sparc64 */
# endif
#endif
/* End of block that should be kept in sync with GCC's limits.h. */
2000-02-17 20:39:52 +01:00
#ifndef _POINTER_INT
#define _POINTER_INT long
#endif
#ifdef __frv__
#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata")))
#endif
#undef __RAND_MAX
#if __INT_MAX__ == 32767
#define __RAND_MAX 32767
#else
#define __RAND_MAX 0x7fffffff
#endif
2000-02-17 20:39:52 +01:00
#if defined(__CYGWIN__)
#include <cygwin/config.h>
#endif
#if defined(__rtems__)
#define __FILENAME_MAX__ 255
#define _READ_WRITE_RETURN_TYPE _ssize_t
#define __DYNAMIC_REENT__
#define _REENT_GLOBAL_ATEXIT
#define _REENT_GLOBAL_STDIO_STREAMS
#endif
* libc/ctype/Makefile.am: Remove _tolower.c and _toupper.c source files. Add a dependency rule for ctype_o to note changes in ctype_iso.h and ctype_cp.h. * libc/ctype/Makefile.in: Regenerate. * libc/ctype/_tolower.c: Remove file. * libc/ctype/_toupper.c: Remove file. * libc/ctype/ctype_.c: Make sure ALLOW_NEGATIVE_CTYPE_INDEX is always defined on Cygwin. (_ctype_b): Don't make `static const' on Cygwin. (ctype_iso.h): Include if _MB_EXTENDED_CHARSETS_ISO is set. (ctype_cp.h): Include if _MB_EXTENDED_CHARSETS_WINDOWS is set. (__ctype_ptr): Drop definition. (__ctype_ptr__): De-constify. Mark as __EXPORT symbol. (_ctype_): Add Cygwin-specifc asm define. (__set_ctype): New function to set __ctype_ptr__ according to current charset. * libc/ctype/ctype_cp.h: New file containing Windows codepage specific character class tables. * libc/ctype/ctype_iso.h: New file containing ISO-8859-x specific character class tables. * libc/ctype/tolower.c (tolower): Reimplement to support any singlebyte charset if one of the extended charsets is enabled. * libc/ctype/toupper.c (toupper): Ditto. * libc/include/ctype.h (_tolower): Define as macro per POSIX. (_toupper): Ditto. (__ctype_ptr__): De-constify. (toupper): Disable macro on systems supporting extended charsets. (tolower): Ditto. * libc/include/sys/config.h (__EXPORT): Define empty if not defined. * libc/locale/locale.c (__mb_cur_max): Mark as __EXPORT symbol. (__set_ctype): Declare unconditionally. (loadlocale): Remove __CYGWIN__ guard around __set_ctype call.
2009-03-31 11:31:38 +02:00
#ifndef __EXPORT
#define __EXPORT
#endif
#ifndef __IMPORT
#define __IMPORT
#endif
/* Define return type of read/write routines. In POSIX, the return type
for read()/write() is "ssize_t" but legacy newlib code has been using
"int" for some time. If not specified, "int" is defaulted. */
#ifndef _READ_WRITE_RETURN_TYPE
#define _READ_WRITE_RETURN_TYPE int
#endif
/* Define `count' parameter of read/write routines. In POSIX, the `count'
parameter is "size_t" but legacy newlib code has been using "int" for some
time. If not specified, "int" is defaulted. */
#ifndef _READ_WRITE_BUFSIZE_TYPE
#define _READ_WRITE_BUFSIZE_TYPE int
#endif
#ifndef __WCHAR_MAX__
#if __INT_MAX__ == 32767 || defined (_WIN32)
#define __WCHAR_MAX__ 0xffffu
#endif
#endif
/* See if small reent asked for at configuration time and
is not chosen by the platform by default. */
#ifdef _WANT_REENT_SMALL
#ifndef _REENT_SMALL
#define _REENT_SMALL
#endif
#endif
#ifdef _WANT_REENT_GLOBAL_STDIO_STREAMS
#ifndef _REENT_GLOBAL_STDIO_STREAMS
#define _REENT_GLOBAL_STDIO_STREAMS
#endif
#endif
#ifdef _WANT_USE_LONG_TIME_T
#ifndef _USE_LONG_TIME_T
#define _USE_LONG_TIME_T
#endif
#endif
* libc/ctype/iswalpha.c: Handle all wchar_t as unicode on _MB_CAPABLE systems. * libc/ctype/iswblank.c: Ditto. * libc/ctype/iswcntrl.c: Ditto. * libc/ctype/iswprint.c: Ditto. * libc/ctype/iswpunct.c: Ditto. * libc/ctype/iswspace.c: Ditto. * libc/ctype/jp2uc.c (__jp2uc): On Cygwin, just return c. Explain why. * libc/ctype/towlower.c: Ditto. * libc/ctype/towupper.c: Ditto. * libc/include/sys/config.h: Define _MB_EXTENDED_CHARSETS_ISO and _MB_EXTENDED_CHARSETS_WINDOWS if _MB_EXTENDED_CHARSETS_ALL is defined. Define _MB_EXTENDED_CHARSETS_ALL on Cygwin only for now. * libc/include/sys/reent.h (struct _reent): Mark _current_category and _current_locale as unused. * libc/locale/locale.c: Add new charset support to documentation. Include ../stdio/local.h from here. (lc_ctype_charset): Set to "ASCII" by default. (lc_message_charset): Ditto. (_setlocale_r): Don't set _current_category and _current_locale. (loadlocale): Add Cygwin codepage support. On _MB_CAPABLE systems, set __mbtowc and __wctomb function pointers to function corresponding with current charset. Don't allow non-existant ISO-8859-12 charset. Add support for Windows singlebyte codepages. On Cygwin, add support for GBK, CP949, and BIG5. On Cygwin, call __set_ctype() in case the catorgy is LC_CTYPE. Don't set _current_category and _current_locale. * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add sb_charsets.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/local.h: Add prototype for __locale_charset. Add prototypes for __mbtowc and __wctomb pointers. Add prototypes for charset-specific _wctomb_r and _mbtowc_r functions. Declare tables and functions from sb_charsets.c. * libc/stdlib/mbtowc_r.c (__mbtowc): Define. Set to __ascii_mbtowc by default. (_mbtowc_r): Just call __mbtowc from here. (__ascii_mbtowc): New function. (__iso_mbtowc): New function. (__cp_mbtowc): New function. (__utf8_mbtowc): New function. (__sjis_mbtowc): New function. Disable on Cygwin. (__eucjp_mbtowc): New function. Disable on Cygwin. (__jis_mbtowc): New function. Disable on Cygwin. * libc/stdlib/sb_charsets.c: New file, adding singlebyte to UTF conversion tables for all ISO and CP charsets. (__iso_8859_index): New function. (__cp_index): New function. * libc/stdlib/wctomb_r.c (__wctomb): Define. Set to __ascii_wctomb by default. (_wctomb_r): Just call __wctomb from here. (__ascii_wctomb): New function. (__utf8_wctomb): New function. (__sjis_wctomb): New function. Disable on Cygwin. (__eucjp_wctomb): New function. Disable on Cygwin. (__jis_wctomb): New function. Disable on Cygwin. (__iso_wctomb): New function. (__cp_wctomb): New function.
2009-03-24 11:13:27 +01:00
/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended
charsets. The extended charsets add a few functions and a couple
of tables of a few K each. */
#ifdef _MB_EXTENDED_CHARSETS_ALL
#define _MB_EXTENDED_CHARSETS_ISO 1
#define _MB_EXTENDED_CHARSETS_WINDOWS 1
#endif
2000-02-17 20:39:52 +01:00
#endif /* __SYS_CONFIG_H__ */