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
AgeCommit message (Collapse)Author
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-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-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-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-18sparc64: move struct timeval to <sys/_timeval.h>Yaakov Selkowitz
commit bb0159489785d577ad0b8061a1ba7956ee0f89d0 moved the struct timeval declaration from <sys/time.h> to <sys/_timeval.h>, and commit 01885f533de81ff73e9da1519a4b5f2316b49f86 changed <sys/select.h> to include <sys/_timeval.h>. Therefore, sparc64's own struct timeval needs to be moved accordingly in order to avoid a conflict from the generic type. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18Feature test macros overhaul: sparc64Yaakov Selkowitz
sparc64 has a number of its own headers which override the generic ones. These too need to use feature test macros properly. These changes correspond to the generic fcntl.h and sys/stat.h changes in commit d2df6d381b36f3f76420bc3bab965fbbdc3c3a8c and commit 069e400c913659432c5d1953c4fa9a696b06e340. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18Cleanup macros in chacha_private.h to be target-type independentHowland, Craig D
* libc/stdlib/chacha_private.h (U8C, U32C): Remove un-necessary macros. (U8V, U32V): Drop masking.
2016-03-18Only export arc4random_stir and arc4random_addrandom on CygwinCorinna Vinschen
Export to maintain backward compatibility, but don't let them do anything useful. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18Feature test macros overhaul: signal.h (part 2)Yaakov Selkowitz
Move the sig*set macros following the functions inside their feature test macro conditional. This fixes the build on bare-metal targets following commit 5c78499ae2ae6ac28854b43a1ad73d917b40c62d. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> Acked-by: Corinna Vinschen <vinschen@redhat.com>
2016-03-18arm: fix build with newlib supplied syscalls enabledYaakov Selkowitz
In file included from libc/sys/arm/crt0.S:2:0: libc/sys/arm/arm.h:32:25: fatal error: acle-compat.h: No such file or directory acle-compat.h is libc/machine/arm. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Arc4random locking: Check for threaded application on CygwinCorinna Vinschen
libc/stdlib/arc4random.h (_ARC4_LOCK): Special case Cygwin. (_ARC4_UNLOCK): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18Add arc4random_stir and arc4random_addrandom for OpenBSD compatibilityCorinna Vinschen
* libc/stdlib/arc4random.c (arc4random_stir): New function. (arc4random_addrandom): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-18Add arc4random() etc. from OpenBSD 5.8Sebastian Huber
According to the OpenBSD man page, "A Replacement Call for Random". It offers high quality random numbers derived from input data obtained by the OpenBSD specific getentropy() system call which is declared in <unistd.h> and must be implemented for each Newlib port externally. The arc4random() functions are used for example in LibreSSL and OpenSSH. Cygwin provides currently its own implementation of the arc4random family. Maybe it makes sense to use this getentropy() implementation: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libcrypto/crypto/getentropy_win.c?rev=1.4&content-type=text/x-cvsweb-markup * libc/include/stdlib.h (arc4random): Declare if __BSD_VISIBLE. (arc4random_buf): Likewise. (arc4random_uniform): Likewise. * libc/include/sys/unistd.h (getentropy): Likewise. * libc/include/machine/_arc4random.h: New file. * libc/stdlib/arc4random.c: Likewise. * libc/stdlib/arc4random.h: Likewise. * libc/stdlib/arc4random_uniform.c: Likewise. * libc/stdlib/chacha_private.h: Likewise. * libc/sys/rtems/include/machine/_arc4random.h: Likewise. * libc/stdlib/Makefile.am (EXTENDED_SOURCES): Add arc4random.c and arc4random_uniform.c. * libc/stdlib/Makefile.in: Regenerate.
2016-03-18Add timingsafe_memcmp()Sebastian Huber
This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_memcmp): Declare. * libc/string/timingsafe_memcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
2016-03-18Add timingsafe_bcmp()Sebastian Huber
This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (timingsafe_bcmp): Declare. * libc/string/timingsafe_bcmp.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
2016-03-18Add explicit_bzero()Sebastian Huber
This function is used by LibreSSL and OpenSSH and is provided by the OpenBSD libc. * libc/include/string.h (explicit_bzero): Declare. * libc/string/explicit_bzero.c: New file. * libc/string/Makefile.am: Add new file. * libc/string/Makefile.in: Regenerate.
2016-03-18Guard ssize_t definition by _SSIZE_T_DECLAREDSebastian Huber
This guard is used by FreeBSD <sys/socket.h> for example. The FreeBSD network stack is used in RTEMS. * newlib/libc/include/sys/types.h (ssize_t): Guard by _SSIZE_T_DECLARED.
2016-03-18Feature test macros overhaul: sys/types.hYaakov Selkowitz
The u_int/u_char/etc. BSD types are needed by Cygwin's netinet/*.h headers, so they always need to be available. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Revert "Remove inclusion of sys/select.h in sys/types.h for backward compat"Yaakov Selkowitz
This BSDism is still in use (e.g. putty). This reverts commit 088f7a723962dd18dcae09e8e8fa168bbea6ed0b.
2016-03-18Feature test macros overhaul: sys/time.hYaakov Selkowitz
The inclusion of <sys/select.h> is required also by POSIX.1-2001. setitimer is XSI, and futimesat is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: sys/stat.hYaakov Selkowitz
Replace all !_POSIX_SOURCE with BSD. All *at functions depend on ATFILE; futimens is POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: sys/select.hYaakov Selkowitz
Remove !_POSIX_SOURCE conditional; pselect is POSIX.1-2001. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: wchar.hYaakov Selkowitz
open_wmemstream is POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: unistd.hYaakov Selkowitz
Throughout, use proper internal macros for functions, including those marked as target-specific. Use ATFILE for all *at functions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: time.hYaakov Selkowitz
Throughout, replace __STRICT_ANSI__ with the proper internal macros. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: strings.hYaakov Selkowitz
Replace __STRICT_ANSI__ with the proper internal macros for bcmp etc. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: string.hYaakov Selkowitz
Throughout, remove __STRICT_ANSI__ and use the proper internal macros. bcmp, bcopy, bzero, index, and rindex were in POSIX prior to 2008. memrchr is GNU. strdup and strndup are POSIX.1-2008. The int-returning form of strerror_r is POSIX.1-2001. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: stdlib.hYaakov Selkowitz
Throughout, simplify the C99/C11 conditionals, and replace __STRICT_ANSI__ with the proper internal POSIX macros. The _*_r reentrant functions need not be guarded (and most haven't been) because such names in the global scope are reserved to the implementation. atoff is unique to newlib. dtoa is not actually exported (_dtoa_r is used internally), is nonstandard, and the declaration conflicts with the code included in MySQL, NSPR, and SpiderMonkey. mktemp was removed in POSIX.1-2001. The qsort_r declarations are reordered so that the GNU version retains precedence. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: stdio.hYaakov Selkowitz
Throughout, remove references to __STRICT_ANSI__ and use the proper internal macros and versions for C99, POSIX, ATFILE for the various *at functions, or LARGEFILE for fseeko and ftello. [v]asprintf are GNU extensions, but the *iprintf, *iscanf, and *asnprintf functions are unique to newlib. getw and putw were removed from POSIX.1-2001. funopen is BSD, and fopencookie is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: signal.hYaakov Selkowitz
Use proper internal macros for BSD sig_t and GNU sighandler_t. sigaltstack and friends are XSI even in SUSv4 but in glibc are nonetheless handled as POSIX.1-2008 (not 2001). The requirement for the ucontext_t typedef in signal.h was XSI prior to POSIX.1-2008. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: pwd.hYaakov Selkowitz
getpw*_r dates back to POSIX.1c, and *pwent to XPG4v2. Both are also BSD. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: pthread.hYaakov Selkowitz
Use internal macros for GNU extensions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: math.hYaakov Selkowitz
Simplify the C99 conditionals. Mark the drem and gamma functions as BSD|SVID, the Bessel double functions also XSI and the floats also SUSv3. signgam is BSD|SVID|XSI, and matherr is SVID. Finally, use the internal macros to control the symbolic constants. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: limits.hYaakov Selkowitz
Simplify the C99 conditional, and use the internal macro for GNU extensions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: grp.hYaakov Selkowitz
_PATH_GROUP is a BSDism. getgr*_r are BSD|SVID|POSIX, and the *grent functions are BSD|SVID|XPG4v2. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: fnmatch.hYaakov Selkowitz
Use the proper internal macro for GNU extensions. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-18Feature test macros overhaul: fcntl.hYaakov Selkowitz
Most of the !_POSIX_SOURCE code is BSD, although ironically some were added to POSIX.1-2001. Use the ATFILE conditional for most of the *at functions, except futimesat which is GNU. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>