Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6536 → Rev 6535

/contrib/sdk/sources/newlib/static.lds
1,7 → 1,6
/*OUTPUT_FORMAT("binary")*/
SEARCH_DIR("=/lib")
SEARCH_DIR("=/mingw32/lib")
ENTRY(__crt_start)
 
ENTRY(__start)
SECTIONS
{
.text 0x000000:
77,13 → 76,12
___iend = . ;
}
 
.eh_frame BLOCK(16) :
/* .eh_frame BLOCK(16) :
{
PROVIDE (___EH_FRAME_BEGIN__ = .) ;
*(.eh_frame*)
___FRAME_END__ = . ;
LONG(0);
}
*/
 
bss ALIGN(16):
{
/contrib/sdk/sources/newlib/libc/include/_newlib_version.h
File deleted
/contrib/sdk/sources/newlib/libc/include/kos32sys.h
237,7 → 237,7
__asm__ __volatile__(
"int $0x40"
:"=a"(old_event_mask)
:"a"(40),"b"(event_mask));
:"a"(40));
 
return old_event_mask;
};
273,7 → 273,7
return val;
};
 
static inline uint32_t check_os_event(void)
static inline uint32_t check_os_event()
{
uint32_t val;
__asm__ __volatile__(
283,7 → 283,7
return val;
};
 
static inline uint32_t get_os_event(void)
static inline uint32_t get_os_event()
{
uint32_t val;
__asm__ __volatile__(
328,7 → 328,7
}
 
static inline
uint32_t get_os_button(void)
uint32_t get_os_button()
{
uint32_t val;
__asm__ __volatile__(
453,7 → 453,7
};
static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file")));
 
static inline int GetScreenSize(void)
static inline int GetScreenSize()
{
int retval;
 
514,42 → 514,6
::"a"(73),"b"(0),"c"(&bc.dstx));
};
 
#define TLS_KEY_PID 0
#define TLS_KEY_TID 4
#define TLS_KEY_LOW_STACK 8
#define TLS_KEY_HIGH_STACK 12
#define TLS_KEY_LIBC 16
 
unsigned int tls_alloc(void);
int tls_free(unsigned int key);
 
static inline int tls_set(unsigned int key, void *val)
{
int ret = -1;
if(key < 4096)
{
__asm__ __volatile__(
"movl %0, %%fs:(%1)"
::"r"(val),"r"(key));
ret = 0;
}
return ret;
};
 
static inline void *tls_get(unsigned int key)
{
void *val = (void*)-1;
if(key < 4096)
{
__asm__ __volatile__(
"movl %%fs:(%1), %0"
:"=r"(val)
:"r"(key));
};
return val;
}
 
 
int create_thread(int (*proc)(void *param), void *param, int stack_size);
 
void* load_library(const char *name);
/contrib/sdk/sources/newlib/libc/include/ctype.h
2,7 → 2,6
#define _CTYPE_H_
 
#include "_ansi.h"
#include <sys/cdefs.h>
 
_BEGIN_STD_C
 
20,11 → 19,11
int _EXFUN(tolower, (int __c));
int _EXFUN(toupper, (int __c));
 
#if __ISO_C_VISIBLE >= 1999
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
int _EXFUN(isblank, (int __c));
#endif
 
#if __MISC_VISIBLE || __XSI_VISIBLE
#ifndef __STRICT_ANSI__
int _EXFUN(isascii, (int __c));
int _EXFUN(toascii, (int __c));
#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
41,9 → 40,10
#define _B 0200
 
#ifndef _MB_CAPABLE
_CONST
extern _CONST __IMPORT char *__ctype_ptr__;
#else
extern __IMPORT char *__ctype_ptr__;
#endif
extern __IMPORT char *__ctype_ptr__;
 
#ifndef __cplusplus
/* These macros are intentionally written in a manner that will trigger
69,7 → 69,8
#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N))
#define iscntrl(__c) (__ctype_lookup(__c)&_C)
 
#if defined(__GNUC__) && __ISO_C_VISIBLE >= 1999
#if defined(__GNUC__) && \
(!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
#define isblank(__c) \
__extension__ ({ __typeof__ (__c) __x = (__c); \
(__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
98,14 → 99,13
(void) __ctype_ptr__[__x]; (tolower) (__x);})
# endif /* _MB_EXTENDED_CHARSETS* */
# endif /* __GNUC__ */
#endif /* !__cplusplus */
 
#if __MISC_VISIBLE || __XSI_VISIBLE
#ifndef __STRICT_ANSI__
#define isascii(__c) ((unsigned)(__c)<=0177)
#define toascii(__c) ((__c)&0177)
#endif
 
#endif /* !__cplusplus */
 
/* For C++ backward-compatibility only. */
extern __IMPORT _CONST char _ctype_[];
 
/contrib/sdk/sources/newlib/libc/include/newlib.h
11,11 → 11,11
/* #undef _ELIX_LEVEL */
 
/* Newlib version */
#include <_newlib_version.h>
#define _NEWLIB_VERSION "2.3.0"
 
/* C99 formats support (such as %a, %zu, ...) in IO functions like
* printf/scanf enabled */
/* #undef _WANT_IO_C99_FORMATS */
//#define _WANT_IO_C99_FORMATS
 
#define __DYNAMIC_REENT__
 
49,7 → 49,7
 
/* Define if the linker supports .preinit_array/.init_array/.fini_array
* sections. */
/* #undef HAVE_INITFINI_ARRAY */
#define HAVE_INITFINI_ARRAY 1
 
/* True if atexit() may dynamically allocate space for cleanup
functions. */
58,9 → 58,6
/* True if long double supported. */
#define _HAVE_LONG_DOUBLE 1
 
/* Define if compiler supports -fno-tree-loop-distribute-patterns. */
#define _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1
 
/* True if long double supported and it is equal to double. */
/* #undef _LDBL_EQ_DBL */
 
/contrib/sdk/sources/newlib/libc/include/sys/gthr-default.h
File deleted
/contrib/sdk/sources/newlib/libc/include/sys/gthr.h
File deleted
/contrib/sdk/sources/newlib/libc/include/sys/cdefs.h
624,7 → 624,135
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
#endif
 
/*-
* The following definitions are an extension of the behavior originally
* implemented in <sys/_posix.h>, but with a different level of granularity.
* POSIX.1 requires that the macros we test be defined before any standard
* header file is included.
*
* Here's a quick run-down of the versions:
* defined(_POSIX_SOURCE) 1003.1-1988
* _POSIX_C_SOURCE == 1 1003.1-1990
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
* _POSIX_C_SOURCE == 199309 1003.1b-1993
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
* _POSIX_C_SOURCE == 200112 1003.1-2001
* _POSIX_C_SOURCE == 200809 1003.1-2008
*
* In addition, the X/Open Portability Guide, which is now the Single UNIX
* Specification, defines a feature-test macro which indicates the version of
* that specification, and which subsumes _POSIX_C_SOURCE.
*
* Our macros begin with two underscores to avoid namespace screwage.
*/
 
/* Deal with _GNU_SOURCE, which implies everything and the kitchen sink */
#ifdef _GNU_SOURCE
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#define __BSD_VISIBLE 1
#define __GNU_VISIBLE 1
#endif
 
#define __GNU_VISIBLE 1
 
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
 
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
 
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 700
#define __XSI_VISIBLE 700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809
#elif _XOPEN_SOURCE - 0 >= 600
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#elif _XOPEN_SOURCE - 0 >= 500
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
#endif
 
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 198808
#endif
#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE >= 200809
#define __POSIX_VISIBLE 200809
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 200112
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 199506
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199309
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199209
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199009
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
#else
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 2011
#else /* Default: everything except __GNU_VISIBLE. */
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 2011
#endif
#endif
 
/*
* Type Safety Checking
*
* Clang provides additional attributes to enable checking type safety
/contrib/sdk/sources/newlib/libc/include/sys/features.h
25,7 → 25,11
extern "C" {
#endif
 
#include <_newlib_version.h>
/* Macros to determine that newlib is being used. Put in this header to
* be similar to where glibc stores its version of these macros.
*/
#define __NEWLIB__ 2
#define __NEWLIB_MINOR__ 2
 
/* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */
#ifndef __GNUC_PREREQ
39,281 → 43,6
/* Version with trailing underscores for BSD compatibility. */
#define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi)
 
 
/*
* Feature test macros control which symbols are exposed by the system
* headers. Any of these must be defined before including any headers.
*
* __STRICT_ANSI__ (defined by gcc -ansi, -std=c90, -std=c99, or -std=c11)
* ISO C
*
* _POSIX_SOURCE (deprecated by _POSIX_C_SOURCE=1)
* _POSIX_C_SOURCE >= 1
* POSIX.1-1990
*
* _POSIX_C_SOURCE >= 2
* POSIX.2-1992
*
* _POSIX_C_SOURCE >= 199309L
* POSIX.1b-1993 Real-time extensions
*
* _POSIX_C_SOURCE >= 199506L
* POSIX.1c-1995 Threads extensions
*
* _POSIX_C_SOURCE >= 200112L
* POSIX.1-2001 and C99
*
* _POSIX_C_SOURCE >= 200809L
* POSIX.1-2008
*
* _XOPEN_SOURCE
* POSIX.1-1990 and XPG4
*
* _XOPEN_SOURCE_EXTENDED
* SUSv1 (POSIX.2-1992 plus XPG4v2)
*
* _XOPEN_SOURCE >= 500
* SUSv2 (POSIX.1c-1995 plus XSI)
*
* _XOPEN_SOURCE >= 600
* SUSv3 (POSIX.1-2001 plus XSI) and C99
*
* _XOPEN_SOURCE >= 700
* SUSv4 (POSIX.1-2008 plus XSI)
*
* _ISOC99_SOURCE or gcc -std=c99 or g++
* ISO C99
*
* _ISOC11_SOURCE or gcc -std=c11 or g++ -std=c++11
* ISO C11
*
* _ATFILE_SOURCE (implied by _POSIX_C_SOURCE >= 200809L)
* "at" functions
*
* _LARGEFILE_SOURCE (deprecated by _XOPEN_SOURCE >= 500)
* fseeko, ftello
*
* _GNU_SOURCE
* All of the above plus GNU extensions
*
* _BSD_SOURCE (deprecated by _DEFAULT_SOURCE)
* _SVID_SOURCE (deprecated by _DEFAULT_SOURCE)
* _DEFAULT_SOURCE (or none of the above)
* POSIX-1.2008 with BSD and SVr4 extensions
*/
 
#ifdef _GNU_SOURCE
#undef _ATFILE_SOURCE
#define _ATFILE_SOURCE 1
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE 1
#undef _ISOC99_SOURCE
#define _ISOC99_SOURCE 1
#undef _ISOC11_SOURCE
#define _ISOC11_SOURCE 1
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 700
#undef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
#endif /* _GNU_SOURCE */
 
#if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \
(!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE) && \
!defined(_ISOC99_SOURCE) && !defined(_POSIX_SOURCE) && \
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
#undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE 1
#endif
 
#if defined(_DEFAULT_SOURCE)
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
 
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
((!defined(__STRICT_ANSI__) && !defined(_ANSI_SOURCE)) || \
(_XOPEN_SOURCE - 0) >= 500)
#define _POSIX_SOURCE 1
#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 700
#define _POSIX_C_SOURCE 200809L
#elif (_XOPEN_SOURCE - 0) >= 600
#define _POSIX_C_SOURCE 200112L
#elif (_XOPEN_SOURCE - 0) >= 500
#define _POSIX_C_SOURCE 199506L
#elif (_XOPEN_SOURCE - 0) < 500
#define _POSIX_C_SOURCE 2
#endif
#endif
 
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809
#undef _ATFILE_SOURCE
#define _ATFILE_SOURCE 1
#endif
 
/*
* The following private macros are used throughout the headers to control
* which symbols should be exposed. They are for internal use only, as
* indicated by the leading double underscore, and must never be used outside
* of these headers.
*
* __POSIX_VISIBLE
* any version of POSIX.1; enabled by default, or with _POSIX_SOURCE,
* any value of _POSIX_C_SOURCE, or _XOPEN_SOURCE >= 500.
*
* __POSIX_VISIBLE >= 2
* POSIX.2-1992; enabled by default, with _POSIX_C_SOURCE >= 2,
* or _XOPEN_SOURCE >= 500.
*
* __POSIX_VISIBLE >= 199309
* POSIX.1b-1993; enabled by default, with _POSIX_C_SOURCE >= 199309L,
* or _XOPEN_SOURCE >= 500.
*
* __POSIX_VISIBLE >= 199506
* POSIX.1c-1995; enabled by default, with _POSIX_C_SOURCE >= 199506L,
* or _XOPEN_SOURCE >= 500.
*
* __POSIX_VISIBLE >= 200112
* POSIX.1-2001; enabled by default, with _POSIX_C_SOURCE >= 200112L,
* or _XOPEN_SOURCE >= 600.
*
* __POSIX_VISIBLE >= 200809
* POSIX.1-2008; enabled by default, with _POSIX_C_SOURCE >= 200809L,
* or _XOPEN_SOURCE >= 700.
*
* __XSI_VISIBLE
* XPG4 XSI extensions; enabled with any version of _XOPEN_SOURCE.
*
* __XSI_VISIBLE >= 4
* SUSv1 XSI extensions; enabled with both _XOPEN_SOURCE and
* _XOPEN_SOURCE_EXTENDED together.
*
* __XSI_VISIBLE >= 500
* SUSv2 XSI extensions; enabled with _XOPEN_SOURCE >= 500.
*
* __XSI_VISIBLE >= 600
* SUSv3 XSI extensions; enabled with _XOPEN_SOURCE >= 600.
*
* __XSI_VISIBLE >= 700
* SUSv4 XSI extensions; enabled with _XOPEN_SOURCE >= 700.
*
* __ISO_C_VISIBLE >= 1999
* ISO C99; enabled with gcc -std=c99 or newer (on by default since GCC 5),
* any version of C++, or with _ISOC99_SOURCE, _POSIX_C_SOURCE >= 200112L,
* or _XOPEN_SOURCE >= 600.
*
* __ISO_C_VISIBLE >= 2011
* ISO C11; enabled with gcc -std=c11 or newer (on by default since GCC 5),
* g++ -std=c++11 or newer (on by default since GCC 6), or with
* _ISOC11_SOURCE.
*
* __ATFILE_VISIBLE
* "at" functions; enabled by default, with _ATFILE_SOURCE,
* _POSIX_C_SOURCE >= 200809L, or _XOPEN_SOURCE >= 700.
*
* __LARGEFILE_VISIBLE
* fseeko, ftello; enabled with _LARGEFILE_SOURCE or _XOPEN_SOURCE >= 500.
*
* __BSD_VISIBLE
* BSD extensions; enabled by default, or with _BSD_SOURCE.
*
* __SVID_VISIBLE
* SVr4 extensions; enabled by default, or with _SVID_SOURCE.
*
* __MISC_VISIBLE
* Extensions found in both BSD and SVr4 (shorthand for
* (__BSD_VISIBLE || __SVID_VISIBLE)), or newlib-specific
* extensions; enabled by default.
*
* __GNU_VISIBLE
* GNU extensions; enabled with _GNU_SOURCE.
*
* In all cases above, "enabled by default" means either by defining
* _DEFAULT_SOURCE, or by not defining any of the public feature test macros.
* Defining _GNU_SOURCE makes all of the above avaliable.
*/
 
#ifdef _ATFILE_SOURCE
#define __ATFILE_VISIBLE 1
#else
#define __ATFILE_VISIBLE 0
#endif
 
#ifdef _DEFAULT_SOURCE
#define __BSD_VISIBLE 1
#else
#define __BSD_VISIBLE 0
#endif
 
#ifdef _GNU_SOURCE
#define __GNU_VISIBLE 1
#else
#define __GNU_VISIBLE 0
#endif
 
#if defined(_ISOC11_SOURCE) || \
(__STDC_VERSION__ - 0) >= 201112L || (__cplusplus - 0) >= 201103L
#define __ISO_C_VISIBLE 2011
#elif defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200112L || \
(__STDC_VERSION__ - 0) >= 199901L || defined(__cplusplus)
#define __ISO_C_VISIBLE 1999
#else
#define __ISO_C_VISIBLE 1990
#endif
 
#if defined(_LARGEFILE_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
#define __LARGEFILE_VISIBLE 1
#else
#define __LARGEFILE_VISIBLE 0
#endif
 
#ifdef _DEFAULT_SOURCE
#define __MISC_VISIBLE 1
#else
#define __MISC_VISIBLE 0
#endif
 
#if (_POSIX_C_SOURCE - 0) >= 200809L
#define __POSIX_VISIBLE 200809
#elif (_POSIX_C_SOURCE - 0) >= 200112L
#define __POSIX_VISIBLE 200112
#elif (_POSIX_C_SOURCE - 0) >= 199506L
#define __POSIX_VISIBLE 199506
#elif (_POSIX_C_SOURCE - 0) >= 199309L
#define __POSIX_VISIBLE 199309
#elif (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE)
#define __POSIX_VISIBLE 199209
#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
#define __POSIX_VISIBLE 199009
#else
#define __POSIX_VISIBLE 0
#endif
 
#ifdef _DEFAULT_SOURCE
#define __SVID_VISIBLE 1
#else
#define __SVID_VISIBLE 0
#endif
 
#if (_XOPEN_SOURCE - 0) >= 700
#define __XSI_VISIBLE 700
#elif (_XOPEN_SOURCE - 0) >= 600
#define __XSI_VISIBLE 600
#elif (_XOPEN_SOURCE - 0) >= 500
#define __XSI_VISIBLE 500
#elif defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)
#define __XSI_VISIBLE 4
#elif defined(_XOPEN_SOURCE)
#define __XSI_VISIBLE 1
#else
#define __XSI_VISIBLE 0
#endif
 
/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */
 
#ifdef __rtems__
383,50 → 112,50
#ifdef __CYGWIN__
 
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
#define _POSIX_VERSION 200809L
#define _POSIX2_VERSION 200809L
#define _POSIX_VERSION 200112L
#define _POSIX2_VERSION 200112L
#define _XOPEN_VERSION 600
 
#define _POSIX_ADVISORY_INFO 200809L
#define _POSIX_ADVISORY_INFO 200112L
/* #define _POSIX_ASYNCHRONOUS_IO -1 */
#define _POSIX_BARRIERS 200809L
/* #define _POSIX_BARRIERS -1 */
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_CLOCK_SELECTION 200809L
#define _POSIX_CPUTIME 200809L
#define _POSIX_FSYNC 200809L
#define _POSIX_IPV6 200809L
#define _POSIX_CLOCK_SELECTION 200112L
#define _POSIX_CPUTIME 200112L
#define _POSIX_FSYNC 200112L
#define _POSIX_IPV6 200112L
#define _POSIX_JOB_CONTROL 1
#define _POSIX_MAPPED_FILES 200809L
#define _POSIX_MAPPED_FILES 200112L
/* #define _POSIX_MEMLOCK -1 */
#define _POSIX_MEMLOCK_RANGE 200809L
#define _POSIX_MEMORY_PROTECTION 200809L
#define _POSIX_MESSAGE_PASSING 200809L
#define _POSIX_MONOTONIC_CLOCK 200809L
#define _POSIX_MEMLOCK_RANGE 200112L
#define _POSIX_MEMORY_PROTECTION 200112L
#define _POSIX_MESSAGE_PASSING 200112L
#define _POSIX_MONOTONIC_CLOCK 200112L
#define _POSIX_NO_TRUNC 1
/* #define _POSIX_PRIORITIZED_IO -1 */
#define _POSIX_PRIORITY_SCHEDULING 200809L
#define _POSIX_RAW_SOCKETS 200809L
#define _POSIX_READER_WRITER_LOCKS 200809L
#define _POSIX_REALTIME_SIGNALS 200809L
#define _POSIX_PRIORITY_SCHEDULING 200112L
#define _POSIX_RAW_SOCKETS 200112L
#define _POSIX_READER_WRITER_LOCKS 200112L
#define _POSIX_REALTIME_SIGNALS 200112L
#define _POSIX_REGEXP 1
#define _POSIX_SAVED_IDS 1
#define _POSIX_SEMAPHORES 200809L
#define _POSIX_SHARED_MEMORY_OBJECTS 200809L
#define _POSIX_SEMAPHORES 200112L
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
#define _POSIX_SHELL 1
#define _POSIX_SPAWN 200809L
#define _POSIX_SPIN_LOCKS 200809L
/* #define _POSIX_SPAWN -1 */
#define _POSIX_SPIN_LOCKS 200112L
/* #define _POSIX_SPORADIC_SERVER -1 */
#define _POSIX_SYNCHRONIZED_IO 200809L
#define _POSIX_THREAD_ATTR_STACKADDR 200809L
#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
#define _POSIX_THREAD_CPUTIME 200809L
#define _POSIX_SYNCHRONIZED_IO 200112L
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
#define _POSIX_THREAD_CPUTIME 200112L
/* #define _POSIX_THREAD_PRIO_INHERIT -1 */
/* #define _POSIX_THREAD_PRIO_PROTECT -1 */
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
#define _POSIX_THREAD_PROCESS_SHARED 200809L
#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
#define _POSIX_THREAD_PROCESS_SHARED 200112L
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */
#define _POSIX_THREADS 200809L
#define _POSIX_THREADS 200112L
/* #define _POSIX_TIMEOUTS -1 */
#define _POSIX_TIMERS 1
/* #define _POSIX_TRACE -1 */
435,9 → 164,9
/* #define _POSIX_TRACE_LOG -1 */
/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */
#define _POSIX_VDISABLE '\0'
#define _POSIX2_C_BIND 200809L
#define _POSIX2_C_DEV 200809L
#define _POSIX2_CHAR_TERM 200809L
#define _POSIX2_C_BIND 200112L
#define _POSIX2_C_DEV 200112L
#define _POSIX2_CHAR_TERM 200112L
/* #define _POSIX2_FORT_DEV -1 */
/* #define _POSIX2_FORT_RUN -1 */
/* #define _POSIX2_LOCALEDEF -1 */
447,8 → 176,8
/* #define _POSIX2_PBS_LOCATE -1 */
/* #define _POSIX2_PBS_MESSAGE -1 */
/* #define _POSIX2_PBS_TRACK -1 */
#define _POSIX2_SW_DEV 200809L
#define _POSIX2_UPE 200809L
#define _POSIX2_SW_DEV 200112L
#define _POSIX2_UPE 200112L
#define _POSIX_V6_ILP32_OFF32 -1
#ifdef __LP64__
#define _POSIX_V6_ILP32_OFFBIG -1
481,6 → 210,27
 
#endif /* __CYGWIN__ */
 
/* Per the permission given in POSIX.1-2008 section 2.2.1, define
* _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not.
* (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.)
* This permission is first granted in 2008, but use it for older ones, also.
* Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it
* was required to have specific values).
*/
#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE)
#if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */
#define _POSIX_C_SOURCE 200809L
#elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */
#define _POSIX_C_SOURCE 200112L
#elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */
#define _POSIX_C_SOURCE 199506L
#elif (_XOPEN_SOURCE - 0) < 500 /* really old */
#define _POSIX_C_SOURCE 2
#endif
#endif
 
#define _POSIX_MONOTONIC_CLOCK 200112L
 
#ifdef __cplusplus
}
#endif
/contrib/sdk/sources/newlib/libc/include/sys/stat.h
82,12 → 82,12
#define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */
#define S_ISVTX 0001000 /* save swapped text even after use */
#if __BSD_VISIBLE
#ifndef _POSIX_SOURCE
#define S_IREAD 0000400 /* read permission, owner */
#define S_IWRITE 0000200 /* write permission, owner */
#define S_IEXEC 0000100 /* execute/search permission, owner */
#define S_ENFMT 0002000 /* enforcement-mode locking */
#endif /* !_BSD_VISIBLE */
#endif /* !_POSIX_SOURCE */
 
#define S_IFMT _IFMT
#define S_IFDIR _IFDIR
124,7 → 124,7
#define S_IWOTH 0000002 /* write permission, other */
#define S_IXOTH 0000001/* execute/search permission, other */
 
#if __BSD_VISIBLE
#ifndef _POSIX_SOURCE
#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */
#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */
#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */
144,8 → 144,6
#define UTIME_OMIT -1L
#endif
 
int _EXFUN(chmod,( const char *__path, mode_t __mode ));
int _EXFUN(fchmod,(int __fd, mode_t __mode));
int _EXFUN(fstat,( int __fd, struct stat *__sbuf ));
int _EXFUN(mkdir,( const char *_path, mode_t __mode ));
int _EXFUN(mkfifo,( const char *__path, mode_t __mode ));
157,15 → 155,19
int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev ));
#endif
 
#if __ATFILE_VISIBLE && !defined(__INSIDE_CYGWIN__)
#if (__POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
int _EXFUN(fchmodat, (int, const char *, mode_t, int));
#endif
#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
int _EXFUN(fstatat, (int, const char *__restrict , struct stat *__restrict, int));
int _EXFUN(mkdirat, (int, const char *, mode_t));
int _EXFUN(mkfifoat, (int, const char *, mode_t));
#endif
#if (__BSD_VISIBLE || __XSI_VISIBLE >= 700 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
int _EXFUN(mknodat, (int, const char *, mode_t, dev_t));
#endif
#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__)
int _EXFUN(utimensat, (int, const char *, const struct timespec *, int));
#endif
#if __POSIX_VISIBLE >= 200809 && !defined(__INSIDE_CYGWIN__)
int _EXFUN(futimens, (int, const struct timespec *));
#endif
 
/contrib/sdk/sources/newlib/libc/include/sys/_default_fcntl.h
66,8 → 66,9
#define _O_BINARY O_BINARY
#define _O_RAW O_BINARY
#define _O_NOINHERIT O_NOINHERIT
#if __MISC_VISIBLE
 
#ifndef _POSIX_SOURCE
 
/*
* Flags that work for fcntl(fd, F_SETFL, FXXXX)
*/
98,7 → 99,7
#define FEXCL _FEXCL
#define FNOCTTY _FNOCTTY
 
#endif /* __MISC_VISIBLE */
#endif /* !_POSIX_SOURCE */
 
/* XXX close on exec request; must match UF_EXCLOSE in user.h */
#define FD_CLOEXEC 1 /* posix */
109,20 → 110,20
#define F_SETFD 2 /* Set fildes flags (close on exec) */
#define F_GETFL 3 /* Get file flags */
#define F_SETFL 4 /* Set file flags */
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
#ifndef _POSIX_SOURCE
#define F_GETOWN 5 /* Get owner - for ASYNC */
#define F_SETOWN 6 /* Set owner - for ASYNC */
#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 */
#endif /* !_POSIX_SOURCE */
#define F_GETLK 7 /* Get record-locking information */
#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
#if __MISC_VISIBLE
#ifndef _POSIX_SOURCE
#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */
#define F_RSETLK 11 /* Set or unlock a remote lock */
#define F_CNVT 12 /* Convert a fhandle to an open fd */
#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */
#endif /* __MISC_VISIBLE */
#if __POSIX_VISIBLE >= 200809
#endif /* !_POSIX_SOURCE */
#ifdef __CYGWIN__
#define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */
#endif
 
130,11 → 131,11
#define F_RDLCK 1 /* read lock */
#define F_WRLCK 2 /* write lock */
#define F_UNLCK 3 /* remove lock(s) */
#if __MISC_VISIBLE
#ifndef _POSIX_SOURCE
#define F_UNLKSYS 4 /* remove remote locks for a given system */
#endif /* __MISC_VISIBLE */
#endif /* !_POSIX_SOURCE */
 
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__)
/* Special descriptor value to denote the cwd in calls to openat(2) etc. */
#define AT_FDCWD -2
 
167,7 → 168,7
};
#endif /* __CYGWIN__ */
 
#if __MISC_VISIBLE
#ifndef _POSIX_SOURCE
/* extended file segment locking set data type */
struct eflock {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
179,13 → 180,13
long l_rpid; /* Remote process id wanting this lock */
long l_rsys; /* Remote system id wanting this lock */
};
#endif /* __MISC_VISIBLE */
#endif /* !_POSIX_SOURCE */
 
#include <sys/types.h>
#include <sys/stat.h> /* sigh. for the mode bits for open/creat */
 
extern int open _PARAMS ((const char *, int, ...));
#if __ATFILE_VISIBLE
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__)
extern int openat _PARAMS ((int, const char *, int, ...));
#endif
extern int creat _PARAMS ((const char *, mode_t));
193,7 → 194,7
#if __BSD_VISIBLE
extern int flock _PARAMS ((int, int));
#endif
#if __GNU_VISIBLE
#ifdef __CYGWIN__
#include <sys/time.h>
extern int futimesat _PARAMS ((int, const char *, const struct timeval *));
#endif
/contrib/sdk/sources/newlib/libc/include/sys/config.h
232,7 → 232,10
 
#if defined(__CYGWIN__)
#include <cygwin/config.h>
#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
#define __USE_XOPEN2K 1
#endif
#endif
 
#if defined(__rtems__)
#define __FILENAME_MAX__ 255
/contrib/sdk/sources/newlib/libc/include/sys/select.h
19,9 → 19,10
includes the W32api winsock[2].h header must know what it is doing;
it must not call the Cygwin select function.
*/
# if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS))
 
#include <sys/cdefs.h>
 
#include <sys/_sigset.h>
#include <sys/_timeval.h>
#include <sys/timespec.h>
72,16 → 73,14
 
int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
fd_set *__exceptfds, struct timeval *__timeout));
#if __POSIX_VISIBLE >= 200112
int pselect __P ((int __n, fd_set *__readfds, fd_set *__writefds,
fd_set *__exceptfds, const struct timespec *__timeout,
const sigset_t *__set));
#endif
 
__END_DECLS
 
#endif /* !__INSIDE_CYGWIN_NET__ */
#endif
 
#endif /* !(_WINSOCK_H || _WINSOCKAPI_ || __USE_W32_SOCKETS) */
#endif /* !_POSIX_SOURCE, !__INSIDE_CYGWIN_NET__ */
 
#endif /* sys/select.h */
/contrib/sdk/sources/newlib/libc/include/sys/signal.h
13,6 → 13,8
#include <sys/_sigset.h>
#include <sys/_timespec.h>
 
/* #ifndef __STRICT_ANSI__*/
 
#if !defined(_SIGSET_T_DECLARED)
#define _SIGSET_T_DECLARED
typedef __sigset_t sigset_t;
75,7 → 77,7
#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */
#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */
/* three arguments instead of one. */
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */
#endif
 
123,7 → 125,7
};
#endif /* defined(__rtems__) */
 
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
/*
* Minimum and default signal stack constants. Allow for target overrides
* from <sys/features.h>.
156,6 → 158,15
#define SIG_BLOCK 1 /* set of signals to block */
#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */
 
/* These depend upon the type of sigset_t, which right now
is always a long.. They're in the POSIX namespace, but
are not ANSI. */
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
#define sigemptyset(what) (*(what) = 0, 0)
#define sigfillset(what) (*(what) = ~(0), 0)
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
 
int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset));
 
#if defined(_POSIX_THREADS)
163,6 → 174,12
#endif
 
#if defined(__CYGWIN__) || defined(__rtems__)
#undef sigaddset
#undef sigdelset
#undef sigemptyset
#undef sigfillset
#undef sigismember
 
#ifdef _COMPILING_NEWLIB
int _EXFUN(_kill, (pid_t, int));
#endif /* _COMPILING_NEWLIB */
170,7 → 187,7
 
int _EXFUN(kill, (pid_t, int));
 
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
#if defined(__CYGWIN__) || defined(__rtems__)
int _EXFUN(killpg, (pid_t, int));
int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *));
int _EXFUN(sigaddset, (sigset_t *, const int));
182,21 → 199,11
int _EXFUN(sigsuspend, (const sigset_t *));
int _EXFUN(sigpause, (int));
 
#if !defined(__CYGWIN__) && !defined(__rtems__)
/* These depend upon the type of sigset_t, which right now
is always a long.. They're in the POSIX namespace, but
are not ANSI. */
#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0)
#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0)
#define sigemptyset(what) (*(what) = 0, 0)
#define sigfillset(what) (*(what) = ~(0), 0)
#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0)
#endif /* !__CYGWIN__ && !__rtems__ */
#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 4 */
 
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#if defined(__CYGWIN__) || defined(__rtems__)
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict));
#endif
#endif
 
#if defined(_POSIX_THREADS)
#ifdef __CYGWIN__
223,6 → 230,10
 
#endif /* defined(_POSIX_REALTIME_SIGNALS) */
 
#endif /* defined(__CYGWIN__) || defined(__rtems__) */
 
/* #endif __STRICT_ANSI__ */
 
#if defined(___AM29K__)
/* These all need to be defined for ANSI C, but I don't think they are
meaningful. */
343,7 → 354,7
#endif
 
#if defined(__CYGWIN__)
#if __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
#if __POSIX_VISIBLE >= 200809
#include <sys/ucontext.h>
#endif
#endif
/contrib/sdk/sources/newlib/libc/include/sys/time.h
43,7 → 43,7
#include <sys/types.h>
#include <sys/timespec.h>
 
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#if __BSD_VISIBLE
#include <sys/select.h>
#endif
 
416,27 → 416,24
#include <sys/cdefs.h>
 
__BEGIN_DECLS
int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value,
struct itimerval *__restrict __ovalue));
int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp));
 
#if __BSD_VISIBLE
int _EXFUN(adjtime, (const struct timeval *, struct timeval *));
int _EXFUN(futimes, (int, const struct timeval *));
int _EXFUN(futimesat, (int, const char *, const struct timeval [2]));
int _EXFUN(lutimes, (const char *, const struct timeval *));
int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *));
#endif
 
#if __MISC_VISIBLE || __XSI_VISIBLE
#if __XSI_VISIBLE
int _EXFUN(getitimer, (int __which, struct itimerval *__value));
int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value,
struct itimerval *__restrict __ovalue));
int _EXFUN(gettimeofday, (struct timeval *__restrict __p,
void *__restrict __tz));
#endif
 
#if __GNU_VISIBLE
int _EXFUN(futimesat, (int, const char *, const struct timeval [2]));
#endif
 
#ifdef _COMPILING_NEWLIB
int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz));
#endif
/contrib/sdk/sources/newlib/libc/include/sys/types.h
19,11 → 19,20
 
#include <_ansi.h>
#include <sys/cdefs.h>
 
#ifndef __INTTYPES_DEFINED__
#define __INTTYPES_DEFINED__
 
#include <machine/_types.h>
 
/* BSD types permitted by POSIX and always exposed as in Glibc. Only provided
for backward compatibility with BSD code. The uintN_t standard types should
be preferred in new code. */
#if defined(__rtems__) || defined(__XMK__)
/*
* The following section is RTEMS specific and is needed to more
* closely match the types defined in the BSD sys/types.h.
* This is needed to let the RTEMS/BSD TCP/IP stack compile.
*/
 
/* deprecated */
#if ___int8_t_defined
typedef __uint8_t u_int8_t;
#endif
33,26 → 42,20
#if ___int32_t_defined
typedef __uint32_t u_int32_t;
#endif
 
#if ___int64_t_defined
typedef __uint64_t u_int64_t;
#endif
 
#if defined(__rtems__) || defined(__XMK__)
/*
* The following section is RTEMS specific and is needed to more
* closely match the types defined in the BSD sys/types.h.
* This is needed to let the RTEMS/BSD TCP/IP stack compile.
*/
 
/* deprecated */
#if ___int64_t_defined
typedef __uint64_t u_quad_t;
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;
#endif
 
#endif /* __rtems__ || __XMK__ */
#endif
 
#endif /* ! __INTTYPES_DEFINED */
 
#ifndef __need_inttypes
 
#define _SYS_TYPES_H
82,12 → 85,10
#endif
 
#if __BSD_VISIBLE
#include <sys/select.h>
 
# define physadr physadr_t
# define quad quad_t
#endif
 
#if __MISC_VISIBLE
#ifndef _BSDTYPES_DEFINED
/* also defined in mingw/gmon.h and in w32api/winsock[2].h */
#ifndef __u_char_defined
108,13 → 109,11
#endif
#define _BSDTYPES_DEFINED
#endif
#endif /*__BSD_VISIBLE || __CYGWIN__ */
 
#if __MISC_VISIBLE
typedef unsigned short ushort; /* System V compatibility */
typedef unsigned int uint; /* System V compatibility */
typedef unsigned long ulong; /* System V compatibility */
#endif
# endif /*__BSD_VISIBLE */
 
#ifndef __clock_t_defined
typedef _CLOCK_T_ clock_t;
188,11 → 187,7
#ifndef __CYGWIN__
typedef long key_t;
#endif
 
#ifndef _SSIZE_T_DECLARED
typedef _ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
 
#if !defined(__CYGWIN__) && !defined(__rtems__)
#ifdef __MS_types__
415,7 → 410,6
 
typedef struct {
int is_initialized;
clock_t clock; /* specifiy clock for timeouts */
#if defined(_POSIX_THREAD_PROCESS_SHARED)
int process_shared; /* allow this to be shared amongst processes */
#endif
437,7 → 431,6
 
/* POSIX Barrier Types */
 
#if !defined(__CYGWIN__)
#if defined(_POSIX_BARRIERS)
typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */
typedef struct {
450,6 → 443,7
 
/* POSIX Spin Lock Types */
 
#if !defined (__CYGWIN__)
#if defined(_POSIX_SPIN_LOCKS)
typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */
#endif /* defined(_POSIX_SPIN_LOCKS) */
/contrib/sdk/sources/newlib/libc/include/sys/unistd.h
24,46 → 24,42
#if !defined(__INSIDE_CYGWIN__)
int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112)
#if defined(__CYGWIN__) || defined(__rtems__)
int _EXFUN(chroot, (const char *__path ));
#endif
int _EXFUN(close, (int __fildes ));
#if __POSIX_VISIBLE >= 199209
#if defined(__CYGWIN__)
size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len));
#endif
char * _EXFUN(ctermid, (char *__s ));
char * _EXFUN(cuserid, (char *__s ));
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
#if defined(__CYGWIN__)
int _EXFUN(daemon, (int nochdir, int noclose));
#endif
int _EXFUN(dup, (int __fildes ));
int _EXFUN(dup2, (int __fildes, int __fildes2 ));
#if __GNU_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(dup3, (int __fildes, int __fildes2, int flags));
int _EXFUN(eaccess, (const char *__path, int __mode));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
void _EXFUN(endusershell, (void));
#endif
#if __GNU_VISIBLE
int _EXFUN(euidaccess, (const char *__path, int __mode));
#endif
int _EXFUN(execl, (const char *__path, const char *, ... ));
int _EXFUN(execle, (const char *__path, const char *, ... ));
int _EXFUN(execlp, (const char *__file, const char *, ... ));
#if __MISC_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(execlpe, (const char *__file, const char *, ... ));
#endif
int _EXFUN(execv, (const char *__path, char * const __argv[] ));
int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] ));
int _EXFUN(execvp, (const char *__file, char * const __argv[] ));
#if __GNU_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(execvpe, (const char *__file, char * const __argv[], char * const __envp[] ));
#endif
#if __ATFILE_VISIBLE
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
int _EXFUN(faccessat, (int __dirfd, const char *__path, int __mode, int __flags));
#endif
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__)
int _EXFUN(fchdir, (int __fildes));
#endif
int _EXFUN(fchmod, (int __fildes, mode_t __mode ));
70,10 → 66,10
#if !defined(__INSIDE_CYGWIN__)
int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
#endif
#if __ATFILE_VISIBLE
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
int _EXFUN(fchownat, (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags));
#endif
#if __POSIX_VISIBLE >= 200809
#if defined(__CYGWIN__)
int _EXFUN(fexecve, (int __fd, char * const __argv[], char * const __envp[] ));
#endif
pid_t _EXFUN(fork, (void ));
80,16 → 76,13
long _EXFUN(fpathconf, (int __fd, int __name ));
int _EXFUN(fsync, (int __fd));
int _EXFUN(fdatasync, (int __fd));
#if __GNU_VISIBLE
#if defined(__CYGWIN__)
char * _EXFUN(get_current_dir_name, (void));
#endif
char * _EXFUN(getcwd, (char *__buf, size_t __size ));
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
#if defined(__CYGWIN__)
int _EXFUN(getdomainname ,(char *__name, size_t __len));
#endif
#if __BSD_VISIBLE
int _EXFUN(getentropy, (void *, size_t));
#endif
#if !defined(__INSIDE_CYGWIN__)
gid_t _EXFUN(getegid, (void ));
uid_t _EXFUN(geteuid, (void ));
96,7 → 89,7
gid_t _EXFUN(getgid, (void ));
#endif
int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
#if defined(__CYGWIN__)
long _EXFUN(gethostid, (void));
#endif
char * _EXFUN(getlogin, (void ));
105,7 → 98,7
#endif
char * _EXFUN(getpass, (const char *__prompt));
int _EXFUN(getpagesize, (void));
#if __BSD_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(getpeereid, (int, uid_t *, gid_t *));
#endif
pid_t _EXFUN(getpgid, (pid_t));
112,19 → 105,15
pid_t _EXFUN(getpgrp, (void ));
pid_t _EXFUN(getpid, (void ));
pid_t _EXFUN(getppid, (void ));
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4
#if defined(__CYGWIN__) || defined(__rtems__)
pid_t _EXFUN(getsid, (pid_t));
#endif
#if !defined(__INSIDE_CYGWIN__)
uid_t _EXFUN(getuid, (void ));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
#ifdef __CYGWIN__
char * _EXFUN(getusershell, (void));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809)
char * _EXFUN(getwd, (char *__buf ));
#endif
#if __BSD_VISIBLE
int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser));
#endif
int _EXFUN(isatty, (int __fildes ));
135,7 → 124,7
int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group ));
#endif
int _EXFUN(link, (const char *__path1, const char *__path2 ));
#if __ATFILE_VISIBLE
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
int _EXFUN(linkat, (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags ));
#endif
int _EXFUN(nice, (int __nice_value ));
142,7 → 131,7
#if !defined(__INSIDE_CYGWIN__)
off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
#endif
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
#if defined(__SPU__) || defined(__CYGWIN__)
#define F_ULOCK 0
#define F_LOCK 1
#define F_TLOCK 2
151,41 → 140,41
#endif
long _EXFUN(pathconf, (const char *__path, int __name ));
int _EXFUN(pause, (void ));
#if __POSIX_VISIBLE >= 199506
#ifdef __CYGWIN__
int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void)));
#endif
int _EXFUN(pipe, (int __fildes[2] ));
#if __GNU_VISIBLE
#ifdef __CYGWIN__
int _EXFUN(pipe2, (int __fildes[2], int flags));
#endif
ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset));
ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset));
_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte ));
#if __BSD_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(rresvport, (int *__alport));
int _EXFUN(revoke, (char *__path));
#endif
int _EXFUN(rmdir, (const char *__path ));
#if __BSD_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser));
#endif
void * _EXFUN(sbrk, (ptrdiff_t __incr));
#if !defined(__INSIDE_CYGWIN__)
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
#if defined(__CYGWIN__) || defined(__rtems__)
int _EXFUN(setegid, (gid_t __gid ));
int _EXFUN(seteuid, (uid_t __uid ));
#endif
int _EXFUN(setgid, (gid_t __gid ));
#endif
#if __BSD_VISIBLE
#if defined(__CYGWIN__)
int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
#if __BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500)
int _EXFUN(sethostname, (const char *, size_t));
#endif
int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
int _EXFUN(setpgrp, (void ));
#if (__BSD_VISIBLE || __XSI_VISIBLE >= 4) && !defined(__INSIDE_CYGWIN__)
#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
int _EXFUN(setregid, (gid_t __rgid, gid_t __egid));
int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid));
#endif
193,7 → 182,7
#if !defined(__INSIDE_CYGWIN__)
int _EXFUN(setuid, (uid_t __uid ));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
#if defined(__CYGWIN__)
void _EXFUN(setusershell, (void));
#endif
unsigned _EXFUN(sleep, (unsigned int __seconds ));
202,7 → 191,9
pid_t _EXFUN(tcgetpgrp, (int __fildes ));
int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id ));
char * _EXFUN(ttyname, (int __fildes ));
#if defined(__CYGWIN__) || defined(__rtems__)
int _EXFUN(ttyname_r, (int, char *, size_t));
#endif
int _EXFUN(unlink, (const char *__path ));
int _EXFUN(usleep, (useconds_t __useconds));
int _EXFUN(vhangup, (void ));
219,9 → 210,9
extern int optreset; /* getopt(3) external variable */
#endif
 
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809)
#ifndef _POSIX_SOURCE
pid_t _EXFUN(vfork, (void ));
#endif
#endif /* _POSIX_SOURCE */
 
#ifdef _COMPILING_NEWLIB
/* Provide prototypes for most of the _<systemcall> names that are
264,14 → 255,14
void _EXFUN(sync, (void));
#endif
 
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4
ssize_t _EXFUN(readlink, (const char *__restrict __path,
char *__restrict __buf, size_t __buflen));
int _EXFUN(symlink, (const char *__name1, const char *__name2));
#endif
#if __ATFILE_VISIBLE
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__restrict __path,
char *__restrict __buf, size_t __buflen));
#endif
int _EXFUN(symlink, (const char *__name1, const char *__name2));
#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__)
int _EXFUN(symlinkat, (const char *, int, const char *));
int _EXFUN(unlinkat, (int, const char *, int));
#endif
/contrib/sdk/sources/newlib/libc/include/sys/lock.h
1,47 → 1,69
#ifndef __SYS_LOCK_H__
#define __SYS_LOCK_H__
 
#ifndef _SYS_LOCK_H_
#define _SYS_LOCK_H_
//#define _LIBC 1
#define NOT_IN_libc 1
 
#include <sys/cdefs.h>
#include <stddef.h>
#include <sys/gthr.h>
#ifndef __USE_GNU
#define __USE_GNU 1
#endif
 
typedef __gthread_mutex_t _LOCK_T;
void __mutex_lock(volatile int *val);
 
typedef __gthread_recursive_mutex_t _LOCK_RECURSIVE_T;
typedef volatile int __libc_lock_t;
typedef struct { volatile int mutex; } __libc_lock_recursive_t;
 
#define _MUTEX_INITIALIZER { 0, -1 }
#define __libc_lock_define(CLASS,NAME) \
CLASS __libc_lock_t NAME;
#define __libc_rwlock_define(CLASS,NAME) \
CLASS __libc_rwlock_t NAME;
#define __libc_lock_define_recursive(CLASS,NAME) \
CLASS __libc_lock_recursive_t NAME;
#define __rtld_lock_define_recursive(CLASS,NAME) \
CLASS __rtld_lock_recursive_t NAME;
 
#define _MUTEX_RECURSIVE_INITIALIZER { 0,-1,0,0 }
typedef __libc_lock_t _LOCK_T;
typedef __libc_lock_recursive_t _LOCK_RECURSIVE_T;
 
#define __LOCK_INIT(_qualifier, _designator) \
_qualifier _LOCK_T _designator = _MUTEX_INITIALIZER
#define __LOCK_INIT(class,lock) \
__libc_lock_define_initialized(class, lock)
 
#define __LOCK_INIT_RECURSIVE(_qualifier, _designator) \
_qualifier _LOCK_RECURSIVE_T _designator = _MUTEX_RECURSIVE_INITIALIZER
#define __LOCK_INIT_RECURSIVE(class, lock) \
__libc_lock_define_initialized_recursive(class, lock)
 
static inline int __libc_lock_acquire(_LOCK_T *lock)
{
if(lock->handle == -1)
__gthread_mutex_init_function(lock);
#define __libc_lock_define_initialized(CLASS,NAME) \
CLASS __libc_lock_t NAME;
 
return __gthread_mutex_lock(lock);
}
#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
 
static inline int __libc_lock_acquire_recursive(_LOCK_RECURSIVE_T *lock)
{
if(lock->handle == -1)
__gthread_recursive_mutex_init_function(lock);
#define _LIBC_LOCK_RECURSIVE_INITIALIZER {0}
 
return __gthread_recursive_mutex_lock(lock);
}
#define __lock_init(__lock) __libc_lock_init(__lock)
#define __lock_init_recursive(__lock) __libc_lock_init_recursive(__lock)
#define __lock_acquire(__lock) __libc_lock_lock(__lock)
#define __lock_acquire_recursive(__lock) __libc_lock_lock_recursive(__lock)
#define __lock_release(__lock) __libc_lock_unlock(__lock)
#define __lock_release_recursive(__lock) __libc_lock_unlock_recursive(__lock)
#define __lock_try_acquire(__lock) __libc_lock_trylock(__lock)
#define __lock_try_acquire_recursive(__lock) \
__libc_lock_trylock_recursive(__lock)
#define __lock_close(__lock) __libc_lock_fini(__lock)
#define __lock_close_recursive(__lock) __libc_lock_fini_recursive(__lock)
 
#define __lock_acquire(_lock) __libc_lock_acquire(&_lock)
#define __lock_release(_lock) __gthread_mutex_unlock(&_lock)
 
#define __lock_init_recursive(_lock) __gthread_recursive_mutex_init_function(&_lock)
#define __lock_acquire_recursive(_lock) __libc_lock_acquire_recursive(&_lock)
#define __lock_release_recursive(_lock) __gthread_recursive_mutex_unlock(&_lock)
#define __lock_close_recursive(_lock) __gthread_recursive_mutex_destroy(&_lock)
#define __libc_lock_init_recursive(NAME) ((NAME).mutex=0)
#define __libc_lock_fini(NAME)
 
#endif /* _SYS_LOCK_H_ */
#define __libc_lock_fini_recursive(NAME) __libc_lock_fini ((NAME).mutex)
 
 
#define __libc_lock_lock(NAME) __mutex_lock (&(NAME))
 
/* Lock the recursive named lock variable. */
#define __libc_lock_lock_recursive(NAME) __libc_lock_lock ((NAME).mutex)
 
#define __libc_lock_unlock(NAME) ((NAME)=0)
#define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock ((NAME).mutex)
 
#endif /* __SYS_LOCK_H__ */
/contrib/sdk/sources/newlib/libc/include/sys/stdio.h
9,12 → 9,12
detect if FILE is private to sprintf/sscanf class of functions; if
set then do nothing as lock is not initialised. */
#if !defined(_flockfile)
#ifndef __SINGLE_THREAD__
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
#else
//#ifndef __SINGLE_THREAD__
//# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
//#else
# define _flockfile(fp) (_CAST_VOID 0)
//#endif
#endif
#endif
 
#if !defined(_funlockfile)
#ifndef __SINGLE_THREAD__
/contrib/sdk/sources/newlib/libc/include/complex.h
108,10 → 108,12
/* 7.3.9.3 The conj functions */
double complex conj(double complex);
float complex conjf(float complex);
/*long double complex conjl(long double complex); */
 
/* 7.3.9.4 The cproj functions */
double complex cproj(double complex);
float complex cprojf(float complex);
/*long double complex cprojl(long double complex); */
 
/* 7.3.9.5 The creal functions */
double creal(double complex);
118,36 → 120,6
float crealf(float complex);
long double creall(long double complex);
 
#if __GNU_VISIBLE
double complex clog10(double complex);
float complex clog10f(float complex);
#endif
 
#if defined(__CYGWIN__)
long double complex cacosl(long double complex);
long double complex casinl(long double complex);
long double complex catanl(long double complex);
long double complex ccosl(long double complex);
long double complex csinl(long double complex);
long double complex ctanl(long double complex);
long double complex cacoshl(long double complex);
long double complex casinhl(long double complex);
long double complex catanhl(long double complex);
long double complex ccoshl(long double complex);
long double complex csinhl(long double complex);
long double complex ctanhl(long double complex);
long double complex cexpl(long double complex);
long double complex clogl(long double complex);
long double complex cpowl(long double complex, long double complex);
long double complex csqrtl(long double complex);
long double cargl(long double complex);
long double complex conjl(long double complex);
long double complex cprojl(long double complex);
#if __GNU_VISIBLE
long double complex clog10l(long double complex);
#endif
#endif /* __CYGWIN__ */
 
__END_DECLS
 
#endif /* ! _COMPLEX_H */
/contrib/sdk/sources/newlib/libc/include/grp.h
49,7 → 49,7
#include <cygwin/grp.h>
#endif
 
#if __BSD_VISIBLE
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define _PATH_GROUP "/etc/group"
#endif
 
67,20 → 67,25
#ifndef __INSIDE_CYGWIN__
struct group *getgrgid (gid_t);
struct group *getgrnam (const char *);
#if __MISC_VISIBLE || __POSIX_VISIBLE
int getgrnam_r (const char *, struct group *,
char *, size_t, struct group **);
int getgrgid_r (gid_t, struct group *,
char *, size_t, struct group **);
#endif /* __MISC_VISIBLE || __POSIX_VISIBLE */
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
#ifndef _POSIX_SOURCE
struct group *getgrent (void);
void setgrent (void);
void endgrent (void);
#endif /* __MISC_VISIBLE || __XSI_VISIBLE >= 4 */
#if __BSD_VISIBLE
#ifndef __CYGWIN__
void setgrfile (const char *);
#endif /* !__CYGWIN__ */
#ifndef _XOPEN_SOURCE
#ifndef __CYGWIN__
char *group_from_gid (gid_t, int);
int setgroupent (int);
#endif /* !__CYGWIN__ */
int initgroups (const char *, gid_t);
#endif /* __BSD_VISIBLE */
#endif /* !_XOPEN_SOURCE */
#endif /* !_POSIX_SOURCE */
#endif /* !__INSIDE_CYGWIN__ */
 
#ifdef __cplusplus
/contrib/sdk/sources/newlib/libc/include/ieeefp.h
270,17 → 270,22
#define __IEEE_DBL_NAN_EXP 0x7ff
#define __IEEE_FLT_NAN_EXP 0xff
 
#ifdef __ieeefp_isnanf
#ifndef __ieeefp_isnanf
#define __ieeefp_isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
((*(long *)&(x) & 0x007fffffL)!=0000000000L))
#endif
#define isnanf(x) __ieeefp_isnanf(x)
 
#ifndef __ieeefp_isinff
#define __ieeefp_isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
((*(long *)&(x) & 0x007fffffL)==0000000000L))
#endif
#define isinff(x) __ieeefp_isinff(x)
 
#ifdef __ieeefp_isinff
#define isinff(x) __ieeefp_isinff(x)
#ifndef __ieeefp_finitef
#define __ieeefp_finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L))
#endif
 
#ifdef __ieeefp_finitef
#define finitef(x) __ieeefp_finitef(x)
#endif
 
#ifdef _DOUBLE_IS_32BITS
#undef __IEEE_DBL_EXPBIAS
/contrib/sdk/sources/newlib/libc/include/machine/fastmath.h
1,122 → 1,100
#ifndef _MACHFASTMATH_H
#define _MACHFASTMATH_H
#ifdef __sysvnecv70_target
double EXFUN(fast_sin,(double));
double EXFUN(fast_cos,(double));
double EXFUN(fast_tan,(double));
 
#if defined(__GNUC__) && __STDC__ - 0 > 0
double EXFUN(fast_asin,(double));
double EXFUN(fast_acos,(double));
double EXFUN(fast_atan,(double));
 
#define __str1__(__x) #__x
#define __str2__(__x) __str1__(__x)
#define __U_L_PREFIX__ __str2__(__USER_LABEL_PREFIX__)
double EXFUN(fast_sinh,(double));
double EXFUN(fast_cosh,(double));
double EXFUN(fast_tanh,(double));
 
__extension__ double atan2(double, double)
__asm__(__U_L_PREFIX__ "_f_atan2");
__extension__ double exp(double)
__asm__(__U_L_PREFIX__ "_f_exp");
__extension__ double frexp(double, int*)
__asm__(__U_L_PREFIX__ "_f_frexp");
__extension__ double ldexp(double, int)
__asm__(__U_L_PREFIX__ "_f_ldexp");
__extension__ double log(double)
__asm__(__U_L_PREFIX__ "_f_log");
__extension__ double log10(double)
__asm__(__U_L_PREFIX__ "_f_log10");
__extension__ double pow(double, double)
__asm__(__U_L_PREFIX__ "_f_pow");
__extension__ double tan(double)
__asm__(__U_L_PREFIX__ "_f_tan");
double EXFUN(fast_asinh,(double));
double EXFUN(fast_acosh,(double));
double EXFUN(fast_atanh,(double));
 
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
double EXFUN(fast_abs,(double));
double EXFUN(fast_sqrt,(double));
double EXFUN(fast_exp2,(double));
double EXFUN(fast_exp10,(double));
double EXFUN(fast_expe,(double));
double EXFUN(fast_log10,(double));
double EXFUN(fast_log2,(double));
double EXFUN(fast_loge,(double));
 
 
__extension__ float atan2f(float, float)
__asm__(__U_L_PREFIX__ "_f_atan2f");
__extension__ float expf(float)
__asm__(__U_L_PREFIX__ "_f_expf");
__extension__ float frexpf(float, int*)
__asm__(__U_L_PREFIX__ "_f_frexpf");
__extension__ float ldexpf(float, int)
__asm__(__U_L_PREFIX__ "_f_ldexpf");
__extension__ long long llrint(double)
__asm__(__U_L_PREFIX__ "_f_llrint");
__extension__ long long llrintf(float)
__asm__(__U_L_PREFIX__ "_f_llrintf");
__extension__ long long llrintl(long double)
__asm__(__U_L_PREFIX__ "_f_llrintl");
__extension__ float logf(float)
__asm__(__U_L_PREFIX__ "_f_logf");
__extension__ float log10f(float)
__asm__(__U_L_PREFIX__ "_f_log10f");
__extension__ long lrint(double)
__asm__(__U_L_PREFIX__ "_f_lrint");
__extension__ long lrintf(float)
__asm__(__U_L_PREFIX__ "_f_lrintf");
__extension__ long lrintl(long double)
__asm__(__U_L_PREFIX__ "_f_lrintl");
__extension__ float powf(float, float)
__asm__(__U_L_PREFIX__ "_f_powf");
__extension__ double rint(double)
__asm__(__U_L_PREFIX__ "_f_rint");
__extension__ float rintf(float)
__asm__(__U_L_PREFIX__ "_f_rintf");
__extension__ long double rintl(long double)
__asm__(__U_L_PREFIX__ "_f_rintl");
__extension__ float tanf(float)
__asm__(__U_L_PREFIX__ "_f_tanf");
#endif
#define sin(x) fast_sin(x)
#define cos(x) fast_cos(x)
#define tan(x) fast_tan(x)
#define asin(x) fast_asin(x)
#define acos(x) fast_acos(x)
#define atan(x) fast_atan(x)
#define sinh(x) fast_sinh(x)
#define cosh(x) fast_cosh(x)
#define tanh(x) fast_tanh(x)
#define asinh(x) fast_asinh(x)
#define acosh(x) fast_acosh(x)
#define atanh(x) fast_atanh(x)
#define abs(x) fast_abs(x)
#define sqrt(x) fast_sqrt(x)
#define exp2(x) fast_exp2(x)
#define exp10(x) fast_exp10(x)
#define expe(x) fast_expe(x)
#define log10(x) fast_log10(x)
#define log2(x) fast_log2(x)
#define loge(x) fast_loge(x)
 
#else
#ifdef _HAVE_STDC
/* These functions are in assembler, they really do take floats. This
can only be used with a real ANSI compiler */
 
double EXFUN(_f_atan2,(double, double));
double EXFUN(_f_exp,(double));
double EXFUN(_f_frexp,(double, int*));
double EXFUN(_f_ldexp,(double, int));
double EXFUN(_f_log,(double));
double EXFUN(_f_log10,(double));
double EXFUN(_f_pow,(double, double));
float EXFUN(fast_sinf,(float));
float EXFUN(fast_cosf,(float));
float EXFUN(fast_tanf,(float));
 
#define atan2(__y,__x) _f_atan2((__y),(__x))
#define exp(__x) _f_exp(__x)
#define frexp(__x,__p) _f_frexp((__x),(__p))
#define ldexp(__x,__e) _f_ldexp((__x),(__e))
#define log(__x) _f_log(__x)
#define log10(__x) _f_log10(__x)
#define pow(__x,__y) _f_pow((__x),(__y))
float EXFUN(fast_asinf,(float));
float EXFUN(fast_acosf,(float));
float EXFUN(fast_atanf,(float));
 
#ifndef __STRICT_ANSI__
float EXFUN(fast_sinhf,(float));
float EXFUN(fast_coshf,(float));
float EXFUN(fast_tanhf,(float));
 
float EXFUN(_f_atan2f,(float, float));
float EXFUN(_f_expf,(float));
float EXFUN(_f_frexpf,(float, int*));
float EXFUN(_f_ldexpf,(float, int));
long long EXFUN(_f_llrint,(double));
long long EXFUN(_f_llrintf,(float));
long long EXFUN(_f_llrintl,(long double));
float EXFUN(_f_logf,(float));
float EXFUN(_f_log10f,(float));
long EXFUN(_f_lrint,(double));
long EXFUN(_f_lrintf,(float));
long EXFUN(_f_lrintl,(long double));
float EXFUN(_f_powf,(float, float));
float EXFUN(_f_rint,(double));
double EXFUN(_f_rintf,(float));
long double EXFUN(_f_rintl,(long double));
float EXFUN(fast_asinhf,(float));
float EXFUN(fast_acoshf,(float));
float EXFUN(fast_atanhf,(float));
 
#define atan2f(__y,__x) _f_atan2f((__y),(__x))
#define expf(__x) _f_expf(__x)
#define frexpf(__x,__p) _f_frexpf((__x),(__p))
#define ldexpf(__x,__e) _f_ldexpf((__x),(__e))
#define llrint(__x) _f_llrint((__x))
#define llrintf(__x) _f_llrintf((__x))
#define llrintl(__x) _f_llrintl((__x))
#define logf(__x) _f_logf(__x)
#define log10f(__x) _f_log10f(__x)
#define lrint(__x) _f_lrint((__x))
#define lrintf(__x) _f_lrintf((__x))
#define lrintl(__x) _f_lrintl((__x))
#define powf(__x,y) _f_powf((__x),(__y))
#define rint(__x) _f_rint((__x))
#define rintf(__x) _f_rintf((__x))
#define rintl(__x) _f_rintl((__x))
float EXFUN(fast_absf,(float));
float EXFUN(fast_sqrtf,(float));
float EXFUN(fast_exp2f,(float));
float EXFUN(fast_exp10f,(float));
float EXFUN(fast_expef,(float));
float EXFUN(fast_log10f,(float));
float EXFUN(fast_log2f,(float));
float EXFUN(fast_logef,(float));
#define sinf(x) fast_sinf(x)
#define cosf(x) fast_cosf(x)
#define tanf(x) fast_tanf(x)
#define asinf(x) fast_asinf(x)
#define acosf(x) fast_acosf(x)
#define atanf(x) fast_atanf(x)
#define sinhf(x) fast_sinhf(x)
#define coshf(x) fast_coshf(x)
#define tanhf(x) fast_tanhf(x)
#define asinhf(x) fast_asinhf(x)
#define acoshf(x) fast_acoshf(x)
#define atanhf(x) fast_atanhf(x)
#define absf(x) fast_absf(x)
#define sqrtf(x) fast_sqrtf(x)
#define exp2f(x) fast_exp2f(x)
#define exp10f(x) fast_exp10f(x)
#define expef(x) fast_expef(x)
#define log10f(x) fast_log10f(x)
#define log2f(x) fast_log2f(x)
#define logef(x) fast_logef(x)
#endif
/* Override the functions defined in math.h */
#endif /* __sysvnecv70_target */
 
#endif /* GCC */
#endif /* _MACHFASTMATH_H */
/contrib/sdk/sources/newlib/libc/include/math.h
3,7 → 3,6
#define _MATH_H_
 
#include <sys/reent.h>
#include <sys/cdefs.h>
#include <machine/ieeefp.h>
#include "_ansi.h"
 
137,7 → 136,9
#endif /* ! defined (__math_68881) */
#endif /* ! defined (_REENT_ONLY) */
 
#if __ISO_C_VISIBLE >= 1999
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
 
/* ISO C99 types and macros. */
 
/* FIXME: FLT_EVAL_METHOD should somehow be gotten from float.h (which is hard,
204,70 → 205,35
extern int __signbitf (float x);
extern int __signbitd (double x);
 
/* Note: isinf and isnan were once functions in newlib that took double
* arguments. C99 specifies that these names are reserved for macros
* supporting multiple floating point types. Thus, they are
* now defined as macros. Implementations of the old functions
* taking double arguments still exist for compatibility purposes
* (prototypes for them are in <ieeefp.h>). */
 
#if __GNUC_PREREQ (4, 4)
#define fpclassify(__x) (__builtin_fpclassify (FP_NAN, FP_INFINITE, \
FP_NORMAL, FP_SUBNORMAL, \
FP_ZERO, __x))
#ifndef isfinite
#define isfinite(__x) (__builtin_isfinite (__x))
#endif
#ifndef isinf
#define isinf(__x) (__builtin_isinf_sign (__x))
#endif
#ifndef isnan
#define isnan(__x) (__builtin_isnan (__x))
#endif
#define isnormal(__x) (__builtin_isnormal (__x))
#else
#define fpclassify(__x) \
((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \
__fpclassifyd(__x))
 
#ifndef isfinite
#define isfinite(__y) \
(__extension__ ({int __cy = fpclassify(__y); \
__cy != FP_INFINITE && __cy != FP_NAN;}))
#endif
 
/* Note: isinf and isnan were once functions in newlib that took double
* arguments. C99 specifies that these names are reserved for macros
* supporting multiple floating point types. Thus, they are
* now defined as macros. Implementations of the old functions
* taking double arguments still exist for compatibility purposes
* (prototypes for them are in <ieeefp.h>). */
#ifndef isinf
#define isinf(__x) (fpclassify(__x) == FP_INFINITE)
#define isinf(y) (fpclassify(y) == FP_INFINITE)
#endif
 
#ifndef isnan
#define isnan(__x) (fpclassify(__x) == FP_NAN)
#define isnan(y) (fpclassify(y) == FP_NAN)
#endif
#define isnormal(__x) (fpclassify(__x) == FP_NORMAL)
#endif
 
#if __GNUC_PREREQ (4, 0)
#if defined(_HAVE_LONG_DOUBLE)
#define isnormal(y) (fpclassify(y) == FP_NORMAL)
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __builtin_signbitf(__x) : \
(sizeof(__x) == sizeof(double)) ? __builtin_signbit (__x) : \
__builtin_signbitl(__x))
#else
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __builtin_signbitf(__x) : \
__builtin_signbit (__x))
#endif
#else
#define signbit(__x) \
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
__signbitd(__x))
#endif
 
#if __GNUC_PREREQ (2, 97)
#define isgreater(__x,__y) (__builtin_isgreater (__x, __y))
#define isgreaterequal(__x,__y) (__builtin_isgreaterequal (__x, __y))
#define isless(__x,__y) (__builtin_isless (__x, __y))
#define islessequal(__x,__y) (__builtin_islessequal (__x, __y))
#define islessgreater(__x,__y) (__builtin_islessgreater (__x, __y))
#define isunordered(__x,__y) (__builtin_isunordered (__x, __y))
#else
#define isgreater(x,y) \
(__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
!isunordered(__x,__y) && (__x > __y);}))
287,7 → 253,6
#define isunordered(a,b) \
(__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \
fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;}))
#endif
 
/* Non ANSI long double precision functions. */
 
421,12 → 386,8
extern float hypotf _PARAMS((float, float));
#endif /* ! defined (_REENT_ONLY) */
 
/* Newlib doesn't fully support long double math functions so far.
On platforms where long double equals double the long double functions
simply call the double functions. On Cygwin the long double functions
are implemented independently from newlib to be able to use optimized
assembler functions despite using the Microsoft x86_64 ABI. */
#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
/* On platforms where long double equals double. */
#ifdef _LDBL_EQ_DBL
/* Reentrant ANSI C functions. */
#ifndef __math_68881
extern long double atanl _PARAMS((long double));
496,7 → 457,7
extern long double erfl _PARAMS((long double));
extern long double erfcl _PARAMS((long double));
#endif /* ! defined (_REENT_ONLY) */
#else /* !_LDBL_EQ_DBL && !__CYGWIN__ */
#else /* !_LDBL_EQ_DBL */
extern long double hypotl _PARAMS((long double, long double));
extern long double sqrtl _PARAMS((long double));
#ifdef __i386__
505,23 → 466,17
extern long int lrintl _PARAMS((_LONG_DOUBLE));
extern long long int llrintl _PARAMS((_LONG_DOUBLE));
#endif /* __i386__ */
#endif /* !_LDBL_EQ_DBL && !__CYGWIN__ */
#endif /* !_LDBL_EQ_DBL */
 
#endif /* __ISO_C_VISIBLE >= 1999 */
#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
 
#if __MISC_VISIBLE
#if !defined (__STRICT_ANSI__) || defined(__cplusplus)
 
extern double drem _PARAMS((double, double));
extern float dremf _PARAMS((float, float));
#ifdef __CYGWIN__
extern float dreml _PARAMS((long double, long double));
#endif /* __CYGWIN__ */
extern void sincos _PARAMS((double, double *, double *));
extern double gamma_r _PARAMS((double, int *));
extern double lgamma_r _PARAMS((double, int *));
extern float gammaf_r _PARAMS((float, int *));
extern float lgammaf_r _PARAMS((float, int *));
#endif
 
#if __MISC_VISIBLE || __XSI_VISIBLE
extern double y0 _PARAMS((double));
extern double y1 _PARAMS((double));
extern double yn _PARAMS((int, double));
528,9 → 483,12
extern double j0 _PARAMS((double));
extern double j1 _PARAMS((double));
extern double jn _PARAMS((int, double));
#endif
 
#if __MISC_VISIBLE || __XSI_VISIBLE >= 600
extern float dremf _PARAMS((float, float));
extern void sincosf _PARAMS((float, float *, float *));
extern float gammaf_r _PARAMS((float, int *));
extern float lgammaf_r _PARAMS((float, int *));
 
extern float y0f _PARAMS((float));
extern float y1f _PARAMS((float));
extern float ynf _PARAMS((int, float));
537,15 → 495,8
extern float j0f _PARAMS((float));
extern float j1f _PARAMS((float));
extern float jnf _PARAMS((int, float));
#endif
 
/* GNU extensions */
#if __GNU_VISIBLE
extern void sincos _PARAMS((double, double *, double *));
extern void sincosf _PARAMS((float, float *, float *));
#ifdef __CYGWIN__
extern void sincosl _PARAMS((long double, long double *, long double *));
#endif /* __CYGWIN__ */
# ifndef exp10
extern double exp10 _PARAMS((double));
# endif
558,17 → 509,11
# ifndef pow10f
extern float pow10f _PARAMS((float));
# endif
#ifdef __CYGWIN__
# ifndef exp10l
extern float exp10l _PARAMS((float));
# endif
# ifndef pow10l
extern float pow10l _PARAMS((float));
# endif
#endif /* __CYGWIN__ */
#endif /* __GNU_VISIBLE */
 
#if __MISC_VISIBLE || __XSI_VISIBLE
#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */
 
#ifndef __STRICT_ANSI__
 
/* The gamma functions use a global variable, signgam. */
#ifndef _REENT_ONLY
#define signgam (*__signgam())
576,9 → 521,7
#endif /* ! defined (_REENT_ONLY) */
 
#define __signgam_r(ptr) _REENT_SIGNGAM(ptr)
#endif /* __MISC_VISIBLE || __XSI_VISIBLE */
 
#if __SVID_VISIBLE
/* The exception structure passed to the matherr routine. */
/* We have a problem when using C++ since `exception' is a reserved
name in C++. */
611,11 → 554,11
#define TLOSS 5
#define PLOSS 6
 
#endif /* __SVID_VISIBLE */
#endif /* ! defined (__STRICT_ANSI__) */
 
/* Useful constants. */
 
#if __BSD_VISIBLE || __XSI_VISIBLE >= 500
#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500)
 
#define MAXFLOAT 3.40282347e+38F
 
635,7 → 578,7
 
#endif
 
#if __BSD_VISIBLE
#ifndef __STRICT_ANSI__
 
#define M_TWOPI (M_PI * 2.0)
#define M_3PI_4 2.3561944901923448370E0
667,7 → 610,7
#define _XOPEN_ __fdlibm_xopen
#define _POSIX_ __fdlibm_posix
 
#endif /* __BSD_VISIBLE */
#endif /* ! defined (__STRICT_ANSI__) */
 
_END_STD_C
 
/contrib/sdk/sources/newlib/libc/include/pthread.h
1,7 → 1,8
/*
* Written by Joel Sherrill <joel.sherrill@OARcorp.com>.
/* pthread.h
*
* COPYRIGHT (c) 1989-2013, 2015.
* Written by Joel Sherrill <joel@OARcorp.com>.
*
* COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* Permission to use, copy, modify, and distribute this software for any
13,6 → 14,8
* WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION
* OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
* SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*
* $Id$
*/
 
#ifndef __PTHREAD_h
93,13 → 96,6
int _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr));
int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr));
 
int _EXFUN(pthread_condattr_getclock,
(const pthread_condattr_t *__restrict __attr,
clockid_t *__restrict __clock_id));
int _EXFUN(pthread_condattr_setclock,
(pthread_condattr_t *__attr, clockid_t __clock_id));
 
int _EXFUN(pthread_condattr_getpshared,
(_CONST pthread_condattr_t *__attr, int *__pshared));
int _EXFUN(pthread_condattr_setpshared,
165,9 → 161,6
int _EXFUN(pthread_setschedparam,
(pthread_t __pthread, int __policy, struct sched_param *__param));
 
/* Set Scheduling Priority of a Thread */
int _EXFUN(pthread_setschedprio, (pthread_t thread, int prio));
 
#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */
 
#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT)
260,7 → 253,7
 
/* Thread Termination, p1003.1c/Draft 10, p. 150 */
 
void _EXFUN(pthread_exit, (void *__value_ptr)) __dead2;
void _EXFUN(pthread_exit, (void *__value_ptr));
 
/* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */
 
270,14 → 263,6
 
int _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2));
 
/* Retrieve ID of a Thread's CPU Time Clock */
int _EXFUN(pthread_getcpuclockid,
(pthread_t thread, clockid_t *clock_id));
 
/* Get/Set Current Thread's Concurrency Level */
int _EXFUN(pthread_setconcurrency, (int new_level));
int _EXFUN(pthread_getconcurrency, (void));
 
/* Dynamic Package Initialization */
 
/* This is used to statically initialize a pthread_once_t. Example:
344,7 → 329,7
_pthread_cleanup_pop(&_pthread_clup_ctx, (_execute)); \
} while (0)
 
#if __GNU_VISIBLE
#if defined(_GNU_SOURCE)
void _EXFUN(_pthread_cleanup_push_defer,
(struct _pthread_cleanup_context *_context,
void (*_routine)(void *), void *_arg));
362,7 → 347,7
#define pthread_cleanup_pop_restore_np(_execute) \
_pthread_cleanup_pop_restore(&_pthread_clup_ctx, (_execute)); \
} while (0)
#endif /* __GNU_VISIBLE */
#endif /* defined(_GNU_SOURCE) */
 
#if defined(_POSIX_THREAD_CPUTIME)
/contrib/sdk/sources/newlib/libc/include/pwd.h
63,7 → 63,7
struct passwd *getpwuid (uid_t);
struct passwd *getpwnam (const char *);
 
#if __MISC_VISIBLE || __POSIX_VISIBLE
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
int getpwnam_r (const char *, struct passwd *,
char *, size_t , struct passwd **);
int getpwuid_r (uid_t, struct passwd *, char *,
70,7 → 70,7
size_t, struct passwd **);
#endif
 
#if __MISC_VISIBLE || __XSI_VISIBLE >= 4
#if __XSI_VISIBLE >= 500
struct passwd *getpwent (void);
void setpwent (void);
void endpwent (void);
/contrib/sdk/sources/newlib/libc/include/stdio.h
128,7 → 128,7
#define L_tmpnam FILENAME_MAX
#endif
 
#if __BSD_VISIBLE || __XSI_VISIBLE
#ifndef __STRICT_ANSI__
#define P_tmpdir "/tmp"
#endif
 
230,7 → 230,7
int _EXFUN(_rename, (const char *, const char *));
#endif
#endif
#if __LARGEFILE_VISIBLE || __POSIX_VISIBLE >= 200112
#if !defined(__STRICT_ANSI__) || defined(__USE_XOPEN2K)
#ifdef _COMPILING_NEWLIB
int _EXFUN(fseeko, (FILE *, _off_t, int));
_off_t _EXFUN(ftello, ( FILE *));
242,26 → 242,8
#if __GNU_VISIBLE
int _EXFUN(fcloseall, (_VOID));
#endif
#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L)
#ifndef _REENT_ONLY
#if __ISO_C_VISIBLE >= 1999
int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(vscanf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
#endif
#if __GNU_VISIBLE
int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
int _EXFUN(vasprintf, (char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
#endif
#if __MISC_VISIBLE /* Newlib-specific */
int _EXFUN(asiprintf, (char **, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...)
268,6 → 250,8
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
#ifndef diprintf
int _EXFUN(diprintf, (int, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
284,6 → 268,8
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
int _EXFUN(siscanf, (const char *, const char *, ...)
_ATTRIBUTE ((__format__ (__scanf__, 2, 3))));
int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(sniprintf, (char *, size_t, const char *, ...)
_ATTRIBUTE ((__format__ (__printf__, 3, 4))));
int _EXFUN(vasiprintf, (char **, const char *, __VALIST)
292,6 → 278,8
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vasprintf, (char **, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vdiprintf, (int, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST)
298,10 → 286,14
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(viprintf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 1, 0))));
int _EXFUN(viscanf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
int _EXFUN(vscanf, (const char *, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 1, 0))));
int _EXFUN(vsiprintf, (char *, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
int _EXFUN(vsiscanf, (const char *, const char *, __VALIST)
308,34 → 300,28
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
#endif /* __MISC_VISIBLE */
int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__scanf__, 2, 0))));
#endif /* !_REENT_ONLY */
#endif /* !__STRICT_ANSI__ */
 
/*
* Routines in POSIX 1003.1:2001.
*/
 
#if __POSIX_VISIBLE
#ifndef __STRICT_ANSI__
#ifndef _REENT_ONLY
FILE * _EXFUN(fdopen, (int, const char *));
#endif
int _EXFUN(fileno, (FILE *));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 199209
int _EXFUN(getw, (FILE *));
int _EXFUN(pclose, (FILE *));
FILE * _EXFUN(popen, (const char *, const char *));
#endif
 
#if __BSD_VISIBLE
int _EXFUN(putw, (int, FILE *));
void _EXFUN(setbuffer, (FILE *, char *, int));
int _EXFUN(setlinebuf, (FILE *));
#endif
 
#if __MISC_VISIBLE || (__XSI_VISIBLE && __POSIX_VISIBLE < 200112)
int _EXFUN(getw, (FILE *));
int _EXFUN(putw, (int, FILE *));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE
int _EXFUN(getc_unlocked, (FILE *));
int _EXFUN(getchar_unlocked, (void));
void _EXFUN(flockfile, (FILE *));
343,13 → 329,13
void _EXFUN(funlockfile, (FILE *));
int _EXFUN(putc_unlocked, (int, FILE *));
int _EXFUN(putchar_unlocked, (int));
#endif
#endif /* ! __STRICT_ANSI__ */
 
/*
* Routines in POSIX 1003.1:200x.
*/
 
#if __POSIX_VISIBLE >= 200809
#ifndef __STRICT_ANSI__
# ifndef _REENT_ONLY
# ifndef dprintf
int _EXFUN(dprintf, (int, const char *__restrict, ...)
359,13 → 345,13
/* getdelim - see __getdelim for now */
/* getline - see __getline for now */
FILE * _EXFUN(open_memstream, (char **, size_t *));
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
int _EXFUN(renameat, (int, const char *, int, const char *));
#endif
int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST)
_ATTRIBUTE ((__format__ (__printf__, 2, 0))));
# endif
#endif
#if __ATFILE_VISIBLE
int _EXFUN(renameat, (int, const char *, int, const char *));
#endif
 
/*
* Recursive versions of the above.
509,7 → 495,7
ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *));
ssize_t _EXFUN(__getline, (char **, size_t *, FILE *));
 
#if __MISC_VISIBLE
#if __BSD_VISIBLE
void _EXFUN(clearerr_unlocked, (FILE *));
int _EXFUN(feof_unlocked, (FILE *));
int _EXFUN(ferror_unlocked, (FILE *));
559,7 → 545,7
* Stdio function-access interface.
*/
 
#if __BSD_VISIBLE
#ifndef __STRICT_ANSI__
# ifdef __LARGE64_FILES
FILE *_EXFUN(funopen,(const _PTR __cookie,
int (*__readfn)(_PTR __c, char *__buf,
596,9 → 582,7
(fpos_t (*)())0, (int (*)())0)
# define fwopen(__cookie, __fn) funopen(__cookie, (int (*)())0, __fn, \
(fpos_t (*)())0, (int (*)())0)
#endif /* __BSD_VISIBLE */
 
#if __GNU_VISIBLE
typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n);
typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf,
size_t __n);
622,7 → 606,7
const char *__mode, cookie_io_functions_t __functions));
FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie,
const char *__mode, cookie_io_functions_t __functions));
#endif /* __GNU_VISIBLE */
#endif /* ! __STRICT_ANSI__ */
 
#ifndef __CUSTOM_FILE_IO__
/*
661,12 → 645,10
#define __sgetc_r(__ptr, __p) __sgetc_raw_r(__ptr, __p)
#endif
 
#ifdef __GNUC__
#ifdef _never /* __GNUC__ */
/* If this inline is actually used, then systems using coff debugging
info get hopelessly confused. 21sept93 rich@cygnus.com. */
_ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
#ifdef __SCLE
if ((_p->_flags & __SCLE) && _c == '\n')
__sputc_r (_ptr, '\r', _p);
#endif
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
704,14 → 686,14
#define ferror(p) __sferror(p)
#define clearerr(p) __sclearerr(p)
 
#if __MISC_VISIBLE
#if __BSD_VISIBLE
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
#define clearerr_unlocked(p) __sclearerr(p)
#endif /* __MISC_VISIBLE */
#endif /* __BSD_VISIBLE */
#endif /* _REENT_SMALL */
 
#if 0 /* __POSIX_VISIBLE - FIXME: must initialize stdio first, use fn */
#if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */
#define fileno(p) __sfileno(p)
#endif
 
722,13 → 704,11
#endif /* lint */
#endif /* __CYGWIN__ */
 
#if __MISC_VISIBLE
#ifndef __STRICT_ANSI__
/* fast always-buffered version, true iff error */
#define fast_putc(x,p) (--(p)->_w < 0 ? \
__swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0))
#endif
 
#if __XSI_VISIBLE
#define L_cuserid 9 /* posix says it goes in stdio.h :( */
#ifdef __CYGWIN__
#define L_ctermid 16
740,7 → 720,7
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
 
#if __MISC_VISIBLE || __POSIX_VISIBLE
#ifndef __STRICT_ANSI__
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif
/contrib/sdk/sources/newlib/libc/include/stdlib.h
40,7 → 40,9
long rem; /* remainder */
} ldiv_t;
 
#if __ISO_C_VISIBLE >= 1999
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
typedef struct
{
long long int quot; /* quotient */
64,14 → 66,9
 
_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__)));
int _EXFUN(abs,(int));
#if __BSD_VISIBLE
__uint32_t _EXFUN(arc4random, (void));
__uint32_t _EXFUN(arc4random_uniform, (__uint32_t));
void _EXFUN(arc4random_buf, (void *, size_t));
#endif
int _EXFUN(atexit,(_VOID (*__func)(_VOID)));
double _EXFUN(atof,(const char *__nptr));
#if __MISC_VISIBLE
#ifndef __STRICT_ANSI__
float _EXFUN(atoff,(const char *__nptr));
#endif
int _EXFUN(atoi,(const char *__nptr));
91,7 → 88,7
char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
char * _EXFUN(_findenv,(_CONST char *, int *));
char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
#if __POSIX_VISIBLE >= 200809
#ifndef __STRICT_ANSI__
extern char *suboptarg; /* getsubopt(3) external variable */
int _EXFUN(getsubopt,(char **, char * const *, char **));
#endif
108,24 → 105,15
size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *));
size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t));
size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *));
#ifndef __STRICT_ANSI__
#ifndef _REENT_ONLY
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
char * _EXFUN(mkdtemp,(char *));
#endif
#if __GNU_VISIBLE
int _EXFUN(mkostemp,(char *, int));
int _EXFUN(mkostemps,(char *, int, int));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4
int _EXFUN(mkstemp,(char *));
#endif
#if __MISC_VISIBLE
int _EXFUN(mkstemps,(char *, int));
#endif
#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112)
char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
#endif
#endif /* !_REENT_ONLY */
char * _EXFUN(_mkdtemp_r, (struct _reent *, char *));
int _EXFUN(_mkostemp_r, (struct _reent *, char *, int));
int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int));
132,25 → 120,24
int _EXFUN(_mkstemp_r, (struct _reent *, char *));
int _EXFUN(_mkstemps_r, (struct _reent *, char *, int));
char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))));
#endif
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar));
int _EXFUN(rand,(_VOID));
_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size));
#if __BSD_VISIBLE
#ifndef __STRICT_ANSI__
_PTR _EXFUN(reallocf,(_PTR __r, size_t __size));
#endif
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4
char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path));
#endif
#if __BSD_VISIBLE
int _EXFUN(rpmatch, (const char *response));
#endif
_VOID _EXFUN(srand,(unsigned __seed));
double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR));
double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR));
#if __ISO_C_VISIBLE >= 1999
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR));
#endif
#if __MISC_VISIBLE
#ifndef __STRICT_ANSI__
/* the following strtodf interface is deprecated...use strtof instead */
# ifndef strtodf
# define strtodf strtof
163,28 → 150,24
 
int _EXFUN(system,(const char *__string));
 
#if __SVID_VISIBLE || __XSI_VISIBLE >= 4
#ifndef __STRICT_ANSI__
long _EXFUN(a64l,(const char *__input));
char * _EXFUN(l64a,(long __input));
char * _EXFUN(_l64a_r,(struct _reent *,long __input));
#endif
#if __MISC_VISIBLE
int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg));
#endif
#if __ISO_C_VISIBLE >= 1999
#endif /* ! __STRICT_ANSI__ */
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__)));
#endif
#if __SVID_VISIBLE || __XSI_VISIBLE
#ifndef __STRICT_ANSI__
int _EXFUN(putenv,(char *__string));
#endif
int _EXFUN(_putenv_r,(struct _reent *, char *__string));
_PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t));
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
#endif
int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));
 
#if __XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112
char * _EXFUN(gcvt,(double,int,char *));
char * _EXFUN(gcvtf,(float,int,char *));
char * _EXFUN(fcvt,(double,int,int *,int *));
193,18 → 176,15
char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *));
char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *));
char * _EXFUN(ecvtf,(float,int,int *,int *));
char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
#endif
char * _EXFUN(__itoa,(int, char *, int));
char * _EXFUN(__utoa,(unsigned, char *, int));
#if __MISC_VISIBLE
#ifndef __STRICT_ANSI__
char * _EXFUN(itoa,(int, char *, int));
char * _EXFUN(utoa,(unsigned, char *, int));
#endif
#if __POSIX_VISIBLE
int _EXFUN(rand_r,(unsigned *__seed));
#endif
 
#if __SVID_VISIBLE || __XSI_VISIBLE
double _EXFUN(drand48,(_VOID));
double _EXFUN(_drand48_r,(struct _reent *));
double _EXFUN(erand48,(unsigned short [3]));
225,42 → 205,45
_EXFUN(_seed48_r,(struct _reent *, unsigned short [3]));
_VOID _EXFUN(srand48,(long));
_VOID _EXFUN(_srand48_r,(struct _reent *, long));
#endif /* __SVID_VISIBLE || __XSI_VISIBLE */
#if __SVID_VISIBLE || __XSI_VISIBLE >= 4 || __BSD_VISIBLE
char * _EXFUN(initstate,(unsigned, char *, size_t));
long _EXFUN(random,(_VOID));
char * _EXFUN(setstate,(char *));
_VOID _EXFUN(srandom,(unsigned));
#endif
#if __ISO_C_VISIBLE >= 1999
#endif /* ! __STRICT_ANSI__ */
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
long long _EXFUN(atoll,(const char *__nptr));
#endif
#ifndef __STRICT_ANSI__
long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr));
#if __ISO_C_VISIBLE >= 1999
#endif /* ! __STRICT_ANSI__ */
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
long long _EXFUN(llabs,(long long));
lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom));
long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base));
#endif
#ifndef __STRICT_ANSI__
long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));
#if __ISO_C_VISIBLE >= 1999
#endif /* ! __STRICT_ANSI__ */
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base));
#endif
#ifndef __STRICT_ANSI__
unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base));
 
#ifndef __CYGWIN__
#if __MISC_VISIBLE
_VOID _EXFUN(cfree,(_PTR));
#endif
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
int _EXFUN(unsetenv,(const char *__string));
int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
#endif
int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string));
#endif /* !__CYGWIN__ */
 
#if __POSIX_VISIBLE >= 200112
int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t));
#ifdef __rtems__
int _EXFUN(posix_memalign,(void **, size_t, size_t));
#endif
 
#endif /* ! __STRICT_ANSI__ */
 
char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
#ifndef __CYGWIN__
_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t));
277,9 → 260,7
_BSD_SOURCE, you get the BSD version; otherwise you get the GNU
version. We want that #undef qsort_r will still let you
invoke the underlying function, but that requires gcc support. */
#if __GNU_VISIBLE
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk));
#elif __BSD_VISIBLE
#ifdef _BSD_SOURCE
# ifdef __GNUC__
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR)))
__asm__ (__ASMNAME ("__bsd_qsort_r"));
287,12 → 268,16
_VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR)));
# define qsort_r __bsd_qsort_r
# endif
#elif __GNU_VISIBLE
_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk));
#endif
 
/* On platforms where long double equals double. */
#ifdef _HAVE_LONG_DOUBLE
extern long double _strtold_r (struct _reent *, const char *__restrict, char **__restrict);
#if __ISO_C_VISIBLE >= 1999
#if !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
extern long double strtold (const char *__restrict, char **__restrict);
#endif
#endif /* _HAVE_LONG_DOUBLE */
300,7 → 285,7
/*
* If we're in a mode greater than C99, expose C11 functions.
*/
#if __ISO_C_VISIBLE >= 2011
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
__alloc_size(2);
int at_quick_exit(void (*)(void));
/contrib/sdk/sources/newlib/libc/include/string.h
43,35 → 43,28
#endif
size_t _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t));
 
#if __MISC_VISIBLE || __POSIX_VISIBLE
#if __POSIX_VISIBLE
char *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict));
#endif
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
#if __BSD_VISIBLE
int _EXFUN(bcmp,(const void *, const void *, size_t));
void _EXFUN(bcopy,(const void *, void *, size_t));
void _EXFUN(bzero,(void *, size_t));
#endif
#if __BSD_VISIBLE
void _EXFUN(explicit_bzero,(void *, size_t));
int _EXFUN(timingsafe_bcmp,(const void *, const void *, size_t));
int _EXFUN(timingsafe_memcmp,(const void *, const void *, size_t));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809
int _EXFUN(ffs,(int));
#endif
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
char *_EXFUN(index,(const char *, int));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE
#if __BSD_VISIBLE || __XSI_VISIBLE
_PTR _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t));
#endif
#if __GNU_VISIBLE
_PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
_PTR _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
#endif
_PTR _EXFUN(memrchr,(const _PTR, int, size_t));
#if __GNU_VISIBLE
_PTR _EXFUN(rawmemchr,(const _PTR, int));
#endif
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
#if __BSD_VISIBLE
char *_EXFUN(rindex,(const char *, int));
#endif
char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict));
83,14 → 76,19
char *_EXFUN(strcasestr,(const char *, const char *));
char *_EXFUN(strchrnul,(const char *, int));
#endif
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4
#if __XSI_VISIBLE >= 500
char *_EXFUN(strdup,(const char *));
#endif
#ifndef __STRICT_ANSI__
char *_EXFUN(_strdup_r,(struct _reent *, const char *));
#if __POSIX_VISIBLE >= 200809
#endif
#if __XSI_VISIBLE >= 700
char *_EXFUN(strndup,(const char *, size_t));
#endif
 
#ifndef __STRICT_ANSI__
char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
#endif
 
#if __GNU_VISIBLE
int _EXFUN(ffsl,(long));
103,7 → 101,7
invoke the underlying function, but that requires gcc support. */
#if __GNU_VISIBLE
char *_EXFUN(strerror_r,(int, char *, size_t));
#elif __POSIX_VISIBLE >= 200112
#else
# ifdef __GNUC__
int _EXFUN(strerror_r,(int, char *, size_t))
#ifdef __ASMNAME
126,7 → 124,8
#if __BSD_VISIBLE || __POSIX_VISIBLE
int _EXFUN(strncasecmp,(const char *, const char *, size_t));
#endif
#if __POSIX_VISIBLE >= 200809
#if !defined(__STRICT_ANSI__) || __POSIX_VISIBLE >= 200809 || \
__XSI_VISIBLE >= 700
size_t _EXFUN(strnlen,(const char *, size_t));
#endif
#if __BSD_VISIBLE
133,7 → 132,11
char *_EXFUN(strsep,(char **, const char *));
#endif
 
#if __MISC_VISIBLE
/*
* The origin of these is unknown to me so I am conditionalizing them
* on __STRICT_ANSI__. Finetuning this is definitely needed. --joel
*/
#if !defined(__STRICT_ANSI__)
char *_EXFUN(strlwr,(char *));
char *_EXFUN(strupr,(char *));
#endif
146,7 → 149,7
int _EXFUN(strtosigno, (const char *__name));
#endif
 
#if __GNU_VISIBLE && defined(__GNUC__)
#if defined _GNU_SOURCE && defined __GNUC__
#define strdupa(__s) \
(__extension__ ({const char *__in = (__s); \
size_t __len = strlen (__in) + 1; \
158,7 → 161,7
char *__out = (char *) __builtin_alloca (__len); \
__out[__len-1] = '\0'; \
(char *) memcpy (__out, __in, __len-1);}))
#endif /* __GNU_VISIBLE && __GNUC__ */
#endif /* _GNU_SOURCE && __GNUC__ */
 
/* There are two common basename variants. If you do NOT #include <libgen.h>
and you do
/contrib/sdk/sources/newlib/libc/include/time.h
8,7 → 8,6
#define _TIME_H_
 
#include "_ansi.h"
#include <sys/cdefs.h>
#include <sys/reent.h>
 
#define __need_size_t
77,14 → 76,11
extern "C" {
#endif
 
#if __XSI_VISIBLE
#ifndef __STRICT_ANSI__
char *_EXFUN(strptime, (const char *__restrict,
const char *__restrict,
struct tm *__restrict));
#endif
#if __POSIX_VISIBLE
_VOID _EXFUN(tzset, (_VOID));
#endif
_VOID _EXFUN(_tzset_r, (struct _reent *));
 
typedef struct __tzrule_struct
110,7 → 106,6
/* getdate functions */
 
#ifdef HAVE_GETDATE
#if __XSI_VISIBLE >= 4
#ifndef _REENT_ONLY
#define getdate_err (*__getdate_err())
int *_EXFUN(__getdate_err,(_VOID));
126,20 → 121,14
7 there is no line in the template that matches the input,
8 invalid input specification */
#endif /* !_REENT_ONLY */
#endif /* __XSI_VISIBLE >= 4 */
 
#if __GNU_VISIBLE
/* getdate_r returns the error code as above */
int _EXFUN(getdate_r, (const char *, struct tm *));
#endif /* __GNU_VISIBLE */
#endif /* HAVE_GETDATE */
 
/* defines for the opengroup specifications Derived from Issue 1 of the SVID. */
#if __SVID_VISIBLE || __XSI_VISIBLE
extern __IMPORT long _timezone;
extern __IMPORT int _daylight;
#endif
#if __POSIX_VISIBLE
extern __IMPORT char *_tzname[2];
 
/* POSIX defines the external tzname being defined in time.h */
146,7 → 135,7
#ifndef tzname
#define tzname _tzname
#endif
#endif /* __POSIX_VISIBLE */
#endif /* !__STRICT_ANSI__ */
 
#ifdef __cplusplus
}
/contrib/sdk/sources/newlib/libc/include/wchar.h
189,9 → 189,7
wint_t _EXFUN(putwchar_unlocked, (wchar_t));
#endif
 
#if __POSIX_VISIBLE >= 200809
__FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *));
#endif
__FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *));
 
#ifndef __VALIST
/contrib/sdk/sources/newlib/libc/include/limits.h
2,7 → 2,6
# define _LIBC_LIMITS_H_ 1
 
#include <newlib.h>
#include <sys/cdefs.h>
 
# ifdef _MB_LEN_MAX
# define MB_LEN_MAX _MB_LEN_MAX
97,7 → 96,8
# define __LONG_LONG_MAX__ 9223372036854775807LL
# endif
 
# if __ISO_C_VISIBLE >= 1999
# if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L)
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LLONG_MIN
# define LLONG_MIN (-LLONG_MAX-1)
109,7 → 109,7
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
# endif
 
# if __GNU_VISIBLE
# 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-1)
/contrib/sdk/sources/newlib/libc/include/tgmath.h
79,7 → 79,7
__tg_type3(__e1, __e2, __e3, long double _Complex) || \
__tg_type3(__e1, __e2, __e3, __typeof__(_Complex_I)))
 
#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
#ifdef _LDBL_EQ_DBL
#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \
__builtin_choose_expr(__tg_type_corr(x, y, z, long double), \
fnl(__VA_ARGS__), __builtin_choose_expr( \
161,10 → 161,9
#define lround(__x) __tg_simple(__x, lround)
#define nearbyint(__x) __tg_simple(__x, nearbyint)
#define nextafter(__x, __y) __tg_simple2(__x, __y, nextafter)
/* not yet implemented even for _LDBL_EQ_DBL platforms */
#ifdef __CYGWIN__
/* not yet implemented even for _LDBL_EQ_DBL platforms
#define nexttoward(__x, __y) __tg_simplev(__x, nexttoward, __x, __y)
#endif
*/
#define remainder(__x, __y) __tg_simple2(__x, __y, remainder)
#define remquo(__x, __y, __z) __tg_impl_simple(__x, __x, __y, remquo, remquof, \
remquol, __x, __y, __z)
/contrib/sdk/sources/newlib/libc/include/dirent.h
3,10 → 3,9
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/cdefs.h>
#include <sys/dirent.h>
 
#if !defined(MAXNAMLEN) && __BSD_VISIBLE
#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE)
#define MAXNAMLEN 1024
#endif
 
/contrib/sdk/sources/newlib/libc/include/fnmatch.h
33,8 → 33,6
#ifndef _FNMATCH_H_
#define _FNMATCH_H_
 
#include <sys/cdefs.h>
 
#define FNM_NOMATCH 1 /* Match failed. */
 
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
41,7 → 39,7
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
 
#if __GNU_VISIBLE
#if defined(_GNU_SOURCE) || !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
#define FNM_IGNORECASE FNM_CASEFOLD
48,6 → 46,8
#define FNM_FILE_NAME FNM_PATHNAME
#endif
 
#include <sys/cdefs.h>
 
__BEGIN_DECLS
int fnmatch(const char *, const char *, int);
__END_DECLS
/contrib/sdk/sources/newlib/libc/include/gthr.h
0,0 → 1,103
/* Threads compatibility routines for libgcc2. */
/* Compile this one with gcc. */
/* Copyright (C) 1997, 1998, 2004, 2008, 2009 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 3, 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.
 
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
 
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
 
#ifndef GCC_GTHR_H
#define GCC_GTHR_H
 
typedef unsigned int __gthread_key_t;
 
typedef struct {
volatile int done;
int started;
} __gthread_once_t;
 
typedef struct {
volatile int counter;
} __gthread_mutex_t;
 
 
void *tls_alloc(void);
 
static int __gthread_mutex_lock (__gthread_mutex_t *mutex)
{
__mutex_lock(&mutex->counter);
return 0;
};
 
static int __gthread_mutex_unlock (__gthread_mutex_t *mutex)
{
mutex->counter = 0;
return 0;
};
 
static inline int __gthread_key_create (__gthread_key_t *__key,
void (*__dtor) (void *) __attribute__((unused)))
{
int __status = 0;
void *__tls_index = tls_alloc();
if (__tls_index != NULL)
{
*__key = (unsigned int)__tls_index;
 
#ifdef MINGW32_SUPPORTS_MT_EH /* FIXME */
/* Mingw runtime will run the dtors in reverse order for each thread
when the thread exits. */
// __status = __mingwthr_key_dtor (*__key, __dtor);
#endif
 
}
else
__status = (int) ENOMEM;
return __status;
}
 
 
static inline void *
__gthread_getspecific (__gthread_key_t __key)
{
void *val;
__asm__ __volatile__(
"movl %%fs:(%1), %0"
:"=r"(val)
:"r"(__key));
 
return val;
};
 
static inline int
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
{
if(!(__key & 3))
{
__asm__ __volatile__(
"movl %0, %%fs:(%1)"
::"r"(__ptr),"r"(__key));
return 0;
}
else return EINVAL;
}
 
 
#endif
/contrib/sdk/sources/newlib/libc/include/signal.h
2,18 → 2,15
#define _SIGNAL_H_
 
#include "_ansi.h"
#include <sys/cdefs.h>
#include <sys/signal.h>
 
_BEGIN_STD_C
 
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
#if __BSD_VISIBLE
#ifndef _POSIX_SOURCE
typedef _sig_func_ptr sig_t; /* BSD naming */
#endif
#if __GNU_VISIBLE
typedef _sig_func_ptr sighandler_t; /* glibc naming */
#endif
#endif /* !_POSIX_SOURCE */
 
#define SIG_DFL ((_sig_func_ptr)0) /* Default action */
#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */
/contrib/sdk/sources/newlib/libc/include/strings.h
9,12 → 9,12
 
#include "_ansi.h"
#include <sys/reent.h>
#include <sys/cdefs.h>
 
#include <sys/types.h> /* for size_t */
 
_BEGIN_STD_C
 
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809)
#if !defined __STRICT_ANSI__ && _POSIX_VERSION < 200809L
/*
* Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
* Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
24,7 → 24,7
void _EXFUN(bzero,(void *, size_t));
char *_EXFUN(index,(const char *, int));
char *_EXFUN(rindex,(const char *, int));
#endif /* __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE < 200809) */
#endif /* ! __STRICT_ANSI__ */
 
int _EXFUN(ffs,(int));
int _EXFUN(strcasecmp,(const char *, const char *));
/contrib/sdk/sources/newlib/libc/sys/write.c
12,10 → 12,13
* the new terms are clearly indicated on the first page of each file where
* they apply.
*/
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <alloca.h>
#include <sys/kos_io.h>
#include "glue.h"
#include "io.h"
 
#undef erro
/contrib/sdk/sources/newlib/libc/sys/conio.c
9,37 → 9,9
unsigned __stdcall con_set_flags(unsigned new_flags);
void __stdcall con_cls(void);
void __stdcall con_write_string(const char* string, unsigned length);
short __stdcall con_getch2(void);
 
int __gui_mode;
 
static int console_read(const char *path, void *buff,
size_t offset, size_t count, size_t *done)
{
char *p = buff;
int cnt = 0;
short c;
char ch;
 
// __asm__ volatile("int3");
 
do
{
c = con_getch2();
ch = (char)c;
if(ch != 0)
{
p[cnt] = ch != 0x0D ? ch : 0x0A;
con_write_string(p+cnt, 1);
cnt++;
}
}while(ch != 0x0D);
 
*done = cnt;
return 0;
}
 
 
static int console_write(const char *path, const void *buff,
size_t offset, size_t count, size_t *writes)
{
46,7 → 18,7
con_write_string(buff, count);
 
*writes = count;
return 0;
return count;
};
 
void __init_conio()
56,10 → 28,6
load_libconsole();
con_init(80, 25, 80, 500, "Console application");
 
ioh = &__io_tab[STDIN_FILENO];
ioh->mode = _READ|_ISTTY;
ioh->read = &console_read;
 
ioh = &__io_tab[STDOUT_FILENO];
ioh->mode = _WRITE|_ISTTY;
ioh->write = &console_write;
/contrib/sdk/sources/newlib/libc/sys/_rename.c
14,10 → 14,9
*/
 
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <alloca.h>
#include <errno.h>
 
int _rename (char *from, char *to)
{
/contrib/sdk/sources/newlib/libc/sys/io.c
1,6 → 1,5
 
#include <stddef.h>
#include <stdio.h>
#include "io.h"
 
extern __io_handle __io_tab[64];
12,17 → 11,9
return 10;
};
 
//static int fake_io_read(const char *path, void *buff,
// size_t offset, size_t count, size_t *done) __attribute__ ((alias("fake_io")));
 
static int fake_io_read(const char *path, void *buff,
size_t offset, size_t count, size_t *done)
{
printf("%s path:%s buf:%p offset:%d count:%d\n",
__FUNCTION__, path, buff, offset, count);
size_t offset, size_t count, size_t *done) __attribute__ ((alias("fake_io")));
 
}
 
static int fake_io_write(const char *path, const void *buff,
size_t offset, size_t count, size_t *done) __attribute__ ((alias("fake_io")));
 
/contrib/sdk/sources/newlib/libc/sys/read.c
12,8 → 12,13
* the new terms are clearly indicated on the first page of each file where
* they apply.
*/
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <alloca.h>
#include <sys/kos_io.h>
#include "glue.h"
#include "io.h"
 
#undef erro
58,7 → 63,7
 
if( iomode_flags & _BINARY ) /* if binary mode */
{
err = ioh->read(ioh->name, buffer, ioh->offset, cnt, &amount_read);
err = read_file(ioh->name, buffer, ioh->offset, cnt, &amount_read);
ioh->offset+= amount_read;
total_len = amount_read;
 
72,7 → 77,7
read_len = cnt;
do
{
err=ioh->read(ioh->name,buffer, ioh->offset, cnt, &amount_read);
err=read_file(ioh->name,buffer, ioh->offset, cnt, &amount_read);
ioh->offset+=amount_read;
 
if( amount_read == 0 )
/contrib/sdk/sources/newlib/libc/Tupfile.lua
1,6 → 1,6
if tup.getconfig("NO_GCC") ~= "" or tup.getconfig("NO_FASM") ~= "" then return end
tup.include("../../../../../programs/use_gcc.lua")
CFLAGS = CFLAGS_OPTIMIZE_SPEED .. " -c -fno-builtin -DBUILD_LIBC -DMISSING_SYSCALL_NAMES"
CFLAGS = CFLAGS_OPTIMIZE_SPEED .. " -c -DBUILD_LIBC -DMISSING_SYSCALL_NAMES"
LDFLAGS = "-shared -s -T libcdll.lds --out-implib $(SDK_DIR)/lib/libc.dll.a --image-base 0"
-- LDFLAGS = LDFLAGS .. " --output-def libc.orig.def"
 
21,12 → 21,13
end
end
LIBPATH = "-L$(SDK_DIR)/lib -L$(TOOLCHAIN_LIBPATH)"
STATIC_SRCS = {"crt/start.S", "crt/crt1.c", "crt/crt2.c", "crt/exit.S"}
LIBDLL_SRCS = {"crt/dllstart.c", "crt/exit.S", "crt/pseudo-reloc.c", "crt/setjmp.S"}
LIBCDLL_SRCS = {"crt/crt2.c", "crt/pseudo-reloc.c", "crt/exit.S"}
STATIC_SRCS = {"crt/start.S", "crt/crt1.c", "crt/crt2.c", "crt/chkstk.S", "crt/exit.c"}
LIBCRT_SRCS = {"crt/start.S", "crt/crt3.c", "crt/chkstk.S", "crt/pseudo-reloc.c", "pe/crtloader.c"}
LIBDLL_SRCS = {"crt/dllstart.c", "crt/chkstk.S", "crt/exit.S", "crt/pseudo-reloc.c", "crt/setjmp.S"}
LIBCDLL_SRCS = {"crt/crtdll.c", "crt/crt2.c", "crt/pseudo-reloc.c", "crt/chkstk.S", "crt/exit.S", "pe/loader.c"}
CORE_SRCS = {
"argz/buf_findstr.c", "argz/envz_get.c",
"crt/console.asm", "crt/thread.S", "crt/cpu_features.c", "crt/tls.c",
"crt/console.asm", "crt/emutls.c", "crt/thread.S", "crt/tls.S", "crt/setjmp.S", "crt/cpu_features.c",
"ctype/ctype_.c", "ctype/isascii.c", "ctype/isblank.c", "ctype/isalnum.c",
"ctype/isalpha.c", "ctype/iscntrl.c", "ctype/isdigit.c", "ctype/islower.c",
"ctype/isupper.c", "ctype/isprint.c", "ctype/ispunct.c", "ctype/isspace.c",
42,7 → 43,7
"reent/closer.c", "reent/fstatr.c", "reent/getreent.c", "reent/gettimeofdayr.c",
"reent/impure.c", "reent/init_reent.c", "reent/isattyr.c", "reent/linkr.c",
"reent/lseekr.c", "reent/mutex.c", "reent/openr.c", "reent/readr.c",
"reent/statr.c", "reent/timesr.c", "reent/unlinkr.c",
"reent/renamer.c", "reent/statr.c", "reent/timesr.c", "reent/unlinkr.c",
"reent/writer.c",
"search/qsort.c", "search/bsearch.c",
"signal/signal.c",
57,215 → 58,40
"time/timelocal.c", "time/tzlock.c", "time/tzset.c", "time/tzset_r.c", "time/tzvars.c"
}
STDLIB_SRCS = {
"__atexit.c",
"__call_atexit.c",
"abort.c",
"abs.c",
"assert.c",
"atexit.c",
"atof.c",
"atoi.c",
"atol.c",
"cxa_atexit.c",
"cxa_finalize.c",
"div.c",
"dtoa.c",
"dtoastub.c",
"efgcvt.c",
"ecvtbuf.c",
"eprintf.c",
"erand48.c",
"exit.c",
"gdtoa-gethex.c",
"gdtoa-hexnan.c",
"getenv.c",
"getenv_r.c",
"itoa.c",
"labs.c",
"mprec.c",
"mbtowc.c",
"mbtowc_r.c",
"mbrtowc.c",
"mlock.c",
"calloc.c",
"malloc.c",
"mallocr.c",
"rand.c",
"rand_r.c",
"rand48.c",
"realloc.c",
"seed48.c",
"srand48.c",
"strtod.c",
"strtodg.c",
"strtol.c",
"strtold.c",
"strtoll.c",
"strtoll_r.c",
"strtorx.c",
"strtoul.c",
"strtoull.c",
"strtoull_r.c",
"system.c",
"utoa.c",
"wcrtomb.c",
"__atexit.c", "__call_atexit.c", "abort.c", "abs.c", "assert.c", "atexit.c",
"atof.c", "atoi.c", "atol.c", "div.c", "dtoa.c", "dtoastub.c", "exit.c",
"gdtoa-gethex.c", "gdtoa-hexnan.c", "getenv.c", "getenv_r.c","mprec.c", "mbtowc.c",
"mbtowc_r.c", "mbrtowc.c", "mlock.c", "calloc.c", "malloc.c", "mallocr.c",
"rand.c", "rand_r.c", "rand48.c", "realloc.c", "seed48.c", "srand48.c",
"strtod.c", "strtodg.c", "strtol.c", "strtold.c", "strtoll.c", "strtoll_r.c",
"strtorx.c","strtoul.c", "strtoull.c", "strtoull_r.c", "system.c", "wcrtomb.c",
"wctomb_r.c"
}
STRING_SRCS = {
"memcpy.c",
"memcmp.c",
"memmove.c",
"memset.c",
"memchr.c",
"stpcpy.c",
"stpncpy.c",
"strcat.c",
"strchr.c",
"strcmp.c",
"strcoll.c",
"strcasecmp.c",
"strncasecmp.c",
"strncat.c",
"strncmp.c",
"strncpy.c",
"strndup.c",
"strndup_r.c",
"strnlen.c",
"strcasestr.c",
"strdup.c",
"strdup_r.c",
"strerror.c",
"strlen.c",
"strrchr.c",
"strpbrk.c",
"strsep.c",
"strstr.c",
"strtok.c",
"strtok_r.c",
"strupr.c",
"strxfrm.c",
"strcspn.c",
"strspn.c",
"strcpy.c",
"memcpy.c", "memcmp.c", "memmove.c", "memset.c", "memchr.c", "stpcpy.c",
"stpncpy.c", "strcat.c", "strchr.c", "strcmp.c", "strcoll.c", "strcasecmp.c",
"strncasecmp.c", "strncat.c", "strncmp.c", "strncpy.c", "strndup.c",
"strndup_r.c", "strnlen.c", "strcasestr.c", "strdup.c", "strdup_r.c",
"strerror.c", "strlen.c", "strrchr.c", "strpbrk.c", "strsep.c", "strstr.c",
"strtok.c", "strtok_r.c", "strupr.c", "strcspn.c", "strspn.c", "strcpy.c",
"u_strerr.c"
}
 
STDIO_SRCS = {
"asiprintf.c",
"asniprintf.c",
"asnprintf.c",
"asprintf.c",
"clearerr.c",
"diprintf.c",
"dprintf.c",
"fclose.c",
"fcloseall.c",
"fdopen.c",
"feof.c",
"feof_u.c",
"ferror.c",
"ferror_u.c",
"fflush.c",
"fflush_u.c",
"fgetc.c",
"fgetc_u.c",
"fgetpos.c",
"fgets.c",
"fgets_u.c",
"fileno.c",
"fileno_u.c",
"findfp.c",
"fiprintf.c",
"fiscanf.c",
"flags.c",
"fmemopen.c",
"fopen.c",
"fopencookie.c",
"fprintf.c",
"fpurge.c",
"fputc.c",
"fputc_u.c",
"fputs.c",
"fputs_u.c",
"fputwc.c",
"fsetpos.c",
"fread.c",
"fread_u.c",
"freopen.c",
"fscanf.c",
"fseek.c",
"fseeko.c",
"fsetlocking.c",
"ftell.c",
"ftello.c",
"fvwrite.c",
"fwalk.c",
"fwide.c",
"fwrite.c",
"fwrite_u.c",
"getc.c",
"getc_u.c",
"getchar.c",
"getchar_u.c",
"getdelim.c",
"getline.c",
"gets.c",
"iprintf.c",
"iscanf.c",
"makebuf.c",
"mbstowcs.c",
"mktemp.c",
"open_memstream.c",
"perror.c",
"printf.c",
"putc.c",
"putc_u.c",
"putchar.c",
"putchar_u.c",
"puts.c",
"refill.c",
"remove.c",
"rename.c",
"rewind.c",
"rget.c",
"scanf.c",
"sccl.c",
"setbuf.c",
"setbuffer.c",
"setlinebuf.c",
"setvbuf.c",
"siprintf.c",
"siscanf.c",
"sniprintf.c",
"snprintf.c",
"sprintf.c",
"sscanf.c",
"stdio.c",
"stdio_ext.c",
"tmpfile.c",
"tmpnam.c",
"ungetc.c",
"vasiprintf.c",
"vasniprintf.c",
"vasnprintf.c",
"vasprintf.c",
"vdiprintf.c",
"vdprintf.c",
"viprintf.c",
"viscanf.c",
"vprintf.c",
"vscanf.c",
"vsiprintf.c",
"vsiscanf.c",
"vsprintf.c",
"vsniprintf.c",
"vsnprintf.c",
"vsscanf.c",
"wsetup.c",
"wbuf.c"
"clearerr.c", "diprintf.c", "dprintf.c", "printf.c", "putchar.c", "fgetc.c",
"fgets.c", "fopen.c", "fclose.c", "fdopen.c", "fflush.c", "flags.c",
"fileno.c", "findfp.c", "fiprintf.c", "fiscanf.c", "fprintf.c", "fputc.c",
"fputs.c", "fputwc.c", "fread.c", "freopen.c", "fscanf.c", "fseek.c", "fseeko.c",
"ftell.c", "ftello.c", "fwrite.c", "fvwrite.c", "fwalk.c", "makebuf.c",
"mbstowcs.c", "mktemp.c", "perror.c", "putc.c", "puts.c", "refill.c", "remove.c",
"rename.c", "rewind.c", "rget.c", "sccl.c", "setvbuf.c", "siprintf.c",
"siscanf.c", "sniprintf.c", "snprintf.c", "sprintf.c", "sscanf.c", "stdio.c",
"tmpfile.c", "tmpnam.c", "ungetc.c", "vasniprintf.c", "vasnprintf.c",
"vdprintf.c", "vdiprintf.c", "vscanf.c", "vsprintf.c", "vsnprintf.c",
"vsscanf.c", "wsetup.c", "wbuf.c"
 
}
 
 
MATH_SRCS = {
"e_acos.c", "e_acosh.c", "e_asin.c", "e_atan2.c", "e_atanh.c", "e_cosh.c", "e_exp.c", "e_fmod.c",
"e_hypot.c", "e_j0.c", "e_j1.c", "e_jn.c", "e_log.c", "e_log10.c", "e_pow.c", "e_rem_pio2.c",
336,15 → 162,11
end
 
LIB_OBJS = compile(LIB_SRCS)
LIB_OBJS += tup.rule("crt/crtdll.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks -c crt/crtdll.c -o crt/crtdll.o")
LIB_OBJS += tup.rule("pe/loader.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks -c pe/loader.c -o pe/loader.o")
LIB_OBJS += tup.rule("reent/renamer.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -D_COMPILING_NEWLIB -c reent/renamer.c -o reent/renamer.o")
 
LIBCRT_OBJS = compile(LIBCRT_SRCS)
LIBDLL_OBJS = compile(LIBDLL_SRCS)
 
 
vfprintf_extra_objs = {
{"", "stdio/vfprintf.o"},
{"-DFLOATING_POINT", "stdio/vfprintf.o"},
{"-DINTEGER_ONLY", "stdio/vfiprintf.o"},
{"-DSTRING_ONLY", "stdio/svfprintf.o"},
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiprintf.o"},
360,9 → 182,10
{"-DINTEGER_ONLY -DSTRING_ONLY", "stdio/svfiscanf.o"},
}
for i,v in ipairs(vfscanf_extra_objs) do
LIB_OBJS += tup.rule("stdio/vfscanf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) " .. v[1] .. " -c %f -o %o", v[2])
LIB_OBJS += tup.rule("stdio/vfscanf.c", "kos32-gcc $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums " .. v[1] .. " -c %f -o %o", v[2])
end
 
tup.rule(LIB_OBJS, "kos32-ld " .. LDFLAGS .. " " .. LIBPATH .. " -o %o %f -lgcc --version-script libc.ver " .. tup.getconfig("KPACK_CMD"),
{SDK_DIR .. "/bin/libc.dll", extra_outputs = {SDK_DIR .. "/lib/libc.dll.a", SDK_DIR .. "/lib/<libc.dll.a>"}})
tup.rule(LIBCRT_OBJS, "kos32-ar rcs %o %f", {SDK_DIR .. "/lib/libapp.a", extra_outputs = {SDK_DIR .. "/lib/<libapp.a>"}})
tup.rule(LIBDLL_OBJS, "kos32-ar rcs %o %f", {SDK_DIR .. "/lib/libdll.a", extra_outputs = {SDK_DIR .. "/lib/<libdll.a>"}})
/contrib/sdk/sources/newlib/libc/Makefile
1,10 → 1,9
 
CC = kos32-gcc
AR = kos32-ar
LD = kos32-ld
 
INSTALLDIR:= /home/autobuild/tools/win32/lib
 
CFLAGS = -c -O2 -fno-builtin -fno-ident -fomit-frame-pointer -DMISSING_SYSCALL_NAMES
CFLAGS = -c -O2 -fno-ident -fomit-frame-pointer -fexceptions -DMISSING_SYSCALL_NAMES
LDFLAGS = -shared -s -T libcdll.lds --out-implib libc.dll.a --image-base 0
#LDFLAGS+= --output-def libc.orig.def
ARFLAGS = crs
16,20 → 15,29
 
NAME:= libc
 
DEFINES:= -D_IEEE_LIBM -DHAVE_RENAME -DBUILD_LIBC -DPACKAGE_NAME=\"newlib\"
DEFINES+= -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"2.4.0\"
SEFINES+= -DPACKAGE_STRING=\"newlib\ 2.4.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
DEFINES:= -D_IEEE_LIBM -DHAVE_RENAME -DBUILD_LIBC
 
INCLUDES:= -I $(LIBC_INCLUDES)
 
LIBPATH:= -L$(SDK_DIR)/lib -L/home/autobuild/tools/win32/mingw32/lib
 
STATIC_SRCS:= \
crt/start.S \
crt/crt1.c \
crt/crt2.c \
crt/chkstk.S \
crt/exit.S
 
LIBCRT_SRCS:= \
crt/start.S \
crt/crt3.c \
crt/chkstk.S \
crt/pseudo-reloc.c \
pe/crtloader.c
 
LIBDLL_SRCS:= \
crt/dllstart.c \
crt/chkstk.S \
crt/exit.S \
crt/pseudo-reloc.c \
crt/setjmp.S
39,6 → 47,7
crt/crtdll.c \
crt/crt2.c \
crt/pseudo-reloc.c \
crt/chkstk.S \
crt/exit.S \
pe/loader.c
 
46,10 → 55,11
argz/buf_findstr.c \
argz/envz_get.c \
crt/console.asm \
crt/emutls.c \
crt/thread.S \
crt/tls.S \
crt/setjmp.S \
crt/cpu_features.c \
crt/tls.c \
ctype/ctype_.c \
ctype/isascii.c \
ctype/isblank.c \
163,22 → 173,14
atof.c \
atoi.c \
atol.c \
cxa_atexit.c \
cxa_finalize.c \
div.c \
dtoa.c \
dtoastub.c \
efgcvt.c \
ecvtbuf.c \
eprintf.c \
erand48.c \
exit.c \
gdtoa-gethex.c \
gdtoa-hexnan.c \
getenv.c \
getenv_r.c \
itoa.c \
labs.c \
mprec.c \
mbtowc.c \
mbtowc_r.c \
204,7 → 206,6
strtoull.c \
strtoull_r.c \
system.c \
utoa.c \
wcrtomb.c \
wctomb_r.c
 
240,7 → 241,6
strtok.c \
strtok_r.c \
strupr.c \
strxfrm.c \
strcspn.c \
strspn.c \
strcpy.c \
247,79 → 247,43
u_strerr.c
 
STDIO_SRCS= \
asiprintf.c \
asniprintf.c \
asnprintf.c \
asprintf.c \
clearerr.c \
clearerr_u.c \
diprintf.c \
dprintf.c \
printf.c \
putchar.c \
fgetc.c \
fgets.c \
fopen.c \
fclose.c \
fcloseall.c \
fdopen.c \
feof.c \
feof_u.c \
ferror.c \
ferror_u.c \
fflush.c \
fflush_u.c \
fgetc.c \
fgetc_u.c \
fgetpos.c \
fgets.c \
fgets_u.c \
flags.c \
fileno.c \
fileno_u.c \
findfp.c \
fiprintf.c \
fiscanf.c \
flags.c \
fmemopen.c \
fopen.c \
fopencookie.c \
fprintf.c \
fpurge.c \
fputc.c \
fputc_u.c \
fputs.c \
fputs_u.c \
fputwc.c \
fsetpos.c \
funopen.c \
fread.c \
fread_u.c \
freopen.c \
fscanf.c \
fseek.c \
fseeko.c \
fsetlocking.c \
ftell.c \
ftello.c \
fwrite.c \
fvwrite.c \
fwalk.c \
fwide.c \
fwrite.c \
fwrite_u.c \
getc.c \
getc_u.c \
getchar.c \
getchar_u.c \
getdelim.c \
getline.c \
gets.c \
iprintf.c \
iscanf.c \
makebuf.c \
mbstowcs.c \
mktemp.c \
open_memstream.c \
perror.c \
printf.c \
putc.c \
putc_u.c \
putchar.c \
putchar_u.c \
puts.c \
refill.c \
remove.c \
326,11 → 290,7
rename.c \
rewind.c \
rget.c \
scanf.c \
sccl.c \
setbuf.c \
setbuffer.c \
setlinebuf.c \
setvbuf.c \
siprintf.c \
siscanf.c \
339,24 → 299,15
sprintf.c \
sscanf.c \
stdio.c \
stdio_ext.c \
tmpfile.c \
tmpnam.c \
ungetc.c \
vasiprintf.c \
vasniprintf.c \
vasnprintf.c \
vasprintf.c \
vdprintf.c \
vdiprintf.c \
vdprintf.c \
viprintf.c \
viscanf.c \
vprintf.c \
vscanf.c \
vsiprintf.c \
vsiscanf.c \
vsprintf.c \
vsniprintf.c \
vsnprintf.c \
vsscanf.c \
wsetup.c \
461,7 → 412,7
 
 
 
shared: $(NAME).dll libdll.a
shared: $(NAME).dll libapp.a libdll.a
 
 
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile
470,51 → 421,39
#sed -f cmd2.sed libc.def > mem
#sed -f newlib.sed mem > libc.inc
 
install: libc.dll libc.dll.a libdll.a
install: libc.dll libc.dll.a libapp.a libdll.a
mv -f libc.dll $(SDK_DIR)/bin
mv -f libc.dll.a $(INSTALLDIR)
mv -f libdll.a $(INSTALLDIR)
mv -f libc.dll.a $(SDK_DIR)/lib
mv -f libapp.a $(SDK_DIR)/lib
mv -f libdll.a $(SDK_DIR)/lib
 
libapp.a: $(LIBCRT_OBJS) Makefile
$(AR) $(ARFLAGS) libapp.a $(LIBCRT_OBJS)
 
libdll.a: $(LIBDLL_OBJS) Makefile
$(AR) $(ARFLAGS) libdll.a $(LIBDLL_OBJS)
 
 
static: $(NAME).a
 
$(NAME).a: $(LIB_OBJS) $(SRC_DEP) Makefile
$(AR) $(ARFLAGS) $(NAME).a $(LIB_OBJS)
mv -f libc.a $(INSTALLDIR)
 
crt/crt1.o: crt/crt1.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks crt/crt1.c -o $@
 
crt/crtdll.o: crt/crtdll.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks crt/crtdll.c -o $@
 
pe/loader.o: pe/loader.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fno-delete-null-pointer-checks pe/loader.c -o $@
stdio/vfprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DFLOATING_POINT -c stdio/vfprintf.c -o $@
 
reent/renamer.o: reent/renamer.c
$(CC) $(CFLAGS) $(DEFINES) -D_COMPILING_NEWLIB $(INCLUDES) reent/renamer.c -o $@
stdio/vfiprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -c stdio/vfprintf.c -o $@
 
stdio/svfiprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY stdio/vfprintf.c -o $@
 
stdio/svfprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DSTRING_ONLY stdio/vfprintf.c -o $@
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DSTRING_ONLY -c stdio/vfprintf.c -o $@
 
stdio/vfiprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY stdio/vfprintf.c -o $@
stdio/svfiprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c stdio/vfprintf.c -o $@
 
stdio/vfprintf.o: stdio/vfprintf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums stdio/vfprintf.c -o $@
 
 
stdio/svfiscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
 
stdio/svscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
 
stdio/vfscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) stdio/vfscanf.c -o $@
 
521,8 → 460,12
stdio/vfiscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
 
stdio/svscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
 
 
stdio/svfiscanf.o: stdio/vfscanf.c
$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
 
 
 
/contrib/sdk/sources/newlib/libc/app.lds
86,7 → 86,7
*(SORT(.data$*))
*(.jcr)
__CRT_MT = .;
LONG(1);
LONG(0);
PROVIDE ( __data_end__ = .) ;
*(.data_cygwin_nocopy)
___iend = . ;
/contrib/sdk/sources/newlib/libc/locale/ldpart.c
175,8 → 175,6
 
for (i = 0; p < plim; i++) {
p = strchr(p, '\n');
if (!p)
break;
*p++ = '\0';
}
return i;
/contrib/sdk/sources/newlib/libc/reent/getreent.c
2,10 → 2,9
 
#include <_ansi.h>
#include <string.h>
#include <sys/reent.h>
#include <reent.h>
#include <kos32sys.h>
 
extern _VOID _EXFUN(__sinit,(struct _reent *));
 
void init_reent()
{
/contrib/sdk/sources/newlib/libc/stdio/iprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/viscanf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getchar_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getdelim.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fflush_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vasprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fwrite_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/feof_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vsiscanf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getc_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fcloseall.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fpurge.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getline.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/iscanf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/putc_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/funopen.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vsiprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/gets.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getc.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/clearerr_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fgetc_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/setbuf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fputc_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fopencookie.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fsetpos.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fgetpos.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fgets_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fileno_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fmemopen.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/stdio_ext.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/ferror_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fwide.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fputs_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fsetlocking.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/setlinebuf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/open_memstream.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/fread_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vsniprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/vasiprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/viprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/getchar.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/putchar_u.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/setbuffer.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/scanf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdio/findfp.c
267,25 → 267,25
_VOID
_DEFUN_VOID(__sfp_lock_acquire)
{
__lock_acquire_recursive (__sfp_lock);
//__lock_acquire_recursive (__sfp_lock);
}
 
_VOID
_DEFUN_VOID(__sfp_lock_release)
{
__lock_release_recursive (__sfp_lock);
//__lock_release_recursive (__sfp_lock);
}
 
_VOID
_DEFUN_VOID(__sinit_lock_acquire)
{
__lock_acquire_recursive (__sinit_lock);
//__lock_acquire_recursive (__sinit_lock);
}
 
_VOID
_DEFUN_VOID(__sinit_lock_release)
{
__lock_release_recursive (__sinit_lock);
//__lock_release_recursive (__sinit_lock);
}
 
/* Walkable file locking routine. */
/contrib/sdk/sources/newlib/libc/stdio/local.h
182,7 → 182,6
extern _VOID _EXFUN(__sinit,(struct _reent *));
extern _VOID _EXFUN(_cleanup_r,(struct _reent *));
extern _VOID _EXFUN(__smakebuf_r,(struct _reent *, FILE *));
extern int _EXFUN(__swhatbuf_r,(struct _reent *, FILE *, size_t *, int *));
extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *)));
extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(struct _reent *, FILE *)));
struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n));
/contrib/sdk/sources/newlib/libc/stdio/vfprintf.c
1332,7 → 1332,7
expsize = exponent (expstr, expt, ch);
size = expsize + ndig;
if (ndig > 1 || flags & ALT)
size += decp_len;
++size;
# ifdef _WANT_IO_C99_FORMATS
flags &= ~GROUPING;
# endif
1341,20 → 1341,18
if (expt > 0) {
size = expt;
if (prec || flags & ALT)
size += prec + decp_len;
size += prec + 1;
} else /* "0.X" */
size = (prec || flags & ALT)
? prec + 1 + decp_len
? prec + 2
: 1;
} else if (expt >= ndig) { /* fixed g fmt */
size = expt;
if (flags & ALT)
size += decp_len;
} else {
size = ndig + decp_len;
if (expt <= 0)
size += 1 - expt;
}
++size;
} else
size = ndig + (expt > 0 ?
1 : 2 - expt);
# ifdef _WANT_IO_C99_FORMATS
if ((flags & GROUPING) && expt > 0) {
/* space for thousands' grouping */
/contrib/sdk/sources/newlib/libc/stdio/makebuf.c
39,10 → 39,13
struct _reent *ptr _AND
register FILE *fp)
{
register size_t size, couldbetty;
register _PTR p;
int flags;
size_t size;
int couldbetty;
#ifdef __USE_INTERNAL_STAT64
struct stat64 st;
#else
struct stat st;
#endif
 
if (fp->_flags & __SNBF)
{
50,7 → 53,49
fp->_bf._size = 1;
return;
}
flags = __swhatbuf_r (ptr, fp, &size, &couldbetty);
#ifdef __USE_INTERNAL_STAT64
if (fp->_file < 0 || _fstat64_r (ptr, fp->_file, &st) < 0)
#else
if (fp->_file < 0 || _fstat_r (ptr, fp->_file, &st) < 0)
#endif
{
couldbetty = 0;
/* Check if we are be called by asprintf family for initial buffer. */
if (fp->_flags & __SMBF)
size = _DEFAULT_ASPRINTF_BUFSIZE;
else
size = BUFSIZ;
#ifdef _FSEEK_OPTIMIZATION
/* do not try to optimise fseek() */
fp->_flags |= __SNPT;
#endif
}
else
{
couldbetty = (st.st_mode & S_IFMT) == S_IFCHR;
#ifdef HAVE_BLKSIZE
size = st.st_blksize <= 0 ? BUFSIZ : st.st_blksize;
#else
size = BUFSIZ;
#endif
#ifdef _FSEEK_OPTIMIZATION
/*
* Optimize fseek() only if it is a regular file.
* (The test for __sseek is mainly paranoia.)
*/
if ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek)
{
fp->_flags |= __SOPT;
#ifdef HAVE_BLKSIZE
fp->_blksize = st.st_blksize;
#else
fp->_blksize = 1024;
#endif
}
else
fp->_flags |= __SNPT;
#endif
}
if ((p = _malloc_r (ptr, size)) == NULL)
{
if (!(fp->_flags & __SSTR))
68,60 → 113,5
fp->_bf._size = size;
if (couldbetty && _isatty_r (ptr, fp->_file))
fp->_flags |= __SLBF;
fp->_flags |= flags;
}
}
 
/*
* Internal routine to determine `proper' buffering for a file.
*/
int
_DEFUN(__swhatbuf_r, (ptr, fp, bufsize, couldbetty),
struct _reent *ptr _AND
FILE *fp _AND
size_t *bufsize _AND
int *couldbetty)
{
#ifdef _FSEEK_OPTIMIZATION
const int snpt = __SNPT;
#else
const int snpt = 0;
#endif
 
#ifdef __USE_INTERNAL_STAT64
struct stat64 st;
 
if (fp->_file < 0 || _fstat64_r (ptr, fp->_file, &st) < 0)
#else
struct stat st;
 
if (fp->_file < 0 || _fstat_r (ptr, fp->_file, &st) < 0)
#endif
{
*couldbetty = 0;
/* Check if we are be called by asprintf family for initial buffer. */
if (fp->_flags & __SMBF)
*bufsize = _DEFAULT_ASPRINTF_BUFSIZE;
else
*bufsize = BUFSIZ;
return (0);
}
 
/* could be a tty iff it is a character device */
*couldbetty = S_ISCHR(st.st_mode);
#ifdef HAVE_BLKSIZE
if (st.st_blksize > 0)
{
/*
* Optimise fseek() only if it is a regular file. (The test for
* __sseek is mainly paranoia.) It is safe to set _blksize
* unconditionally; it will only be used if __SOPT is also set.
*/
*bufsize = st.st_blksize;
fp->_blksize = st.st_blksize;
return ((st.st_mode & S_IFMT) == S_IFREG ? __SOPT : snpt);
}
#endif
*bufsize = BUFSIZ;
return (snpt);
}
/contrib/sdk/sources/newlib/libc/stdio/setvbuf.c
104,21 → 104,22
{
int ret = 0;
struct _reent *reent = _REENT;
size_t iosize;
int ttyflag;
 
CHECK_INIT (reent, fp);
 
_newlib_flockfile_start (fp);
 
/*
* Verify arguments. The `int' limit on `size' is due to this
* particular implementation. Note, buf and size are ignored
* when setting _IONBF.
* particular implementation.
*/
if (mode != _IONBF)
if ((mode != _IOFBF && mode != _IOLBF) || (int)(_POINTER_INT) size < 0)
 
if ((mode != _IOFBF && mode != _IOLBF && mode != _IONBF) || (int)(_POINTER_INT) size < 0)
{
_newlib_flockfile_exit (fp);
return (EOF);
}
 
 
/*
* Write current buffer, if any; drop read count, if any.
* Make sure putc() will not think fp is line buffered.
125,49 → 126,34
* Free old buffer if it was from malloc(). Clear line and
* non buffer flags, and clear malloc flag.
*/
_newlib_flockfile_start (fp);
 
_fflush_r (reent, fp);
if (HASUB(fp))
FREEUB(reent, fp);
fp->_r = fp->_lbfsize = 0;
fp->_r = 0;
fp->_lbfsize = 0;
if (fp->_flags & __SMBF)
_free_r (reent, (_PTR) fp->_bf._base);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SNPT | __SEOF);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF);
 
if (mode == _IONBF)
goto nbf;
 
/*
* Find optimal I/O size for seek optimization. This also returns
* a `tty flag' to suggest that we check isatty(fd), but we do not
* care since our caller told us how to buffer.
*/
fp->_flags |= __swhatbuf_r (reent, fp, &iosize, &ttyflag);
if (size == 0)
{
buf = NULL;
size = iosize;
}
 
/* Allocate buffer if needed. */
* Allocate buffer if needed. */
if (buf == NULL)
{
/* we need this here because malloc() may return a pointer
even if size == 0 */
if (!size) size = BUFSIZ;
if ((buf = malloc (size)) == NULL)
{
/*
* Unable to honor user's request. We will return
* failure, but try again with file system size.
*/
ret = EOF;
if (size != iosize)
{
size = iosize;
buf = malloc (size);
/* Try another size... */
buf = malloc (BUFSIZ);
size = BUFSIZ;
}
}
if (buf == NULL)
{
/* No luck; switch to unbuffered I/O. */
/* Can't allocate it, let's try another approach */
nbf:
fp->_flags |= __SNBF;
fp->_w = 0;
178,54 → 164,36
}
fp->_flags |= __SMBF;
}
 
/*
* We're committed to buffering from here, so make sure we've
* registered to flush buffers on exit.
* Now put back whichever flag is needed, and fix _lbfsize
* if line buffered. Ensure output flush on exit if the
* stream will be buffered at all.
* If buf is NULL then make _lbfsize 0 to force the buffer
* to be flushed and hence malloced on first use
*/
if (!reent->__sdidinit)
__sinit(reent);
 
#ifdef _FSEEK_OPTIMIZATION
/*
* Kill any seek optimization if the buffer is not the
* right size.
*
* SHOULD WE ALLOW MULTIPLES HERE (i.e., ok iff (size % iosize) == 0)?
*/
if (size != iosize)
fp->_flags |= __SNPT;
#endif
switch (mode)
{
case _IOLBF:
fp->_flags |= __SLBF;
fp->_lbfsize = buf ? -size : 0;
/* FALLTHROUGH */
 
/*
* Fix up the FILE fields, and set __cleanup for output flush on
* exit (since we are buffered in some way).
*/
if (mode == _IOLBF)
fp->_flags |= __SLBF;
case _IOFBF:
/* no flag */
reent->__cleanup = _cleanup_r;
fp->_bf._base = fp->_p = (unsigned char *) buf;
fp->_bf._size = size;
/* fp->_lbfsize is still 0 */
if (fp->_flags & __SWR)
{
break;
}
 
/*
* Begin or continue writing: see __swsetup(). Note
* that __SNBF is impossible (it was handled earlier).
* Patch up write count if necessary.
*/
if (fp->_flags & __SLBF)
{
fp->_w = 0;
fp->_lbfsize = -fp->_bf._size;
}
else
fp->_w = size;
}
else
{
/* begin/continue reading, or stay in intermediate state */
fp->_w = 0;
}
 
if (fp->_flags & __SWR)
fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : size;
 
_newlib_flockfile_end (fp);
return 0;
}
/contrib/sdk/sources/newlib/libc/stdlib/eprintf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/erand48.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/efgcvt.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/cxa_atexit.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/labs.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/ecvtbuf.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/cxa_finalize.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/itoa.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/drand48.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/utoa.c
File deleted
/contrib/sdk/sources/newlib/libc/stdlib/mallocr.c
382,7 → 382,7
size_t footprint;
size_t max_footprint;
flag_t mflags;
_LOCK_RECURSIVE_T lock; /* locate lock among fields that rarely change */
__libc_lock_recursive_t lock; /* locate lock among fields that rarely change */
msegment seg;
void* extp; /* Unused but available for extensions */
size_t exts;
425,11 → 425,11
 
__LOCK_INIT_RECURSIVE(static, malloc_global_mutex);
 
#define ACQUIRE_MALLOC_GLOBAL_LOCK() __lock_acquire_recursive(malloc_global_mutex);
#define RELEASE_MALLOC_GLOBAL_LOCK() __lock_release_recursive(malloc_global_mutex);
#define ACQUIRE_MALLOC_GLOBAL_LOCK() __libc_lock_lock_recursive(malloc_global_mutex);
#define RELEASE_MALLOC_GLOBAL_LOCK() __libc_lock_unlock_recursive(malloc_global_mutex);
 
#define PREACTION(M) ( __lock_acquire_recursive((M)->lock))
#define POSTACTION(M) { __lock_release_recursive((M)->lock); }
#define PREACTION(M) ( __libc_lock_lock_recursive((M)->lock))
#define POSTACTION(M) { __libc_lock_unlock_recursive((M)->lock); }
 
/* ---------------------------- Indexing Bins ---------------------------- */
 
991,7 → 991,7
 
/* Set up lock for main malloc area */
gm->mflags = mparams.default_mflags;
__lock_init_recursive(gm->lock);
__libc_lock_init_recursive(gm->lock);
 
magic = (size_t)(0x12345678 ^ (size_t)0x55555555U);
magic |= (size_t)8U; /* ensure nonzero */
/contrib/sdk/sources/newlib/libc/stdlib/strtold.c
30,8 → 30,6
 
#include <stdlib.h>
#include "local.h"
#include "mprec.h"
#undef FLT_ROUNDS
 
#ifdef _HAVE_LONG_DOUBLE
 
/contrib/sdk/sources/newlib/libc/stdlib/strtorx.c
88,8 → 88,7
 
case STRTOG_Infinite:
L[_0] = 0x7fff;
L[_1] = 0x8000;
L[_2] = L[_3] = L[_4] = 0;
L[_1] = L[_2] = L[_3] = L[_4] = 0;
break;
 
case STRTOG_NaN:
/contrib/sdk/sources/newlib/libc/string/strxfrm.c
File deleted
/contrib/sdk/sources/newlib/libc/crt/tls.c
File deleted
/contrib/sdk/sources/newlib/libc/crt/crt1.c
12,7 → 12,12
/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to
avoid problems with older GCC. */
 
#include <newlib.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/kos_io.h>
 
struct app_hdr
{
27,12 → 32,9
int __subsystem__;
};
 
extern void init_reent();
extern void init_stdio();
extern void __init_conio();
extern void __fini_conio();
void __init_conio();
void __fini_conio();
 
extern void tls_init(void);
extern int main (int, char **, char **);
 
/* NOTE: The code for initializing the _argv, _argc, and environ variables
44,6 → 46,8
char* __appenv;
int __appenv_size;
 
extern char _tls_map[128];
 
char * __libc_getenv(const char *name)
{
return NULL;
164,7 → 168,7
};
 
void __attribute__((noreturn))
__libc_init (void)
__crt_startup (void)
{
struct app_hdr *header = NULL;
int retval = 0;
172,7 → 176,8
char **argv;
int argc;
 
tls_init();
memset(_tls_map, 0xFF, 32*4);
_tls_map[0] = 0xE0;
init_reent();
init_stdio();
 
/contrib/sdk/sources/newlib/libc/crt/crtdll.c
35,21 → 35,19
int (*main)(int argc, char **argv, char **envp);
};
 
extern void _pei386_runtime_relocator (void);
extern void init_loader(void *libc_image);
extern void init_reent(void);
extern void init_stdio(void);
void _pei386_runtime_relocator (void);
void init_loader(void *libc_image);
void init_reent();
void __init_conio();
void __fini_conio();
int link_app();
void* get_entry_point(void *raw);
int (*entry)(int, char **, char **);
 
extern void __init_conio(void);
extern void __fini_conio(void);
extern int link_app(void);
extern void* get_entry_point(void *raw);
 
extern void tls_init(void);
 
char* __appenv;
int __appenv_size;
 
extern char _tls_map[128];
 
char * __libc_getenv(const char *name)
{
170,8 → 168,8
return argc;
};
 
__attribute__((noreturn))
void libc_crt_startup (void *libc_base)
void __attribute__((noreturn))
libc_crt_startup (void *libc_base)
{
struct app_hdr *header = NULL;
int retval = 0;
181,7 → 179,8
 
_pei386_runtime_relocator();
 
tls_init();
memset(_tls_map, 0xFF, 32*4);
_tls_map[0] = 0xE0;
init_reent();
init_stdio();
 
188,6 → 187,8
if(header->__subsystem__ == 3)
__init_conio();
 
__do_global_ctors();
 
// __appenv = load_file("/sys/system.env", &__appenv_size);
 
init_loader(libc_base);
/contrib/sdk/sources/newlib/libc/crt/console.asm
10,7 → 10,6
public _con_set_flags@4
public _con_cls
public _con_write_string@8
public _con_getch2@0
 
section '.text' align 16
 
165,9 → 164,6
_con_write_string@8:
jmp [con_write_string]
 
_con_getch2@0:
jmp [con_getch2]
 
_con_get_flags:
_con_set_flags@4:
_con_cls:
/contrib/sdk/sources/newlib/libc/crt/start.S
1,7 → 1,7
 
.section .init
 
.global __crt_start
.global __start
 
#tls:0 pid process id
#tls:4 tid reserved for thread slot
10,7 → 10,7
#tls:16 reseved for libc
 
.align 4
__crt_start:
__start:
movl $68, %eax
movl $12, %ebx
lea __size_of_stack_reserve__, %ecx
38,7 → 38,7
 
addl $1024, %esp
 
jmp ___libc_init
jmp ___crt_startup
1:
int3 #trap to debugger
 
/contrib/sdk/sources/newlib/libc/pe/loader.c
345,7 → 345,7
int link_image(void *img_base, PIMAGE_IMPORT_DESCRIPTOR imp)
{
static jmp_buf loader_env;
static int recursion = -1;
static recursion = -1;
int warn = 0;
 
recursion++;
/contrib/sdk/sources/newlib/libc/libcdll.lds
1,5 → 1,5
 
OUTPUT_FORMAT(pei-i386)
SEARCH_DIR("=/mingw32/lib")
 
ENTRY("_libc_crt_startup")