Commit Graph

731 Commits

Author SHA1 Message Date
Corinna Vinschen 601c50292b * libc/include/stdlib.h: Include sys/cdefs.h to avoid undefined
__ASMNAME.
2014-12-15 12:58:19 +00:00
Jeff Johnston f58bc5991f 2014-12-12 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
* configure.host: or1knd support, OpenRISC without delay slot
        * libc/include/machine/setjmp.h: Add or1knd
        * libc/machine/or1k/setjmp.S: Optional delay slot
2014-12-12 21:14:06 +00:00
Corinna Vinschen c6332722d9 * libc/include/stdio.h: Fix type signature of __sfeof and __sferror
(and thus feof and ferror) for C++.
2014-12-11 17:42:19 +00:00
Yaakov Selkowitz 6f34876e5e * libc/include/stdio_ext.h: Rename __fwriteable to __fwritable.
[!__GNUC__]: Declare real functions for the macros, and make
the macros conditional on !__cplusplus.
* libc/stdio/Makefile.am (ELIX_4_SOURCES): Add stdio_ext.c.
(CHEWOUT_FILES): Add stdio_ext.def.
* libc/stdio/Makefile.in: Regenerate.
* libc/stdio/stdio.tex: Include stdio_ext.def.
* libc/stdio/stdio_ext.c: New file.
2014-12-11 16:53:32 +00:00
Corinna Vinschen 2d48118f11 * libc/include/stdio_ext.h: Remove excess "inline". 2014-12-10 09:39:06 +00:00
Yaakov Selkowitz bf9897549d * libc/include/stdlib.h (__bsd_qsort_r): Declare.
(qsort_r): Declare.
* libc/search/Makefile.am (ELIX_2_SOURCES): Rename from ELIX_SOURCES.
(ELIX_4_SOURCES): Define.  Add bsd_qsort_r.c and qsort_r.c.
(libsearch_la_SOURCES): Adapt accordingly.
(lib_a_SOURCES): Adapt accordingly.
(CHEWOUT_FILES): Add qsort_r.def.
* libc/search/Makefile.in: Regenerate.
* libc/search/bsd_qsort_r.c: New file.
* libc/search/qsort.c: Update from FreeBSD HEAD. Adapt for both BSD
and GNU qsort_r flavors.
* libc/search/qsort_r.c: New file.
2014-12-05 16:21:04 +00:00
Corinna Vinschen a800b3ae9c * libc/include/sys/signal.h [__SPU__] (kill): Declare. 2014-12-04 09:15:50 +00:00
Jeff Johnston 8c049028d9 2014-12-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/inttypes.h: Only enable the 8-bit scanning macros
        if _WANT_IO_C99_FORMATS is defined by configuration.  Add comment
        on why.
2014-12-03 20:25:09 +00:00
Corinna Vinschen d37bfe1da2 * libc/include/machine/setjmp.h [__mips__]: Remove __mips_fpr == 64
from the 64-bit _JBTYPE definition.
	* libc/machine/mips/setjmp.S: Re-work the o32 FP64 support to match
	the now one-and-only supported o32 FP64 ABI extension.  Also
	support o32 FPXX.
2014-11-28 08:47:39 +00:00
Corinna Vinschen 75e2565a57 * libc/include/sys/_default_fcntl.h: Move all Cygwin-specific open
flags from Cygwin's fcntl.h here.  Remove check for WIN32.  Remove
	Windows-specific macros.
2014-11-25 11:53:00 +00:00
Joel Sherrill 63d53b9255 2014-11-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/resource.h: Add prototype for getrusage()
	to <sys/resource.h>
2014-11-24 14:12:32 +00:00
Jeff Johnston 85907fe082 2014-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.in: Add autoconf test to determine size of uintptr_t.
        * newlib.hin: Add new autoconf feature variables.
        * libc/include/inttypes.h: Use new feature variables.
        * configure: Regenerate.
2014-11-06 17:45:14 +00:00
Jon TURNEY e7ebfb119e 2014-10-29 Jon Turney <jon.turney@dronecode.org.uk>
* libc/include/string.h: Correct guard for strcasecmp().
2014-10-30 11:25:17 +00:00
Corinna Vinschen 8134be8ac2 * libc/include/sys/unistd.h (sethostname): Declare if
requested.
2014-10-27 14:35:46 +00:00
Corinna Vinschen 7a84e9c4bc * libc/include/_ansi.h: _LONG_LONG_TYPE definition removed.
* libc/include/math.h: _LONG_LONG_TYPE replaced by "long long".
	Guards for C99 and C++11 functions fixed.
	* libc/include/stdlib.h: Guards for C99 and C++11 functions fixed.
2014-10-10 14:43:19 +00:00
Jeff Johnston 50f799240e 2014-10-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/stdint.h: Include <sys/_intsup.h>.
        (__STDINT_EXP): Delete.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/sys/_intsup.h: New file.
        (__STDINT_EXP): Move from libc/include/stdint.h.
        (__have_long32): Likewise.
        (__have_long64): Likewise.
        (__have_longlong64): Likewise.
        * libc/include/inttypes.h: Include <sys/_intsup.h>.
        (__INTTYPES_EXP): Delete and use __STDINT_EXP() instead.
2014-10-09 15:57:50 +00:00
Corinna Vinschen da77c6d1e5 * libc/include/string.h (ffsl): Declare as GNU function.
(ffsll): Ditto.
2014-10-08 21:04:59 +00:00
Jeff Johnston 99eb60455b 2014-09-17 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/features.h: Add __NEWLIB__ and
        __NEWLIB_MINOR__ macros.
2014-09-17 22:20:16 +00:00
Jeff Johnston ad9ed96b6b 2014-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
Thomas Uhle <thomas.uhle@eas.iis.fraunhofer.de>

        * libc/include/string.h: Correct guard for strnlen().
2014-09-16 19:59:01 +00:00
DJ Delorie dd48219ba9 * libc/include/math.h (frexpl): Remove parameter name. 2014-08-27 19:27:03 +00:00
Corinna Vinschen d5fd6aeb6d * libc/include/sys/signal.h: Declare sigaltstack for RTEMS only. 2014-08-18 18:18:10 +00:00
Jeff Johnston 6811cfb0b9 2014-08-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/config.h[__m68k__]: Set _READ_WRITE_RETURN_TYPE
        to _ssize_t to match underlying code in libgloss.
2014-08-18 16:43:42 +00:00
Joel Sherrill 81c17949f0 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/string.h: Improve language and OS standard guards.
2014-08-18 14:18:10 +00:00
Joel Sherrill 6042d39486 2014-08-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/signal.h: Add sigaltstack() support.
2014-08-18 14:03:35 +00:00
Jon TURNEY a4a96eb436 * libc/include/math.h: Also define M_PI etc. if _XOPEN_SOURCE is
defined appropriately.
2014-08-04 21:32:37 +00:00
Eric Blake ada456dcfe headers: properly decorate attributes
Found by:
find -name '*.h' |xargs grep -i 'attribute.*(([a-z]'

For an example of the type of bugs this causes, try compiling this valid
C11 program (it's valid because 'noreturn' is reserved for use in the
user namespace unless you include <stdnoreturn.h>):

$ cat foo.c
#define noreturn __attribute__((noreturn))
#include <stdlib.h>
$ gcc -c -o foo.o -Wall foo.c
In file included from /usr/include/stdlib.h:11:0,
                 from foo.c:2:
foo.c:1:18: error: expected ')' before '__attribute__'
 #define noreturn __attribute__((noreturn))
                  ^
/usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token
 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
                            ^

* libc/machine/spu/spu_timer_internal.h: Decorate attribute names
with __, for namespace safety.
* libc/machine/xscale/machine/profile.h: Likewise.
* libc/include/stdlib.h: Likewise.
* libc/include/_ansi.h: Likewise.
* libc/include/sys/unistd.h: Likewise.
* libc/sys/linux/linuxthreads/libc-symbols.h: Likewise.
* libc/sys/linux/linuxthreads/internals.h: Likewise.
* libc/sys/linux/machine/i386/weakalias.h: Likewise.
* libc/sys/linux/machine/i386/dl-procinfo.h: Likewise.
* libc/sys/linux/machine/i386/dl-machine.h: Likewise.
* libc/sys/linux/libc-symbols.h: Likewise.
* libc/sys/linux/iconv/gconv_charset.h: Likewise.
* libc/sys/linux/include/resolv.h: Likewise.
* libc/sys/linux/sys/unistd.h: Likewise.
* libc/sys/linux/dl/atomicity.h: Likewise.
* libc/sys/linux/dl/dynamic-link.h: Likewise.
* libc/sys/linux/dl/ldsodefs.h: Likewise.
2014-08-01 15:44:51 +00:00
Joel Sherrill e4994e769e 2014-07-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* libc/include/sys/time.h: Add prototype for adjtime() and
	wrap it and settimeofday() prototype with __BSD_VISIBLE.
2014-07-22 19:30:00 +00:00
Corinna Vinschen 81fd6210c0 * configure.host: Remove or16 and or32 targets and add or1k.
* libc/include/machine/ieeefp.h: Replace or32 with or1k.
	* libc/machine/configure.in: Add or1k subdirectory.
	* libc/machine/or1k/configure.in: New file.
	* libc/machine/or1k/Makefile.am: New file.
	* libc/machine/or1k/setjmp.S: New file.
2014-07-17 18:43:05 +00:00
Corinna Vinschen e2b585c12c * libc/include/sys/errno.h: Fix comments.
* libc/string/strerror.c: Fix documentation.
	(_strerror_r): Handle ENETRESET, EILSEQ, ENODATA, ECONNRESET,
	EADDRNOTAVAIL, EOVERFLOW.  Fix strings for EMFILE and EDOM.
2014-07-14 13:40:17 +00:00
Corinna Vinschen a265e7269f * libc/include/machine/ieeefp.h: Define _DOUBLE_IS_32BITS when double
options is not __RL78_64BIT_DOUBLES__.
2014-05-14 11:33:24 +00:00
Corinna Vinschen c57ccec649 * libc/include/stdint.h (WCHAR_MIN): Copy definition from wchar.h.
(WCHAR_MAX): Ditto.
	* libc/include/wchar.h (WCHAR_MIN): Add comment.
	(WCHAR_MAX): Ditto.
2014-05-12 17:02:11 +00:00
Corinna Vinschen 7bc7b551f5 * libc/include/stdio.h (tempnam): Declare as __BSD_VISIBLE or
__XSI_VISIBLE or if __POSIX_VISIBLE >= 200112.
2014-05-09 14:25:32 +00:00
Corinna Vinschen 783e4d51e2 * libc/include/stdio.h (fcloseall): Declare as __GNU_VISIBLE only.
(renameat): Drop explicit __CYGWIN__ dependency.
2014-05-09 08:42:39 +00:00
Corinna Vinschen 7e9b678464 * libc/include/stdio.h: Declare various C99 printf/scanf functions for
C++11, too.
2014-05-05 12:53:47 +00:00
Corinna Vinschen 0b3ad39364 * libc/include/stdlib.h (strtold): Define if _HAVE_LONG_DOUBLE is
defined.
	* libc/stdlib/strtold.c (strtold): Ditto.  Call strtod on systems
	with long double == double, _strtold otherwise.
2014-03-07 20:06:54 +00:00
Corinna Vinschen d5b32c8fad * libc/include/time.h (__TM_GMTOFF): Remove Cygwin-specific definition.
(__TM_ZONE): Ditto.
2014-03-05 12:49:40 +00:00
Corinna Vinschen 07be216aab * libc/include/time.h (__TM_GMTOFF): Define on Cygwin.
(__TM_ZONE): Ditto.
	(struct tm): Add __TM_GMTOFF and __TM_ZONE members if they are defined.
2014-03-05 12:43:12 +00:00
Corinna Vinschen 17ff765184 * libc/include/machine/_default_types.h: Define unsigned type using
signed type macros in case unsigned type macros are not available.
2014-03-04 08:05:39 +00:00
Corinna Vinschen ab7165e43b * libc/include/pwd.h: Include <sys/cdefs.h>.
* libc/include/grp.h: Ditto.
2014-02-09 20:02:17 +00:00
Corinna Vinschen ae691ac535 * libc/include/setjmp.h (longjmp): Fix copy/paste error. 2014-01-20 17:23:41 +00:00
Corinna Vinschen 5e66ab7852 * libc/include/setjmp.h (longjmp): Mark "noreturn" when building with
GCC.
2014-01-19 09:38:34 +00:00
Corinna Vinschen 93012a1d0d * libc/include/pwd.h: Use __foo_VISIBLE macros from sys/cdefs.h.
(setpassent): Declare.
2014-01-17 14:54:31 +00:00
Corinna Vinschen ad1a102dd6 * libc/include/sys/_default_fcntl.h (LOCK_SH): Define.
(LOCK_EX): Likewise.
	(LOCK_NB): Likewise.
	(LOCK_UN): Likewise.
	(flock): Declare.
2014-01-17 10:57:54 +00:00
Jeff Johnston 439f4e7a87 2014-01-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/_default_fcntl.h (AT_FDCWD): Define according
        to POSIX.
        (AT_EACCESS): Likewise.
        (AT_SYMLINK_NOFOLLOW): Likewise.
        (AT_SYMLINK_FOLLOW): Likewise.
        (AT_REMOVEDIR): Likewise.
        (openat): Declare according to POSIX.
        * libc/include/stdio.h (renameat): Likewise.
        * libc/include/sys/stat.h (fchmodat): Likewise.
        (fstatat): Likewise.
        (mkdirat): Likewise.
        (mkfifoat): Likewise.
        (mknodat): Likewise.
        (utimensat): Likewise.
        (futimens): Likewise.
        * libc/include/sys/unistd.h (faccessat): Likewise.
        (fchownat): Likewise.
        (linkat): Likewise.
        (readlinkat): Likewise.
        (symlinkat): Likewise.
        (unlinkat): Likewise.
2014-01-06 20:59:38 +00:00
Jeff Johnston b153931f18 2013-12-22 JF Bastien <jfb@chromium.org>
* libc/include/limits.h: Define LLONG_MIN, LLONG_MAX and ULLONG_MAX
        for C++11 too.
        * libc/include/stdlib.h: Define struct lldiv_t, _Exit, atoll, llabs
        and lldiv for C99 and C++11.  Move wcstold to wchar.h.
        * libc/include/wchar.h: Define WCHAR_MIN and WCHAR_MAX according to
        __WCHAR_UNSIGNED__ if it is provided, and correct the limit when
        unsigned (to 32 all-1 bits, not 31).  Define FILE as in stdio.h.
        Move wcstold from stdlib.h here.
2013-12-23 19:21:07 +00:00
Corinna Vinschen 9bd3bcc642 * libc/include/machine/_default_types.h: Move extern "C" after
header includes.  Include <sys/features.h> for
	__GNUC_PREREQ__().
	(__u?int.*_t): Define via GCC provided __U?INT.*_TYPE__ if
	available.
	(__intptr_t): Define.
	(__uintptr_t): Likewise.
	* libc/include/stdint.h: Include <machine/_default_types.h>
	instead of <_ansi.h>.
	(u?int.*_t): Define via __u?int.*_t provided by
	<machine/_default_types.h>.
	(u?int_fast.*_t): Define via GCC provided
	__U?INT_FAST.*_TYPE__ if available.
	(U?INT.*(MIN|MAX)): Define via GCC provided __U?INT.*(MIN|MAX)__
	if available.
	(U?INT.*_C): Define via GCC provided __U?INT.*_C if available.
	* libc/include/sys/cdefs.h: Use <machine/_default_types.h>
	instead of <stdint.h>.
	* libc/sys/rtems/sys/cpuset.h: Likewise.
	* libc/sys/rtems/machine/_types.h: Include <stdint.h> for
	FreeBSD compatibility.
2013-12-03 16:04:41 +00:00
Joel Sherrill a534dfd26e 2013-11-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/pthread.h (pthread_cleanup_push): Delete prototype
	and add macro of the same name.
	(pthread_cleanup_pop): Likewise.
	(_pthread_cleanup_context): Define.
	(_pthread_cleanup_push): Likewise.
	(_pthread_cleanup_pop): Likewise.
	(pthread_cleanup_push_defer_np): Define if _GNU_SOURCE is defined.
	(pthread_cleanup_pop_restore_np): Likewise.
	(_pthread_cleanup_push_defer): Likewise.
	(_pthread_cleanup_pop_restore): Likewise.
2013-11-29 23:35:34 +00:00
Joel Sherrill 62c28b76ac 2013-11-29 Jennifer Averett <jennifer.averett@oarcorp.com>
* libc/include/pthread.h (pthread_attr_setaffinity_np):
	Add pthread SMP affinity attributes to methods to RTEMS for
	compatibility with GNU/Linux.
	(pthread_attr_getaffinity_np): Likewise.
	(pthread_setaffinity_np): Likewise.
	(pthread_getaffinity_np): Likewise.
	(pthread_getattr_np): Add for GNU/Linux compatibility.
	* libc/include/sys/types.h: Add cpuset to pthread_attr_t for RTEMS.
	* libc/include/sys/cdefs.h (_GNU_SOURCE): Defining _GNU_SOURCE
	turns on all _XXX_VISBLE feature flags.
2013-11-29 23:14:57 +00:00
Jeff Johnston a00d2722b6 2013-11-26 Matheus Almeida <Matheus.Almeida@imgtec.com>
* libc/include/machine/setjmp.h: Add support for __mips_fpr being
        64 and treat it the same as if __mips64 is set.
        * libc/machine/mips/setjmp.S: Ditto, plus add checks for _MIPS_SIM
        being _ABIN32 and _ABI64.
2013-11-26 19:58:19 +00:00
Joel Sherrill 380c9f6165 2013-11-26 Julio Gutierrez <jgutleyva@gmail.com>
*libc/include/wchar.h: Add restrict keyword.
	*libc/stdio/fgetws.c (fgetws): ditto.
	*libc/stdio/fputws.c (fputws): ditto.
	*libc/stdio/fwprintf.c (fwprintf): ditto.
	*libc/stdio/fwscanf.c (fwscanf): ditto.
	*libc/stdio/swprintf.c (swprintf): ditto.
	*libc/stdio/swscanf.c (swscanf): ditto.
	*libc/stdio/vfwprintf.c (vfwprintf): ditto.
	*libc/stdio/vfwscanf.c (vfwscanf): ditto.
	*libc/stdio/vswprintf.c (vswprintf): ditto.
	*libc/stdio/vswscanf.c (vswscanf): ditto.
	*libc/stdio/vwprintf.c (vwprintf): ditto.
	*libc/stdio/vwscanf.c (vwscanf): ditto.
	*libc/stdio/wprintf.c (wprintf): ditto.
	*libc/stdio/wscanf.c (wscanf): ditto.
	*libc/stdlib/mbrlen.c (mbrlen): ditto.
	*libc/stdlib/mbrtowc.c (mbrtowc): ditto.
	*libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto.
	*libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto.
	*libc/stdlib/wcrtomb.c (wcrtomb): ditto.
	*libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto.
	*libc/stdlib/wcsrtombs.c (wcsrtombs): ditto.
	*libc/stdlib/wcstod.c (wcstod): ditto.
	*libc/stdlib/wcstol.c (wcstol): ditto.
	*libc/stdlib/wcstold.c (wcstold): ditto.
	*libc/stdlib/wcstoll.c (wcstoll): ditto.
	*libc/stdlib/wcstoul.c (wcstoul): ditto.
	*libc/stdlib/wcstoull.c (cstoull): ditto.
	*libc/string/wcpcpy.c (wcpcpy): ditto.
	*libc/string/wcpncpy.c (wcpncpy): ditto.
	*libc/string/wcscat.c (wcscat): ditto.
	*libc/string/wcscpy.c (wcscpy): ditto.
	*libc/string/wcsncat.c (wcsncat): ditto.
	*libc/string/wcsncpy.c (wcsncpy): ditto.
	*libc/string/wcsstr.c (wcsstr): ditto.
	*libc/string/wcstok.c (wcstok): ditto.
	*libc/string/wcsxfrm.c (wcsxfrm): ditto.
	*libc/string/wmemcpy.c (wmemcpy): ditto.
2013-11-26 17:21:01 +00:00