Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
AgeCommit message (Collapse)Author
2016-04-15Add __va_list to <sys/_types.h>Sebastian Huber
Add __va_list to <sys/_types.h> for BSD compatibility. In FreeBSD this typedef is provided by the various architecture-specific <machine/_types.h> in a copy and paste manner. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guards for fixed-size integer typesChristian Mauderer
Signed-off-by: Christian Mauderer <christian.mauderer@embedded-brains.de>
2016-04-15Add BSD guard for useconds_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for nlink_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Provide POSIX defined fsblkcnt_t and fsfilcnt_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Provide POSIX defined blksize_t in <sys/types.h>Sebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Provide POSIX defined blkcnt_t in <sys/types.h>Sebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for timer_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for clockid_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for time_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for clock_tSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Define mode_t via __mode_tSebastian Huber
Use __uint32_t to avoid the use of GCC-specific _ST_INT32. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Add BSD guard for ino_t in <sys/types.h>Sebastian Huber
Introduce internal type __ino_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Provide POSIX defined id_t in <sys/types.h>Sebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15Use __machine_*_t_defined for internal typesSebastian Huber
Newlib defines defaults for internal types via <sys/_types.h> and uses <machine/_types.h> to let targets define their own type if necessary. Previously for example #ifndef __dev_t_defined typedef short __dev_t; #endif However, the __*_t_defined pattern conflicts with the glibc type guard pattern for user types, e.g. dev_t in this example. Introduce a __machine_*_t_defined pattern for internal types (defined by <machine/_types.h>, used by <sys/_types.h>). For example #ifndef __machine_dev_t_defined typedef short __dev_t; #endif Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-14Feature test macros overhaul: string.h and strings.h overlapsYaakov Selkowitz
strings.h is the header mandated for these functions in POSIX.1 prior to 2008 (when most of these were removed). The declarations in string.h are only for BSD compatibility. But when both headers are included, avoid duplicate declarations. Also, mark stpcpy and stpncpy as POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-13Get rid of some special cases for Cygwin in sys/types.hCorinna Vinschen
Remove off_t typedef from cygwin/types.h thus relying on sys/types.h. Introduce winsup/cygwin/machine/_types.h and move some types shared with newlib into it. Get rid of their definition in cygwin/types.h. Add same handling for __key_t/key_t as for the other types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-13Add BSD guards for off_t, dev_t, uid_t, and gid_tSebastian Huber
Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest FreeBSD <sys/types.h>. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-13Eliminate use of Newlib-specific <machine/types.h>Sebastian Huber
This change solves a glibc/BSD compatibility problem. glibc and BSD use double underscore types for internal types. The Linux port of Newlib uses some glibc provided internal type definitions which are not protected by guard defines, e.g. __off_t. To avoid a conflict Newlib uses single underscore types for some internal types, e.g. _off_t. However, for BSD compatibility we have to define the internal types with double underscore names in <sys/_types.h>. The header file <machine/types.h> is Newlib-specific. It was used instead of <sys/_types.h> to provide the internal type definitions _CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t. Move these definitions to <sys/_types.h> (there exist two instances of this file, one for Linux and one for all other targets). This makes the _HAVE_SYSTYPES configuration define obsolete (could possibly break the __RDOS__ target). Use the standard <sys/_types.h> include throughout. Move __loff_t defintion to default (non-Linux) <sys/_types.h>. Define it via _off64_t to avoid a dependency on the compiler. Provide the __off_t definition via default (non-Linux) <sys/_types.h> based on _off_t for all systems except Cygwin. For Cygwin use _off64_t. Define off_t via __off_t. Provide the __pid_t definition via default (non-Linux) <sys/_types.h>. This prevents a potential __pid_t and pid_t incompatibility. Add BSD guard defines for pid_t. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-08Move kernel dependent parts of <sys/time.h>cygwin-2_5_0-releaseSebastian Huber
Move the kernel dependent parts of <sys/time.h> to new system-specific header file <machine/_time.h>. Provide an empty default implementation. Add a specialized implementation for RTEMS. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-07math: fix isinf/isnan on SPU after move to math.hYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-07Drop <unistd.h> include from RTEMS <sys/param.h>Sebastian Huber
This include is not present in default Newlib, glibc and FreeBSD <sys/param.h>. With it there is now a conflict with <sys/libkern.h> introduced by ecf453f9635fb278cff4d4bae21a1e249313b817. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-05math: update isinf/isnan function comments after move to math.hYaakov Selkowitz
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04math: guard BSD finite/isinf/isnan functions properly in math.hYaakov Selkowitz
Now that we have properly functioning feature test macros, the BSD floating-point classification functions can go into math.h instead of the non-standard ieeefp.h, and not under the C99 guard: http://man7.org/linux/man-pages/man3/finite.3.html The isnan function was in earlier versions of SUS but removed starting with POSIX.1-2001, compare: http://pubs.opengroup.org/onlinepubs/007908799/xsh/math.h.html http://pubs.opengroup.org/onlinepubs/009695399/basedefs/math.h.html Note that the isinf and isnan functions (but not the variants) conflict with functions by the same name in C++11, hence they (and only they) need to be hidden: https://sourceware.org/git/?p=glibc.git;a=commit;h=d9b965fa56350d6eea9f7f438a0714c7ffbb183f https://sourceware.org/git/?p=glibc.git;a=commit;h=3c47c83a9730c20e602694505b9278c25637b0d0 Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04Feature test macros overhaul: tar.hYaakov Selkowitz
TSVTX was marked XSI beginning with SUSv3, compare: http://pubs.opengroup.org/onlinepubs/007908799/xsh/tar.h.html http://pubs.opengroup.org/onlinepubs/009695399/basedefs/tar.h.html http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tar.h.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04Add cpio.hYaakov Selkowitz
This header dates back to XPG3: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/cpio.h.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04cygwin: make POSIX/XSI version macros dependent on feature test macrosYaakov Selkowitz
Each version of SUS specifies a different value for _POSIX_VERSION, _POSIX2_VERSION, and _XOPEN_VERSION. glibc also changes the value of the other _POSIX2_ variables but not the _POSIX_* variables. _POSIX_TIMERS should be set to a version number, not just 1. The _POSIX_V7_* macros were missing, which was not noticed because the V6 values were aliased in sysconf (<unistd.h>). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-04-04Add Intel MCU targetIgor Venevtsev
Intel MCU System V ABI are incompartible with i386 System V ABI: o Minimum instruction set is Intel Pentium ISA minus x87 instructions o No x87 or vector registers o First three args are passed in %eax, %edx and %ecx o Full specification available here: https://github.com/hjl-tools/x86-psABI/wiki/iamcu-psABI-0.7.pdf newlib/ * configure.host: Add new ix86-*-elfiamcu target newlib/libc/include/ * setjmp.h: Change _JBLEN for Intel MCU target newlib/libc/machine/i386/ * memchr.S: (memchr) Target-specific size-optimized version * memcmp.S: (memcmp) Likewise * memcpy.S: (memcpy) Likewise * memmove.S: (memmove) Likewise * memset.S: (memset) Likewise * setjmp.S: (setjmp) Likewise * strchr.S: (strchr) Likewise * strlen.S: (strlen) Likewise newlib/libc/stdlib/ * srtold.c: (__flt_rounds) Disable for Intel MCU
2016-03-30Bump up newlib version to 2.4.0 due to feature test refactoringnewlib-2_4_0Jeff Johnston
2016-03-29Add missing long double functions to CygwinCorinna Vinschen
This patch adds the long double functions missing in newlib to Cygwin. Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l}, isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib. Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin. Cygwin: * math: New subdir with math functions. * Makefile.in (VPATH): Add math subdir. (MATH_OFILES): List of object files collected from building files in math subdir. (DLL_OFILES): Add $(MATH_OFILES). ${CURDIR}/libm.a: Add $(MATH_OFILES) to build. * common.din: Add new functions from math subdir. * i686.din: Align to new math subdir. Remove functions now commonly available. * x86_64.din: Ditto. * math.h: math.h wrapper to define mingw structs used in some files in math subdir. * include/cygwin/version.h: Bump API minor version. newlib: * libc/include/complex.h: Add prototypes for complex long double functions. Only define for Cygwin. * libc/include/math.h: Additionally enable prototypes of long double functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl, exp10l and pow10l. Explain why we don't add them to newlib. * libc/include/tgmath.h: Enable long double handling on Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29Add simple versions of random() and srandom()Joel Sherrill
Prototypes also added for initstate() and setstate() but they were not implemented in the shared newlib code. * newlib/libc/include/cygwin/stdlib.h: Prototypes added. * winsup/cygwin/include/cygwin/stdlib.h: Prototypes removed. * newlib/libc/stdlib/random.c: New file. * newlib/libc/machine/epiphany/machine/stdlib.h: Removed * newlib/libc/stdlib/Makefile.am: Added random.c. * newlib/libc/stdlib/stdlib.tex: Added random.def. * newlib/libc/stdlib/Makefile.in: Regenerated.
2016-03-26math.h: Use GCC builtins for C99 macros where availableCorinna Vinschen
GCCs builtin functions are mostly type agnostic and architecture indepedent. Prefer to use them if available. * libc/include/math.h (fpclassify, isfinite, isinf, isnan, isnormal): Use matching GCC builtin functions if built with GCC 4.4 or later. (signbit): Use matching GCC builtin functions if built with GCC 4.0 or later. (isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered): Use matching GCC builtin functions if built with GCC 2.97 or later. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-26finitel: Use correct GCC builtinCorinna Vinschen
__builtin_isinf_sign doesn't reflect the correct return value for NaN to emulate finite function. Use __builtin_isfinite instead whichg is available since GCC 4.4 just as __builtin_isinf_sign. * libm/common/sl_finite.c (finitel): Use __builtin_isfinite. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-26strtold: Fix Infinity value.Corinna Vinschen
Infinity returned from strtold is recognized as NaN by GCC builtin functions. The reason is that ULtox is missing to set a bit. * libc/stdlib/strtorx.c (ULtox): Set high bit in second word to create valid Infinity value. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24Drop usage of old-age BSD types in generically used Cygwin headersCorinna Vinschen
u_char, u_short, u_int, u_long are BSD-only types. Remove them from Cygwin headers which are supposed to be used in a non-BSD scenario. Drop special Cygwin handling of those types in sys/types.h. newlib: * libc/include/sys/types.h (u_char,u_short,u_int,u_long): Drop Cygwin exception. cygwin: * fhandler_socket.cc (fhandler_socket::ioctl): Accommodate change in include/asm/socket.h. Continue using u_long since that's the MS type here. * include/asm/socket.h: Since the type given in _IOR/_IOW macros is only used for its sizeof, replace u_long with equivalent long. * netdb.h (getnetbyaddr): Fix prototype. * netinet/ip.h: Replace old BSD-only types with generically defined old BSD types (u_char -> u_int8_t, etc). * netinet/tcp.h: Ditto. * netinet/udp.h: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24Define BSD u_intN_t types indiscriminatelyCorinna Vinschen
The u_intN_t types are BSD types but sanctioned by POSIX. They are always defined when using Glibc headers so we follow suit. newlib: * libc/include/sys/types.h: Drop outdated __INTTYPES_DEFINED__ macro. Always define u_intN_t types. cygwin: * include/cygwin/types.h: Remove definition of u_intN_t types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24Fix coverity CID 143502: Null pointer dereferenceCorinna Vinschen
* libc/locale/ldpart.c (split_lines): Don't dereference result of strchr without checking for NULL pointer first. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-24Feature test macros overhaul: C++ TR1Yaakov Selkowitz
While C++11 was the first version of the standard to use C99 functionality, TR1 (for C++03) also does, and G++ does not distinguish between C++98 and C++03, or when TR1 is in use. Therefore, while not strictly correct for "pure" C++98, enabling C99 for all C++ usage is the simplest solution (and much better than always using -D_GNU_SOURCE as on Linux). See thread starting: https://sourceware.org/ml/newlib/2016/msg00297.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-23Drop Cygwin-only posix_memalign prototypeCorinna Vinschen
newlib: * libc/include/stdlib.h (posix_memalign): Drop __rtmes__ guards. cygwin: * include/cygwin/stdlib.h (posix_memalign): Drop prototype. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-23Target/Host configuration elucidatedKonrad Schwarz
2016-03-23Guard u_char,u_short,u_int,u_long with __MISC_VISIBLECorinna Vinschen
These types are available in SVID as well. * libc/include/sys/types.h (u_char,u_short,u_int,u_long): Replace __BSD_VISIBLE with __MISC_VISIBLE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-23Fix "/*" within comment warningSebastian Huber
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-03-22stdio: fseeko/ftello are also POSIX.1-2001Yaakov Selkowitz
_LARGEFILE_SOURCE, which controls only these two functions, is implicitly defined by _XOPEN_SOURCE >= 500. However, they are also later added to POSIX.1-2001 (and therefore available by default). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-22pthread.h: Mark pthread_exit() as not returningJoel Sherrill
2016-03-22epiphany/machine/stdlib.h: Disable epiphany unique random wrappers for RTEMSJoel Sherrill
2016-03-22newlib/configure.host: Turn off sti/cli for i386 setjmp for i386-rtems*Joel Sherrill
When running RTEMS paravirtualized in user space, the cli/sti instructions can't be used. But I can't see why they are needed in either user or supervisor state. Turning the use of them off for RTEMS. This code is unmodified since the beginning of the repository, so I have no insight into why it was done. I may even have been the one to add them. Absolutely no idea except they aren't necessary.
2016-03-21Add nonnull annotation to posix_memalign.Peter Foley
GCC 6.0+ asserts that the memptr argument to the builtin function posix_memalign is nonnull. Add the necessary annotation to the prototype and remove the now unnecessary check to fix a warning. newlib/Changelog newlib/libc/include/stdlib.h: Annotate arg to posix_memalign as non-null. winsup/cygwin/ChangeLog malloc_wrapper.cc (posix_memalign): Remove always true nonnull check. Signed-off-by: Peter Foley <pefoley2@pefoley.com>
2016-03-21Move arc4random Cygwin only code to CygwinSebastian Huber
Keep the Newlib arc4random.c identical to the OpenBSD upstream version. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>.
2016-03-20Allow machine-dependent arc4 lockingCorinna Vinschen
newlib: * libc/stdlib/arc4random.h: Remove Cygwin-specific locking code. Conditionalize arc4 locking. Check for _ARC4_LOCK_INIT being undefined to fall back to default implementation. cygwin: * include/machine/_arc4random.h: New file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-19Regenerate configure script.Jeff Johnston