diff --git a/COPYING.NEWLIB b/COPYING.NEWLIB index e0b31f378..7242a44ac 100644 --- a/COPYING.NEWLIB +++ b/COPYING.NEWLIB @@ -760,9 +760,9 @@ SUCH DAMAGE. SUCH DAMAGE. -(35) - ARM Ltd (arm and thumb variant targets only) +(35) - Arm Ltd - Copyright (c) 2009-2015 ARM Ltd + Copyright (c) 2009-2018 Arm Ltd All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1140,7 +1140,7 @@ Copyright (c) 2017 SiFive Inc. All rights reserved. This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions -of the BSD License. This program is distributed in the hope that +of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/Makefile.in b/Makefile.in index 737e6029b..e42a69d8e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -55307,7 +55307,6 @@ all-build-m4: maybe-all-build-texinfo all-build-fixincludes: maybe-all-build-libiberty all-build-libcpp: maybe-all-build-libiberty configure-gcc: maybe-configure-intl - configure-stage1-gcc: maybe-configure-stage1-intl configure-stage2-gcc: maybe-configure-stage2-intl configure-stage3-gcc: maybe-configure-stage3-intl @@ -55317,7 +55316,6 @@ configure-stagefeedback-gcc: maybe-configure-stagefeedback-intl configure-stageautoprofile-gcc: maybe-configure-stageautoprofile-intl configure-stageautofeedback-gcc: maybe-configure-stageautofeedback-intl configure-gcc: maybe-all-gmp - configure-stage1-gcc: maybe-all-stage1-gmp configure-stage2-gcc: maybe-all-stage2-gmp configure-stage3-gcc: maybe-all-stage3-gmp @@ -55327,7 +55325,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-gmp configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gmp configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gmp configure-gcc: maybe-all-mpfr - configure-stage1-gcc: maybe-all-stage1-mpfr configure-stage2-gcc: maybe-all-stage2-mpfr configure-stage3-gcc: maybe-all-stage3-mpfr @@ -55337,7 +55334,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-mpfr configure-stageautoprofile-gcc: maybe-all-stageautoprofile-mpfr configure-stageautofeedback-gcc: maybe-all-stageautofeedback-mpfr configure-gcc: maybe-all-mpc - configure-stage1-gcc: maybe-all-stage1-mpc configure-stage2-gcc: maybe-all-stage2-mpc configure-stage3-gcc: maybe-all-stage3-mpc @@ -55347,7 +55343,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-mpc configure-stageautoprofile-gcc: maybe-all-stageautoprofile-mpc configure-stageautofeedback-gcc: maybe-all-stageautofeedback-mpc configure-gcc: maybe-all-isl - configure-stage1-gcc: maybe-all-stage1-isl configure-stage2-gcc: maybe-all-stage2-isl configure-stage3-gcc: maybe-all-stage3-isl @@ -55357,7 +55352,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-isl configure-stageautoprofile-gcc: maybe-all-stageautoprofile-isl configure-stageautofeedback-gcc: maybe-all-stageautofeedback-isl configure-gcc: maybe-all-lto-plugin - configure-stage1-gcc: maybe-all-stage1-lto-plugin configure-stage2-gcc: maybe-all-stage2-lto-plugin configure-stage3-gcc: maybe-all-stage3-lto-plugin @@ -55367,7 +55361,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin configure-stageautoprofile-gcc: maybe-all-stageautoprofile-lto-plugin configure-stageautofeedback-gcc: maybe-all-stageautofeedback-lto-plugin configure-gcc: maybe-all-binutils - configure-stage1-gcc: maybe-all-stage1-binutils configure-stage2-gcc: maybe-all-stage2-binutils configure-stage3-gcc: maybe-all-stage3-binutils @@ -55377,7 +55370,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-binutils configure-stageautoprofile-gcc: maybe-all-stageautoprofile-binutils configure-stageautofeedback-gcc: maybe-all-stageautofeedback-binutils configure-gcc: maybe-all-gas - configure-stage1-gcc: maybe-all-stage1-gas configure-stage2-gcc: maybe-all-stage2-gas configure-stage3-gcc: maybe-all-stage3-gas @@ -55387,7 +55379,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-gas configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gas configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gas configure-gcc: maybe-all-ld - configure-stage1-gcc: maybe-all-stage1-ld configure-stage2-gcc: maybe-all-stage2-ld configure-stage3-gcc: maybe-all-stage3-ld @@ -55397,7 +55388,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-ld configure-stageautoprofile-gcc: maybe-all-stageautoprofile-ld configure-stageautofeedback-gcc: maybe-all-stageautofeedback-ld configure-gcc: maybe-all-gold - configure-stage1-gcc: maybe-all-stage1-gold configure-stage2-gcc: maybe-all-stage2-gold configure-stage3-gcc: maybe-all-stage3-gold @@ -55407,7 +55397,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-gold configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gold configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gold configure-gcc: maybe-all-libelf - configure-stage1-gcc: maybe-all-stage1-libelf configure-stage2-gcc: maybe-all-stage2-libelf configure-stage3-gcc: maybe-all-stage3-libelf @@ -55417,7 +55406,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-libelf configure-stageautoprofile-gcc: maybe-all-stageautoprofile-libelf configure-stageautofeedback-gcc: maybe-all-stageautofeedback-libelf configure-gcc: maybe-all-libiconv - configure-stage1-gcc: maybe-all-stage1-libiconv configure-stage2-gcc: maybe-all-stage2-libiconv configure-stage3-gcc: maybe-all-stage3-libiconv @@ -55427,7 +55415,6 @@ configure-stagefeedback-gcc: maybe-all-stagefeedback-libiconv configure-stageautoprofile-gcc: maybe-all-stageautoprofile-libiconv configure-stageautofeedback-gcc: maybe-all-stageautofeedback-libiconv all-gcc: all-libiberty - all-stage1-gcc: all-stage1-libiberty all-stage2-gcc: all-stage2-libiberty all-stage3-gcc: all-stage3-libiberty @@ -55437,7 +55424,6 @@ all-stagefeedback-gcc: all-stagefeedback-libiberty all-stageautoprofile-gcc: all-stageautoprofile-libiberty all-stageautofeedback-gcc: all-stageautofeedback-libiberty all-gcc: maybe-all-intl - all-stage1-gcc: maybe-all-stage1-intl all-stage2-gcc: maybe-all-stage2-intl all-stage3-gcc: maybe-all-stage3-intl @@ -55447,7 +55433,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-intl all-stageautoprofile-gcc: maybe-all-stageautoprofile-intl all-stageautofeedback-gcc: maybe-all-stageautofeedback-intl all-gcc: maybe-all-mpfr - all-stage1-gcc: maybe-all-stage1-mpfr all-stage2-gcc: maybe-all-stage2-mpfr all-stage3-gcc: maybe-all-stage3-mpfr @@ -55457,7 +55442,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-mpfr all-stageautoprofile-gcc: maybe-all-stageautoprofile-mpfr all-stageautofeedback-gcc: maybe-all-stageautofeedback-mpfr all-gcc: maybe-all-mpc - all-stage1-gcc: maybe-all-stage1-mpc all-stage2-gcc: maybe-all-stage2-mpc all-stage3-gcc: maybe-all-stage3-mpc @@ -55467,7 +55451,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-mpc all-stageautoprofile-gcc: maybe-all-stageautoprofile-mpc all-stageautofeedback-gcc: maybe-all-stageautofeedback-mpc all-gcc: maybe-all-isl - all-stage1-gcc: maybe-all-stage1-isl all-stage2-gcc: maybe-all-stage2-isl all-stage3-gcc: maybe-all-stage3-isl @@ -55477,7 +55460,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-isl all-stageautoprofile-gcc: maybe-all-stageautoprofile-isl all-stageautofeedback-gcc: maybe-all-stageautofeedback-isl all-gcc: maybe-all-build-texinfo - all-stage1-gcc: maybe-all-build-texinfo all-stage2-gcc: maybe-all-build-texinfo all-stage3-gcc: maybe-all-build-texinfo @@ -55487,7 +55469,6 @@ all-stagefeedback-gcc: maybe-all-build-texinfo all-stageautoprofile-gcc: maybe-all-build-texinfo all-stageautofeedback-gcc: maybe-all-build-texinfo all-gcc: maybe-all-build-bison - all-stage1-gcc: maybe-all-build-bison all-stage2-gcc: maybe-all-build-bison all-stage3-gcc: maybe-all-build-bison @@ -55497,7 +55478,6 @@ all-stagefeedback-gcc: maybe-all-build-bison all-stageautoprofile-gcc: maybe-all-build-bison all-stageautofeedback-gcc: maybe-all-build-bison all-gcc: maybe-all-build-flex - all-stage1-gcc: maybe-all-build-flex all-stage2-gcc: maybe-all-build-flex all-stage3-gcc: maybe-all-build-flex @@ -55507,7 +55487,6 @@ all-stagefeedback-gcc: maybe-all-build-flex all-stageautoprofile-gcc: maybe-all-build-flex all-stageautofeedback-gcc: maybe-all-build-flex all-gcc: maybe-all-build-libiberty - all-stage1-gcc: maybe-all-build-libiberty all-stage2-gcc: maybe-all-build-libiberty all-stage3-gcc: maybe-all-build-libiberty @@ -55517,7 +55496,6 @@ all-stagefeedback-gcc: maybe-all-build-libiberty all-stageautoprofile-gcc: maybe-all-build-libiberty all-stageautofeedback-gcc: maybe-all-build-libiberty all-gcc: maybe-all-build-fixincludes - all-stage1-gcc: maybe-all-build-fixincludes all-stage2-gcc: maybe-all-build-fixincludes all-stage3-gcc: maybe-all-build-fixincludes @@ -55527,7 +55505,6 @@ all-stagefeedback-gcc: maybe-all-build-fixincludes all-stageautoprofile-gcc: maybe-all-build-fixincludes all-stageautofeedback-gcc: maybe-all-build-fixincludes all-gcc: maybe-all-build-libcpp - all-stage1-gcc: maybe-all-build-libcpp all-stage2-gcc: maybe-all-build-libcpp all-stage3-gcc: maybe-all-build-libcpp @@ -55537,7 +55514,6 @@ all-stagefeedback-gcc: maybe-all-build-libcpp all-stageautoprofile-gcc: maybe-all-build-libcpp all-stageautofeedback-gcc: maybe-all-build-libcpp all-gcc: maybe-all-zlib - all-stage1-gcc: maybe-all-stage1-zlib all-stage2-gcc: maybe-all-stage2-zlib all-stage3-gcc: maybe-all-stage3-zlib @@ -55547,7 +55523,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-zlib all-stageautoprofile-gcc: maybe-all-stageautoprofile-zlib all-stageautofeedback-gcc: maybe-all-stageautofeedback-zlib all-gcc: all-libbacktrace - all-stage1-gcc: all-stage1-libbacktrace all-stage2-gcc: all-stage2-libbacktrace all-stage3-gcc: all-stage3-libbacktrace @@ -55557,7 +55532,6 @@ all-stagefeedback-gcc: all-stagefeedback-libbacktrace all-stageautoprofile-gcc: all-stageautoprofile-libbacktrace all-stageautofeedback-gcc: all-stageautofeedback-libbacktrace all-gcc: all-libcpp - all-stage1-gcc: all-stage1-libcpp all-stage2-gcc: all-stage2-libcpp all-stage3-gcc: all-stage3-libcpp @@ -55567,7 +55541,6 @@ all-stagefeedback-gcc: all-stagefeedback-libcpp all-stageautoprofile-gcc: all-stageautoprofile-libcpp all-stageautofeedback-gcc: all-stageautofeedback-libcpp all-gcc: all-libdecnumber - all-stage1-gcc: all-stage1-libdecnumber all-stage2-gcc: all-stage2-libdecnumber all-stage3-gcc: all-stage3-libdecnumber @@ -55577,7 +55550,6 @@ all-stagefeedback-gcc: all-stagefeedback-libdecnumber all-stageautoprofile-gcc: all-stageautoprofile-libdecnumber all-stageautofeedback-gcc: all-stageautofeedback-libdecnumber all-gcc: maybe-all-libiberty - all-stage1-gcc: maybe-all-stage1-libiberty all-stage2-gcc: maybe-all-stage2-libiberty all-stage3-gcc: maybe-all-stage3-libiberty @@ -55587,7 +55559,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-libiberty all-stageautoprofile-gcc: maybe-all-stageautoprofile-libiberty all-stageautofeedback-gcc: maybe-all-stageautofeedback-libiberty all-gcc: maybe-all-fixincludes - all-stage1-gcc: maybe-all-stage1-fixincludes all-stage2-gcc: maybe-all-stage2-fixincludes all-stage3-gcc: maybe-all-stage3-fixincludes @@ -55597,7 +55568,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-fixincludes all-stageautoprofile-gcc: maybe-all-stageautoprofile-fixincludes all-stageautofeedback-gcc: maybe-all-stageautofeedback-fixincludes all-gcc: maybe-all-lto-plugin - all-stage1-gcc: maybe-all-stage1-lto-plugin all-stage2-gcc: maybe-all-stage2-lto-plugin all-stage3-gcc: maybe-all-stage3-lto-plugin @@ -55607,7 +55577,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin all-stageautoprofile-gcc: maybe-all-stageautoprofile-lto-plugin all-stageautofeedback-gcc: maybe-all-stageautofeedback-lto-plugin all-gcc: maybe-all-libiconv - all-stage1-gcc: maybe-all-stage1-libiconv all-stage2-gcc: maybe-all-stage2-libiconv all-stage3-gcc: maybe-all-stage3-libiconv @@ -55617,7 +55586,6 @@ all-stagefeedback-gcc: maybe-all-stagefeedback-libiconv all-stageautoprofile-gcc: maybe-all-stageautoprofile-libiconv all-stageautofeedback-gcc: maybe-all-stageautofeedback-libiconv info-gcc: maybe-all-build-libiberty - info-stage1-gcc: maybe-all-build-libiberty info-stage2-gcc: maybe-all-build-libiberty info-stage3-gcc: maybe-all-build-libiberty @@ -55627,7 +55595,6 @@ info-stagefeedback-gcc: maybe-all-build-libiberty info-stageautoprofile-gcc: maybe-all-build-libiberty info-stageautofeedback-gcc: maybe-all-build-libiberty dvi-gcc: maybe-all-build-libiberty - dvi-stage1-gcc: maybe-all-build-libiberty dvi-stage2-gcc: maybe-all-build-libiberty dvi-stage3-gcc: maybe-all-build-libiberty @@ -55637,7 +55604,6 @@ dvi-stagefeedback-gcc: maybe-all-build-libiberty dvi-stageautoprofile-gcc: maybe-all-build-libiberty dvi-stageautofeedback-gcc: maybe-all-build-libiberty pdf-gcc: maybe-all-build-libiberty - pdf-stage1-gcc: maybe-all-build-libiberty pdf-stage2-gcc: maybe-all-build-libiberty pdf-stage3-gcc: maybe-all-build-libiberty @@ -55647,7 +55613,6 @@ pdf-stagefeedback-gcc: maybe-all-build-libiberty pdf-stageautoprofile-gcc: maybe-all-build-libiberty pdf-stageautofeedback-gcc: maybe-all-build-libiberty html-gcc: maybe-all-build-libiberty - html-stage1-gcc: maybe-all-build-libiberty html-stage2-gcc: maybe-all-build-libiberty html-stage3-gcc: maybe-all-build-libiberty @@ -55661,7 +55626,6 @@ install-gcc: maybe-install-lto-plugin install-strip-gcc: maybe-install-strip-fixincludes install-strip-gcc: maybe-install-strip-lto-plugin configure-libcpp: configure-libiberty - configure-stage1-libcpp: configure-stage1-libiberty configure-stage2-libcpp: configure-stage2-libiberty configure-stage3-libcpp: configure-stage3-libiberty @@ -55671,7 +55635,6 @@ configure-stagefeedback-libcpp: configure-stagefeedback-libiberty configure-stageautoprofile-libcpp: configure-stageautoprofile-libiberty configure-stageautofeedback-libcpp: configure-stageautofeedback-libiberty configure-libcpp: maybe-configure-intl - configure-stage1-libcpp: maybe-configure-stage1-intl configure-stage2-libcpp: maybe-configure-stage2-intl configure-stage3-libcpp: maybe-configure-stage3-intl @@ -55681,7 +55644,6 @@ configure-stagefeedback-libcpp: maybe-configure-stagefeedback-intl configure-stageautoprofile-libcpp: maybe-configure-stageautoprofile-intl configure-stageautofeedback-libcpp: maybe-configure-stageautofeedback-intl configure-libcpp: maybe-all-libiconv - configure-stage1-libcpp: maybe-all-stage1-libiconv configure-stage2-libcpp: maybe-all-stage2-libiconv configure-stage3-libcpp: maybe-all-stage3-libiconv @@ -55691,7 +55653,6 @@ configure-stagefeedback-libcpp: maybe-all-stagefeedback-libiconv configure-stageautoprofile-libcpp: maybe-all-stageautoprofile-libiconv configure-stageautofeedback-libcpp: maybe-all-stageautofeedback-libiconv all-libcpp: all-libiberty - all-stage1-libcpp: all-stage1-libiberty all-stage2-libcpp: all-stage2-libiberty all-stage3-libcpp: all-stage3-libiberty @@ -55701,7 +55662,6 @@ all-stagefeedback-libcpp: all-stagefeedback-libiberty all-stageautoprofile-libcpp: all-stageautoprofile-libiberty all-stageautofeedback-libcpp: all-stageautofeedback-libiberty all-libcpp: maybe-all-intl - all-stage1-libcpp: maybe-all-stage1-intl all-stage2-libcpp: maybe-all-stage2-intl all-stage3-libcpp: maybe-all-stage3-intl @@ -55711,7 +55671,6 @@ all-stagefeedback-libcpp: maybe-all-stagefeedback-intl all-stageautoprofile-libcpp: maybe-all-stageautoprofile-intl all-stageautofeedback-libcpp: maybe-all-stageautofeedback-intl all-libcpp: maybe-all-libiconv - all-stage1-libcpp: maybe-all-stage1-libiconv all-stage2-libcpp: maybe-all-stage2-libiconv all-stage3-libcpp: maybe-all-stage3-libiconv @@ -55721,7 +55680,6 @@ all-stagefeedback-libcpp: maybe-all-stagefeedback-libiconv all-stageautoprofile-libcpp: maybe-all-stageautoprofile-libiconv all-stageautofeedback-libcpp: maybe-all-stageautofeedback-libiconv all-fixincludes: maybe-all-libiberty - all-stage1-fixincludes: maybe-all-stage1-libiberty all-stage2-fixincludes: maybe-all-stage2-libiberty all-stage3-fixincludes: maybe-all-stage3-libiberty @@ -55731,9 +55689,7 @@ all-stagefeedback-fixincludes: maybe-all-stagefeedback-libiberty all-stageautoprofile-fixincludes: maybe-all-stageautoprofile-libiberty all-stageautofeedback-fixincludes: maybe-all-stageautofeedback-libiberty all-gnattools: maybe-all-target-libada -all-gnattools: maybe-all-target-libstdc++-v3 all-lto-plugin: maybe-all-libiberty - all-stage1-lto-plugin: maybe-all-stage1-libiberty all-stage2-lto-plugin: maybe-all-stage2-libiberty all-stage3-lto-plugin: maybe-all-stage3-libiberty @@ -55743,7 +55699,6 @@ all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty all-stageautoprofile-lto-plugin: maybe-all-stageautoprofile-libiberty all-stageautofeedback-lto-plugin: maybe-all-stageautofeedback-libiberty all-lto-plugin: maybe-all-libiberty-linker-plugin - all-stage1-lto-plugin: maybe-all-stage1-libiberty-linker-plugin all-stage2-lto-plugin: maybe-all-stage2-libiberty-linker-plugin all-stage3-lto-plugin: maybe-all-stage3-libiberty-linker-plugin @@ -55752,12 +55707,8 @@ all-stageprofile-lto-plugin: maybe-all-stageprofile-libiberty-linker-plugin all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty-linker-plugin all-stageautoprofile-lto-plugin: maybe-all-stageautoprofile-libiberty-linker-plugin all-stageautofeedback-lto-plugin: maybe-all-stageautofeedback-libiberty-linker-plugin -configure-libcc1: maybe-configure-gcc -all-libcc1: maybe-all-gcc all-gotools: maybe-all-target-libgo -all-utils: maybe-all-libiberty configure-intl: maybe-all-libiconv - configure-stage1-intl: maybe-all-stage1-libiconv configure-stage2-intl: maybe-all-stage2-libiconv configure-stage3-intl: maybe-all-stage3-libiconv @@ -55767,7 +55718,6 @@ configure-stagefeedback-intl: maybe-all-stagefeedback-libiconv configure-stageautoprofile-intl: maybe-all-stageautoprofile-libiconv configure-stageautofeedback-intl: maybe-all-stageautofeedback-libiconv configure-mpfr: maybe-all-gmp - configure-stage1-mpfr: maybe-all-stage1-gmp configure-stage2-mpfr: maybe-all-stage2-gmp configure-stage3-mpfr: maybe-all-stage3-gmp @@ -55777,7 +55727,6 @@ configure-stagefeedback-mpfr: maybe-all-stagefeedback-gmp configure-stageautoprofile-mpfr: maybe-all-stageautoprofile-gmp configure-stageautofeedback-mpfr: maybe-all-stageautofeedback-gmp configure-mpc: maybe-all-mpfr - configure-stage1-mpc: maybe-all-stage1-mpfr configure-stage2-mpc: maybe-all-stage2-mpfr configure-stage3-mpc: maybe-all-stage3-mpfr @@ -55787,7 +55736,6 @@ configure-stagefeedback-mpc: maybe-all-stagefeedback-mpfr configure-stageautoprofile-mpc: maybe-all-stageautoprofile-mpfr configure-stageautofeedback-mpc: maybe-all-stageautofeedback-mpfr configure-isl: maybe-all-gmp - configure-stage1-isl: maybe-all-stage1-gmp configure-stage2-isl: maybe-all-stage2-gmp configure-stage3-isl: maybe-all-stage3-gmp @@ -55797,7 +55745,6 @@ configure-stagefeedback-isl: maybe-all-stagefeedback-gmp configure-stageautoprofile-isl: maybe-all-stageautoprofile-gmp configure-stageautofeedback-isl: maybe-all-stageautofeedback-gmp all-intl: maybe-all-libiconv - all-stage1-intl: maybe-all-stage1-libiconv all-stage2-intl: maybe-all-stage2-libiconv all-stage3-intl: maybe-all-stage3-libiconv @@ -55806,17 +55753,10 @@ all-stageprofile-intl: maybe-all-stageprofile-libiconv all-stagefeedback-intl: maybe-all-stagefeedback-libiconv all-stageautoprofile-intl: maybe-all-stageautoprofile-libiconv all-stageautofeedback-intl: maybe-all-stageautofeedback-libiconv -configure-gdb: maybe-all-intl configure-gdb: maybe-configure-sim -configure-gdb: maybe-all-bfd -configure-gdb: maybe-all-libiconv -all-gdb: maybe-all-libiberty -all-gdb: maybe-all-libiconv -all-gdb: maybe-all-opcodes all-gdb: maybe-all-readline all-gdb: maybe-all-build-bison all-gdb: maybe-all-sim -all-gdb: maybe-all-libdecnumber all-gdb: maybe-all-libtermcap configure-libgui: maybe-configure-tcl configure-libgui: maybe-configure-tk @@ -55824,7 +55764,6 @@ all-libgui: maybe-all-tcl all-libgui: maybe-all-tk all-libgui: maybe-all-itcl configure-bfd: configure-libiberty - configure-stage1-bfd: configure-stage1-libiberty configure-stage2-bfd: configure-stage2-libiberty configure-stage3-bfd: configure-stage3-libiberty @@ -55834,7 +55773,6 @@ configure-stagefeedback-bfd: configure-stagefeedback-libiberty configure-stageautoprofile-bfd: configure-stageautoprofile-libiberty configure-stageautofeedback-bfd: configure-stageautofeedback-libiberty configure-bfd: maybe-configure-intl - configure-stage1-bfd: maybe-configure-stage1-intl configure-stage2-bfd: maybe-configure-stage2-intl configure-stage3-bfd: maybe-configure-stage3-intl @@ -55844,7 +55782,6 @@ configure-stagefeedback-bfd: maybe-configure-stagefeedback-intl configure-stageautoprofile-bfd: maybe-configure-stageautoprofile-intl configure-stageautofeedback-bfd: maybe-configure-stageautofeedback-intl all-bfd: maybe-all-libiberty - all-stage1-bfd: maybe-all-stage1-libiberty all-stage2-bfd: maybe-all-stage2-libiberty all-stage3-bfd: maybe-all-stage3-libiberty @@ -55854,7 +55791,6 @@ all-stagefeedback-bfd: maybe-all-stagefeedback-libiberty all-stageautoprofile-bfd: maybe-all-stageautoprofile-libiberty all-stageautofeedback-bfd: maybe-all-stageautofeedback-libiberty all-bfd: maybe-all-intl - all-stage1-bfd: maybe-all-stage1-intl all-stage2-bfd: maybe-all-stage2-intl all-stage3-bfd: maybe-all-stage3-intl @@ -55864,7 +55800,6 @@ all-stagefeedback-bfd: maybe-all-stagefeedback-intl all-stageautoprofile-bfd: maybe-all-stageautoprofile-intl all-stageautofeedback-bfd: maybe-all-stageautofeedback-intl all-bfd: maybe-all-zlib - all-stage1-bfd: maybe-all-stage1-zlib all-stage2-bfd: maybe-all-stage2-zlib all-stage3-bfd: maybe-all-stage3-zlib @@ -55874,7 +55809,6 @@ all-stagefeedback-bfd: maybe-all-stagefeedback-zlib all-stageautoprofile-bfd: maybe-all-stageautoprofile-zlib all-stageautofeedback-bfd: maybe-all-stageautofeedback-zlib configure-opcodes: configure-libiberty - configure-stage1-opcodes: configure-stage1-libiberty configure-stage2-opcodes: configure-stage2-libiberty configure-stage3-opcodes: configure-stage3-libiberty @@ -55884,7 +55818,6 @@ configure-stagefeedback-opcodes: configure-stagefeedback-libiberty configure-stageautoprofile-opcodes: configure-stageautoprofile-libiberty configure-stageautofeedback-opcodes: configure-stageautofeedback-libiberty all-opcodes: maybe-all-libiberty - all-stage1-opcodes: maybe-all-stage1-libiberty all-stage2-opcodes: maybe-all-stage2-libiberty all-stage3-opcodes: maybe-all-stage3-libiberty @@ -55894,7 +55827,6 @@ all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty all-stageautoprofile-opcodes: maybe-all-stageautoprofile-libiberty all-stageautofeedback-opcodes: maybe-all-stageautofeedback-libiberty configure-binutils: maybe-configure-intl - configure-stage1-binutils: maybe-configure-stage1-intl configure-stage2-binutils: maybe-configure-stage2-intl configure-stage3-binutils: maybe-configure-stage3-intl @@ -55904,7 +55836,6 @@ configure-stagefeedback-binutils: maybe-configure-stagefeedback-intl configure-stageautoprofile-binutils: maybe-configure-stageautoprofile-intl configure-stageautofeedback-binutils: maybe-configure-stageautofeedback-intl all-binutils: maybe-all-libiberty - all-stage1-binutils: maybe-all-stage1-libiberty all-stage2-binutils: maybe-all-stage2-libiberty all-stage3-binutils: maybe-all-stage3-libiberty @@ -55914,7 +55845,6 @@ all-stagefeedback-binutils: maybe-all-stagefeedback-libiberty all-stageautoprofile-binutils: maybe-all-stageautoprofile-libiberty all-stageautofeedback-binutils: maybe-all-stageautofeedback-libiberty all-binutils: maybe-all-opcodes - all-stage1-binutils: maybe-all-stage1-opcodes all-stage2-binutils: maybe-all-stage2-opcodes all-stage3-binutils: maybe-all-stage3-opcodes @@ -55924,7 +55854,6 @@ all-stagefeedback-binutils: maybe-all-stagefeedback-opcodes all-stageautoprofile-binutils: maybe-all-stageautoprofile-opcodes all-stageautofeedback-binutils: maybe-all-stageautofeedback-opcodes all-binutils: maybe-all-bfd - all-stage1-binutils: maybe-all-stage1-bfd all-stage2-binutils: maybe-all-stage2-bfd all-stage3-binutils: maybe-all-stage3-bfd @@ -55934,7 +55863,6 @@ all-stagefeedback-binutils: maybe-all-stagefeedback-bfd all-stageautoprofile-binutils: maybe-all-stageautoprofile-bfd all-stageautofeedback-binutils: maybe-all-stageautofeedback-bfd all-binutils: maybe-all-build-flex - all-stage1-binutils: maybe-all-build-flex all-stage2-binutils: maybe-all-build-flex all-stage3-binutils: maybe-all-build-flex @@ -55944,7 +55872,6 @@ all-stagefeedback-binutils: maybe-all-build-flex all-stageautoprofile-binutils: maybe-all-build-flex all-stageautofeedback-binutils: maybe-all-build-flex all-binutils: maybe-all-build-bison - all-stage1-binutils: maybe-all-build-bison all-stage2-binutils: maybe-all-build-bison all-stage3-binutils: maybe-all-build-bison @@ -55954,7 +55881,6 @@ all-stagefeedback-binutils: maybe-all-build-bison all-stageautoprofile-binutils: maybe-all-build-bison all-stageautofeedback-binutils: maybe-all-build-bison all-binutils: maybe-all-intl - all-stage1-binutils: maybe-all-stage1-intl all-stage2-binutils: maybe-all-stage2-intl all-stage3-binutils: maybe-all-stage3-intl @@ -55964,7 +55890,6 @@ all-stagefeedback-binutils: maybe-all-stagefeedback-intl all-stageautoprofile-binutils: maybe-all-stageautoprofile-intl all-stageautofeedback-binutils: maybe-all-stageautofeedback-intl all-binutils: maybe-all-gas - all-stage1-binutils: maybe-all-stage1-gas all-stage2-binutils: maybe-all-stage2-gas all-stage3-binutils: maybe-all-stage3-gas @@ -55978,7 +55903,6 @@ install-strip-binutils: maybe-install-strip-opcodes install-opcodes: maybe-install-bfd install-strip-opcodes: maybe-install-strip-bfd configure-gas: maybe-configure-intl - configure-stage1-gas: maybe-configure-stage1-intl configure-stage2-gas: maybe-configure-stage2-intl configure-stage3-gas: maybe-configure-stage3-intl @@ -55988,7 +55912,6 @@ configure-stagefeedback-gas: maybe-configure-stagefeedback-intl configure-stageautoprofile-gas: maybe-configure-stageautoprofile-intl configure-stageautofeedback-gas: maybe-configure-stageautofeedback-intl all-gas: maybe-all-libiberty - all-stage1-gas: maybe-all-stage1-libiberty all-stage2-gas: maybe-all-stage2-libiberty all-stage3-gas: maybe-all-stage3-libiberty @@ -55998,7 +55921,6 @@ all-stagefeedback-gas: maybe-all-stagefeedback-libiberty all-stageautoprofile-gas: maybe-all-stageautoprofile-libiberty all-stageautofeedback-gas: maybe-all-stageautofeedback-libiberty all-gas: maybe-all-opcodes - all-stage1-gas: maybe-all-stage1-opcodes all-stage2-gas: maybe-all-stage2-opcodes all-stage3-gas: maybe-all-stage3-opcodes @@ -56008,7 +55930,6 @@ all-stagefeedback-gas: maybe-all-stagefeedback-opcodes all-stageautoprofile-gas: maybe-all-stageautoprofile-opcodes all-stageautofeedback-gas: maybe-all-stageautofeedback-opcodes all-gas: maybe-all-bfd - all-stage1-gas: maybe-all-stage1-bfd all-stage2-gas: maybe-all-stage2-bfd all-stage3-gas: maybe-all-stage3-bfd @@ -56018,7 +55939,6 @@ all-stagefeedback-gas: maybe-all-stagefeedback-bfd all-stageautoprofile-gas: maybe-all-stageautoprofile-bfd all-stageautofeedback-gas: maybe-all-stageautofeedback-bfd all-gas: maybe-all-intl - all-stage1-gas: maybe-all-stage1-intl all-stage2-gas: maybe-all-stage2-intl all-stage3-gas: maybe-all-stage3-intl @@ -56027,14 +55947,7 @@ all-stageprofile-gas: maybe-all-stageprofile-intl all-stagefeedback-gas: maybe-all-stagefeedback-intl all-stageautoprofile-gas: maybe-all-stageautoprofile-intl all-stageautofeedback-gas: maybe-all-stageautofeedback-intl -configure-gprof: maybe-configure-intl -all-gprof: maybe-all-libiberty -all-gprof: maybe-all-bfd -all-gprof: maybe-all-opcodes -all-gprof: maybe-all-intl -all-gprof: maybe-all-gas configure-ld: maybe-configure-intl - configure-stage1-ld: maybe-configure-stage1-intl configure-stage2-ld: maybe-configure-stage2-intl configure-stage3-ld: maybe-configure-stage3-intl @@ -56044,7 +55957,6 @@ configure-stagefeedback-ld: maybe-configure-stagefeedback-intl configure-stageautoprofile-ld: maybe-configure-stageautoprofile-intl configure-stageautofeedback-ld: maybe-configure-stageautofeedback-intl all-ld: maybe-all-libiberty - all-stage1-ld: maybe-all-stage1-libiberty all-stage2-ld: maybe-all-stage2-libiberty all-stage3-ld: maybe-all-stage3-libiberty @@ -56054,7 +55966,6 @@ all-stagefeedback-ld: maybe-all-stagefeedback-libiberty all-stageautoprofile-ld: maybe-all-stageautoprofile-libiberty all-stageautofeedback-ld: maybe-all-stageautofeedback-libiberty all-ld: maybe-all-bfd - all-stage1-ld: maybe-all-stage1-bfd all-stage2-ld: maybe-all-stage2-bfd all-stage3-ld: maybe-all-stage3-bfd @@ -56064,7 +55975,6 @@ all-stagefeedback-ld: maybe-all-stagefeedback-bfd all-stageautoprofile-ld: maybe-all-stageautoprofile-bfd all-stageautofeedback-ld: maybe-all-stageautofeedback-bfd all-ld: maybe-all-opcodes - all-stage1-ld: maybe-all-stage1-opcodes all-stage2-ld: maybe-all-stage2-opcodes all-stage3-ld: maybe-all-stage3-opcodes @@ -56074,7 +55984,6 @@ all-stagefeedback-ld: maybe-all-stagefeedback-opcodes all-stageautoprofile-ld: maybe-all-stageautoprofile-opcodes all-stageautofeedback-ld: maybe-all-stageautofeedback-opcodes all-ld: maybe-all-build-bison - all-stage1-ld: maybe-all-build-bison all-stage2-ld: maybe-all-build-bison all-stage3-ld: maybe-all-build-bison @@ -56084,7 +55993,6 @@ all-stagefeedback-ld: maybe-all-build-bison all-stageautoprofile-ld: maybe-all-build-bison all-stageautofeedback-ld: maybe-all-build-bison all-ld: maybe-all-build-flex - all-stage1-ld: maybe-all-build-flex all-stage2-ld: maybe-all-build-flex all-stage3-ld: maybe-all-build-flex @@ -56094,7 +56002,6 @@ all-stagefeedback-ld: maybe-all-build-flex all-stageautoprofile-ld: maybe-all-build-flex all-stageautofeedback-ld: maybe-all-build-flex all-ld: maybe-all-intl - all-stage1-ld: maybe-all-stage1-intl all-stage2-ld: maybe-all-stage2-intl all-stage3-ld: maybe-all-stage3-intl @@ -56104,7 +56011,6 @@ all-stagefeedback-ld: maybe-all-stagefeedback-intl all-stageautoprofile-ld: maybe-all-stageautoprofile-intl all-stageautofeedback-ld: maybe-all-stageautofeedback-intl all-ld: maybe-all-gas - all-stage1-ld: maybe-all-stage1-gas all-stage2-ld: maybe-all-stage2-gas all-stage3-ld: maybe-all-stage3-gas @@ -56114,7 +56020,6 @@ all-stagefeedback-ld: maybe-all-stagefeedback-gas all-stageautoprofile-ld: maybe-all-stageautoprofile-gas all-stageautofeedback-ld: maybe-all-stageautofeedback-gas all-ld: maybe-all-binutils - all-stage1-ld: maybe-all-stage1-binutils all-stage2-ld: maybe-all-stage2-binutils all-stage3-ld: maybe-all-stage3-binutils @@ -56126,7 +56031,6 @@ all-stageautofeedback-ld: maybe-all-stageautofeedback-binutils install-ld: maybe-install-gold install-strip-ld: maybe-install-strip-gold configure-gold: maybe-configure-intl - configure-stage1-gold: maybe-configure-stage1-intl configure-stage2-gold: maybe-configure-stage2-intl configure-stage3-gold: maybe-configure-stage3-intl @@ -56136,7 +56040,6 @@ configure-stagefeedback-gold: maybe-configure-stagefeedback-intl configure-stageautoprofile-gold: maybe-configure-stageautoprofile-intl configure-stageautofeedback-gold: maybe-configure-stageautofeedback-intl all-gold: maybe-all-libiberty - all-stage1-gold: maybe-all-stage1-libiberty all-stage2-gold: maybe-all-stage2-libiberty all-stage3-gold: maybe-all-stage3-libiberty @@ -56146,7 +56049,6 @@ all-stagefeedback-gold: maybe-all-stagefeedback-libiberty all-stageautoprofile-gold: maybe-all-stageautoprofile-libiberty all-stageautofeedback-gold: maybe-all-stageautofeedback-libiberty all-gold: maybe-all-intl - all-stage1-gold: maybe-all-stage1-intl all-stage2-gold: maybe-all-stage2-intl all-stage3-gold: maybe-all-stage3-intl @@ -56156,7 +56058,6 @@ all-stagefeedback-gold: maybe-all-stagefeedback-intl all-stageautoprofile-gold: maybe-all-stageautoprofile-intl all-stageautofeedback-gold: maybe-all-stageautofeedback-intl all-gold: maybe-all-bfd - all-stage1-gold: maybe-all-stage1-bfd all-stage2-gold: maybe-all-stage2-bfd all-stage3-gold: maybe-all-stage3-bfd @@ -56166,7 +56067,6 @@ all-stagefeedback-gold: maybe-all-stagefeedback-bfd all-stageautoprofile-gold: maybe-all-stageautoprofile-bfd all-stageautofeedback-gold: maybe-all-stageautofeedback-bfd all-gold: maybe-all-build-bison - all-stage1-gold: maybe-all-build-bison all-stage2-gold: maybe-all-build-bison all-stage3-gold: maybe-all-build-bison @@ -56176,7 +56076,6 @@ all-stagefeedback-gold: maybe-all-build-bison all-stageautoprofile-gold: maybe-all-build-bison all-stageautofeedback-gold: maybe-all-build-bison all-gold: maybe-all-gas - all-stage1-gold: maybe-all-stage1-gas all-stage2-gold: maybe-all-stage2-gas all-stage3-gold: maybe-all-stage3-gas @@ -56186,7 +56085,6 @@ all-stagefeedback-gold: maybe-all-stagefeedback-gas all-stageautoprofile-gold: maybe-all-stageautoprofile-gas all-stageautofeedback-gold: maybe-all-stageautofeedback-gas check-gold: maybe-all-binutils - check-stage1-gold: maybe-all-stage1-binutils check-stage2-gold: maybe-all-stage2-binutils check-stage3-gold: maybe-all-stage3-binutils @@ -56196,7 +56094,6 @@ check-stagefeedback-gold: maybe-all-stagefeedback-binutils check-stageautoprofile-gold: maybe-all-stageautoprofile-binutils check-stageautofeedback-gold: maybe-all-stageautofeedback-binutils check-gold: maybe-all-gas - check-stage1-gold: maybe-all-stage1-gas check-stage2-gold: maybe-all-stage2-gas check-stage3-gold: maybe-all-stage3-gas @@ -56206,7 +56103,6 @@ check-stagefeedback-gold: maybe-all-stagefeedback-gas check-stageautoprofile-gold: maybe-all-stageautoprofile-gas check-stageautofeedback-gold: maybe-all-stageautofeedback-gas configure-opcodes: maybe-configure-intl - configure-stage1-opcodes: maybe-configure-stage1-intl configure-stage2-opcodes: maybe-configure-stage2-intl configure-stage3-opcodes: maybe-configure-stage3-intl @@ -56216,7 +56112,6 @@ configure-stagefeedback-opcodes: maybe-configure-stagefeedback-intl configure-stageautoprofile-opcodes: maybe-configure-stageautoprofile-intl configure-stageautofeedback-opcodes: maybe-configure-stageautofeedback-intl all-opcodes: maybe-all-bfd - all-stage1-opcodes: maybe-all-stage1-bfd all-stage2-opcodes: maybe-all-stage2-bfd all-stage3-opcodes: maybe-all-stage3-bfd @@ -56226,7 +56121,6 @@ all-stagefeedback-opcodes: maybe-all-stagefeedback-bfd all-stageautoprofile-opcodes: maybe-all-stageautoprofile-bfd all-stageautofeedback-opcodes: maybe-all-stageautofeedback-bfd all-opcodes: maybe-all-libiberty - all-stage1-opcodes: maybe-all-stage1-libiberty all-stage2-opcodes: maybe-all-stage2-libiberty all-stage3-opcodes: maybe-all-stage3-libiberty @@ -56236,7 +56130,6 @@ all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty all-stageautoprofile-opcodes: maybe-all-stageautoprofile-libiberty all-stageautofeedback-opcodes: maybe-all-stageautofeedback-libiberty all-opcodes: maybe-all-intl - all-stage1-opcodes: maybe-all-stage1-intl all-stage2-opcodes: maybe-all-stage2-intl all-stage3-opcodes: maybe-all-stage3-intl @@ -56260,38 +56153,23 @@ install-itcl: maybe-install-tcl install-strip-itcl: maybe-install-strip-tcl configure-tk: maybe-configure-tcl all-tk: maybe-all-tcl -all-sid: maybe-all-libiberty -all-sid: maybe-all-bfd -all-sid: maybe-all-opcodes all-sid: maybe-all-tcl all-sid: maybe-all-tk install-sid: maybe-install-tcl install-strip-sid: maybe-install-strip-tcl install-sid: maybe-install-tk install-strip-sid: maybe-install-strip-tk -configure-sim: maybe-configure-intl -all-sim: maybe-all-intl -all-sim: maybe-all-libiberty -all-sim: maybe-all-bfd -all-sim: maybe-all-opcodes all-sim: maybe-all-readline all-sim: maybe-configure-gdb -all-fastjar: maybe-all-zlib all-fastjar: maybe-all-build-texinfo -all-fastjar: maybe-all-libiberty -all-bison: maybe-all-intl all-bison: maybe-all-build-texinfo all-flex: maybe-all-build-bison -all-flex: maybe-all-intl all-flex: maybe-all-m4 all-flex: maybe-all-build-texinfo -all-m4: maybe-all-intl all-m4: maybe-all-build-texinfo -configure-target-boehm-gc: maybe-all-target-libstdc++-v3 configure-target-fastjar: maybe-configure-target-zlib all-target-fastjar: maybe-all-target-zlib configure-target-libgo: maybe-configure-target-libffi -configure-target-libgo: maybe-all-target-libstdc++-v3 all-target-libgo: maybe-all-target-libbacktrace all-target-libgo: maybe-all-target-libffi all-target-libgo: maybe-all-target-libatomic @@ -56305,7 +56183,6 @@ all-target-libjava: maybe-all-target-libffi configure-target-libobjc: maybe-configure-target-boehm-gc all-target-libobjc: maybe-all-target-boehm-gc configure-target-libstdc++-v3: maybe-configure-target-libgomp - configure-stage1-target-libstdc++-v3: maybe-configure-stage1-target-libgomp configure-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp configure-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp @@ -56314,9 +56191,7 @@ configure-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target- configure-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp configure-stageautoprofile-target-libstdc++-v3: maybe-configure-stageautoprofile-target-libgomp configure-stageautofeedback-target-libstdc++-v3: maybe-configure-stageautofeedback-target-libgomp -configure-target-liboffloadmic: maybe-configure-target-libgomp configure-target-libsanitizer: maybe-all-target-libstdc++-v3 - configure-stage1-target-libsanitizer: maybe-all-stage1-target-libstdc++-v3 configure-stage2-target-libsanitizer: maybe-all-stage2-target-libstdc++-v3 configure-stage3-target-libsanitizer: maybe-all-stage3-target-libstdc++-v3 @@ -56326,7 +56201,6 @@ configure-stagefeedback-target-libsanitizer: maybe-all-stagefeedback-target-libs configure-stageautoprofile-target-libsanitizer: maybe-all-stageautoprofile-target-libstdc++-v3 configure-stageautofeedback-target-libsanitizer: maybe-all-stageautofeedback-target-libstdc++-v3 configure-target-libvtv: maybe-all-target-libstdc++-v3 - configure-stage1-target-libvtv: maybe-all-stage1-target-libstdc++-v3 configure-stage2-target-libvtv: maybe-all-stage2-target-libstdc++-v3 configure-stage3-target-libvtv: maybe-all-stage3-target-libstdc++-v3 @@ -56336,7 +56210,6 @@ configure-stagefeedback-target-libvtv: maybe-all-stagefeedback-target-libstdc++- configure-stageautoprofile-target-libvtv: maybe-all-stageautoprofile-target-libstdc++-v3 configure-stageautofeedback-target-libvtv: maybe-all-stageautofeedback-target-libstdc++-v3 all-target-libstdc++-v3: maybe-configure-target-libgomp - all-stage1-target-libstdc++-v3: maybe-configure-stage1-target-libgomp all-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp all-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp @@ -56345,7 +56218,6 @@ all-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target-libgom all-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp all-stageautoprofile-target-libstdc++-v3: maybe-configure-stageautoprofile-target-libgomp all-stageautofeedback-target-libstdc++-v3: maybe-configure-stageautofeedback-target-libgomp -all-target-liboffloadmic: maybe-all-target-libgomp install-target-libgo: maybe-install-target-libatomic install-target-libgfortran: maybe-install-target-libquadmath install-target-libgfortran: maybe-install-target-libgcc @@ -56363,12 +56235,63 @@ install-target-libobjc: maybe-install-target-libgcc install-target-libstdc++-v3: maybe-install-target-libgcc all-target-libgloss: maybe-all-target-newlib all-target-winsup: maybe-all-target-libtermcap -configure-target-newlib: maybe-all-binutils -configure-target-newlib: maybe-all-ld configure-target-libgfortran: maybe-all-target-libquadmath configure-target-libgfortran: maybe-all-target-libbacktrace +@if gcc-bootstrap +configure-gnattools: stage_last +configure-libcc1: stage_last +configure-utils: stage_last +configure-gdb: stage_last +configure-gprof: stage_last +configure-sid: stage_last +configure-sim: stage_last +configure-fastjar: stage_last +configure-bison: stage_last +configure-flex: stage_last +configure-m4: stage_last +@endif gcc-bootstrap + +@unless gcc-bootstrap +all-gnattools: maybe-all-target-libstdc++-v3 +configure-libcc1: maybe-configure-gcc +all-libcc1: maybe-all-gcc +all-utils: maybe-all-libiberty +configure-gdb: maybe-all-intl +configure-gdb: maybe-all-bfd +configure-gdb: maybe-all-libiconv +all-gdb: maybe-all-libiberty +all-gdb: maybe-all-libiconv +all-gdb: maybe-all-opcodes +all-gdb: maybe-all-libdecnumber +configure-gprof: maybe-configure-intl +all-gprof: maybe-all-libiberty +all-gprof: maybe-all-bfd +all-gprof: maybe-all-opcodes +all-gprof: maybe-all-intl +all-gprof: maybe-all-gas +all-sid: maybe-all-libiberty +all-sid: maybe-all-bfd +all-sid: maybe-all-opcodes +configure-sim: maybe-configure-intl +all-sim: maybe-all-intl +all-sim: maybe-all-libiberty +all-sim: maybe-all-bfd +all-sim: maybe-all-opcodes +all-fastjar: maybe-all-zlib +all-fastjar: maybe-all-libiberty +all-bison: maybe-all-intl +all-flex: maybe-all-intl +all-m4: maybe-all-intl +configure-target-boehm-gc: maybe-all-target-libstdc++-v3 +configure-target-libgo: maybe-all-target-libstdc++-v3 +configure-target-liboffloadmic: maybe-configure-target-libgomp +all-target-liboffloadmic: maybe-all-target-libgomp +configure-target-newlib: maybe-all-binutils +configure-target-newlib: maybe-all-ld +@endunless gcc-bootstrap + # Dependencies for target modules on other target modules are # described by lang_env_dependencies; the defaults apply to anything # not mentioned there. diff --git a/Makefile.tpl b/Makefile.tpl index 94a4f79f6..8227d4d36 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -403,6 +403,7 @@ DLLTOOL = @DLLTOOL@ LD = @LD@ LIPO = @LIPO@ NM = @NM@ +OBJCOPY = @OBJCOPY@ OBJDUMP = @OBJDUMP@ RANLIB = @RANLIB@ READELF = @READELF@ @@ -1822,25 +1823,46 @@ configure-target-[+module+]: maybe-all-gcc[+ (define dep-maybe (lambda () (if (exist? "hard") "" "maybe-"))) - ;; dep-kind returns "normal" if the dependency is on an "install" target, - ;; or if either module is not bootstrapped. It returns "bootstrap" for - ;; configure or build dependencies between bootstrapped modules; it returns - ;; "prebootstrap" for configure or build dependencies of bootstrapped - ;; modules on a build module (e.g. all-gcc on all-build-bison). All this - ;; is only necessary for host modules. + ;; dep-kind returns returns "prebootstrap" for configure or build + ;; dependencies of bootstrapped modules on a build module + ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is + ;; on an "install" target, or if the dependence module is not + ;; bootstrapped; otherwise, it returns "bootstrap" or + ;; "postbootstrap" depending on whether the dependent module is + ;; bootstrapped. All this is only necessary for host and target + ;; modules. It might seem like, in order to avoid build races, we + ;; might need more elaborate detection between prebootstrap and + ;; postbootstrap modules, but there are no host prebootstrap + ;; modules. If there were any non-bootstrap host modules that + ;; bootstrap modules depended on, we'd get unsatisfied per-stage + ;; dependencies on them, which would be immediately noticed. (define dep-kind (lambda () - (if (and (hash-ref boot-modules (dep-module "module")) - (=* (dep-module "on") "build-")) - "prebootstrap" + (cond + ((and (hash-ref boot-modules (dep-module "module")) + (=* (dep-module "on") "build-")) + "prebootstrap") - (if (or (= (dep-subtarget "on") "install-") - (not (hash-ref boot-modules (dep-module "module"))) - (not (hash-ref boot-modules (dep-module "on")))) - "normal" - "bootstrap")))) + ((or (= (dep-subtarget "on") "install-") + (not (hash-ref boot-modules (dep-module "on")))) + "normal") + + ((hash-ref boot-modules (dep-module "module")) + "bootstrap") + + (1 "postbootstrap")))) + + (define make-postboot-dep (lambda () + (let ((target (dep-module "module")) (dep "stage_last")) + (unless (= (hash-ref postboot-targets target) dep) + (hash-create-handle! postboot-targets target dep) + ;; All non-bootstrap modules' configure target already + ;; depend on dep. + (unless (=* target "target-") + (string-append "configure-" target ": " dep "\n")))))) ;; We now build the hash table that is used by dep-kind. (define boot-modules (make-hash-table 113)) + (define postboot-targets (make-hash-table 113)) +] [+ FOR host_modules +][+ @@ -1857,18 +1879,23 @@ configure-target-[+module+]: maybe-all-gcc[+ # to check for bootstrap/prebootstrap dependencies. To resolve # prebootstrap dependencies, prebootstrap modules are gathered in # a hash table. -[+ FOR dependencies +][+ (make-dep "" "") +] -[+ CASE (dep-kind) +] -[+ == "prebootstrap" - +][+ FOR bootstrap_stage +] -[+ (make-dep (dep-stage) "") +][+ - ENDFOR bootstrap_stage +] -[+ == "bootstrap" - +][+ FOR bootstrap_stage +] -[+ (make-dep (dep-stage) (dep-stage)) +][+ - ENDFOR bootstrap_stage +] -[+ ESAC +][+ -ENDFOR dependencies +] +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +] +[+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +] +[+ == "normal" +][+ (make-dep "" "") +] +[+ ESAC +][+ ENDFOR dependencies +] + +@if gcc-bootstrap +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+ +ENDFOR dependencies +]@endif gcc-bootstrap + +@unless gcc-bootstrap +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "postbootstrap" +][+ (make-dep "" "") +] +[+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap # Dependencies for target modules on other target modules are # described by lang_env_dependencies; the defaults apply to anything diff --git a/config.guess b/config.guess index 0967f2afa..445c40683 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2016-04-02' +timestamp='2018-06-26' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2016-04-02' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2016-04-02' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -106,10 +106,10 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; +case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,27 +176,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -205,10 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -216,46 +226,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -307,28 +326,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -340,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -367,19 +377,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. @@ -392,13 +402,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -407,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -436,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -482,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -524,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -551,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -563,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -581,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -595,7 +605,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -604,18 +614,18 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -630,28 +640,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -684,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -709,15 +719,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -742,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -755,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -763,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -790,127 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -924,63 +916,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -994,64 +986,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1065,34 +1063,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1102,12 +1100,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1117,9 +1115,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1139,9 +1137,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1161,9 +1159,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1172,28 +1170,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1204,7 +1202,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1224,23 +1222,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1259,49 +1257,56 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1312,7 +1317,7 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1320,19 +1325,25 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1341,7 +1352,7 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 @@ -1352,7 +1363,7 @@ EOF else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1373,14 +1384,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1389,37 +1400,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1438,16 +1460,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.sub b/config.sub index b434622c4..fe6229780 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2016-05-10' +timestamp='2018-07-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2016-05-10' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2016-05-10' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -94,7 +94,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,134 +110,455 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -bluegene*) - os=-cnk + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \ + | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \ + | harris | dolphin | highlevel | gould | cbm | ns | masscomp \ + | apple | axis | knuth | cray | microblaze* \ + | sim | cisco | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + craynv) + basic_machine=craynv-cray + os=unicosmp + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-unknown + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac @@ -252,18 +573,18 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ - | c4x | c8051 | clipper \ + | c4x | c8051 | clipper | csky \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -296,13 +617,15 @@ case $basic_machine in | mt \ | msp430 \ | nds32 | nds32le | nds32be \ + | nfp \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ - | riscv32 | riscv64 \ + | riscv | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -314,7 +637,7 @@ case $basic_machine in | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ - | we32k \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -333,20 +656,23 @@ case $basic_machine in ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown - os=-none + os=${os:-none} ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + m9s12z | m68hcs12z | hcs12z | s12z) + basic_machine=s12z-unknown + os=${os:-none} ;; ms1) basic_machine=mt-unknown ;; - strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown - os=-none + os=${os:-none} ;; xscaleeb) basic_machine=armeb-unknown @@ -362,11 +688,6 @@ case $basic_machine in i*86 | x86_64) basic_machine=$basic_machine-pc ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ @@ -380,14 +701,14 @@ case $basic_machine in | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -421,6 +742,7 @@ case $basic_machine in | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ @@ -428,8 +750,9 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ - | riscv32-* | riscv64-* \ + | riscv-* | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ @@ -444,6 +767,7 @@ case $basic_machine in | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -456,141 +780,77 @@ case $basic_machine in ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; abacus) basic_machine=abacus-unknown ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; amd64) basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amiga | amiga-*) basic_machine=m68k-unknown ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; asmjs) basic_machine=asmjs-unknown ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; bluegene*) basic_machine=powerpc-ibm - os=-cnk + os=cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc + os=${os:-unicos} ;; convex-c1) basic_machine=c1-convex - os=-bsd + os=bsd ;; convex-c2) basic_machine=c2-convex - os=-bsd + os=bsd ;; convex-c32) basic_machine=c32-convex - os=-bsd + os=bsd ;; convex-c34) basic_machine=c34-convex - os=-bsd + os=bsd ;; convex-c38) basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp + os=bsd ;; cr16 | cr16-*) basic_machine=cr16-unknown - os=-elf + os=${os:-elf} ;; crds | unos) basic_machine=m68k-crds @@ -603,7 +863,7 @@ case $basic_machine in ;; crx) basic_machine=crx-unknown - os=-elf + os=${os:-elf} ;; da30 | da30-*) basic_machine=m68k-da30 @@ -613,50 +873,38 @@ case $basic_machine in ;; decsystem10* | dec10*) basic_machine=pdp10-dec - os=-tops10 + os=tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec - os=-tops20 + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; dpx20 | dpx20-*) basic_machine=rs6000-bull - os=-bosx + os=${os:-bosx} ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull - os=-sysv3 + os=sysv3 ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" ;; encore | umax | mmax) basic_machine=ns32k-encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + basic_machine=elxsi-elxsi + os=${os:-bsd} ;; fx2800) basic_machine=i860-alliant @@ -664,45 +912,13 @@ case $basic_machine in genix) basic_machine=ns32k-ns ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 + os=hiuxwe2 ;; hp300-*) basic_machine=m68k-hp ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; @@ -732,200 +948,82 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + basic_machine=j90-cray + os=${os:-unicos} ;; iris | iris4d) basic_machine=mips-sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; microblaze*) basic_machine=microblaze-xilinx ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) basic_machine=m68000-convergent ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari - os=-mint + os=mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; news-3600 | risc-news) basic_machine=mips-sony - os=-newsos + os=newsos ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in - -nextstep* ) + nextstep* ) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) basic_machine=np1-gould ;; @@ -938,40 +1036,26 @@ case $basic_machine in nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki - os=-proelf + os=proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; pa-hitachi) basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux + os=hiuxwe2 ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux ;; pbd) basic_machine=sparc-tti @@ -986,7 +1070,7 @@ case $basic_machine in basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -1001,16 +1085,16 @@ case $basic_machine in basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -1020,43 +1104,27 @@ case $basic_machine in ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; rm[46]00) basic_machine=mips-siemens ;; @@ -1069,10 +1137,6 @@ case $basic_machine in s390x | s390x-*) basic_machine=s390x-ibm ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; sb1) basic_machine=mipsisa64sb1-unknown ;; @@ -1081,32 +1145,17 @@ case $basic_machine in ;; sde) basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux + os=${os:-elf} ;; sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + os=vxworks ;; spur) basic_machine=spur-unknown @@ -1114,44 +1163,12 @@ case $basic_machine in st2000) basic_machine=m68k-tandem ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; sun3 | sun3-*) basic_machine=m68k-sun ;; @@ -1161,25 +1178,9 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; tile*) basic_machine=$basic_machine-unknown - os=-linux-gnu + os=linux-gnu ;; tx39) basic_machine=mipstx39-unknown @@ -1187,85 +1188,32 @@ case $basic_machine in tx39el) basic_machine=mipstx39el-unknown ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; tower | tower-32) basic_machine=m68k-ncr ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; w65*) basic_machine=w65-wdc - os=-none + os=none ;; w89k-*) basic_machine=hppa1.1-winbond - os=-proelf + os=proelf ;; - xbox) - basic_machine=i686-pc - os=-mingw32 + x64) + basic_machine=x86_64-pc ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; none) basic_machine=none-none - os=-none + os=${os:-none} ;; # Here we handle the default manufacturer of certain CPU types. It is in @@ -1291,10 +1239,6 @@ case $basic_machine in vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1304,9 +1248,6 @@ case $basic_machine in sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1326,7 +1267,7 @@ case $basic_machine in # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1334,10 +1275,10 @@ esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1345,200 +1286,246 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) + bluegene*) + os=cnk + ;; + solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -solaris) - os=-solaris2 + solaris) + os=solaris2 ;; - -svr4*) - os=-sysv4 + unixware*) + os=sysv4.2uw ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -jehanne*) + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | -jehanne*) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) + qnx*) case $basic_machine in x86-* | i*86-*) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) + nto-qnx*) + ;; + nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + linux-dietlibc) + os=linux-dietlibc ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + lynx*5) + os=lynxos5 ;; - -opened*) - os=-openedition + lynx*) + os=lynxos ;; - -os400*) - os=-os400 + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -wince*) - os=-wince + opened*) + os=openedition ;; - -osfrose*) - os=-osfrose + os400*) + os=os400 ;; - -osf*) - os=-osf + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -utek*) - os=-bsd + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -dynix*) - os=-bsd + wince*) + os=wince ;; - -acis*) - os=-aos + utek*) + os=bsd ;; - -atheos*) - os=-atheos + dynix*) + os=bsd ;; - -syllable*) - os=-syllable + acis*) + os=aos ;; - -386bsd) - os=-bsd + atheos*) + os=atheos ;; - -ctix* | -uts*) - os=-sysv + syllable*) + os=syllable ;; - -nova*) - os=-rtmk-nova + 386bsd) + os=bsd ;; - -ns2 ) - os=-nextstep2 + ctix* | uts*) + os=sysv ;; - -nsk*) - os=-nsk + nova*) + os=rtmk-nova + ;; + ns2) + os=nextstep2 + ;; + nsk*) + os=nsk ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 + sinix*) + os=sysv4 ;; - -tpf*) - os=-tpf + tpf*) + os=tpf ;; - -triton*) - os=-sysv3 + triton*) + os=sysv3 ;; - -oss*) - os=-sysv3 + oss*) + os=sysv3 ;; - -svr4) - os=-sysv4 + svr4*) + os=sysv4 ;; - -svr3) - os=-sysv3 + svr3) + os=sysv3 ;; - -sysvr4) - os=-sysv4 + sysvr4) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + # This must come after sysvr4. + sysv*) ;; - -ose*) - os=-ose + ose*) + os=ose ;; - -es1800*) - os=-ose + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -xenix) - os=-xenix + zvmoe) + os=zvmoe ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + dicos*) + os=dicos ;; - -aros*) - os=-aros + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -zvmoe) - os=-zvmoe + nacl*) ;; - -dicos*) - os=-dicos + ios) ;; - -nacl*) + none) ;; - -ios) - ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1556,176 +1543,179 @@ else case $basic_machine in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 + ;; + pru-*) + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs + os=luna ;; *-next) - os=-nextstep3 + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi @@ -1736,79 +1726,82 @@ vendor=unknown case $basic_machine in *-unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/configure b/configure index 2d0963bbe..5db527014 100755 --- a/configure +++ b/configure @@ -7191,7 +7191,9 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` # extrasub-{build,host,target} not because there is any reason to split # the substitutions up that way, but only to remain below the limit of # 99 commands in a script, for HP-UX sed. -# Do not nest @if/@endif pairs, because configure will not warn you at all. + +# Do not nest @if/@endif or @unless/@endunless pairs, because +# configure will not warn you at all. case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in yes:yes:*\ gold\ *:*,c++,*) ;; @@ -7210,8 +7212,10 @@ for module in ${build_configdirs} ; do extrasub_build="$extrasub_build /^@if build-$module\$/d /^@endif build-$module\$/d +/^@unless build-$module\$/,/^@endunless build-$module\$/d /^@if build-$module-$bootstrap_suffix\$/d -/^@endif build-$module-$bootstrap_suffix\$/d" +/^@endif build-$module-$bootstrap_suffix\$/d +/^@unless build-$module-$bootstrap_suffix\$/,/^@endunless build-$module-$bootstrap_suffix\$/d" done extrasub_host= for module in ${configdirs} ; do @@ -7230,8 +7234,10 @@ for module in ${configdirs} ; do extrasub_host="$extrasub_host /^@if $module\$/d /^@endif $module\$/d +/^@unless $module\$/,/^@endunless $module\$/d /^@if $module-$host_bootstrap_suffix\$/d -/^@endif $module-$host_bootstrap_suffix\$/d" +/^@endif $module-$host_bootstrap_suffix\$/d +/^@unless $module-$host_bootstrap_suffix\$/,/^@endunless $module-$host_bootstrap_suffix\$/d" done extrasub_target= for module in ${target_configdirs} ; do @@ -7250,13 +7256,17 @@ for module in ${target_configdirs} ; do extrasub_target="$extrasub_target /^@if target-$module\$/d /^@endif target-$module\$/d +/^@unless target-$module\$/,/^@endunless target-$module\$/d /^@if target-$module-$target_bootstrap_suffix\$/d -/^@endif target-$module-$target_bootstrap_suffix\$/d" +/^@endif target-$module-$target_bootstrap_suffix\$/d +/^@unless target-$module-$target_bootstrap_suffix\$/,/^@endunless target-$module-$target_bootstrap_suffix\$/d" done # Do the final fixup along with target modules. extrasub_target="$extrasub_target -/^@if /,/^@endif /d" +/^@if /,/^@endif /d +/^@unless /d +/^@endunless /d" # Create the serialization dependencies. This uses a temporary file. diff --git a/configure.ac b/configure.ac index 3cb95d69d..cf856e567 100644 --- a/configure.ac +++ b/configure.ac @@ -2787,7 +2787,9 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g` # extrasub-{build,host,target} not because there is any reason to split # the substitutions up that way, but only to remain below the limit of # 99 commands in a script, for HP-UX sed. -# Do not nest @if/@endif pairs, because configure will not warn you at all. + +# Do not nest @if/@endif or @unless/@endunless pairs, because +# configure will not warn you at all. case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in yes:yes:*\ gold\ *:*,c++,*) ;; @@ -2806,8 +2808,10 @@ for module in ${build_configdirs} ; do extrasub_build="$extrasub_build /^@if build-$module\$/d /^@endif build-$module\$/d +/^@unless build-$module\$/,/^@endunless build-$module\$/d /^@if build-$module-$bootstrap_suffix\$/d -/^@endif build-$module-$bootstrap_suffix\$/d" +/^@endif build-$module-$bootstrap_suffix\$/d +/^@unless build-$module-$bootstrap_suffix\$/,/^@endunless build-$module-$bootstrap_suffix\$/d" done extrasub_host= for module in ${configdirs} ; do @@ -2826,8 +2830,10 @@ for module in ${configdirs} ; do extrasub_host="$extrasub_host /^@if $module\$/d /^@endif $module\$/d +/^@unless $module\$/,/^@endunless $module\$/d /^@if $module-$host_bootstrap_suffix\$/d -/^@endif $module-$host_bootstrap_suffix\$/d" +/^@endif $module-$host_bootstrap_suffix\$/d +/^@unless $module-$host_bootstrap_suffix\$/,/^@endunless $module-$host_bootstrap_suffix\$/d" done extrasub_target= for module in ${target_configdirs} ; do @@ -2846,13 +2852,17 @@ for module in ${target_configdirs} ; do extrasub_target="$extrasub_target /^@if target-$module\$/d /^@endif target-$module\$/d +/^@unless target-$module\$/,/^@endunless target-$module\$/d /^@if target-$module-$target_bootstrap_suffix\$/d -/^@endif target-$module-$target_bootstrap_suffix\$/d" +/^@endif target-$module-$target_bootstrap_suffix\$/d +/^@unless target-$module-$target_bootstrap_suffix\$/,/^@endunless target-$module-$target_bootstrap_suffix\$/d" done # Do the final fixup along with target modules. extrasub_target="$extrasub_target -/^@if /,/^@endif /d" +/^@if /,/^@endif /d +/^@unless /d +/^@endunless /d" # Create the serialization dependencies. This uses a temporary file. diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index 4528d58f5..2f9964050 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -181,6 +181,16 @@ install-info: srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \ $(MAKE) DO=$@ DODIRS=doc $(FLAGS_TO_PASS) subdir_do +install-html: + rootpre=`pwd`/; export rootpre; \ + srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \ + $(MAKE) DO=$@ DODIRS=doc $(FLAGS_TO_PASS) subdir_do + +install-pdf: + rootpre=`pwd`/; export rootpre; \ + srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \ + $(MAKE) DO=$@ DODIRS=doc $(FLAGS_TO_PASS) subdir_do + clean-info: force: diff --git a/libgloss/aarch64/_exit.c b/libgloss/aarch64/_exit.c index 1a6b01532..16564bbda 100644 --- a/libgloss/aarch64/_exit.c +++ b/libgloss/aarch64/_exit.c @@ -26,7 +26,7 @@ #include <_ansi.h> #include "svc.h" -void _exit _PARAMS ((int)); +void _exit (int); __attribute__ ((noreturn)) void _exit (int status) diff --git a/libgloss/aarch64/_kill.c b/libgloss/aarch64/_kill.c index 1d42371f0..8109ace12 100644 --- a/libgloss/aarch64/_kill.c +++ b/libgloss/aarch64/_kill.c @@ -28,7 +28,7 @@ #include #include "svc.h" -int _kill _PARAMS ((int, int)); +int _kill (int, int); int _kill (int pid, int sig) diff --git a/libgloss/aarch64/cpu-init/rdimon-aem-el3.S b/libgloss/aarch64/cpu-init/rdimon-aem-el3.S index 41db8f90c..e00f0b2c8 100644 --- a/libgloss/aarch64/cpu-init/rdimon-aem-el3.S +++ b/libgloss/aarch64/cpu-init/rdimon-aem-el3.S @@ -145,6 +145,33 @@ _flat_map: dsb sy msr sctlr_el3, x0 isb + + /* Determine if SVE is available. */ + mrs x0, id_aa64pfr0_el1 + tbz x0, 32, .Lnosve + + /* set up CPTR_EL3.TZ to 1. */ + mrs x0, cptr_el3 + + /* TZ is bit 8 of CPTR_EL3. */ + orr x0, x0, #0x100 + msr cptr_el3, x0 + isb + + /* set up vector lenght in ZCR_EL3 (4 LSB). */ + mov x2, #0xF + + /* Try to set the maximum value supported by the architecture (2048). + SVE Arch. + + "If this field is set to a value that is not supported by the + implementation then reading the register must return the highest + supported vector length that is less than the value written." */ + mrs x1, s3_6_c1_c2_0 /* mrs x1, zcr_el3. */ + bfi x1, x2, 0, 4 + msr s3_6_c1_c2_0, x1 /* msr zcr_el3, x1. */ + isb +.Lnosve: ret .data @@ -157,12 +184,16 @@ ttb: .align 2 .global FUNCTION (_cpu_init_hook) .type FUNCTION (_cpu_init_hook), %function + .cfi_sections .debug_frame FUNCTION (_cpu_init_hook): - sub sp, sp, #16 - str x30, [sp, xzr] + .cfi_startproc + str x30, [sp, -16]! + .cfi_def_cfa_offset 16 + .cfi_offset 30, -16 bl _init_vectors bl _flat_map - ldr x30, [sp, xzr] - add sp, sp, #16 + ldr x30, [sp], 16 + .cfi_restore 30 ret + .cfi_endproc .size FUNCTION (_cpu_init_hook), .-FUNCTION (_cpu_init_hook) diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S index 4ad435e03..f831be12e 100644 --- a/libgloss/aarch64/crt0.S +++ b/libgloss/aarch64/crt0.S @@ -101,33 +101,45 @@ exposed here in the HeapInfo Angel call. */ ldr x0, .LC0 /* point at returned values */ ldr x1, [x0, #8] /* get heap_limit */ -#else - /* Set up the stack pointer to a fixed value. */ - ldr x1, .Lstack + + /* Set __heap_limit. */ +#ifdef __ILP32__ + /* Sanity check on the __heap_limit. */ + tst x1, #0xffffffff00000000 + bne .Linsanepar #endif + cmp x1, xzr + beq .LC4 + adrp x2, __heap_limit + add x2, x2, #:lo12:__heap_limit + str x1, [x2] +.LC4: + + ldr x1, [x0] /* get heap_base */ #ifdef __ILP32__ /* Sanity check on the heap base. */ - ldr x0, [x0] /* get heap_base */ - tst x0, #0xffffffff00000000 - beq 1f - /* Exit with 1 if the heap base is not within the 32-bit address - space. */ - mov x0, ADP_Stopped_ApplicationExit & 0xff - movk x0, ADP_Stopped_ApplicationExit >> 16, lsl #16 - adrp x1, HeapBase /* Reuse to construct the parameter block. */ - add x1, x1, #:lo12:HeapBase - str x0, [x1] - mov x0, 1 - str x0, [x1, #8] - mov w0, #AngelSVC_Reason_ReportException - AngelSVCAsm AngelSVC -1: - /* For the sake of safety, set the stack base to the top end of - the 32-bit address space if the returned value from the - Angel API call is larger than or equal to 4 GiB. */ tst x1, #0xffffffff00000000 - csinv w1, w1, wzr, eq + bne .Linsanepar #endif + cmp x1, xzr + bne .LC5 + /* If the heap base value [x0, #0] is 0 then the heap base is actually + at the end of program data (i.e. __end__) */ + ldr x1, .LC3 + str x1, [x0, #0] +.LC5: + ldr x1, [x0, #16] /* get stack_base */ + +#ifdef __ILP32__ + /* Sanity check on the stack_base. */ + tst x1, #0xffffffff00000000 + bne .Linsanepar +#endif + cmp x1, xzr + bne .LC6 +#endif + ldr x1, .Lstack /* Set up the stack pointer to a fixed value */ +.LC6: /* Ensure quad-word stack alignment. */ and x0, x1, #~15 @@ -233,6 +245,22 @@ b FUNCTION (exit) /* Cannot return. */ +#if defined (ARM_RDI_MONITOR) && defined (__ILP32__) +.Linsanepar: + /* Exit with 1 if the parameter is not within the 32-bit address + space. */ + mov x1, ADP_Stopped_ApplicationExit & 0xff + movk x1, ADP_Stopped_ApplicationExit >> 16, lsl #16 + adrp x0, HeapBase /* Reuse to construct the parameter block. */ + add x0, x0, #:lo12:HeapBase + str x1, [x0] + mov x1, 1 + str x1, [x0, #8] + mov w1, #AngelSVC_Reason_ReportException + AngelSVCAsm AngelSVC + b . +#endif + /* Function initializing exception vector table, flatmap, etc. Declared as weak symbol so that user can override this definition by linking in their own version of the function. */ @@ -244,12 +272,13 @@ FUNCTION (_cpu_init_hook): #ifdef ARM_RDI_MONITOR .LC0: GEN_DWORD HeapBase -#else +.LC3: + GEN_DWORD __end__ +#endif .Lstack: GEN_DWORD __stack - .weak __stack -#endif + .LC1: GEN_DWORD __bss_start__ .LC2: diff --git a/libgloss/aarch64/svc.h b/libgloss/aarch64/svc.h index 60bd00fca..2c3da1317 100644 --- a/libgloss/aarch64/svc.h +++ b/libgloss/aarch64/svc.h @@ -72,9 +72,9 @@ #define SH_EXT_STDOUT_STDERR_BITNUM 0x1 #if !defined (__ASSEMBLER__) -extern int _get_semihosting_exts _PARAMS ((char*, int, int)); -extern int _has_ext_exit_extended _PARAMS ((void)); -extern int _has_ext_stdout_stderr _PARAMS ((void)); +extern int _get_semihosting_exts (char*, int, int); +extern int _has_ext_exit_extended (void); +extern int _has_ext_stdout_stderr (void); #endif #if defined(ARM_RDI_MONITOR) && !defined(__ASSEMBLER__) diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c index af206a1d4..7343cc61f 100644 --- a/libgloss/aarch64/syscalls.c +++ b/libgloss/aarch64/syscalls.c @@ -47,37 +47,37 @@ (param_block_t)(unsigned long) (PTR) /* Forward prototypes. */ -int _system _PARAMS ((const char *)); -int _rename _PARAMS ((const char *, const char *)); -int _isatty _PARAMS ((int)); -clock_t _times _PARAMS ((struct tms *)); -int _gettimeofday _PARAMS ((struct timeval *, void *)); -int _unlink _PARAMS ((const char *)); -int _link _PARAMS ((void)); -int _stat _PARAMS ((const char *, struct stat *)); -int _fstat _PARAMS ((int, struct stat *)); -int _swistat _PARAMS ((int fd, struct stat * st)); -caddr_t _sbrk _PARAMS ((int)); -int _getpid _PARAMS ((int)); -int _close _PARAMS ((int)); -clock_t _clock _PARAMS ((void)); -int _swiclose _PARAMS ((int)); -int _open _PARAMS ((const char *, int, ...)); -int _swiopen _PARAMS ((const char *, int)); -int _write _PARAMS ((int, char *, int)); -int _swiwrite _PARAMS ((int, char *, int)); -int _lseek _PARAMS ((int, int, int)); -int _swilseek _PARAMS ((int, int, int)); -int _read _PARAMS ((int, char *, int)); -int _swiread _PARAMS ((int, char *, int)); -void initialise_monitor_handles _PARAMS ((void)); +int _system (const char *); +int _rename (const char *, const char *); +int _isatty (int); +clock_t _times (struct tms *); +int _gettimeofday (struct timeval *, void *); +int _unlink (const char *); +int _link (void); +int _stat (const char *, struct stat *); +int _fstat (int, struct stat *); +int _swistat (int fd, struct stat * st); +void * _sbrk (ptrdiff_t); +pid_t _getpid (void); +int _close (int); +clock_t _clock (void); +int _swiclose (int); +int _open (const char *, int, ...); +int _swiopen (const char *, int); +int _write (int, const char *, size_t); +int _swiwrite (int, const char *, size_t); +off_t _lseek (int, off_t, int); +off_t _swilseek (int, off_t, int); +int _read (int, void *, size_t); +int _swiread (int, void *, size_t); +void initialise_monitor_handles (void); -static int checkerror _PARAMS ((int)); -static int error _PARAMS ((int)); -static int get_errno _PARAMS ((void)); +static int checkerror (int); +static int error (int); +static int get_errno (void); /* Semihosting utilities. */ -static void initialise_semihosting_exts _PARAMS ((void)); +static void initialise_semihosting_exts (void); /* Struct used to keep track of the file position, just so we can implement fseek(fh,x,SEEK_CUR). */ @@ -108,8 +108,8 @@ struct fdent static struct fdent openfiles[MAX_OPEN_FILES]; -static struct fdent *findslot _PARAMS ((int)); -static int newslot _PARAMS ((void)); +static struct fdent *findslot (int); +static int newslot (void); /* Register name faking - works in collusion with the linker. */ #ifdef __ILP32__ @@ -120,7 +120,7 @@ register char * stack_ptr asm ("sp"); /* following is copied from libc/stdio/local.h to check std streams */ -extern void _EXFUN (__sinit, (struct _reent *)); +extern void __sinit (struct _reent *); #define CHECK_INIT(ptr) \ do \ { \ @@ -349,7 +349,7 @@ checkerror (int result) len, is the length in bytes to read. Returns the number of bytes *not* written. */ int -_swiread (int fh, char *ptr, int len) +_swiread (int fh, void *ptr, size_t len) { param_block_t block[3]; @@ -364,7 +364,7 @@ _swiread (int fh, char *ptr, int len) Translates the return of _swiread into bytes read. */ int -_read (int fd, char *ptr, int len) +_read (int fd, void *ptr, size_t len) { int res; struct fdent *pfd; @@ -389,8 +389,8 @@ _read (int fd, char *ptr, int len) } /* fd, is a user file descriptor. */ -int -_swilseek (int fd, int ptr, int dir) +off_t +_swilseek (int fd, off_t ptr, int dir) { int res; struct fdent *pfd; @@ -449,7 +449,8 @@ _swilseek (int fd, int ptr, int dir) return -1; } -_lseek (int fd, int ptr, int dir) +off_t +_lseek (int fd, off_t ptr, int dir) { return _swilseek (fd, ptr, dir); } @@ -457,7 +458,7 @@ _lseek (int fd, int ptr, int dir) /* fh, is a valid internal file handle. Returns the number of bytes *not* written. */ int -_swiwrite (int fh, char *ptr, int len) +_swiwrite (int fh, const char *ptr, size_t len) { param_block_t block[3]; @@ -470,7 +471,7 @@ _swiwrite (int fh, char *ptr, int len) /* fd, is a user file descriptor. */ int -_write (int fd, char *ptr, int len) +_write (int fd, const char *ptr, size_t len) { int res; struct fdent *pfd; @@ -620,13 +621,16 @@ _close (int fd) } int __attribute__((weak)) -_getpid (int n __attribute__ ((unused))) +_getpid (void) { return 1; } -caddr_t -_sbrk (int incr) +/* Heap limit returned from SYS_HEAPINFO Angel semihost call. */ +ulong __heap_limit __attribute__ ((aligned (8))) = 0xcafedead; + +void * +_sbrk (ptrdiff_t incr) { extern char end asm ("end"); /* Defined by the linker. */ static char *heap_end; @@ -637,7 +641,9 @@ _sbrk (int incr) prev_heap_end = heap_end; - if (heap_end + incr > stack_ptr) + if ((heap_end + incr > stack_ptr) + /* Honour heap limit if it's valid. */ + || ((__heap_limit != 0xcafedead) && (heap_end + incr > (char *)__heap_limit))) { /* Some of the libstdc++-v3 tests rely upon detecting out of memory errors, so do not abort here. */ diff --git a/libgloss/arm/_exit.c b/libgloss/arm/_exit.c index ed0087637..180541ece 100644 --- a/libgloss/arm/_exit.c +++ b/libgloss/arm/_exit.c @@ -1,15 +1,16 @@ #include <_ansi.h> +#include "swi.h" -int _kill _PARAMS ((int, int)); -void _exit _PARAMS ((int)); +int _kill_shared (int, int, int) __attribute__((__noreturn__)); +void _exit (int); void _exit (int status) { - /* There is only one SWI for both _exit and _kill. For _exit, call - the SWI with the second argument set to -1, an invalid value for - signum, so that the SWI handler can distinguish the two calls. - Note: The RDI implementation of _kill throws away both its - arguments. */ - _kill (status, -1); + /* The same SWI is used for both _exit and _kill. + For _exit, call the SWI with "reason" set to ADP_Stopped_ApplicationExit + to mark a standard exit. + Note: The RDI implementation of _kill_shared throws away all its + arguments and all implementations ignore the first argument. */ + _kill_shared (-1, status, ADP_Stopped_ApplicationExit); } diff --git a/libgloss/arm/_kill.c b/libgloss/arm/_kill.c index 8871d3c36..69f985653 100644 --- a/libgloss/arm/_kill.c +++ b/libgloss/arm/_kill.c @@ -2,16 +2,27 @@ #include #include "swi.h" -int _kill _PARAMS ((int, int)); +int _kill_shared (int, int, int) __attribute__((__noreturn__)); +int _kill (int, int); int _kill (int pid, int sig) +{ + if (sig == SIGABRT) + _kill_shared (pid, sig, ADP_Stopped_RunTimeError); + else + _kill_shared (pid, sig, ADP_Stopped_ApplicationExit); +} + +int +_kill_shared (int pid, int sig, int reason) { (void) pid; (void) sig; #ifdef ARM_RDI_MONITOR /* Note: The pid argument is thrown away. */ int block[2]; block[1] = sig; + block[0] = reason; int insn; #if SEMIHOST_V2 @@ -25,22 +36,16 @@ _kill (int pid, int sig) insn = AngelSWI_Reason_ReportException; } - switch (sig) - { - case SIGABRT: - { - block[0] = ADP_Stopped_RunTimeError; - break; - } - default: - { - block[0] = ADP_Stopped_ApplicationExit; - break; - } - } +#if SEMIHOST_V2 +if (_has_ext_exit_extended ()) + do_AngelSWI (insn, block); +else +#endif + do_AngelSWI (insn, (void*)block[0]); - return do_AngelSWI (insn, block); #else asm ("swi %a0" :: "i" (SWI_Exit)); #endif + + __builtin_unreachable(); } diff --git a/libgloss/arm/linux-crt0.c b/libgloss/arm/linux-crt0.c index 878ece765..6b2d62a9b 100644 --- a/libgloss/arm/linux-crt0.c +++ b/libgloss/arm/linux-crt0.c @@ -10,6 +10,8 @@ #include #include "arm.h" +/* forward declaration */ +int main(int argc, char *argv[], char *env[]); static int _main(int argc, char *argv[]) __attribute__((noreturn)); #if __thumb__ && !defined(PREFER_THUMB) diff --git a/libgloss/arm/swi.h b/libgloss/arm/swi.h index 72cb838dc..67eb36b3f 100644 --- a/libgloss/arm/swi.h +++ b/libgloss/arm/swi.h @@ -96,9 +96,9 @@ #define SH_EXT_STDOUT_STDERR_BITNUM 0x1 #if !defined (__ASSEMBLER__) -extern int _get_semihosting_exts _PARAMS ((char*, int, int)); -extern int _has_ext_exit_extended _PARAMS ((void)); -extern int _has_ext_stdout_stderr _PARAMS ((void)); +extern int _get_semihosting_exts (char*, int, int); +extern int _has_ext_exit_extended (void); +extern int _has_ext_stdout_stderr (void); #endif #if defined(ARM_RDI_MONITOR) && !defined(__ASSEMBLER__) diff --git a/libgloss/arm/syscalls.c b/libgloss/arm/syscalls.c index 80713680b..dacd1a9d3 100644 --- a/libgloss/arm/syscalls.c +++ b/libgloss/arm/syscalls.c @@ -18,37 +18,37 @@ #include "swi.h" /* Forward prototypes. */ -int _system _PARAMS ((const char *)); -int _rename _PARAMS ((const char *, const char *)); -int _isatty _PARAMS ((int)); -clock_t _times _PARAMS ((struct tms *)); -int _gettimeofday _PARAMS ((struct timeval *, void *)); -int _unlink _PARAMS ((const char *)); -int _link _PARAMS ((void)); -int _stat _PARAMS ((const char *, struct stat *)); -int _fstat _PARAMS ((int, struct stat *)); -int _swistat _PARAMS ((int fd, struct stat * st)); -caddr_t _sbrk _PARAMS ((int)); -int _getpid _PARAMS ((int)); -int _close _PARAMS ((int)); -clock_t _clock _PARAMS ((void)); -int _swiclose _PARAMS ((int)); -int _open _PARAMS ((const char *, int, ...)); -int _swiopen _PARAMS ((const char *, int)); -int _write _PARAMS ((int, char *, int)); -int _swiwrite _PARAMS ((int, char *, int)); -int _lseek _PARAMS ((int, int, int)); -int _swilseek _PARAMS ((int, int, int)); -int _read _PARAMS ((int, char *, int)); -int _swiread _PARAMS ((int, char *, int)); -void initialise_monitor_handles _PARAMS ((void)); +int _system (const char *); +int _rename (const char *, const char *); +int _isatty (int); +clock_t _times (struct tms *); +int _gettimeofday (struct timeval *, void *); +int _unlink (const char *); +int _link (const char *, const char *); +int _stat (const char *, struct stat *); +int _fstat (int, struct stat *); +int _swistat (int fd, struct stat * st); +void * _sbrk (ptrdiff_t); +pid_t _getpid (void); +int _close (int); +clock_t _clock (void); +int _swiclose (int); +int _open (const char *, int, ...); +int _swiopen (const char *, int); +int _write (int, const void *, size_t); +int _swiwrite (int, const void *, size_t); +_off_t _lseek (int, _off_t, int); +_off_t _swilseek (int, _off_t, int); +int _read (int, void *, size_t); +int _swiread (int, void *, size_t); +void initialise_monitor_handles (void); -static int checkerror _PARAMS ((int)); -static int error _PARAMS ((int)); -static int get_errno _PARAMS ((void)); +static int checkerror (int); +static int error (int); +static int get_errno (void); /* Semihosting utilities. */ -static void initialise_semihosting_exts _PARAMS ((void)); +static void initialise_semihosting_exts (void); /* Struct used to keep track of the file position, just so we can implement fseek(fh,x,SEEK_CUR). */ @@ -77,15 +77,15 @@ struct fdent static struct fdent openfiles [MAX_OPEN_FILES]; -static struct fdent* findslot _PARAMS ((int)); -static int newslot _PARAMS ((void)); +static struct fdent* findslot (int); +static int newslot (void); /* Register name faking - works in collusion with the linker. */ register char * stack_ptr asm ("sp"); /* following is copied from libc/stdio/local.h to check std streams */ -extern void _EXFUN(__sinit,(struct _reent *)); +extern void __sinit (struct _reent *); #define CHECK_INIT(ptr) \ do \ { \ @@ -323,7 +323,7 @@ get_errno (void) #ifdef ARM_RDI_MONITOR return do_AngelSWI (AngelSWI_Reason_Errno, NULL); #else - register r0 asm("r0"); + register int r0 asm("r0"); asm ("swi %a1" : "=r"(r0) : "i" (SWI_GetErrno)); return r0; #endif @@ -352,24 +352,24 @@ checkerror (int result) Returns the number of bytes *not* written. */ int _swiread (int fh, - char * ptr, - int len) + void * ptr, + size_t len) { #ifdef ARM_RDI_MONITOR int block[3]; block[0] = fh; block[1] = (int) ptr; - block[2] = len; + block[2] = (int) len; return checkerror (do_AngelSWI (AngelSWI_Reason_Read, block)); #else - register r0 asm("r0"); - register r1 asm("r1"); - register r2 asm("r2"); + register int r0 asm("r0"); + register int r1 asm("r1"); + register int r2 asm("r2"); r0 = fh; - r1 = (int)ptr; - r2 = len; + r1 = (int) ptr; + r2 = (int) len; asm ("swi %a4" : "=r" (r0) : "0"(r0), "r"(r1), "r"(r2), "i"(SWI_Read)); @@ -382,8 +382,8 @@ _swiread (int fh, bytes read. */ int __attribute__((weak)) _read (int fd, - char * ptr, - int len) + void * ptr, + size_t len) { int res; struct fdent *pfd; @@ -408,12 +408,12 @@ _read (int fd, } /* fd, is a user file descriptor. */ -int +off_t _swilseek (int fd, - int ptr, + off_t ptr, int dir) { - int res; + off_t res; struct fdent *pfd; /* Valid file descriptor? */ @@ -461,7 +461,7 @@ _swilseek (int fd, /* This code only does absolute seeks. */ block[0] = pfd->handle; - block[1] = ptr; + block[1] = (int) ptr; res = checkerror (do_AngelSWI (AngelSWI_Reason_Seek, block)); #else if (dir == SEEK_END) @@ -493,8 +493,9 @@ _swilseek (int fd, return -1; } +off_t _lseek (int fd, - int ptr, + off_t ptr, int dir) { return _swilseek (fd, ptr, dir); @@ -505,21 +506,21 @@ _lseek (int fd, int _swiwrite ( int fh, - char * ptr, - int len) + const void * ptr, + size_t len) { #ifdef ARM_RDI_MONITOR int block[3]; block[0] = fh; block[1] = (int) ptr; - block[2] = len; + block[2] = (int) len; return checkerror (do_AngelSWI (AngelSWI_Reason_Write, block)); #else - register r0 asm("r0"); - register r1 asm("r1"); - register r2 asm("r2"); + register int r0 asm("r0"); + register int r1 asm("r1"); + register int r2 asm("r2"); r0 = fh; r1 = (int)ptr; r2 = len; @@ -533,8 +534,8 @@ _swiwrite ( /* fd, is a user file descriptor. */ int __attribute__((weak)) _write (int fd, - char * ptr, - int len) + const void * ptr, + size_t len) { int res; struct fdent *pfd; @@ -653,7 +654,7 @@ _swiclose (int fh) #ifdef ARM_RDI_MONITOR return checkerror (do_AngelSWI (AngelSWI_Reason_Close, &fh)); #else - register r0 asm("r0"); + register int r0 asm("r0"); r0 = fh; asm ("swi %a2" : "=r"(r0) @@ -694,17 +695,17 @@ _close (int fd) return res; } -int __attribute__((weak)) -_getpid (int n __attribute__ ((unused))) +pid_t __attribute__((weak)) +_getpid (void) { - return 1; + return (pid_t)1; } /* Heap limit returned from SYS_HEAPINFO Angel semihost call. */ uint __heap_limit = 0xcafedead; -caddr_t __attribute__((weak)) -_sbrk (int incr) +void * __attribute__((weak)) +_sbrk (ptrdiff_t incr) { extern char end asm ("end"); /* Defined by the linker. */ static char * heap_end; @@ -717,7 +718,7 @@ _sbrk (int incr) if ((heap_end + incr > stack_ptr) /* Honour heap limit if it's valid. */ - || (__heap_limit != 0xcafedead && heap_end + incr > __heap_limit)) + || (__heap_limit != 0xcafedead && heap_end + incr > (char *)__heap_limit)) { /* Some of the libstdc++-v3 tests rely upon detecting out of memory errors, so do not abort here. */ @@ -729,13 +730,13 @@ _sbrk (int incr) abort (); #else errno = ENOMEM; - return (caddr_t) -1; + return (void *) -1; #endif } heap_end += incr; - return (caddr_t) prev_heap_end; + return (void *) prev_heap_end; } int @@ -795,7 +796,7 @@ _stat (const char *fname, struct stat *st) } int __attribute__((weak)) -_link (void) +_link (const char *__path1 __attribute__ ((unused)), const char *__path2 __attribute__ ((unused))) { errno = ENOSYS; return -1; @@ -811,7 +812,7 @@ _unlink (const char *path) block[1] = strlen(path); res = do_AngelSWI (AngelSWI_Reason_Remove, block); #else - register r0 asm("r0"); + register int r0 asm("r0"); r0 = (int)path; asm ("swi %a2" : "=r"(r0) @@ -900,7 +901,7 @@ _isatty (int fd) #ifdef ARM_RDI_MONITOR tty = do_AngelSWI (AngelSWI_Reason_IsTTY, &pfd->handle); #else - register r0 asm("r0"); + register int r0 asm("r0"); r0 = pfd->handle; asm ("swi %a2" : "=r" (r0) @@ -941,7 +942,7 @@ _system (const char *s) } return e; #else - register r0 asm("r0"); + register int r0 asm("r0"); r0 = (int)s; asm ("swi %a2" : "=r" (r0) @@ -961,8 +962,8 @@ _rename (const char * oldpath, const char * newpath) block[3] = strlen(newpath); return checkerror (do_AngelSWI (AngelSWI_Reason_Rename, block)) ? -1 : 0; #else - register r0 asm("r0"); - register r1 asm("r1"); + register int r0 asm("r0"); + register int r1 asm("r1"); r0 = (int)oldpath; r1 = (int)newpath; asm ("swi %a3" diff --git a/libgloss/bfin/_exit.c b/libgloss/bfin/_exit.c index d7fb9e033..e55cf0849 100644 --- a/libgloss/bfin/_exit.c +++ b/libgloss/bfin/_exit.c @@ -16,9 +16,8 @@ #include <_ansi.h> -_VOID -_DEFUN (_exit, (rc), - int rc) +void +_exit (int rc) { while (1) asm volatile ("EXCPT 0;"); diff --git a/libgloss/close.c b/libgloss/close.c index 7aafcea46..48156aa35 100644 --- a/libgloss/close.c +++ b/libgloss/close.c @@ -18,8 +18,7 @@ * close -- We don't need to do anything, but pretend we did. */ int -_DEFUN (close ,(fd), - int fd) +close (int fd) { return (0); } diff --git a/libgloss/configure b/libgloss/configure index aa6f8f834..1a4033dce 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -710,6 +710,7 @@ spu tic6x iq2000 or1k +nios2 libnosys' # Initialize some variables set by options. @@ -2585,6 +2586,10 @@ case "${target}" in or1k-*-* | or1knd-*-* ) subdirs="$subdirs or1k" + ;; + nios2-*-*) + subdirs="$subdirs nios2" + ;; esac diff --git a/libgloss/configure.in b/libgloss/configure.in index 6da164352..41843eed1 100644 --- a/libgloss/configure.in +++ b/libgloss/configure.in @@ -176,6 +176,9 @@ case "${target}" in or1k-*-* | or1knd-*-* ) AC_CONFIG_SUBDIRS([or1k]) ;; + nios2-*-*) + AC_CONFIG_SUBDIRS([nios2]) + ;; esac dnl For now, don't bother configuring testsuite diff --git a/libgloss/cr16/fstat.c b/libgloss/cr16/fstat.c index 637f87db5..781b2a208 100644 --- a/libgloss/cr16/fstat.c +++ b/libgloss/cr16/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/cr16/getpid.c b/libgloss/cr16/getpid.c index d254c9b0d..efe190098 100644 --- a/libgloss/cr16/getpid.c +++ b/libgloss/cr16/getpid.c @@ -19,8 +19,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/cr16/isatty.c b/libgloss/cr16/isatty.c index 1cb32e5c7..fa3cd038c 100644 --- a/libgloss/cr16/isatty.c +++ b/libgloss/cr16/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { return (1); } diff --git a/libgloss/cr16/kill.c b/libgloss/cr16/kill.c index b37584400..f51ddb5f5 100644 --- a/libgloss/cr16/kill.c +++ b/libgloss/cr16/kill.c @@ -20,8 +20,7 @@ extern void _exit (int) __attribute__((__noreturn__)); * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/cr16/putnum.c b/libgloss/cr16/putnum.c index 3317bbf0a..af7232205 100644 --- a/libgloss/cr16/putnum.c +++ b/libgloss/cr16/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (putnum, (num), - unsigned int num) +putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/cr16/stat.c b/libgloss/cr16/stat.c index f1769cdac..3900a1bce 100644 --- a/libgloss/cr16/stat.c +++ b/libgloss/cr16/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/cris/gensyscalls b/libgloss/cris/gensyscalls index b885a20cb..3e2f9af8c 100644 --- a/libgloss/cris/gensyscalls +++ b/libgloss/cris/gensyscalls @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2005 Axis Communications. +# Copyright (C) 2005, 2018 Axis Communications. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,8 +93,16 @@ cat > gettod.c < #include int -_gettimeofday (struct timeval *tp, void *tzp -${r}gettimeofday (tp, tzp)) +_gettimeofday (struct timeval *tp, void *tzp) +{ + struct kernel_timeval kt; + int retval = _Sys_gettimeofday(&kt, tzp); + if (retval == 0) + { + tp->tv_sec = kt.tv_sec; + tp->tv_usec = kt.tv_usec; + } + R (retval) EOF cat > isatty.c <st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/crx/getpid.c b/libgloss/crx/getpid.c index 3c1a7b8b8..912ca18a5 100644 --- a/libgloss/crx/getpid.c +++ b/libgloss/crx/getpid.c @@ -19,8 +19,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (getpid, (), - ) +getpid (void) { return __MYPID; } diff --git a/libgloss/crx/isatty.c b/libgloss/crx/isatty.c index 927d75497..c0039a59e 100644 --- a/libgloss/crx/isatty.c +++ b/libgloss/crx/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (isatty, (fd), - int fd) +isatty (int fd) { return (1); } diff --git a/libgloss/crx/kill.c b/libgloss/crx/kill.c index 3ed228fd2..98cd3c40e 100644 --- a/libgloss/crx/kill.c +++ b/libgloss/crx/kill.c @@ -19,8 +19,7 @@ * kill -- go out via exit... */ int -_DEFUN (kill, (pid, sig), - int pid _AND +kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/crx/putnum.c b/libgloss/crx/putnum.c index 3317bbf0a..af7232205 100644 --- a/libgloss/crx/putnum.c +++ b/libgloss/crx/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (putnum, (num), - unsigned int num) +putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/crx/stat.c b/libgloss/crx/stat.c index 6ffef821b..497ef83c0 100644 --- a/libgloss/crx/stat.c +++ b/libgloss/crx/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (stat, (path, buf), - const char *path _AND +stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/doc/Makefile.in b/libgloss/doc/Makefile.in index 07fb1e135..53d037049 100644 --- a/libgloss/doc/Makefile.in +++ b/libgloss/doc/Makefile.in @@ -22,6 +22,8 @@ datarootdir = @datarootdir@ mandir = @mandir@ man1dir = $(mandir)/man1 infodir = @infodir@ +htmldir = @htmldir@ +pdfdir = @pdfdir@ MAKEINFO = makeinfo TEXI2DVI = TEXINPUTS=$(TEXIDIR):$(srcdir):$$TEXINPUTS texi2dvi @@ -69,7 +71,7 @@ porting.html: $(srcdir)/porting.texi $(srcdir)/porting.texi porting.ps: porting.dvi dvips -f porting.dvi > porting.ps - + # different targets for -ms, -mm, -me # Try to use a recent texi2roff. v2 was put on prep in jan91. # If you want an index, see texi2roff doc for postprocessing @@ -146,6 +148,23 @@ install-info: info $(INSTALL_DATA) $$i $(DESTDIR)$(infodir)/$$i ; \ done +install-pdf: pdf + for i in *.pdf ; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(pdfdir)/$$i ; \ + done + +install-html: html + for i in *.html ; do \ + if [ -d $$i ]; then \ + mkdir -p $(DESTDIR)$(htmldir)/$$i ; \ + for j in $$i/*.html ; do \ + $(INSTALL_DATA) $$j $(DESTDIR)$(htmldir)/$$j ; \ + done \ + else \ + $(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)/$$i ; \ + fi ; \ + done + clean-info: -rm -rf *.info* diff --git a/libgloss/epiphany/_isatty.c b/libgloss/epiphany/_isatty.c index 9ec5060f9..cfb1bf6e4 100644 --- a/libgloss/epiphany/_isatty.c +++ b/libgloss/epiphany/_isatty.c @@ -20,7 +20,7 @@ #include int -_DEFUN(_isatty, (fd), int fd) +_isatty (int fd) { struct stat buf; diff --git a/libgloss/frv/fstat.c b/libgloss/frv/fstat.c index 756f7b261..99f0abfd6 100644 --- a/libgloss/frv/fstat.c +++ b/libgloss/frv/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/frv/getpid.c b/libgloss/frv/getpid.c index e6d568207..1809a2dde 100644 --- a/libgloss/frv/getpid.c +++ b/libgloss/frv/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/frv/isatty.c b/libgloss/frv/isatty.c index b021b4ff8..65c02b7d6 100644 --- a/libgloss/frv/isatty.c +++ b/libgloss/frv/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { return (1); } diff --git a/libgloss/frv/kill.c b/libgloss/frv/kill.c index 7c365fd06..3be632ead 100644 --- a/libgloss/frv/kill.c +++ b/libgloss/frv/kill.c @@ -20,8 +20,7 @@ extern void _exit (int) __attribute__((__noreturn__)); * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/frv/print.c b/libgloss/frv/print.c index 8c8be847a..3dc3d0fe8 100644 --- a/libgloss/frv/print.c +++ b/libgloss/frv/print.c @@ -18,8 +18,7 @@ * print -- do a raw print of a string */ void -_DEFUN (_print, (ptr), -char *ptr) +_print (char *ptr) { while (*ptr) { outbyte (*ptr++); diff --git a/libgloss/frv/putnum.c b/libgloss/frv/putnum.c index c7fa12114..a07315e13 100644 --- a/libgloss/frv/putnum.c +++ b/libgloss/frv/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (_putnum, (num), - unsigned int num) +_putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/frv/sim-time.c b/libgloss/frv/sim-time.c index c4746b482..7a6af4acb 100644 --- a/libgloss/frv/sim-time.c +++ b/libgloss/frv/sim-time.c @@ -38,8 +38,7 @@ extern time_t _sim_time (void) __asm__("_sim_time"); * time -- return current time in seconds. */ time_t -_DEFUN (time, time (t), - time_t *t) +time (time_t *t) { time_t ret = _sim_time (); @@ -53,8 +52,7 @@ _DEFUN (time, time (t), * _times -- no clock, so return an error. */ int -_DEFUN (_times, _times (buf), - struct tms *buf) +_times (struct tms *buf) { errno = EINVAL; return (-1); @@ -65,8 +63,7 @@ _DEFUN (_times, _times (buf), * microseconds. */ int -_DEFUN (_gettimeofday, _gettimeofday (tv, tz), - struct timeval *tv _AND +_gettimeofday (struct timeval *tv, void *tzvp) { struct timezone *tz = tzvp; diff --git a/libgloss/frv/stat.c b/libgloss/frv/stat.c index 094ab4875..b471f542c 100644 --- a/libgloss/frv/stat.c +++ b/libgloss/frv/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/fstat.c b/libgloss/fstat.c index 8082d6395..c9d14d103 100644 --- a/libgloss/fstat.c +++ b/libgloss/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (fstat, (fd, buf), - int fd _AND +fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/ft32/fstat.c b/libgloss/ft32/fstat.c index 77058b2d1..517d13442 100644 --- a/libgloss/ft32/fstat.c +++ b/libgloss/ft32/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/ft32/getpid.c b/libgloss/ft32/getpid.c index 75bba424a..435d0933f 100644 --- a/libgloss/ft32/getpid.c +++ b/libgloss/ft32/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/ft32/isatty.c b/libgloss/ft32/isatty.c index 449410ebe..def8ff01c 100644 --- a/libgloss/ft32/isatty.c +++ b/libgloss/ft32/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { return (1); } diff --git a/libgloss/ft32/kill.c b/libgloss/ft32/kill.c index 765b03e78..06ec59c61 100644 --- a/libgloss/ft32/kill.c +++ b/libgloss/ft32/kill.c @@ -20,8 +20,7 @@ extern void _exit (int) __attribute__((__noreturn__)); * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/ft32/sim-lseek.S b/libgloss/ft32/sim-lseek.S index 2dfde1625..488edf3df 100644 --- a/libgloss/ft32/sim-lseek.S +++ b/libgloss/ft32/sim-lseek.S @@ -22,9 +22,8 @@ * an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { errno = ESPIPE; diff --git a/libgloss/ft32/sim-lseek.c b/libgloss/ft32/sim-lseek.c index 297de2b8a..d35e08272 100644 --- a/libgloss/ft32/sim-lseek.c +++ b/libgloss/ft32/sim-lseek.c @@ -22,9 +22,8 @@ * an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { /* errno = ESPIPE; */ diff --git a/libgloss/ft32/sim-time.c b/libgloss/ft32/sim-time.c index 25e72a1f4..9d2993b88 100644 --- a/libgloss/ft32/sim-time.c +++ b/libgloss/ft32/sim-time.c @@ -21,8 +21,7 @@ * _times -- no clock, so return an error. */ int -_DEFUN (_times, _times (buf), - struct tms *buf) +_times (struct tms *buf) { errno = EINVAL; return (-1); @@ -33,8 +32,7 @@ _DEFUN (_times, _times (buf), * microseconds. */ int -_DEFUN (_gettimeofday, _gettimeofday (tv, tz), - struct timeval *tv _AND +_gettimeofday (struct timeval *tv, void *tzvp) { struct timezone *tz = tzvp; diff --git a/libgloss/ft32/stat.c b/libgloss/ft32/stat.c index 580e2ca6e..df7ef39ee 100644 --- a/libgloss/ft32/stat.c +++ b/libgloss/ft32/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/getpid.c b/libgloss/getpid.c index 07f7f9279..9814fd539 100644 --- a/libgloss/getpid.c +++ b/libgloss/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (getpid, (), - ) +getpid (void) { return __MYPID; } diff --git a/libgloss/isatty.c b/libgloss/isatty.c index 2d66cd652..2b54861ea 100644 --- a/libgloss/isatty.c +++ b/libgloss/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes, return a 1. */ int -_DEFUN (isatty, (fd), - int fd) +isatty (int fd) { return (1); } diff --git a/libgloss/kill.c b/libgloss/kill.c index afc1257cf..a0eaee75b 100644 --- a/libgloss/kill.c +++ b/libgloss/kill.c @@ -18,8 +18,7 @@ * kill -- go out via exit... */ int -_DEFUN (kill, (pid, sig), - int pid _AND +kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/libnosys/_exit.c b/libgloss/libnosys/_exit.c index 3fdf7f081..731dea7f0 100644 --- a/libgloss/libnosys/_exit.c +++ b/libgloss/libnosys/_exit.c @@ -5,9 +5,8 @@ #include <_ansi.h> #include <_syslist.h> -_VOID -_DEFUN (_exit, (rc), - int rc) +void +_exit (int rc) { /* Default stub just causes a divide by 0 exception. */ int x = rc / INT_MAX; diff --git a/libgloss/libnosys/chown.c b/libgloss/libnosys/chown.c index 67f98d59d..faea82be8 100644 --- a/libgloss/libnosys/chown.c +++ b/libgloss/libnosys/chown.c @@ -12,9 +12,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_chown, (path, owner, group), - const char *path _AND - uid_t owner _AND +_chown (const char *path, + uid_t owner, gid_t group) { errno = ENOSYS; diff --git a/libgloss/libnosys/close.c b/libgloss/libnosys/close.c index b759b86ee..8dc3e8b6a 100644 --- a/libgloss/libnosys/close.c +++ b/libgloss/libnosys/close.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_close, (fildes), - int fildes) +_close (int fildes) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/configure b/libgloss/libnosys/configure index fbe7db764..7c23c7a0a 100755 --- a/libgloss/libnosys/configure +++ b/libgloss/libnosys/configure @@ -2009,6 +2009,8 @@ case "${target}" in ;; a29k-amd-udi) ;; + aarch64*-*-*) + ;; arc-*-*) ;; arm*-*-*) @@ -2031,6 +2033,8 @@ case "${target}" in ;; mn10?00-*-*) ;; + riscv*-*-*) + ;; powerpcle-*-pe) ;; sh*-*-*) diff --git a/libgloss/libnosys/configure.in b/libgloss/libnosys/configure.in index 1d4846b17..890821740 100644 --- a/libgloss/libnosys/configure.in +++ b/libgloss/libnosys/configure.in @@ -43,6 +43,8 @@ case "${target}" in ;; a29k-amd-udi) ;; + aarch64*-*-*) + ;; arc-*-*) ;; arm*-*-*) @@ -65,6 +67,8 @@ case "${target}" in ;; mn10?00-*-*) ;; + riscv*-*-*) + ;; powerpcle-*-pe) ;; sh*-*-*) diff --git a/libgloss/libnosys/execve.c b/libgloss/libnosys/execve.c index 01743fff9..950a43c75 100644 --- a/libgloss/libnosys/execve.c +++ b/libgloss/libnosys/execve.c @@ -11,9 +11,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_execve, (name, argv, env), - char *name _AND - char **argv _AND +_execve (char *name, + char **argv, char **env) { errno = ENOSYS; diff --git a/libgloss/libnosys/fork.c b/libgloss/libnosys/fork.c index f5795cb49..c4724a3f0 100644 --- a/libgloss/libnosys/fork.c +++ b/libgloss/libnosys/fork.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_fork, (), - _NOARGS) +_fork (void) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/fstat.c b/libgloss/libnosys/fstat.c index 4e18d4216..c85b9f209 100644 --- a/libgloss/libnosys/fstat.c +++ b/libgloss/libnosys/fstat.c @@ -13,8 +13,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_fstat, (fildes, st), - int fildes _AND +_fstat (int fildes, struct stat *st) { errno = ENOSYS; diff --git a/libgloss/libnosys/getpid.c b/libgloss/libnosys/getpid.c index 0ea19238e..f8d451e8b 100644 --- a/libgloss/libnosys/getpid.c +++ b/libgloss/libnosys/getpid.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_getpid, (), - _NOARGS) +_getpid (void) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/gettod.c b/libgloss/libnosys/gettod.c index 4d42b4b42..2b5354e72 100644 --- a/libgloss/libnosys/gettod.c +++ b/libgloss/libnosys/gettod.c @@ -15,8 +15,7 @@ extern int errno; struct timeval; int -_DEFUN (_gettimeofday, (ptimeval, ptimezone), - struct timeval *ptimeval _AND +_gettimeofday (struct timeval *ptimeval, void *ptimezone) { errno = ENOSYS; diff --git a/libgloss/libnosys/isatty.c b/libgloss/libnosys/isatty.c index d93e17702..a175bf992 100644 --- a/libgloss/libnosys/isatty.c +++ b/libgloss/libnosys/isatty.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_isatty, (file), - int file) +_isatty (int file) { errno = ENOSYS; return 0; diff --git a/libgloss/libnosys/kill.c b/libgloss/libnosys/kill.c index f1d12c646..27c4f8cf6 100644 --- a/libgloss/libnosys/kill.c +++ b/libgloss/libnosys/kill.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { errno = ENOSYS; diff --git a/libgloss/libnosys/link.c b/libgloss/libnosys/link.c index 35881cf7f..0bae1ef8e 100644 --- a/libgloss/libnosys/link.c +++ b/libgloss/libnosys/link.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_link, (existing, new), - char *existing _AND +_link (char *existing, char *new) { errno = ENOSYS; diff --git a/libgloss/libnosys/lseek.c b/libgloss/libnosys/lseek.c index 0aa89e272..fcc7be411 100644 --- a/libgloss/libnosys/lseek.c +++ b/libgloss/libnosys/lseek.c @@ -11,9 +11,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_lseek, (file, ptr, dir), - int file _AND - int ptr _AND +_lseek (int file, + int ptr, int dir) { errno = ENOSYS; diff --git a/libgloss/libnosys/open.c b/libgloss/libnosys/open.c index 2c8a6ceb9..0c864a5ba 100644 --- a/libgloss/libnosys/open.c +++ b/libgloss/libnosys/open.c @@ -11,9 +11,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_open, (file, flags, mode), - char *file _AND - int flags _AND +_open (char *file, + int flags, int mode) { errno = ENOSYS; diff --git a/libgloss/libnosys/read.c b/libgloss/libnosys/read.c index 1a2819c08..cfc281297 100644 --- a/libgloss/libnosys/read.c +++ b/libgloss/libnosys/read.c @@ -11,9 +11,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_read, (file, ptr, len), - int file _AND - char *ptr _AND +_read (int file, + char *ptr, int len) { errno = ENOSYS; diff --git a/libgloss/libnosys/readlink.c b/libgloss/libnosys/readlink.c index 7df253c40..014c956f9 100644 --- a/libgloss/libnosys/readlink.c +++ b/libgloss/libnosys/readlink.c @@ -12,9 +12,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_readlink, (path, buf, bufsize), - const char *path _AND - char *buf _AND +_readlink (const char *path, + char *buf, size_t bufsize) { errno = ENOSYS; diff --git a/libgloss/libnosys/stat.c b/libgloss/libnosys/stat.c index 7c3463798..734f67289 100644 --- a/libgloss/libnosys/stat.c +++ b/libgloss/libnosys/stat.c @@ -13,8 +13,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_stat, (file, st), - const char *file _AND +_stat (const char *file, struct stat *st) { errno = ENOSYS; diff --git a/libgloss/libnosys/symlink.c b/libgloss/libnosys/symlink.c index d9e29f2e4..bebfbba52 100644 --- a/libgloss/libnosys/symlink.c +++ b/libgloss/libnosys/symlink.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_symlink, (path1, path2), - const char *path1 _AND +_symlink (const char *path1, const char *path2) { errno = ENOSYS; diff --git a/libgloss/libnosys/times.c b/libgloss/libnosys/times.c index f205e50f5..908cd8d12 100644 --- a/libgloss/libnosys/times.c +++ b/libgloss/libnosys/times.c @@ -12,8 +12,7 @@ extern int errno; #include "warning.h" clock_t -_DEFUN (_times, (buf), - struct tms *buf) +_times (struct tms *buf) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/unlink.c b/libgloss/libnosys/unlink.c index c543709e4..3414bf82c 100644 --- a/libgloss/libnosys/unlink.c +++ b/libgloss/libnosys/unlink.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_unlink, (name), - char *name) +_unlink (char *name) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/wait.c b/libgloss/libnosys/wait.c index 2a785be1f..029dcbcd4 100644 --- a/libgloss/libnosys/wait.c +++ b/libgloss/libnosys/wait.c @@ -11,8 +11,7 @@ extern int errno; #include "warning.h" int -_DEFUN (_wait, (status), - int *status) +_wait (int *status) { errno = ENOSYS; return -1; diff --git a/libgloss/libnosys/write.c b/libgloss/libnosys/write.c index 0136d74ce..33d727bbf 100644 --- a/libgloss/libnosys/write.c +++ b/libgloss/libnosys/write.c @@ -11,9 +11,8 @@ extern int errno; #include "warning.h" int -_DEFUN (_write, (file, ptr, len), - int file _AND - char *ptr _AND +_write (int file, + char *ptr, int len) { errno = ENOSYS; diff --git a/libgloss/lm32/isatty.c b/libgloss/lm32/isatty.c index 69833fa07..d90b4df08 100644 --- a/libgloss/lm32/isatty.c +++ b/libgloss/lm32/isatty.c @@ -33,8 +33,7 @@ * other files are not. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { if ((fd == 0) || (fd == 1) || (fd == 2)) return 1; diff --git a/libgloss/lseek.c b/libgloss/lseek.c index 1df36f55e..2fde60d8d 100644 --- a/libgloss/lseek.c +++ b/libgloss/lseek.c @@ -20,9 +20,8 @@ * lseek -- Since a serial port is non-seekable, we return an error. */ off_t -_DEFUN (lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +lseek (int fd, + off_t offset, int whence) { errno = ESPIPE; diff --git a/libgloss/m68k/idp-inbyte.c b/libgloss/m68k/idp-inbyte.c index 41db57fc9..c9c403cad 100644 --- a/libgloss/m68k/idp-inbyte.c +++ b/libgloss/m68k/idp-inbyte.c @@ -32,7 +32,7 @@ * from channel A */ char -_DEFUN_VOID (inbyte) +inbyte (void) { while ((READREG (DUART_SRA) & 0x01) == 0x00) ; diff --git a/libgloss/m68k/idp-outbyte.c b/libgloss/m68k/idp-outbyte.c index a95dc0c53..761d679f7 100644 --- a/libgloss/m68k/idp-outbyte.c +++ b/libgloss/m68k/idp-outbyte.c @@ -32,8 +32,7 @@ * to channel A. */ static void -_DEFUN (raw_outbyte, (byte), - char byte) +raw_outbyte (char byte) { /* First, wait for the UART to finish clocking out the last character we sent, if any. Then, give it the next character to @@ -64,8 +63,7 @@ _DEFUN (raw_outbyte, (byte), * latter we put in libidp.a, which is selected by idp.ld. */ void -_DEFUN (outbyte, (byte), - char byte) +outbyte (char byte) { #ifdef GDB_MONITOR_OUTPUT raw_outbyte (0x0f); diff --git a/libgloss/m68k/mc68ec.c b/libgloss/m68k/mc68ec.c index d5ee9b5fe..76e737fe7 100644 --- a/libgloss/m68k/mc68ec.c +++ b/libgloss/m68k/mc68ec.c @@ -25,8 +25,7 @@ * prompt. It can be restarted from there. */ void -_DEFUN (_exit, (status), - int_status) +_exit (int_status) { /* Use `i' constraint to get proper immediate-operand syntax for target assembler configuration. */ @@ -38,8 +37,7 @@ _DEFUN (_exit, (status), * use the timer, but I'm waiting for docs. (sigh) */ void -_DEFUN (delay, (num), - int num) +delay (int num) { while (num--) { diff --git a/libgloss/m68k/mvme-stub.c b/libgloss/m68k/mvme-stub.c index fbc4c61b5..fcf7e7bf0 100644 --- a/libgloss/m68k/mvme-stub.c +++ b/libgloss/m68k/mvme-stub.c @@ -133,7 +133,7 @@ ExceptionHook exceptionHook; /* hook variable for errors/exceptions */ /* FORWARD DECLARATIONS */ /************************/ /** static void initializeRemcomErrorFrame PARAMS ((void)); **/ -static void _DEFUN_VOID (initializeRemcomErrorFrame); +static void initializeRemcomErrorFrame (void); /************************************************************************/ /* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/ @@ -203,9 +203,9 @@ jmp_buf remcomEnv; #define BREAKPOINT() asm(" trap #1"); -extern void _DEFUN_VOID (return_to_super); -extern void _DEFUN_VOID (return_to_user); -extern void _DEFUN_VOID (_catchException); +extern void return_to_super (void); +extern void return_to_user (void); +extern void _catchException (void); void _returnFromException( Frame *frame ) { diff --git a/libgloss/mcore/close.c b/libgloss/mcore/close.c index b94cb602a..0a9f81141 100644 --- a/libgloss/mcore/close.c +++ b/libgloss/mcore/close.c @@ -18,8 +18,7 @@ * close -- We don't need to do anything, but pretend we did. */ int -_DEFUN (_close ,(fd), - int fd) +_close (int fd) { return (0); } diff --git a/libgloss/mcore/cmb-exit.c b/libgloss/mcore/cmb-exit.c index 0e1de85f3..84703eb0d 100644 --- a/libgloss/mcore/cmb-exit.c +++ b/libgloss/mcore/cmb-exit.c @@ -18,8 +18,7 @@ * _exit -- Just cause a breakpoint so user can see why we exited. */ void -_DEFUN (_exit, (val), - int val) +_exit (int val) { while (1) { asm("bkpt"); diff --git a/libgloss/mcore/cmb-inbyte.c b/libgloss/mcore/cmb-inbyte.c index 0b0b8f5d8..9bfbbde81 100644 --- a/libgloss/mcore/cmb-inbyte.c +++ b/libgloss/mcore/cmb-inbyte.c @@ -15,8 +15,7 @@ #include <_ansi.h> int -_DEFUN (inbyte, (), - _NOARGS) +inbyte (void) { return -1; diff --git a/libgloss/mcore/cmb-outbyte.c b/libgloss/mcore/cmb-outbyte.c index ea2aaef8b..ea31cc5af 100644 --- a/libgloss/mcore/cmb-outbyte.c +++ b/libgloss/mcore/cmb-outbyte.c @@ -33,8 +33,7 @@ * outbyte -- send a byte to the UART. */ void -_DEFUN (outbyte, (ch), - char ch) +outbyte (char ch) { while (!(*SRREG & TRDY)) ; diff --git a/libgloss/mcore/fstat.c b/libgloss/mcore/fstat.c index 02054641b..671f56ad9 100644 --- a/libgloss/mcore/fstat.c +++ b/libgloss/mcore/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/mcore/getpid.c b/libgloss/mcore/getpid.c index eee2ac030..cc9e85749 100644 --- a/libgloss/mcore/getpid.c +++ b/libgloss/mcore/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/mcore/kill.c b/libgloss/mcore/kill.c index 43a359760..833fe89d7 100644 --- a/libgloss/mcore/kill.c +++ b/libgloss/mcore/kill.c @@ -18,8 +18,7 @@ * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/mcore/lseek.c b/libgloss/mcore/lseek.c index 0f236fe64..dc419c753 100644 --- a/libgloss/mcore/lseek.c +++ b/libgloss/mcore/lseek.c @@ -20,9 +20,8 @@ * lseek -- Since a serial port is non-seekable, we return an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { errno = ESPIPE; diff --git a/libgloss/mcore/open.c b/libgloss/mcore/open.c index a9e99597f..fdc1b3081 100644 --- a/libgloss/mcore/open.c +++ b/libgloss/mcore/open.c @@ -20,9 +20,8 @@ * we return an error. */ int -_DEFUN (_open, (buf, flags, mode), - const char *buf _AND - int flags _AND +_open (const char *buf, + int flags, int mode) { errno = EIO; diff --git a/libgloss/mcore/print.c b/libgloss/mcore/print.c index d0d2bcef7..f5d0dba20 100644 --- a/libgloss/mcore/print.c +++ b/libgloss/mcore/print.c @@ -18,8 +18,7 @@ * print -- do a raw print of a string */ void -_DEFUN (_print, (ptr), -char *ptr) +_print (char *ptr) { while (*ptr) { outbyte (*ptr++); diff --git a/libgloss/mcore/putnum.c b/libgloss/mcore/putnum.c index 2e37c0993..10e298b95 100644 --- a/libgloss/mcore/putnum.c +++ b/libgloss/mcore/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (_putnum, (num), - unsigned int num) +_putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/mcore/raise.c b/libgloss/mcore/raise.c index 6657aa649..e39207792 100644 --- a/libgloss/mcore/raise.c +++ b/libgloss/mcore/raise.c @@ -15,8 +15,7 @@ #include "glue.h" int -_DEFUN (_raise, (sig), - int sig) +_raise (int sig) { return _kill (_getpid (), sig); } diff --git a/libgloss/mcore/read.c b/libgloss/mcore/read.c index 499426d1b..d7c5670b0 100644 --- a/libgloss/mcore/read.c +++ b/libgloss/mcore/read.c @@ -14,16 +14,15 @@ */ #include "glue.h" -extern char _DEFUN_VOID (inbyte); +extern char inbyte (void); /* * read -- read bytes from the serial port. Ignore fd, since * we only have stdin. */ int -_DEFUN (_read, (fd, buf, nbytes), - int fd _AND - char *buf _AND +_read (int fd, + char *buf, int nbytes) { int i = 0; diff --git a/libgloss/mcore/stat.c b/libgloss/mcore/stat.c index 401a6b50d..1e16e0e53 100644 --- a/libgloss/mcore/stat.c +++ b/libgloss/mcore/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/mcore/unlink.c b/libgloss/mcore/unlink.c index 16dda14f2..9cbcfc53c 100644 --- a/libgloss/mcore/unlink.c +++ b/libgloss/mcore/unlink.c @@ -20,8 +20,7 @@ * we just return an error. */ int -_DEFUN (_unlink, (path), - char * path) +_unlink (char * path) { errno = EIO; return (-1); diff --git a/libgloss/mcore/write.c b/libgloss/mcore/write.c index 7f39fd1bb..8b50fe274 100644 --- a/libgloss/mcore/write.c +++ b/libgloss/mcore/write.c @@ -14,7 +14,7 @@ */ #include "glue.h" -extern int _EXFUN (outbyte, (char x)); +extern int outbyte (char x); /* * write -- write bytes to the serial port. Ignore fd, since @@ -22,9 +22,8 @@ extern int _EXFUN (outbyte, (char x)); * open will only return an error. */ int -_DEFUN (_write, (fd, buf, nbytes), - int fd _AND - char *buf _AND +_write (int fd, + char *buf, int nbytes) { int i; diff --git a/libgloss/microblaze/_hw_exception_handler.S b/libgloss/microblaze/_hw_exception_handler.S index bb729ca33..47df945c4 100644 --- a/libgloss/microblaze/_hw_exception_handler.S +++ b/libgloss/microblaze/_hw_exception_handler.S @@ -30,7 +30,8 @@ */ .text - .globl _hw_exception_handler # HW Exception Handler Label + .weakext _hw_exception_handler # HW Exception Handler Label + .type _hw_exception_handler, %function .align 2 _hw_exception_handler: diff --git a/libgloss/microblaze/_interrupt_handler.S b/libgloss/microblaze/_interrupt_handler.S index 844c7d01b..5bb7329cc 100644 --- a/libgloss/microblaze/_interrupt_handler.S +++ b/libgloss/microblaze/_interrupt_handler.S @@ -30,7 +30,8 @@ */ .text - .globl _interrupt_handler # Interrupt Handler Label + .weakext _interrupt_handler # Interrupt Handler Label + .type _interrupt_handler, %function .align 2 _interrupt_handler: diff --git a/libgloss/moxie/fstat.c b/libgloss/moxie/fstat.c index 6464a861b..78dd9328e 100644 --- a/libgloss/moxie/fstat.c +++ b/libgloss/moxie/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/moxie/getpid.c b/libgloss/moxie/getpid.c index 957eee746..93704ceb9 100644 --- a/libgloss/moxie/getpid.c +++ b/libgloss/moxie/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/moxie/isatty.c b/libgloss/moxie/isatty.c index 14cb9c42c..f986aa725 100644 --- a/libgloss/moxie/isatty.c +++ b/libgloss/moxie/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { return (1); } diff --git a/libgloss/moxie/kill.c b/libgloss/moxie/kill.c index 257c491e0..623f158f4 100644 --- a/libgloss/moxie/kill.c +++ b/libgloss/moxie/kill.c @@ -20,8 +20,7 @@ extern void _exit (int) __attribute__((__noreturn__)); * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/moxie/print.c b/libgloss/moxie/print.c index a20743ac6..1857258cd 100644 --- a/libgloss/moxie/print.c +++ b/libgloss/moxie/print.c @@ -18,8 +18,7 @@ * print -- do a raw print of a string */ void -_DEFUN (_print, (ptr), -char *ptr) +_print (char *ptr) { while (*ptr) { outbyte (*ptr++); diff --git a/libgloss/moxie/putnum.c b/libgloss/moxie/putnum.c index f5bac1f2b..0f7e89453 100644 --- a/libgloss/moxie/putnum.c +++ b/libgloss/moxie/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (_putnum, (num), - unsigned int num) +_putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/moxie/qemu-time.c b/libgloss/moxie/qemu-time.c index 4b0920994..0049c24ee 100644 --- a/libgloss/moxie/qemu-time.c +++ b/libgloss/moxie/qemu-time.c @@ -40,8 +40,7 @@ * _times -- FIXME */ int -_DEFUN (_times, _times (buf), - struct tms *buf) +_times (struct tms *buf) { errno = EINVAL; return (-1); @@ -70,8 +69,7 @@ rtc_write (unsigned char reg, unsigned char val) * time -- return current time in seconds. */ time_t -_DEFUN (time, time (t), - time_t *t) +time (time_t *t) { struct tm tm; time_t ret; @@ -100,8 +98,7 @@ _DEFUN (time, time (t), * return the microseconds. */ int -_DEFUN (_gettimeofday, _gettimeofday (tv, tz), - struct timeval *tv _AND +_gettimeofday (struct timeval *tv, void *tzvp) { struct timezone *tz = tzvp; diff --git a/libgloss/moxie/sim-lseek.S b/libgloss/moxie/sim-lseek.S index 1c799f872..86fb67504 100644 --- a/libgloss/moxie/sim-lseek.S +++ b/libgloss/moxie/sim-lseek.S @@ -22,9 +22,8 @@ * an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { errno = ESPIPE; diff --git a/libgloss/moxie/sim-lseek.c b/libgloss/moxie/sim-lseek.c index 8e7ee50e9..dacd769af 100644 --- a/libgloss/moxie/sim-lseek.c +++ b/libgloss/moxie/sim-lseek.c @@ -22,9 +22,8 @@ * an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { /* errno = ESPIPE; */ diff --git a/libgloss/moxie/sim-time.c b/libgloss/moxie/sim-time.c index 3e9fafb4b..53793bfe1 100644 --- a/libgloss/moxie/sim-time.c +++ b/libgloss/moxie/sim-time.c @@ -37,8 +37,7 @@ extern time_t _sim_time (void) __asm__("_sim_time"); * time -- return current time in seconds. */ time_t -_DEFUN (time, time (t), - time_t *t) +time (time_t *t) { time_t ret = _sim_time (); @@ -52,8 +51,7 @@ _DEFUN (time, time (t), * _times -- no clock, so return an error. */ int -_DEFUN (_times, _times (buf), - struct tms *buf) +_times (struct tms *buf) { errno = EINVAL; return (-1); @@ -64,8 +62,7 @@ _DEFUN (_times, _times (buf), * microseconds. */ int -_DEFUN (_gettimeofday, _gettimeofday (tv, tz), - struct timeval *tv _AND +_gettimeofday (struct timeval *tv, void *tzvp) { struct timezone *tz = tzvp; diff --git a/libgloss/moxie/stat.c b/libgloss/moxie/stat.c index 0d7511ae6..c80e8d347 100644 --- a/libgloss/moxie/stat.c +++ b/libgloss/moxie/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/multi-build.in b/libgloss/multi-build.in index 1403eb35e..52aeeec26 100644 --- a/libgloss/multi-build.in +++ b/libgloss/multi-build.in @@ -17,9 +17,9 @@ multi-do: destpre=`echo $${rootpre}/$${dir}`/; export destpre; \ if ! test -d $${destpre} ; then \ mkdir -p $${destpre}; \ - cp config.status $${destpre}; \ cd $${destpre}; \ - $(SHELL) config.status; \ + config_cmd=`../config.status --config | sed -re "s:--srcdir=([^/]):--srcdir=../\1:"`; \ + $(SHELL) -c "$(SHELL) $${srcrootpre}/configure $${config_cmd}";\ sed -e "s:^MULTIDIRS[[:space:]]*+=.*$$:MULTIDIRS = :" \ -e "s:^MULTILIBNAME[[:space:]]*=.*$$:MULTILIBNAME = MULTIDIR_$${dir}_NAME:" \ -e "s:^MULTI_FLAGS_FOR_TARGET[[:space:]]*=.*$$:MULTI_FLAGS_FOR_TARGET = MULTIDIR_$${dir}_FLAGS:" \ diff --git a/libgloss/nios2/Makefile.in b/libgloss/nios2/Makefile.in new file mode 100644 index 000000000..fd7e79f70 --- /dev/null +++ b/libgloss/nios2/Makefile.in @@ -0,0 +1,118 @@ +# Copyright (c) 1995, 1996, 2001 Cygnus Support -*- mode:makefile -*- +# Copyright (c) 2018, Mentor Graphics +# +# The authors hereby grant permission to use, copy, modify, distribute, +# and license this software and its documentation for any purpose, provided +# that existing copyright notices are retained in all copies and that this +# notice is included verbatim in any distributions. No written agreement, +# license, or royalty fee is required for any of the authorized uses. +# Modifications to this software may be copyrighted by their authors +# and need not follow the licensing terms described here, provided that +# the new terms are clearly indicated on the first page of each file where +# they apply. +# + +DESTDIR = +VPATH = @srcdir@ +srcdir = @srcdir@ +objdir = . +srcroot = $(srcdir)/../.. +objroot = $(objdir)/../.. + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +host_alias = @host_alias@ +target_alias = @target_alias@ +program_transform_name = @program_transform_name@ + +bindir = @bindir@ +libdir = @libdir@ +tooldir = $(exec_prefix)/$(target_alias) + +# Multilib support variables. +# TOP is used instead of MULTI{BUILD,SRC}TOP. +MULTIDIRS = +MULTISUBDIR = +MULTIDO = true +MULTICLEAN = true + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +SHELL = /bin/sh + +CC = @CC@ + +AS = @AS@ +AR = @AR@ +LD = @LD@ +RANLIB = @RANLIB@ +AR_FLAGS = qv + +OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ + then echo ${objroot}/../binutils/objdump ; \ + else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` +OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ + then echo ${objroot}/../binutils/objcopy ; \ + else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` + +# Linker scripts. + +BSP_SCRIPTS= qemu-hosted.ld + +# Semihosting library. + +HOSTED_BSP= libnios2.a +HOSTED_OBJS= io-gdb.o io-exit.o \ + io-close.o io-fstat.o \ + io-gettimeofday.o io-isatty.o io-lseek.o \ + io-open.o io-read.o io-rename.o \ + io-stat.o io-system.o io-time.o \ + io-unlink.o io-write.o \ + sbrk.o kill.o getpid.o + +# Host specific makefile fragment comes in here. +@host_makefile_frag@ + +all :: ${HOSTED_BSP} + +# Build semihosting library. +crt0.o: crt0.S + $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -c $< -o $@ +io-nios2.o: io-nios2.S + $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -c $< -o $@ +$(HOSTED_OBJS): %.o: %.c io.h + $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) -DHOSTED=1 $(INCLUDES) -c $< -o $@ +$(HOSTED_BSP): crt0.o io-nios2.o $(HOSTED_OBJS) $(OTHER_OBJS) + ${AR} ${ARFLAGS} $@ $^ + ${RANLIB} $@ + + +.PHONY: install info dvi doc install-info clean-info +install:: + $(INSTALL_DATA) $(HOSTED_BSP) \ + $(DESTDIR)$(tooldir)/lib${MULTISUBDIR} + for x in ${BSP_SCRIPTS}; do\ + ${INSTALL_DATA} ${srcdir}/$${x} $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \ + done + +# target specific makefile fragment comes in here. +@target_makefile_frag@ + +clean mostlyclean: + rm -f a.out core *.i *~ *.a *.o *-test *.srec *.dis *.x *.map + +distclean maintainer-clean realclean: clean + rm -f Makefile config.cache config.log config.status + +info dvi doc: +install-info: +clean-info: + +Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@ + $(SHELL) config.status + +config.status: configure + $(SHELL) config.status --recheck diff --git a/libgloss/nios2/aclocal.m4 b/libgloss/nios2/aclocal.m4 new file mode 100644 index 000000000..b6cdfaeb8 --- /dev/null +++ b/libgloss/nios2/aclocal.m4 @@ -0,0 +1,344 @@ +# generated automatically by aclocal 1.9.5 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +m4_include([../acinclude.m4]) diff --git a/libgloss/nios2/configure b/libgloss/nios2/configure new file mode 100755 index 000000000..7b64f8fca --- /dev/null +++ b/libgloss/nios2/configure @@ -0,0 +1,3850 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="crt0.S" +ac_subst_vars='LTLIBOBJS +LIBOBJS +target_makefile_frag_path +host_makefile_frag_path +CCASFLAGS +CCAS +RANLIB +LD +AR +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +am__leading_dot +CC +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='host_makefile_frag +target_makefile_frag' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CCAS +CCASFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +if test "${enable_shared}" = "yes" ; then + echo "Shared libraries not supported for cross compiling, ignored" +fi + +if test "$srcdir" = "." ; then + if test "${with_target_subdir}" != "." ; then + libgloss_topdir="${with_multisrctop}../../.." + else + libgloss_topdir="${with_multisrctop}../.." + fi +else + libgloss_topdir="${srcdir}/../.." +fi +ac_aux_dir= +for ac_dir in $libgloss_topdir "$srcdir"/$libgloss_topdir; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in $libgloss_topdir \"$srcdir\"/$libgloss_topdir" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5 +$as_echo_n "checking whether we are using GNU C... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_c_compiler_gnu=yes +else + ac_cv_c_compiler_gnu=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } + +if test $ac_cv_c_compiler_gnu = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + +AS=${AS-as} + +AR=${AR-ar} + +LD=${LD-ld} + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + + +host_makefile_frag=${srcdir}/../config/default.mh +target_makefile_frag=${srcdir}/../config/default.mt + +host_makefile_frag_path=$host_makefile_frag + + +target_makefile_frag_path=$target_makefile_frag + + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +srcdir=${srcdir} +target=${target} +with_multisubdir=${with_multisubdir} +ac_configure_args="${ac_configure_args} --enable-multilib" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +libgloss_topdir=${libgloss_topdir} + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + +if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then + ac_cs_awk_getline=: + ac_cs_awk_pipe_init= + ac_cs_awk_read_file=' + while ((getline aline < (F[key])) > 0) + print(aline) + close(F[key])' + ac_cs_awk_pipe_fini= +else + ac_cs_awk_getline=false + ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" + ac_cs_awk_read_file=' + print "|#_!!_#|" + print "cat " F[key] " &&" + '$ac_cs_awk_pipe_init + # The final `:' finishes the AND list. + ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' +fi +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + +# Create commands to substitute file output variables. +{ + echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && + echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && + echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && + echo "_ACAWK" && + echo "_ACEOF" +} >conf$$files.sh && +. ./conf$$files.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +rm -f conf$$files.sh + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + \$ac_cs_awk_pipe_init +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + if (nfields == 3 && !substed) { + key = field[2] + if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { + \$ac_cs_awk_read_file + next + } + } + print line +} +\$ac_cs_awk_pipe_fini +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | +if $ac_cs_awk_getline; then + $AWK -f "$ac_tmp/subs.awk" +else + $AWK -f "$ac_tmp/subs.awk" | $SHELL +fi \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + "Makefile":F) . ${libgloss_topdir}/config-ml.in ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/libgloss/nios2/configure.in b/libgloss/nios2/configure.in new file mode 100644 index 000000000..fb187b7fd --- /dev/null +++ b/libgloss/nios2/configure.in @@ -0,0 +1,58 @@ +dnl Process this file with autoconf to produce a configure script. +AC_PREREQ(2.59) +AC_INIT(crt0.S) + +if test "${enable_shared}" = "yes" ; then + echo "Shared libraries not supported for cross compiling, ignored" +fi + +if test "$srcdir" = "." ; then + if test "${with_target_subdir}" != "." ; then + libgloss_topdir="${with_multisrctop}../../.." + else + libgloss_topdir="${with_multisrctop}../.." + fi +else + libgloss_topdir="${srcdir}/../.." +fi +AC_CONFIG_AUX_DIR($libgloss_topdir) + +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM + +AC_PROG_INSTALL + +LIB_AC_PROG_CC +AS=${AS-as} +AC_SUBST(AS) +AR=${AR-ar} +AC_SUBST(AR) +LD=${LD-ld} +AC_SUBST(LD) +AC_PROG_RANLIB +LIB_AM_PROG_AS + +host_makefile_frag=${srcdir}/../config/default.mh +target_makefile_frag=${srcdir}/../config/default.mt + +dnl We have to assign the same value to other variables because autoconf +dnl doesn't provide a mechanism to substitute a replacement keyword with +dnl arbitrary data or pathnames. +dnl +host_makefile_frag_path=$host_makefile_frag +AC_SUBST(host_makefile_frag_path) +AC_SUBST_FILE(host_makefile_frag) +target_makefile_frag_path=$target_makefile_frag +AC_SUBST(target_makefile_frag_path) +AC_SUBST_FILE(target_makefile_frag) + +AC_CONFIG_FILES(Makefile, +. ${libgloss_topdir}/config-ml.in, +srcdir=${srcdir} +target=${target} +with_multisubdir=${with_multisubdir} +ac_configure_args="${ac_configure_args} --enable-multilib" +CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} +libgloss_topdir=${libgloss_topdir} +) +AC_OUTPUT diff --git a/libgloss/nios2/crt0.S b/libgloss/nios2/crt0.S new file mode 100644 index 000000000..77eacb30a --- /dev/null +++ b/libgloss/nios2/crt0.S @@ -0,0 +1,140 @@ +/* crt0.S -- startup code for Nios II QEMU generic-nommu board emulation. + + Copyright (c) 2018 Mentor Graphics + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + Parts of this file were derived from code written by Altera Corporation + and distributed under the following license: + + Copyright (c) 2006 Altera Corporation, San Jose, California, USA. + All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + This agreement shall be governed in all respects by the laws of the State + of California and by the laws of the United States of America. +*/ + +/* Cache sizes. */ + +#define NIOS2_ICACHE_LINE_SIZE 32 +#define NIOS2_ICACHE_SIZE 32768 +#define NIOS2_DCACHE_LINE_SIZE 32 +#define NIOS2_DCACHE_SIZE 32768 + +/* External symbols. */ + .globl __stack + .globl __gp + .globl __bss_start + .globl __bss_end + .weak exit + +/* Processor reset code lives at the base of RAM. At reset, only the cache + line that contains the reset vector is initialized; the reset code has + to fit in this cache line and initialize the remainder of the instruction + cache. */ + + .section .text.entry, "ax" + .align 5 + .set noat + + .globl __reset + .type __reset, @function +__reset: + + /* Initialize the icache. */ + movui r2, NIOS2_ICACHE_SIZE +0: + initi r2 + addi r2, r2, -NIOS2_ICACHE_LINE_SIZE + bgt r2, zero, 0b +1: + /* Jump to the __start entry point. */ + movhi r1, %hi(__start) + ori r1, r1, %lo(__start) + jmp r1 + + .size __reset, . - __reset + + +/* __start is the ELF entry point. */ + + .section .text.start, "ax" + .align 4 + .globl __start + .type __start, @function + +__start: + + /* Initialize the data cache. */ + movui r2, NIOS2_DCACHE_SIZE +0: + initd 0(r2) + addi r2, r2, -NIOS2_DCACHE_LINE_SIZE + bgt r2, zero, 0b +1: + + /* Initialize the stack pointer. */ + movhi sp, %hi(__stack) + ori sp, sp, %lo(__stack) + + /* Initialize the GP. */ + movhi gp, %hi(_gp) + ori gp, gp, %lo(_gp) + + /* Clear BSS. */ + movhi r2, %hi(__bss_start) + ori r2, r2, %lo(__bss_start) + movhi r3, %hi(__bss_end) + ori r3, r3, %lo(__bss_end) + beq r2, r3, 1f +0: + stw zero, (r2) + addi r2, r2, 4 + bltu r2, r3, 0b +1: + + /* Run initializers. */ + call __libc_init_array + + /* Call the C entry point. */ + mov r4, zero /* argc */ + mov r5, zero /* argv */ + call main + + /* If main returns, call exit if it is defined. */ + movhi r3, %hi(exit) + ori r3, r3, %lo(exit) + beq r3, zero, 2f + mov r4, r2 /* exit status from main */ + callr r3 + + /* Otherwise sit in busy loop. */ +2: + br 2b + .size __start, . - __start diff --git a/libgloss/nios2/getpid.c b/libgloss/nios2/getpid.c new file mode 100644 index 000000000..d0ffbbad6 --- /dev/null +++ b/libgloss/nios2/getpid.c @@ -0,0 +1,22 @@ +/* + * kill.c + * + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +/* Minimal implementation of getpid for a target system without processes. */ +int +getpid () +{ + return 1; +} diff --git a/libgloss/nios2/io-close.c b/libgloss/nios2/io-close.c new file mode 100644 index 000000000..676fbba18 --- /dev/null +++ b/libgloss/nios2/io-close.c @@ -0,0 +1,43 @@ +/* + * io-close.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO close +#include "io.h" + +/* + * close -- close a file descriptor. + * input parameters: + * 0 : file descriptor + * output parameters: + * 0 : result + * 1 : errno + */ + +int close (int fd) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fd; + __io_hosted (HOSTED_CLOSE, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + return 0; +#endif +} diff --git a/libgloss/nios2/io-exit.c b/libgloss/nios2/io-exit.c new file mode 100644 index 000000000..e9801c4be --- /dev/null +++ b/libgloss/nios2/io-exit.c @@ -0,0 +1,30 @@ +/* + * io-exit.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#if HOSTED +#include "io.h" + +/* + * _exit -- Exit from the application. + */ + +void __attribute__ ((noreturn)) _exit (int code) +{ + while (1) + __io_hosted (HOSTED_EXIT, (void *)code); +} +#endif diff --git a/libgloss/nios2/io-fstat.c b/libgloss/nios2/io-fstat.c new file mode 100644 index 000000000..113ef8ea6 --- /dev/null +++ b/libgloss/nios2/io-fstat.c @@ -0,0 +1,50 @@ +/* + * io-fstat.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#include +#define IO fstat +#include "io.h" + +/* + * fstat -- get file information + * input parameters: + * 0 : file descriptor + * 1 : stat buf ptr + * output parameters: + * 0 : result + * 1 : errno + */ + +int fstat (int fd, struct stat *buf) +{ +#if HOSTED + gdb_parambuf_t parameters; + struct gdb_stat gbuf; + parameters[0] = (uint32_t) fd; + parameters[1] = (uint32_t) &gbuf; + __io_hosted (HOSTED_FSTAT, parameters); + __hosted_from_gdb_stat (&gbuf, buf); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-gdb.c b/libgloss/nios2/io-gdb.c new file mode 100644 index 000000000..ee585595a --- /dev/null +++ b/libgloss/nios2/io-gdb.c @@ -0,0 +1,152 @@ +/* + * hosted io support for GDB's remote fileio protocol + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include "io.h" +#include +#include +#include + +gdb_mode_t +__hosted_to_gdb_mode_t (mode_t m) +{ + gdb_mode_t result = 0; + if (m & S_IFREG) + result |= GDB_S_IFREG; + if (m & S_IFDIR) + result |= GDB_S_IFDIR; + if (m & S_IRUSR) + result |= GDB_S_IRUSR; + if (m & S_IWUSR) + result |= GDB_S_IWUSR; + if (m & S_IXUSR) + result |= GDB_S_IXUSR; + if (m & S_IRGRP) + result |= GDB_S_IRGRP; + if (m & S_IWGRP) + result |= GDB_S_IWGRP; + if (m & S_IXGRP) + result |= GDB_S_IXGRP; + if (m & S_IROTH) + result |= GDB_S_IROTH; + if (m & S_IWOTH) + result |= GDB_S_IWOTH; + if (m & S_IXOTH) + result |= GDB_S_IXOTH; + return result; +} + +int32_t +__hosted_to_gdb_open_flags (int f) +{ + int32_t result = 0; + if (f & O_RDONLY) + result |= GDB_O_RDONLY; + if (f & O_WRONLY) + result |= GDB_O_WRONLY; + if (f & O_RDWR) + result |= GDB_O_RDWR; + if (f & O_APPEND) + result |= GDB_O_APPEND; + if (f & O_CREAT) + result |= GDB_O_CREAT; + if (f & O_TRUNC) + result |= GDB_O_TRUNC; + if (f & O_EXCL) + result |= GDB_O_EXCL; + return result; +} + +int32_t +__hosted_to_gdb_lseek_flags (int f) +{ + if (f == SEEK_CUR) + return GDB_SEEK_CUR; + else if (f == SEEK_END) + return GDB_SEEK_END; + else + return GDB_SEEK_SET; +} + +/* The GDB remote protocol documentation specifies that integer fields + within structures are stored in big-endian byte order. On little-endian + targets, we have to byte-swap the values to match the target. */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define SWAP32(n) __builtin_bswap32 (n) +#define SWAP64(n) __builtin_bswap64 (n) +#else +#define SWAP32(n) (n) +#define SWAP64(n) (n) +#endif /* __BYTE_ORDER__ */ + +void +__hosted_from_gdb_stat (const struct gdb_stat *gs, + struct stat *s) +{ + s->st_dev = SWAP32 (gs->st_dev); + s->st_ino = SWAP32 (gs->st_ino); + s->st_mode = SWAP32 (gs->st_mode); + s->st_nlink = SWAP32 (gs->st_nlink); + s->st_uid = SWAP32 (gs->st_uid); + s->st_gid = SWAP32 (gs->st_gid); + s->st_rdev = SWAP32 (gs->st_rdev); + s->st_size = SWAP64 (gs->st_size); + s->st_blksize = SWAP64 (gs->st_blksize); + s->st_blocks = SWAP64 (gs->st_blocks); + s->st_atime = SWAP32 (gs->st_atime); + s->st_mtime = SWAP32 (gs->st_mtime); + s->st_ctime = SWAP32 (gs->st_ctime); +} + +void +__hosted_from_gdb_timeval (const struct gdb_timeval *gt, + struct timeval *t) +{ + t->tv_sec = SWAP32 (gt->tv_sec); + t->tv_usec = SWAP64 (gt->tv_usec); +} + +int +__hosted_from_gdb_errno (int32_t err) +{ + switch (err) + { + case 0: return 0; + case GDB_EPERM: return EPERM; + case GDB_ENOENT: return ENOENT; + case GDB_EINTR: return EINTR; + case GDB_EBADF: return EBADF; + case GDB_EACCES: return EACCES; + case GDB_EFAULT: return EFAULT; + case GDB_EBUSY: return EBUSY; + case GDB_EEXIST: return EEXIST; + case GDB_ENODEV: return ENODEV; + case GDB_ENOTDIR: return ENOTDIR; + case GDB_EISDIR: return EISDIR; + case GDB_EINVAL: return EINVAL; + case GDB_ENFILE: return ENFILE; + case GDB_EMFILE: return EMFILE; + case GDB_EFBIG: return EFBIG; + case GDB_ENOSPC: return ENOSPC; + case GDB_ESPIPE: return ESPIPE; + case GDB_EROFS: return EROFS; + case GDB_ENAMETOOLONG: return ENAMETOOLONG; + case GDB_EUNKNOWN: + default: + return EIO; + } +} + diff --git a/libgloss/nios2/io-gettimeofday.c b/libgloss/nios2/io-gettimeofday.c new file mode 100644 index 000000000..1f5750e17 --- /dev/null +++ b/libgloss/nios2/io-gettimeofday.c @@ -0,0 +1,54 @@ +/* + * io-gettimeofday.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO gettimeofday +#include "io.h" + +/* + * gettimeofday -- get the current time + * input parameters: + * 0 : timeval ptr + * output parameters: + * 0 : result + * 1 : errno + */ + +int gettimeofday (struct timeval *tv, void *tzvp) +{ +#if HOSTED + gdb_parambuf_t parameters; + struct gdb_timeval gtv; + struct timezone *tz = tzvp; + if (!tv) + return 0; + if (tz) + { + errno = EINVAL; + return -1; + } + parameters[0] = (uint32_t) >v; + __io_hosted (HOSTED_GETTIMEOFDAY, parameters); + __hosted_from_gdb_timeval (>v, tv); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-isatty.c b/libgloss/nios2/io-isatty.c new file mode 100644 index 000000000..ae33f084a --- /dev/null +++ b/libgloss/nios2/io-isatty.c @@ -0,0 +1,43 @@ +/* + * io-isatty.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO isatty +#include "io.h" + +/* + * isatty -- check if fd is a terminal + * input parameters: + * 0 : file descriptor + * output parameters: + * 0 : result + * 1 : errno + */ + +int isatty (int fd) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fd; + __io_hosted (HOSTED_ISATTY, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + return 1; +#endif +} diff --git a/libgloss/nios2/io-lseek.c b/libgloss/nios2/io-lseek.c new file mode 100644 index 000000000..bfc23c1bc --- /dev/null +++ b/libgloss/nios2/io-lseek.c @@ -0,0 +1,52 @@ +/* + * io-lseek.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#define IO lseek +#include "io.h" + +/* + * lseek -- reposition a file descriptor + * input parameters: + * 0 : file descriptor + * 1 : high word of offset + * 2 : low word of offset + * 3 : seek flag + * output parameters: + * 0 : high word of result + * 1 : low word of result + * 2 : errno + */ + +off_t lseek (int fd, off_t offset, int whence) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fd; + parameters[1] = (uint32_t) ((offset >> 32) & 0xffffffff); + parameters[2] = (uint32_t) (offset & 0xffffffff); + parameters[3] = __hosted_to_gdb_lseek_flags (whence); + __io_hosted (HOSTED_LSEEK, parameters); + errno = __hosted_from_gdb_errno (parameters[2]); + return ((uint64_t)parameters[0] << 32) | ((uint64_t)parameters[1]); +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-nios2.S b/libgloss/nios2/io-nios2.S new file mode 100644 index 000000000..0b818a8fd --- /dev/null +++ b/libgloss/nios2/io-nios2.S @@ -0,0 +1,31 @@ +/* + * Low-level semihosting primitive for csky. + * + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +/* Implement + void __io_hosted (int func, void *args); + by causing a break 1. The break handler can find the two parameters in + r4 and r5 per the normal C calling convention. */ + + .text + .align 2 + .global __io_hosted + .type _io_hosted, @function + +__io_hosted: + break 1 + ret + + .size __io_hosted, .-__io_hosted diff --git a/libgloss/nios2/io-open.c b/libgloss/nios2/io-open.c new file mode 100644 index 000000000..885c6465c --- /dev/null +++ b/libgloss/nios2/io-open.c @@ -0,0 +1,62 @@ +/* + * io-open.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#include +#include +#include +#define IO open +#include "io.h" + +/* + * open -- Open a file. + * input parameters: + * 0 : fname ptr + * 1 : fname length + * 2 : flags + * 3 : mode + * output parameters: + * 0 : result + * 1 : errno + */ + +int open (const char *fname, int flags, ...) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fname; + parameters[1] = strlen (fname) + 1; + parameters[2] = __hosted_to_gdb_open_flags (flags); + if (flags & O_CREAT) + { + va_list ap; + va_start (ap, flags); + parameters[3] = __hosted_to_gdb_mode_t (va_arg (ap, mode_t)); + va_end (ap); + } + else + parameters[3] = 0; + __io_hosted (HOSTED_OPEN, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-read.c b/libgloss/nios2/io-read.c new file mode 100644 index 000000000..91c475edb --- /dev/null +++ b/libgloss/nios2/io-read.c @@ -0,0 +1,48 @@ +/* + * io-read.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO read +#include "io.h" + +/* + * read -- read from a file descriptor + * input parameters: + * 0 : file descriptor + * 1 : buf ptr + * 2 : count + * output parameters: + * 0 : result + * 1 : errno + */ + +ssize_t read (int fd, void *buf, size_t count) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fd; + parameters[1] = (uint32_t) buf; + parameters[2] = (uint32_t) count; + __io_hosted (HOSTED_READ, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-rename.c b/libgloss/nios2/io-rename.c new file mode 100644 index 000000000..1a6cbebe7 --- /dev/null +++ b/libgloss/nios2/io-rename.c @@ -0,0 +1,51 @@ +/* + * io-rename.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#define IO rename +#include "io.h" + +/* + * rename -- rename a file + * input parameters: + * 0 : oldname ptr + * 1 : oldname length + * 2 : newname ptr + * 3 : newname length + * output parameters: + * 0 : result + * 1 : errno + */ + +int _rename (const char *oldpath, const char *newpath) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) oldpath; + parameters[1] = (uint32_t) strlen (oldpath) + 1; + parameters[2] = (uint32_t) newpath; + parameters[3] = (uint32_t) strlen (newpath) + 1; + __io_hosted (HOSTED_RENAME, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-stat.c b/libgloss/nios2/io-stat.c new file mode 100644 index 000000000..3ba6f6672 --- /dev/null +++ b/libgloss/nios2/io-stat.c @@ -0,0 +1,54 @@ +/* + * io-stat.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#include +#include +#define IO stat +#include "io.h" + +/* + * stat -- get file information + * input parameters: + * 0 : filename ptr + * 1 : filename length + * 2 : stat buf ptr + * output parameters: + * 0 : result + * 1 : errno + */ + + +int stat (const char *__restrict filename, struct stat *__restrict buf) +{ +#if HOSTED + gdb_parambuf_t parameters; + struct gdb_stat gbuf; + parameters[0] = (uint32_t) filename; + parameters[1] = (uint32_t) strlen (filename) + 1; + parameters[2] = (uint32_t) &gbuf; + __io_hosted (HOSTED_STAT, parameters); + __hosted_from_gdb_stat (&gbuf, buf); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-system.c b/libgloss/nios2/io-system.c new file mode 100644 index 000000000..bb7c59085 --- /dev/null +++ b/libgloss/nios2/io-system.c @@ -0,0 +1,64 @@ +/* + * io-system.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#include +#define IO _system +#include "io.h" + +/* + * system: execute command on (remote) host + * input parameters: + * 0 : command ptr + * 1 : command length + * output parameters: + * 0 : result + * 1 : errno + */ + +int _system (const char *command) +{ +#if HOSTED + int e; + gdb_parambuf_t parameters; + + parameters[0] = (uint32_t) command; + parameters[1] = command ? (uint32_t) strlen (command) + 1 : 0; + __io_hosted (HOSTED_SYSTEM, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + e = parameters[0]; + if (e >= 0 && command) + { + /* We have to convert e, an exit status to the encoded status of + the command. To avoid hard coding the exit status, we simply + loop until we find the right position. */ + int exit_code; + + for (exit_code = e; e && WEXITSTATUS (e) != exit_code; e <<= 1) + continue; + } + + return e; +#else + if (!command) + return 0; + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-time.c b/libgloss/nios2/io-time.c new file mode 100644 index 000000000..03707c614 --- /dev/null +++ b/libgloss/nios2/io-time.c @@ -0,0 +1,46 @@ +/* + * io-time.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO time +#include "io.h" + +/* + * time -- get the current time + * input parameters: + * 0 : timeval ptr + * output parameters: + * 0 : result + * 1 : errno + */ + +time_t time (time_t *t) +{ +#if HOSTED + struct timeval tv; + + if (gettimeofday (&tv, NULL)) + return -1; + if (t) + *t = tv.tv_sec; + return tv.tv_sec; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-unlink.c b/libgloss/nios2/io-unlink.c new file mode 100644 index 000000000..b6ac92108 --- /dev/null +++ b/libgloss/nios2/io-unlink.c @@ -0,0 +1,47 @@ +/* + * io-unlink.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#define IO unlink +#include "io.h" + +/* + * unlink -- unlink (delete) a file + * input parameters: + * 0 : filename ptr + * 1 : filename length + * output parameters: + * 0 : result + * 1 : errno + */ + +int unlink (const char *path) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) path; + parameters[1] = (uint32_t) strlen (path) + 1; + __io_hosted (HOSTED_UNLINK, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io-write.c b/libgloss/nios2/io-write.c new file mode 100644 index 000000000..f26268cdf --- /dev/null +++ b/libgloss/nios2/io-write.c @@ -0,0 +1,48 @@ +/* + * io-write.c -- + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#define IO write +#include "io.h" + +/* + * write -- write to a file descriptor + * input parameters: + * 0 : file descriptor + * 1 : buf ptr + * 2 : count + * output parameters: + * 0 : result + * 1 : errno + */ + +ssize_t write (int fd, const void *buf, size_t count) +{ +#if HOSTED + gdb_parambuf_t parameters; + parameters[0] = (uint32_t) fd; + parameters[1] = (uint32_t) buf; + parameters[2] = (uint32_t) count; + __io_hosted (HOSTED_WRITE, parameters); + errno = __hosted_from_gdb_errno (parameters[1]); + return parameters[0]; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/libgloss/nios2/io.h b/libgloss/nios2/io.h new file mode 100644 index 000000000..e11843516 --- /dev/null +++ b/libgloss/nios2/io.h @@ -0,0 +1,154 @@ +/* + * hosted & unhosted io support. + * + * Copyright (c) 2006 CodeSourcery Inc + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#if HOSTED +#include +#include +#include +#include + +#define HOSTED_EXIT 0 +#define HOSTED_INIT_SIM 1 +#define HOSTED_OPEN 2 +#define HOSTED_CLOSE 3 +#define HOSTED_READ 4 +#define HOSTED_WRITE 5 +#define HOSTED_LSEEK 6 +#define HOSTED_RENAME 7 +#define HOSTED_UNLINK 8 +#define HOSTED_STAT 9 +#define HOSTED_FSTAT 10 +#define HOSTED_GETTIMEOFDAY 11 +#define HOSTED_ISATTY 12 +#define HOSTED_SYSTEM 13 + +/* This function is provided by the board's BSP, because the precise + mechanism of informing gdb is board specific. */ +extern void __io_hosted (int func, void *args); + +/* Protocol specific representation of datatypes, as specified in D.9.11 + * of the GDB manual. The values here are stored in big-endian order. */ + +typedef uint32_t gdb_mode_t; +typedef uint32_t gdb_time_t; + +struct gdb_stat { + uint32_t st_dev; /* device */ + uint32_t st_ino; /* inode */ + gdb_mode_t st_mode; /* protection */ + uint32_t st_nlink; /* number of hard links */ + uint32_t st_uid; /* user ID of owner */ + uint32_t st_gid; /* group ID of owner */ + uint32_t st_rdev; /* device type (if inode device) */ + uint64_t st_size; /* total size, in bytes */ + uint64_t st_blksize; /* blocksize for filesystem I/O */ + uint64_t st_blocks; /* number of blocks allocated */ + gdb_time_t st_atime; /* time of last access */ + gdb_time_t st_mtime; /* time of last modification */ + gdb_time_t st_ctime; /* time of last change */ +}; + +struct gdb_timeval { + gdb_time_t tv_sec; /* second */ + uint64_t tv_usec; /* microsecond */ +}; + + +/* Parameters are passed between the library and the debugging stub + * in a fixed-size buffer. + */ + +typedef uint32_t gdb_parambuf_t[4]; + +/* open flags */ + +#define GDB_O_RDONLY 0x0 +#define GDB_O_WRONLY 0x1 +#define GDB_O_RDWR 0x2 +#define GDB_O_APPEND 0x8 +#define GDB_O_CREAT 0x200 +#define GDB_O_TRUNC 0x400 +#define GDB_O_EXCL 0x800 + +/* mode_t values */ + +#define GDB_S_IFREG 0100000 +#define GDB_S_IFDIR 040000 +#define GDB_S_IRUSR 0400 +#define GDB_S_IWUSR 0200 +#define GDB_S_IXUSR 0100 +#define GDB_S_IRGRP 040 +#define GDB_S_IWGRP 020 +#define GDB_S_IXGRP 010 +#define GDB_S_IROTH 04 +#define GDB_S_IWOTH 02 +#define GDB_S_IXOTH 01 + +/* errno values */ + +#define GDB_EPERM 1 +#define GDB_ENOENT 2 +#define GDB_EINTR 4 +#define GDB_EBADF 9 +#define GDB_EACCES 13 +#define GDB_EFAULT 14 +#define GDB_EBUSY 16 +#define GDB_EEXIST 17 +#define GDB_ENODEV 19 +#define GDB_ENOTDIR 20 +#define GDB_EISDIR 21 +#define GDB_EINVAL 22 +#define GDB_ENFILE 23 +#define GDB_EMFILE 24 +#define GDB_EFBIG 27 +#define GDB_ENOSPC 28 +#define GDB_ESPIPE 29 +#define GDB_EROFS 30 +#define GDB_ENAMETOOLONG 91 +#define GDB_EUNKNOWN 9999 + +/* lseek flags */ + +#define GDB_SEEK_SET 0 +#define GDB_SEEK_CUR 1 +#define GDB_SEEK_END 2 + + +/* conversion functions */ + +extern gdb_mode_t __hosted_to_gdb_mode_t (mode_t m); +extern int32_t __hosted_to_gdb_open_flags (int f); +extern int32_t __hosted_to_gdb_lseek_flags (int f); + +extern void __hosted_from_gdb_stat (const struct gdb_stat *gs, + struct stat *s); +extern void __hosted_from_gdb_timeval (const struct gdb_timeval *gt, + struct timeval *t); +extern int __hosted_from_gdb_errno (int32_t err); + +#else +#ifdef IO +#define IO_NAME_(IO) __hosted_##IO +#define IO_NAME(IO) IO_NAME_(IO) +#define IO_STRING_(IO) #IO +#define IO_STRING(IO) IO_STRING_(IO) +/* Emit an object that causes a gnu linker warning. */ +static const char IO_NAME (IO) [] +__attribute__ ((section (".gnu.warning"), used)) = +"IO function '" IO_STRING (IO) "' used"; +#endif +#endif diff --git a/libgloss/nios2/kill.c b/libgloss/nios2/kill.c new file mode 100644 index 000000000..972b59962 --- /dev/null +++ b/libgloss/nios2/kill.c @@ -0,0 +1,27 @@ +/* + * kill.c + * + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +/* Minimal implementation of kill for a target system without processes. */ + +extern void _exit (int); + +int +kill (int pid, int sig) +{ + if (pid == 1) + _exit (sig); + return 0; +} diff --git a/libgloss/nios2/qemu-hosted.ld b/libgloss/nios2/qemu-hosted.ld new file mode 100644 index 000000000..28a38b159 --- /dev/null +++ b/libgloss/nios2/qemu-hosted.ld @@ -0,0 +1,210 @@ +/* qemu-hosted.ld -- Linker script for QEMU generic-nommu board emulation. + + Copyright (c) 2018 Mentor Graphics + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + Parts of this file were derived from code written by Altera Corporation + and distributed under the following license: + + Copyright (c) 2008 + Altera Corporation, San Jose, California, USA. + All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + This agreement shall be governed in all respects by the laws of the State + of California and by the laws of the United States of America. + +*/ + +ENTRY(__start) +SEARCH_DIR(.) +GROUP(-lgcc -lc -lnios2) + +MEMORY +{ + rom (rx) : ORIGIN = 0x0, LENGTH = 64M + ram (rwx) : ORIGIN = 0x10000000, LENGTH = 128M + tlbmiss (rwx) : ORIGIN = 0x7fff400, LENGTH = 1K + descriptor (rwx) : ORIGIN = 0x8002000, LENGTH = 8K +} + +/* Force the linker to search for these symbols from + the start of the link process. */ +EXTERN(__reset) +EXTERN(__start) +EXTERN(main __stack __heap_start __heap_end __heap_end) + +/* Where to put the stack and heap. Allocate 1M heap space. */ +PROVIDE(__heap_start = _end); +PROVIDE(__heap_end = _end + 100000); +PROVIDE(__stack = 0x18000000); + +/* Force exit to be picked up in a hosted environment. */ +EXTERN(exit atexit) + +/* Ensure that newlib runs the finalizers. */ +__libc_fini = _fini; + +SECTIONS +{ + .text : + { + _ftext = .; + *(.text.entry) + *(.text.start) + *(.text .text.* .gnu.linkonce.t.*) + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.jcr)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .jcr)) + KEEP (*crtend.o(.jcr)) + + . = ALIGN(0x4); + *(.gcc_except_table .gcc_except_table.*) + *(.gnu_extab .gnu_extab.*) + } > ram + .eh_frame_hdr : ALIGN (4) + { + KEEP (*(.eh_frame_hdr)) + *(.eh_frame_entry .eh_frame_entry.*) + } > ram + .eh_frame : ALIGN (4) + { + KEEP (*(.eh_frame)) *(.eh_frame.*) + } > ram + .note.gnu.build-id : ALIGN (4) + { + KEEP (*(.note.gnu.build-id)) + } > ram + .rodata : ALIGN (4) + { + *(.rodata .rodata.* .gnu.linkonce.r.*) + + . = ALIGN(4); + KEEP(*(.init)) + + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(0x4); + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + *(.lit) + + . = ALIGN (8); + _etext = .; + } > ram + + .data : ALIGN (8) + { + *(.shdata) + *(.data .data.* .gnu.linkonce.d.*) + . = ALIGN(8); + _gp = ABSOLUTE(. + 0x8000); + *(.got.plt) *(.got) + *(.lit8) + *(.lit4) + *(.sdata .sdata.* .gnu.linkonce.s.*) + . = ALIGN (8); + *(.ram) + . = ALIGN (8); + _edata = .; + } > ram + .bss : ALIGN (8) + { + __bss_start = ABSOLUTE(.); + *(.sbss .sbss.* .gnu.linkonce.sb.*) + *(.scommon) + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + . = ALIGN (8); + __bss_end = ABSOLUTE(.); + _end = .; + __end = .; + } > ram + + .stab 0 (NOLOAD) : { *(.stab) } + .stabstr 0 (NOLOAD) : { *(.stabstr) } + /* DWARF debug sections. + * Symbols in the DWARF debugging sections are relative to + * the beginning of the section so we begin them at 0. + */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* DWARF 2.1 */ + .debug_ranges 0 : { *(.debug_ranges) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) } +} diff --git a/libgloss/nios2/sbrk.c b/libgloss/nios2/sbrk.c new file mode 100644 index 000000000..1b309eca5 --- /dev/null +++ b/libgloss/nios2/sbrk.c @@ -0,0 +1,42 @@ +/* + * sbrk.c + * + * Copyright (c) 2018 Mentor Graphics + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +/* + * sbrk -- changes heap size size. Get nbytes more + * RAM. We just increment a pointer in what's + * left of memory on the board. + */ + +/* Provided by the linker script. */ +extern char __heap_start[] __attribute__ ((aligned (8))); +extern char __heap_end[] __attribute__ ((aligned (8))); + +void * +sbrk (int nbytes) +{ + static char *heap = __heap_start; + char *base = heap; + char *new_heap = heap + nbytes; + + if (nbytes < 0 || new_heap > __heap_end) + { + errno = ENOMEM; + return (void *)-1; + } + heap = new_heap; + return base; +} diff --git a/libgloss/open.c b/libgloss/open.c index 468b11cd1..a0eb1717b 100644 --- a/libgloss/open.c +++ b/libgloss/open.c @@ -20,9 +20,8 @@ * we return an error. */ int -_DEFUN (open, (buf, flags, mode), - const char *buf _AND - int flags _AND +open (const char *buf, + int flags, int mode) { errno = EIO; diff --git a/libgloss/print.c b/libgloss/print.c index 8f78ff2af..76d543b67 100644 --- a/libgloss/print.c +++ b/libgloss/print.c @@ -18,8 +18,7 @@ * print -- do a raw print of a string */ void -_DEFUN (print, (ptr), -char *ptr) +print (char *ptr) { while (*ptr) { outbyte (*ptr++); diff --git a/libgloss/putnum.c b/libgloss/putnum.c index 842e10f07..c368c4136 100644 --- a/libgloss/putnum.c +++ b/libgloss/putnum.c @@ -18,8 +18,7 @@ * putnum -- print a 32 bit number in hex */ void -_DEFUN (putnum, (num), - unsigned int num) +putnum (unsigned int num) { char buf[9]; int cnt; diff --git a/libgloss/read.c b/libgloss/read.c index 419a8ed64..24108ce0d 100644 --- a/libgloss/read.c +++ b/libgloss/read.c @@ -14,16 +14,15 @@ */ #include "glue.h" -extern char _DEFUN_VOID (inbyte); +extern char inbyte (void); /* * read -- read bytes from the serial port. Ignore fd, since * we only have stdin. */ int -_DEFUN (read, (fd, buf, nbytes), - int fd _AND - char *buf _AND +read (int fd, + char *buf, int nbytes) { int i = 0; diff --git a/libgloss/riscv/Makefile.in b/libgloss/riscv/Makefile.in index 2f03f4402..579dd9554 100644 --- a/libgloss/riscv/Makefile.in +++ b/libgloss/riscv/Makefile.in @@ -6,7 +6,42 @@ gloss_hdrs = \ machine/syscall.h \ gloss_srcs = \ - syscalls.c \ + nanosleep.c \ + sys_access.c \ + sys_chdir.c \ + sys_chmod.c \ + sys_chown.c \ + sys_close.c \ + sys_conv_stat.c \ + sys_execve.c \ + sys_exit.c \ + sys_faccessat.c \ + sys_fork.c \ + sys_fstatat.c \ + sys_fstat.c \ + sys_ftime.c \ + sys_getcwd.c \ + sys_getpid.c \ + sys_gettimeofday.c \ + sys_isatty.c \ + sys_kill.c \ + sys_link.c \ + sys_lseek.c \ + sys_lstat.c \ + sys_openat.c \ + sys_open.c \ + sys_read.c \ + sys_sbrk.c \ + sys_stat.c \ + sys_sysconf.c \ + sys_times.c \ + sys_unlink.c \ + sys_utime.c \ + sys_wait.c \ + sys_write.c + +gloss_specs = \ + nano.specs sim.specs # Extra files @@ -85,10 +120,20 @@ gloss_c_deps = $(patsubst %.c, %.d, $(notdir $(gloss_c_srcs))) $(gloss_c_objs) : %.o : %.c $(COMPILE) -c $< -objs += $(gloss_c_objs) +gloss_objs += $(gloss_c_objs) deps += $(gloss_c_deps) junk += $(gloss_c_deps) $(gloss_c_objs) +sim_c_objs = $(patsubst %.c, sim-%.o, $(notdir $(gloss_c_srcs))) +sim_c_deps = $(patsubst %.c, sim-%.d, $(notdir $(gloss_c_srcs))) + +$(sim_c_objs): sim-%.o : %.c + $(COMPILE) -c -DUSING_SIM_SPECS -o $@ $< + +sim_objs += $(sim_c_objs) +deps += $(sim_c_deps) +junk += $(sim_c_deps) $(sim_c_objs) + #------------------------------------------------------------------------- # Build Object Files from Assembly Source #------------------------------------------------------------------------- @@ -98,25 +143,49 @@ gloss_asm_objs = $(patsubst %.S, %.o, $(notdir $(gloss_asm_srcs))) gloss_asm_deps = $(patsubst %.S, %.d, $(notdir $(gloss_asm_srcs))) $(gloss_asm_objs) : %.o : %.S - $(COMPILE) -c $< + $(COMPILE) -c -o $@ $< -objs += $(gloss_asm_objs) +gloss_objs += $(gloss_asm_objs) deps += $(gloss_asm_deps) junk += $(gloss_asm_deps) $(gloss_asm_objs) +sim_asm_objs = $(patsubst %.S, sim-%.o, $(notdir $(gloss_asm_srcs))) +sim_asm_deps = $(patsubst %.S, sim-%.d, $(notdir $(gloss_asm_srcs))) + +$(sim_asm_objs) : sim-%.o : %.S + $(COMPILE) -c -DUSING_SIM_SPECS -o $@ $< + +sim_objs += $(sim_asm_objs) +deps += $(sim_asm_deps) +junk += $(sim_asm_deps) $(sim_asm_objs) + #------------------------------------------------------------------------- # Build libgloss.a #------------------------------------------------------------------------- gloss_lib = libgloss.a -$(gloss_lib) : $(objs) +$(gloss_lib) : $(gloss_objs) $(AR) rcv $@ $^ $(RANLIB) $@ -junk += $(gloss_libs) +junk += $(gloss_lib) install_hdrs += $(gloss_hdrs) install_libs += $(gloss_lib) +install_specs += $(gloss_specs) + +#------------------------------------------------------------------------- +# Build libsim.a +#------------------------------------------------------------------------- + +sim_lib = libsim.a +$(sim_lib) : $(sim_objs) + $(AR) rcv $@ $^ + $(RANLIB) $@ + +junk += $(sim_lib) + +install_libs += $(sim_lib) #------------------------------------------------------------------------- # Build crt0.o @@ -159,7 +228,13 @@ install-libs : $(install_libs) $(INSTALL_DATA) $$file $(install_libs_dir)/$$file; \ done -install : install-hdrs install-libs +install-specs : $(install_specs) + test -d $(install_libs_dir) || mkdir -p $(install_libs_dir) + for file in $^; do \ + $(INSTALL_DATA) $$file $(install_libs_dir)/; \ + done + +install : install-hdrs install-libs install-specs .PHONY : install install-hdrs install-libs #------------------------------------------------------------------------- diff --git a/libgloss/riscv/crt0.S b/libgloss/riscv/crt0.S index 35195690c..588becfae 100644 --- a/libgloss/riscv/crt0.S +++ b/libgloss/riscv/crt0.S @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at @@ -41,14 +41,3 @@ _start: call main tail exit .size _start, .-_start - - .global _init - .type _init, @function - .global _fini - .type _fini, @function -_init: -_fini: - # These don't have to do anything since we use init_array/fini_array. - ret - .size _init, .-_init - .size _fini, .-_fini diff --git a/libgloss/riscv/internal_syscall.h b/libgloss/riscv/internal_syscall.h new file mode 100644 index 000000000..e5d559496 --- /dev/null +++ b/libgloss/riscv/internal_syscall.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2017 SiFive Inc. All rights reserved. + + This copyrighted material is made available to anyone wishing to use, + modify, copy, or redistribute it subject to the terms and conditions + of the FreeBSD License. This program is distributed in the hope that + it will be useful, but WITHOUT ANY WARRANTY expressed or implied, + including the implied warranties of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. A copy of this license is available at + http://www.opensource.org/licenses. +*/ + +#ifndef _INTERNAL_SYSCALL_H +#define _INTERNAL_SYSCALL_H + +#include + +static inline long +__syscall_error(long a0) +{ + errno = -a0; + return -1; +} + +static inline long +__internal_syscall(long n, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5) +{ + register long a0 asm("a0") = _a0; + register long a1 asm("a1") = _a1; + register long a2 asm("a2") = _a2; + register long a3 asm("a3") = _a3; + register long a4 asm("a4") = _a4; + register long a5 asm("a5") = _a5; + +#ifdef __riscv_32e + register long syscall_id asm("t0") = n; +#else + register long syscall_id asm("a7") = n; +#endif + + asm volatile ("scall" + : "+r"(a0) : "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5), "r"(syscall_id)); + + return a0; +} + +static inline long +syscall_errno(long n, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5) +{ + long a0 = __internal_syscall (n, _a0, _a1, _a2, _a3, _a4, _a5); + + if (a0 < 0) + return __syscall_error (a0); + else + return a0; +} + +#endif diff --git a/libgloss/riscv/kernel_stat.h b/libgloss/riscv/kernel_stat.h new file mode 100644 index 000000000..d07bac544 --- /dev/null +++ b/libgloss/riscv/kernel_stat.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2017 SiFive Inc. All rights reserved. + + This copyrighted material is made available to anyone wishing to use, + modify, copy, or redistribute it subject to the terms and conditions + of the FreeBSD License. This program is distributed in the hope that + it will be useful, but WITHOUT ANY WARRANTY expressed or implied, + including the implied warranties of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. A copy of this license is available at + http://www.opensource.org/licenses. +*/ + +#ifndef _RISCV_KERNEL_STAT_H +#define _RISCV_KERNEL_STAT_H + +#include +#include + +struct kernel_stat +{ + unsigned long long st_dev; + unsigned long long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + unsigned long long st_rdev; + unsigned long long __pad1; + long long st_size; + int st_blksize; + int __pad2; + long long st_blocks; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + int __glibc_reserved[2]; +}; + +void _conv_stat (struct stat *, struct kernel_stat *); +#endif /* _RISCV_KERNEL_STAT_H */ diff --git a/libgloss/riscv/machine/syscall.h b/libgloss/riscv/machine/syscall.h index 424bd906a..5cd15b848 100644 --- a/libgloss/riscv/machine/syscall.h +++ b/libgloss/riscv/machine/syscall.h @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at @@ -54,29 +54,4 @@ #define SYS_time 1062 #define SYS_getmainvars 2011 -extern long __syscall_error(long); - -static inline long -__internal_syscall(long n, long _a0, long _a1, long _a2, long _a3) -{ - register long a0 asm("a0") = _a0; - register long a1 asm("a1") = _a1; - register long a2 asm("a2") = _a2; - register long a3 asm("a3") = _a3; - -#ifdef __riscv_32e - register long syscall_id asm("t0") = n; -#else - register long syscall_id asm("a7") = n; -#endif - - asm volatile ("scall" - : "+r"(a0) : "r"(a1), "r"(a2), "r"(a3), "r"(syscall_id)); - - if (a0 < 0) - return __syscall_error (a0); - else - return a0; -} - #endif diff --git a/libgloss/riscv/nano.specs b/libgloss/riscv/nano.specs new file mode 100644 index 000000000..89fd23176 --- /dev/null +++ b/libgloss/riscv/nano.specs @@ -0,0 +1,23 @@ +%rename link nano_link +%rename link_gcc_c_sequence nano_link_gcc_c_sequence +%rename cpp nano_cpp + +*cpp: +-isystem =/include/newlib-nano %(nano_cpp) + +*nano_libc: +-lc_nano + +*nano_libgloss: +%{specs=nosys.specs:-lnosys} %{!specs=nosys.specs:-lgloss_nano} + +*link_gcc_c_sequence: +%(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group + +*link: +%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) + +*lib: +%{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}} + +# ??? Maybe put --gc-sections option in here? diff --git a/libgloss/riscv/nanosleep.c b/libgloss/riscv/nanosleep.c new file mode 100644 index 000000000..1a247109c --- /dev/null +++ b/libgloss/riscv/nanosleep.c @@ -0,0 +1,12 @@ +#include +#include + +int +nanosleep(const struct timespec *rqtp, struct timespec *rmtp) +{ + unsigned long current_time, end_time; + asm ("rdtime %0" : "+r" (current_time)); + end_time = current_time + rqtp->tv_sec * 1000000000ULL + rqtp->tv_nsec; + while (current_time <= end_time) asm ("rdtime %0" : "+r" (current_time)); + return 0; +} diff --git a/libgloss/riscv/sim.specs b/libgloss/riscv/sim.specs new file mode 100644 index 000000000..31fde6906 --- /dev/null +++ b/libgloss/riscv/sim.specs @@ -0,0 +1,10 @@ +# Spec file for gdb simulator. + +%rename lib sim_lib +%rename link sim_link + +*lib: +--start-group -lc -lsim --end-group + +*link: +%(sim_link) %:replace-outfile(-lgloss -lsim) diff --git a/libgloss/riscv/sys_access.c b/libgloss/riscv/sys_access.c new file mode 100644 index 000000000..ef446d29b --- /dev/null +++ b/libgloss/riscv/sys_access.c @@ -0,0 +1,9 @@ +#include +#include "internal_syscall.h" + +/* Permissions of a file (by name). */ +int +_access(const char *file, int mode) +{ + return syscall_errno (SYS_access, file, mode, 0, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_chdir.c b/libgloss/riscv/sys_chdir.c new file mode 100644 index 000000000..0b2b0f53d --- /dev/null +++ b/libgloss/riscv/sys_chdir.c @@ -0,0 +1,8 @@ +#include + +/* Stub. */ +int +_chdir(const char *path) +{ + return -1; +} diff --git a/libgloss/riscv/sys_chmod.c b/libgloss/riscv/sys_chmod.c new file mode 100644 index 000000000..2c11e1d03 --- /dev/null +++ b/libgloss/riscv/sys_chmod.c @@ -0,0 +1,9 @@ +#include +#include + +/* Stub. */ +int +_chmod(const char *path, mode_t mode) +{ + return -1; +} diff --git a/libgloss/riscv/sys_chown.c b/libgloss/riscv/sys_chown.c new file mode 100644 index 000000000..8faddffe2 --- /dev/null +++ b/libgloss/riscv/sys_chown.c @@ -0,0 +1,8 @@ +#include +#include + +/* Stub. */ +int _chown(const char *path, uid_t owner, gid_t group) +{ + return -1; +} diff --git a/libgloss/riscv/sys_close.c b/libgloss/riscv/sys_close.c new file mode 100644 index 000000000..80b10c66a --- /dev/null +++ b/libgloss/riscv/sys_close.c @@ -0,0 +1,9 @@ +#include +#include "internal_syscall.h" + +/* Close a file. */ +int +_close(int file) +{ + return syscall_errno (SYS_close, file, 0, 0, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_conv_stat.c b/libgloss/riscv/sys_conv_stat.c new file mode 100644 index 000000000..73c6a8672 --- /dev/null +++ b/libgloss/riscv/sys_conv_stat.c @@ -0,0 +1,21 @@ +#include +#include "kernel_stat.h" + +/* Convert linux's stat64 sturct to newlib's stat. */ +void +_conv_stat (struct stat *st, struct kernel_stat *kst) +{ + st->st_dev = kst->st_dev; + st->st_ino = kst->st_ino; + st->st_mode = kst->st_mode; + st->st_nlink = kst->st_nlink; + st->st_uid = kst->st_uid; + st->st_gid = kst->st_gid; + st->st_rdev = kst->st_rdev; + st->st_size = kst->st_size; + st->st_blocks = kst->st_blocks; + st->st_blksize = kst->st_blksize; + st->st_atime = kst->st_atim.tv_sec; + st->st_mtime = kst->st_mtim.tv_sec; + st->st_ctime = kst->st_ctim.tv_sec; +} diff --git a/libgloss/riscv/sys_execve.c b/libgloss/riscv/sys_execve.c new file mode 100644 index 000000000..d6447373e --- /dev/null +++ b/libgloss/riscv/sys_execve.c @@ -0,0 +1,11 @@ +#include +#include "internal_syscall.h" + +/* Transfer control to a new process. Minimal implementation for a + system without processes from newlib documentation. */ +int +_execve(const char *name, char *const argv[], char *const env[]) +{ + errno = ENOMEM; + return -1; +} diff --git a/libgloss/riscv/sys_exit.c b/libgloss/riscv/sys_exit.c new file mode 100644 index 000000000..03e1c34e8 --- /dev/null +++ b/libgloss/riscv/sys_exit.c @@ -0,0 +1,10 @@ +#include +#include "internal_syscall.h" + +/* Exit a program without cleaning up files. */ +void +_exit(int exit_status) +{ + syscall_errno (SYS_exit, exit_status, 0, 0, 0, 0, 0); + while (1); +} diff --git a/libgloss/riscv/sys_faccessat.c b/libgloss/riscv/sys_faccessat.c new file mode 100644 index 000000000..e966a4a78 --- /dev/null +++ b/libgloss/riscv/sys_faccessat.c @@ -0,0 +1,8 @@ +#include +#include "internal_syscall.h" + +/* Permissions of a file (by name) in a given directory. */ +int _faccessat(int dirfd, const char *file, int mode, int flags) +{ + return syscall_errno (SYS_faccessat, dirfd, file, mode, flags, 0, 0); +} diff --git a/libgloss/riscv/sys_fork.c b/libgloss/riscv/sys_fork.c new file mode 100644 index 000000000..8ace14096 --- /dev/null +++ b/libgloss/riscv/sys_fork.c @@ -0,0 +1,10 @@ +#include +#include "internal_syscall.h" + +/* Create a new process. Minimal implementation for a system without + processes from newlib documentation. */ +int _fork() +{ + errno = EAGAIN; + return -1; +} diff --git a/libgloss/riscv/sys_fstat.c b/libgloss/riscv/sys_fstat.c new file mode 100644 index 000000000..13a0bca2f --- /dev/null +++ b/libgloss/riscv/sys_fstat.c @@ -0,0 +1,15 @@ +#include +#include "kernel_stat.h" +#include "internal_syscall.h" + +/* Status of an open file. The sys/stat.h header file required is + distributed in the include subdirectory for this C library. */ + +int +_fstat(int file, struct stat *st) +{ + struct kernel_stat kst; + int rv = syscall_errno (SYS_fstat, file, &kst, 0, 0, 0, 0); + _conv_stat (st, &kst); + return rv; +} diff --git a/libgloss/riscv/sys_fstatat.c b/libgloss/riscv/sys_fstatat.c new file mode 100644 index 000000000..0e4ea42d0 --- /dev/null +++ b/libgloss/riscv/sys_fstatat.c @@ -0,0 +1,14 @@ +#include +#include "kernel_stat.h" +#include "internal_syscall.h" + +/* Status of an open file. The sys/stat.h header file required is + distributed in the include subdirectory for this C library. */ +int +_fstatat(int dirfd, const char *file, struct stat *st, int flags) +{ + struct kernel_stat kst; + int rv = syscall_errno (SYS_fstatat, dirfd, file, &kst, flags, 0, 0); + _conv_stat (st, &kst); + return rv; +} diff --git a/libgloss/riscv/sys_ftime.c b/libgloss/riscv/sys_ftime.c new file mode 100644 index 000000000..5705592be --- /dev/null +++ b/libgloss/riscv/sys_ftime.c @@ -0,0 +1,10 @@ +#include +#include + +/* Get the current time. Only relatively correct. */ +int +_ftime(struct timeb *tp) +{ + tp->time = tp->millitm = 0; + return 0; +} diff --git a/libgloss/riscv/sys_getcwd.c b/libgloss/riscv/sys_getcwd.c new file mode 100644 index 000000000..b0fb205d7 --- /dev/null +++ b/libgloss/riscv/sys_getcwd.c @@ -0,0 +1,9 @@ +#include +#include + +/* Stub. */ +char * +_getcwd(char *buf, size_t size) +{ + return NULL; +} diff --git a/libgloss/riscv/sys_getpid.c b/libgloss/riscv/sys_getpid.c new file mode 100644 index 000000000..2aa072177 --- /dev/null +++ b/libgloss/riscv/sys_getpid.c @@ -0,0 +1,11 @@ +#include + +/* Get process id. This is sometimes used to generate strings unlikely + to conflict with other processes. Minimal implementation for a + system without processes just returns 1. */ + +int +_getpid() +{ + return 1; +} diff --git a/libgloss/riscv/sys_gettimeofday.c b/libgloss/riscv/sys_gettimeofday.c new file mode 100644 index 000000000..457dcbcc7 --- /dev/null +++ b/libgloss/riscv/sys_gettimeofday.c @@ -0,0 +1,10 @@ +#include +#include +#include "internal_syscall.h" + +/* Get the current time. Only relatively correct. */ +int +_gettimeofday(struct timeval *tp, void *tzp) +{ + return syscall_errno (SYS_gettimeofday, tp, 0, 0, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_isatty.c b/libgloss/riscv/sys_isatty.c new file mode 100644 index 000000000..8857f4828 --- /dev/null +++ b/libgloss/riscv/sys_isatty.c @@ -0,0 +1,17 @@ +#include +#include +#include "internal_syscall.h" + +extern int _fstat(int file, struct stat *st); + +/* Query whether output stream is a terminal. For consistency with the + other minimal implementations, which only support output to stdout, + this minimal implementation is suggested by the newlib docs. */ + +int +_isatty(int file) +{ + struct stat s; + int ret = _fstat (file, &s); + return ret == -1 ? 0 : !!(s.st_mode & S_IFCHR); +} diff --git a/libgloss/riscv/sys_kill.c b/libgloss/riscv/sys_kill.c new file mode 100644 index 000000000..cf7f224ef --- /dev/null +++ b/libgloss/riscv/sys_kill.c @@ -0,0 +1,11 @@ +#include +#include "internal_syscall.h" + +/* Send a signal. Minimal implementation for a system without processes + just causes an error. */ +int +_kill(int pid, int sig) +{ + errno = EINVAL; + return -1; +} diff --git a/libgloss/riscv/sys_link.c b/libgloss/riscv/sys_link.c new file mode 100644 index 000000000..eaeb22b25 --- /dev/null +++ b/libgloss/riscv/sys_link.c @@ -0,0 +1,8 @@ +#include +#include "internal_syscall.h" + +/* Establish a new name for an existing file. */ +int _link(const char *old_name, const char *new_name) +{ + return syscall_errno (SYS_link, old_name, new_name, 0, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_lseek.c b/libgloss/riscv/sys_lseek.c new file mode 100644 index 000000000..7486a3a3e --- /dev/null +++ b/libgloss/riscv/sys_lseek.c @@ -0,0 +1,10 @@ +#include +#include +#include "internal_syscall.h" + +/* Set position in a file. */ +off_t +_lseek(int file, off_t ptr, int dir) +{ + return syscall_errno (SYS_lseek, file, ptr, dir, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_lstat.c b/libgloss/riscv/sys_lstat.c new file mode 100644 index 000000000..2eeabcce3 --- /dev/null +++ b/libgloss/riscv/sys_lstat.c @@ -0,0 +1,13 @@ +#include +#include +#include "internal_syscall.h" +#include "kernel_stat.h" + +/* Status of a link (by name). */ +int _lstat(const char *file, struct stat *st) +{ + struct kernel_stat kst; + int rv = syscall_errno (SYS_lstat, file, &kst, 0, 0, 0, 0); + _conv_stat (st, &kst); + return rv; +} diff --git a/libgloss/riscv/sys_open.c b/libgloss/riscv/sys_open.c new file mode 100644 index 000000000..4fd5d672f --- /dev/null +++ b/libgloss/riscv/sys_open.c @@ -0,0 +1,9 @@ +#include +#include "internal_syscall.h" + +/* Open a file. */ +int +_open(const char *name, int flags, int mode) +{ + return syscall_errno (SYS_open, name, flags, mode, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_openat.c b/libgloss/riscv/sys_openat.c new file mode 100644 index 000000000..cf429b7b2 --- /dev/null +++ b/libgloss/riscv/sys_openat.c @@ -0,0 +1,8 @@ +#include +#include "internal_syscall.h" + +/* Open file relative to given directory. */ +int _openat(int dirfd, const char *name, int flags, int mode) +{ + return syscall_errno (SYS_openat, dirfd, name, flags, mode, 0, 0); +} diff --git a/libgloss/riscv/sys_read.c b/libgloss/riscv/sys_read.c new file mode 100644 index 000000000..7367e2643 --- /dev/null +++ b/libgloss/riscv/sys_read.c @@ -0,0 +1,9 @@ +#include +#include +#include "internal_syscall.h" + +/* Read from a file. */ +ssize_t _read(int file, void *ptr, size_t len) +{ + return syscall_errno (SYS_read, file, ptr, len, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_sbrk.c b/libgloss/riscv/sys_sbrk.c new file mode 100644 index 000000000..f91c2c506 --- /dev/null +++ b/libgloss/riscv/sys_sbrk.c @@ -0,0 +1,56 @@ +#ifdef USING_SIM_SPECS + +// Gdb simulator requires that sbrk be implemented without a syscall. +extern char _end[]; /* _end is set in the linker command file */ +char *heap_ptr; + +/* + * sbrk -- changes heap size size. Get nbytes more + * RAM. We just increment a pointer in what's + * left of memory on the board. + */ +char * +_sbrk (nbytes) + int nbytes; +{ + char *base; + + if (!heap_ptr) + heap_ptr = (char *)&_end; + base = heap_ptr; + heap_ptr += nbytes; + + return base; +} + +#else + +// QEMU uses a syscall. +#include +#include +#include "internal_syscall.h" + +/* Increase program data space. As malloc and related functions depend + on this, it is useful to have a working implementation. The following + is suggested by the newlib docs and suffices for a standalone + system. */ +void * +_sbrk(ptrdiff_t incr) +{ + static unsigned long heap_end; + + if (heap_end == 0) + { + long brk = __internal_syscall (SYS_brk, 0, 0, 0, 0, 0, 0); + if (brk == -1) + return (void *)__syscall_error (-ENOMEM); + heap_end = brk; + } + + if (__internal_syscall (SYS_brk, heap_end + incr, 0, 0, 0, 0, 0) != heap_end + incr) + return (void *)__syscall_error (-ENOMEM); + + heap_end += incr; + return (void *)(heap_end - incr); +} +#endif diff --git a/libgloss/riscv/sys_stat.c b/libgloss/riscv/sys_stat.c new file mode 100644 index 000000000..a193b10ad --- /dev/null +++ b/libgloss/riscv/sys_stat.c @@ -0,0 +1,14 @@ +#include +#include "kernel_stat.h" +#include "internal_syscall.h" + +/* Status of a file (by name). */ + +int +_stat(const char *file, struct stat *st) +{ + struct kernel_stat kst; + int rv = syscall_errno (SYS_stat, file, &kst, 0, 0, 0, 0); + _conv_stat (st, &kst); + return rv; +} diff --git a/libgloss/riscv/sys_sysconf.c b/libgloss/riscv/sys_sysconf.c new file mode 100644 index 000000000..dffdebab9 --- /dev/null +++ b/libgloss/riscv/sys_sysconf.c @@ -0,0 +1,17 @@ +#include +#include +#include + +/* Get configurable system variables. */ + +long +_sysconf(int name) +{ + switch (name) + { + case _SC_CLK_TCK: + return CLOCKS_PER_SEC; + } + + return -1; +} diff --git a/libgloss/riscv/sys_times.c b/libgloss/riscv/sys_times.c new file mode 100644 index 000000000..fc8133ade --- /dev/null +++ b/libgloss/riscv/sys_times.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include "internal_syscall.h" + +extern int _gettimeofday(struct timeval *, void *); + +/* Timing information for current process. From + newlib/libc/include/sys/times.h the tms struct fields are as follows: + + - clock_t tms_utime : user clock ticks + - clock_t tms_stime : system clock ticks + - clock_t tms_cutime : children's user clock ticks + - clock_t tms_cstime : children's system clock ticks + + Since maven does not currently support processes we set both of the + children's times to zero. Eventually we might want to separately + account for user vs system time, but for now we just return the total + number of cycles since starting the program. */ +clock_t +_times(struct tms *buf) +{ + // when called for the first time, initialize t0 + static struct timeval t0; + if (t0.tv_sec == 0 && t0.tv_usec == 0) + _gettimeofday (&t0, 0); + + struct timeval t; + _gettimeofday (&t, 0); + + long long utime = (t.tv_sec - t0.tv_sec) * 1000000 + (t.tv_usec - t0.tv_usec); + buf->tms_utime = utime * CLOCKS_PER_SEC / 1000000; + buf->tms_stime = buf->tms_cstime = buf->tms_cutime = 0; + + return buf->tms_utime; +} diff --git a/libgloss/riscv/sys_unlink.c b/libgloss/riscv/sys_unlink.c new file mode 100644 index 000000000..b55fe1ec2 --- /dev/null +++ b/libgloss/riscv/sys_unlink.c @@ -0,0 +1,9 @@ +#include +#include "internal_syscall.h" + +/* Remove a file's directory entry. */ +int +_unlink(const char *name) +{ + return syscall_errno (SYS_unlink, name, 0, 0, 0, 0, 0); +} diff --git a/libgloss/riscv/sys_utime.c b/libgloss/riscv/sys_utime.c new file mode 100644 index 000000000..c03a968e4 --- /dev/null +++ b/libgloss/riscv/sys_utime.c @@ -0,0 +1,8 @@ +#include + +/* Stub. */ +int +_utime(const char *path, const struct utimbuf *times) +{ + return -1; +} diff --git a/libgloss/riscv/sys_wait.c b/libgloss/riscv/sys_wait.c new file mode 100644 index 000000000..25bf44800 --- /dev/null +++ b/libgloss/riscv/sys_wait.c @@ -0,0 +1,10 @@ +#include +#include + +/* Wait for a child process. Minimal implementation for a system without + processes just causes an error. */ +int _wait(int *status) +{ + errno = ECHILD; + return -1; +} diff --git a/libgloss/riscv/sys_write.c b/libgloss/riscv/sys_write.c new file mode 100644 index 000000000..b972734e2 --- /dev/null +++ b/libgloss/riscv/sys_write.c @@ -0,0 +1,10 @@ +#include +#include +#include "internal_syscall.h" + +/* Write to a file. */ +ssize_t +_write(int file, const void *ptr, size_t len) +{ + return syscall_errno (SYS_write, file, ptr, len, 0, 0, 0); +} diff --git a/libgloss/riscv/syscalls.c b/libgloss/riscv/syscalls.c deleted file mode 100644 index d86bd8980..000000000 --- a/libgloss/riscv/syscalls.c +++ /dev/null @@ -1,419 +0,0 @@ -/* Copyright (c) 2017 SiFive Inc. All rights reserved. - - This copyrighted material is made available to anyone wishing to use, - modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that - it will be useful, but WITHOUT ANY WARRANTY expressed or implied, - including the implied warranties of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. A copy of this license is available at - http://www.opensource.org/licenses. - - ======================================================================== - syscalls.c : Newlib operating system interface - ======================================================================== - This is the maven implementation of the narrow newlib operating - system interface. It is based on the minimum stubs in the newlib - documentation, the error stubs in libnosys, and the previous scale - implementation. Please do not include any additional system calls or - other functions in this file. Additional header and source files - should be in the machine subdirectory. - - Here is a list of the functions which make up the operating system - interface. The file management instructions execute syscall assembly - instructions so that a proxy kernel (or the simulator) can marshal up - the request to the host machine. The process management functions are - mainly just stubs since for now maven only supports a single process. - - - File management functions - + open : (v) open file - + lseek : (v) set position in file - + read : (v) read from file - + write : (v) write to file - + fstat : (z) status of an open file - + stat : (z) status of a file by name - + close : (z) close a file - + link : (z) rename a file - + unlink : (z) remote file's directory entry - - - Process management functions - + execve : (z) transfer control to new proc - + fork : (z) create a new process - + getpid : (v) get process id - + kill : (z) send signal to child process - + wait : (z) wait for a child process - - - Misc functions - + isatty : (v) query whether output stream is a terminal - + times : (z) timing information for current process - + sbrk : (v) increase program data space - + _exit : (-) exit program without cleaning up files - - There are two types of system calls. Those which return a value when - everything is okay (marked with (v) in above list) and those which - return a zero when everything is okay (marked with (z) in above - list). On an error (ie. when the error flag is 1) the return value is - always an errno which should correspond to the numbers in - newlib/libc/include/sys/errno.h - - See the newlib documentation for more information - http://sourceware.org/newlib/libc.html#Syscalls -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define syscall_errno(n, a, b, c, d) \ - __internal_syscall(n, (long)(a), (long)(b), (long)(c), (long)(d)) - -long -__syscall_error(long a0) -{ - errno = -a0; - return -1; -} - -/* Open a file. */ -int -_open(const char *name, int flags, int mode) -{ - return syscall_errno (SYS_open, name, flags, mode, 0); -} - -/* Open file relative to given directory. */ -int -_openat(int dirfd, const char *name, int flags, int mode) -{ - return syscall_errno (SYS_openat, dirfd, name, flags, mode); -} - -/* Set position in a file. */ -off_t -_lseek(int file, off_t ptr, int dir) -{ - return syscall_errno (SYS_lseek, file, ptr, dir, 0); -} - -/* Read from a file. */ -ssize_t -_read(int file, void *ptr, size_t len) -{ - return syscall_errno (SYS_read, file, ptr, len, 0); -} - -/* Write to a file. */ -ssize_t -_write(int file, const void *ptr, size_t len) -{ - return syscall_errno (SYS_write, file, ptr, len, 0); -} - -struct kernel_stat -{ - unsigned long long st_dev; - unsigned long long st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - unsigned long long st_rdev; - unsigned long long __pad1; - long long st_size; - int st_blksize; - int __pad2; - long long st_blocks; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - int __glibc_reserved[2]; -}; - -/* Convert linux's stat64 sturct to newlib's stat. */ -static void -conv_stat (struct stat *st, struct kernel_stat *kst) -{ - st->st_dev = kst->st_dev; - st->st_ino = kst->st_ino; - st->st_mode = kst->st_mode; - st->st_nlink = kst->st_nlink; - st->st_uid = kst->st_uid; - st->st_gid = kst->st_gid; - st->st_rdev = kst->st_rdev; - st->st_size = kst->st_size; - st->st_blocks = kst->st_blocks; - st->st_blksize = kst->st_blksize; - st->st_atime = kst->st_atim.tv_sec; - st->st_mtime = kst->st_mtim.tv_sec; - st->st_ctime = kst->st_ctim.tv_sec; -} - -/* Status of an open file. The sys/stat.h header file required is - distributed in the include subdirectory for this C library. */ -int -_fstat(int file, struct stat *st) -{ - struct kernel_stat kst; - int rv = syscall_errno (SYS_fstat, file, &kst, 0, 0); - conv_stat (st, &kst); - return rv; -} - -/* Status of a file (by name). */ -int -_stat(const char *file, struct stat *st) -{ - struct kernel_stat kst; - int rv = syscall_errno (SYS_stat, file, &kst, 0, 0); - conv_stat (st, &kst); - return rv; -} - -/* Status of a link (by name). */ -int -_lstat(const char *file, struct stat *st) -{ - struct kernel_stat kst; - int rv = syscall_errno (SYS_lstat, file, &kst, 0, 0); - conv_stat (st, &kst); - return rv; -} - -/* Status of a file (by name) in a given directory. */ -int -_fstatat(int dirfd, const char *file, struct stat *st, int flags) -{ - struct kernel_stat kst; - int rv = syscall_errno (SYS_fstatat, dirfd, file, &kst, flags); - conv_stat (st, &kst); - return rv; -} - -/* Permissions of a file (by name). */ -int -_access(const char *file, int mode) -{ - return syscall_errno (SYS_access, file, mode, 0, 0); -} - -/* Permissions of a file (by name) in a given directory. */ -int -_faccessat(int dirfd, const char *file, int mode, int flags) -{ - return syscall_errno (SYS_faccessat, dirfd, file, mode, flags); -} - -/* Close a file. */ -int -_close(int file) -{ - return syscall_errno (SYS_close, file, 0, 0, 0); -} - -/* Establish a new name for an existing file. */ -int -_link(const char *old_name, const char *new_name) -{ - return syscall_errno (SYS_link, old_name, new_name, 0, 0); -} - -/* Remove a file's directory entry. */ -int -_unlink(const char *name) -{ - return syscall_errno (SYS_unlink, name, 0, 0, 0); -} - -/* Transfer control to a new process. Minimal implementation for a - system without processes from newlib documentation. */ -int -_execve(const char *name, char *const argv[], char *const env[]) -{ - errno = ENOMEM; - return -1; -} - -/* Create a new process. Minimal implementation for a system without - processes from newlib documentation. */ - -int -_fork() -{ - errno = EAGAIN; - return -1; -} - -/* Get process id. This is sometimes used to generate strings unlikely - to conflict with other processes. Minimal implementation for a - system without processes just returns 1. */ - -int -_getpid() -{ - return 1; -} - -/* Send a signal. Minimal implementation for a system without processes - just causes an error. */ - -int -_kill(int pid, int sig) -{ - errno = EINVAL; - return -1; -} - -/* Wait for a child process. Minimal implementation for a system without - processes just causes an error. */ - -int -_wait(int *status) -{ - errno = ECHILD; - return -1; -} - -/* Query whether output stream is a terminal. For consistency with the - other minimal implementations, which only support output to stdout, - this minimal implementation is suggested by the newlib docs. */ - -int -_isatty(int file) -{ - struct stat s; - int ret = _fstat (file, &s); - return ret == -1 ? -1 : !!(s.st_mode & S_IFCHR); -} - -/* Get the current time. Only relatively correct. */ - -int -_gettimeofday(struct timeval *tp, void *tz) -{ - return syscall_errno (SYS_gettimeofday, tp, 0, 0, 0); -} - -/* Timing information for current process. From - newlib/libc/include/sys/times.h the tms struct fields are as follows: - - - clock_t tms_utime : user clock ticks - - clock_t tms_stime : system clock ticks - - clock_t tms_cutime : children's user clock ticks - - clock_t tms_cstime : children's system clock ticks - - Since maven does not currently support processes we set both of the - children's times to zero. Eventually we might want to separately - account for user vs system time, but for now we just return the total - number of cycles since starting the program. */ -clock_t -_times(struct tms *buf) -{ - // when called for the first time, initialize t0 - static struct timeval t0; - if(t0.tv_sec == 0) - _gettimeofday (&t0,0); - - struct timeval t; - _gettimeofday (&t, 0); - - long long utime = (t.tv_sec - t0.tv_sec) * 1000000 + (t.tv_usec - t0.tv_usec); - buf->tms_utime = utime * CLOCKS_PER_SEC / 1000000; - buf->tms_stime = buf->tms_cstime = buf->tms_cutime = 0; - - return -1; -} - -/* Get the current time. Only relatively correct. */ -int -_ftime(struct timeb *tp) -{ - tp->time = tp->millitm = 0; - return 0; -} - -/* Stub. */ -int -_utime(const char *path, const struct utimbuf *times) -{ - return -1; -} - -/* Stub. */ -int -_chown(const char *path, uid_t owner, gid_t group) -{ - return -1; -} - -/* Stub. */ -int -_chmod(const char *path, mode_t mode) -{ - return -1; -} - -/* Stub. */ -int -_chdir(const char *path) -{ - return -1; -} - -/* Stub. */ -char * -_getcwd(char *buf, size_t size) -{ - return NULL; -} - -/* Get configurable system variables. */ - -long -_sysconf(int name) -{ - switch (name) - { - case _SC_CLK_TCK: - return CLOCKS_PER_SEC; - } - - return -1; -} - -/* Increase program data space. As malloc and related functions depend - on this, it is useful to have a working implementation. The following - is suggested by the newlib docs and suffices for a standalone - system. */ -void * -_sbrk(ptrdiff_t incr) -{ - static unsigned long heap_end; - - if (heap_end == 0) - { - long brk = syscall_errno (SYS_brk, 0, 0, 0, 0); - if (brk == -1) - return (void *)-1; - heap_end = brk; - } - - if (syscall_errno (SYS_brk, heap_end + incr, 0, 0, 0) != heap_end + incr) - return (void *)-1; - - heap_end += incr; - return (void *)(heap_end - incr); -} - -/* Exit a program without cleaning up files. */ - -void -_exit(int exit_status) -{ - syscall_errno (SYS_exit, exit_status, 0, 0, 0); - while (1); -} diff --git a/libgloss/sparc_leon/asm-leon/clock.h b/libgloss/sparc_leon/asm-leon/clock.h index 189e942e1..7e33ae4d0 100644 --- a/libgloss/sparc_leon/asm-leon/clock.h +++ b/libgloss/sparc_leon/asm-leon/clock.h @@ -30,8 +30,8 @@ #include #ifndef __ASSEMBLER__ -int _EXFUN (gettimeofday, (struct timeval * __p, void *__tz)); -int _EXFUN (settimeofday, (const struct timeval *, const struct timezone *)); +int gettimeofday (struct timeval * __p, void *__tz); +int settimeofday (const struct timeval *, const struct timezone *); void do_gettimeofday (struct timeval *tv); #endif diff --git a/libgloss/sparc_leon/console_dbg.c b/libgloss/sparc_leon/console_dbg.c index 57c258fb4..f4bfc5c27 100644 --- a/libgloss/sparc_leon/console_dbg.c +++ b/libgloss/sparc_leon/console_dbg.c @@ -25,11 +25,7 @@ #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include diff --git a/libgloss/spu/getpid.c b/libgloss/spu/getpid.c index ff2d82028..89361720f 100644 --- a/libgloss/spu/getpid.c +++ b/libgloss/spu/getpid.c @@ -31,7 +31,7 @@ Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ int -getpid () +getpid (void) { return (1); } diff --git a/libgloss/stat.c b/libgloss/stat.c index ebb7de3f5..4d6312830 100644 --- a/libgloss/stat.c +++ b/libgloss/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (stat, (path, buf), - const char *path _AND +stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/tic6x/getpid.c b/libgloss/tic6x/getpid.c index 3c1a7b8b8..912ca18a5 100644 --- a/libgloss/tic6x/getpid.c +++ b/libgloss/tic6x/getpid.c @@ -19,8 +19,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (getpid, (), - ) +getpid (void) { return __MYPID; } diff --git a/libgloss/tic6x/kill.c b/libgloss/tic6x/kill.c index 3ed228fd2..98cd3c40e 100644 --- a/libgloss/tic6x/kill.c +++ b/libgloss/tic6x/kill.c @@ -19,8 +19,7 @@ * kill -- go out via exit... */ int -_DEFUN (kill, (pid, sig), - int pid _AND +kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/unlink.c b/libgloss/unlink.c index 15ea7e8a9..76c1a4fef 100644 --- a/libgloss/unlink.c +++ b/libgloss/unlink.c @@ -20,8 +20,7 @@ * we just return an error. */ int -_DEFUN (unlink, (path), - char * path) +unlink (char * path) { errno = EIO; return (-1); diff --git a/libgloss/write.c b/libgloss/write.c index 292a68e53..28b7ea37a 100644 --- a/libgloss/write.c +++ b/libgloss/write.c @@ -14,7 +14,7 @@ */ #include "glue.h" -extern int _EXFUN (outbyte, (char x)); +extern int outbyte (char x); /* * write -- write bytes to the serial port. Ignore fd, since @@ -22,9 +22,8 @@ extern int _EXFUN (outbyte, (char x)); * open will only return an error. */ int -_DEFUN (write, (fd, buf, nbytes), - int fd _AND - char *buf _AND +write (int fd, + char *buf, int nbytes) { int i; diff --git a/libgloss/xc16x/misc.c b/libgloss/xc16x/misc.c index 786db36dd..d96550129 100644 --- a/libgloss/xc16x/misc.c +++ b/libgloss/xc16x/misc.c @@ -17,21 +17,19 @@ /* _raise(), getpid(), and kill() are required by abort(). getpid/kill are prefixed with '_' because of MISSING_SYSCALL_NAMES. */ -int _DEFUN(_raise,(sig), - int sig) +int _raise (int sig) { errno = ENOSYS; return -1; } -int _DEFUN(_getpid,(),) +int _getpid (void) { errno = ENOSYS; return -1; } -int _DEFUN(_kill,(pid, sig), - int pid _AND +int _kill (int pid, int sig) { errno = ENOSYS; diff --git a/libgloss/xstormy16/close.c b/libgloss/xstormy16/close.c index 5fcfbf576..2b50e6432 100644 --- a/libgloss/xstormy16/close.c +++ b/libgloss/xstormy16/close.c @@ -18,8 +18,7 @@ * close -- We don't need to do anything, but pretend we did. */ int -_DEFUN (_close ,(fd), - int fd) +_close (int fd) { return (0); } diff --git a/libgloss/xstormy16/fstat.c b/libgloss/xstormy16/fstat.c index 982d578cb..b962036f3 100644 --- a/libgloss/xstormy16/fstat.c +++ b/libgloss/xstormy16/fstat.c @@ -19,8 +19,7 @@ * fstat -- Since we have no file system, we just return an error. */ int -_DEFUN (_fstat, (fd, buf), - int fd _AND +_fstat (int fd, struct stat *buf) { buf->st_mode = S_IFCHR; /* Always pretend to be a tty */ diff --git a/libgloss/xstormy16/getpid.c b/libgloss/xstormy16/getpid.c index 0f081a11d..e49fde4a0 100644 --- a/libgloss/xstormy16/getpid.c +++ b/libgloss/xstormy16/getpid.c @@ -18,8 +18,7 @@ * getpid -- only one process, so just return 1. */ int -_DEFUN (_getpid, (), - ) +_getpid (void) { return __MYPID; } diff --git a/libgloss/xstormy16/isatty.c b/libgloss/xstormy16/isatty.c index e3c32051a..f7d8fa098 100644 --- a/libgloss/xstormy16/isatty.c +++ b/libgloss/xstormy16/isatty.c @@ -17,11 +17,10 @@ /* * isatty -- returns 1 if connected to a terminal device, * returns 0 if not. Since we're hooked up to a - * serial port, we'll say yes _AND return a 1. + * serial port, we'll say yes and return a 1. */ int -_DEFUN (_isatty, (fd), - int fd) +_isatty (int fd) { return (1); } diff --git a/libgloss/xstormy16/kill.c b/libgloss/xstormy16/kill.c index 0bbc0141a..f5ccd2191 100644 --- a/libgloss/xstormy16/kill.c +++ b/libgloss/xstormy16/kill.c @@ -18,8 +18,7 @@ * kill -- go out via exit... */ int -_DEFUN (_kill, (pid, sig), - int pid _AND +_kill (int pid, int sig) { if(pid == __MYPID) diff --git a/libgloss/xstormy16/lseek.c b/libgloss/xstormy16/lseek.c index 640a96ea0..c00665723 100644 --- a/libgloss/xstormy16/lseek.c +++ b/libgloss/xstormy16/lseek.c @@ -20,9 +20,8 @@ * lseek -- Since a serial port is non-seekable, we return an error. */ off_t -_DEFUN (_lseek, (fd, offset, whence), - int fd _AND - off_t offset _AND +_lseek (int fd, + off_t offset, int whence) { errno = ESPIPE; diff --git a/libgloss/xstormy16/open.c b/libgloss/xstormy16/open.c index a2c318e1a..f96484c7b 100644 --- a/libgloss/xstormy16/open.c +++ b/libgloss/xstormy16/open.c @@ -20,9 +20,8 @@ * we return an error. */ int -_DEFUN (_open, (buf, flags, mode), - const char *buf _AND - int flags _AND +_open (const char *buf, + int flags, int mode) { errno = EIO; diff --git a/libgloss/xstormy16/stat.c b/libgloss/xstormy16/stat.c index c766a341c..7d089edfa 100644 --- a/libgloss/xstormy16/stat.c +++ b/libgloss/xstormy16/stat.c @@ -20,8 +20,7 @@ * stat -- Since we have no file system, we just return an error. */ int -_DEFUN (_stat, (path, buf), - const char *path _AND +_stat (const char *path, struct stat *buf) { errno = EIO; diff --git a/libgloss/xstormy16/unlink.c b/libgloss/xstormy16/unlink.c index 1c56663ea..10180ac9b 100644 --- a/libgloss/xstormy16/unlink.c +++ b/libgloss/xstormy16/unlink.c @@ -20,8 +20,7 @@ * we just return an error. */ int -_DEFUN (_unlink, (path), - char * path) +_unlink (char * path) { errno = EIO; return (-1); diff --git a/newlib/HOWTO b/newlib/HOWTO index c5754e5b8..bb49e79dd 100644 --- a/newlib/HOWTO +++ b/newlib/HOWTO @@ -47,14 +47,8 @@ but these, however, should be carefully limited and be given alternates for when a non-printed manual is produced--such as when info pages are produced. For an example of this kind of usage, see libm/common/s_logb.c. - Please note that most files with documentation contain both an -ANSI_SYNOPSIS and a TRAD_SYNOPSIS section. The TRAD_SYNOPSIS section gets -deleted (since at least 2000) by makedoc, so when working on files these -can safely be deleted and if you're making a new file, there is no need -to add the TRAD_SYNOPSIS section. - If writing a new function that requires documentation, the required -sections are FUNCTION, INDEX, ANSI_SYNOPSIS (or SYNOPSIS), DESCRIPTION, RETURNS, +sections are FUNCTION, INDEX, SYNOPSIS, DESCRIPTION, RETURNS, and PORTABILITY. BUGS and SEEALSO should be added as appropriate. Source files which contain documentation are processed into ".def" diff --git a/newlib/MAINTAINERS b/newlib/MAINTAINERS index 1ebf74316..48cd0375f 100644 --- a/newlib/MAINTAINERS +++ b/newlib/MAINTAINERS @@ -5,8 +5,8 @@ The official maintainers of newlib: -Jeff Johnston jjohnstn@redhat.com Corinna Vinschen corinna@vinschen.de +Jeff Johnston jjohnstn@redhat.com Various Domain Maintainers @@ -36,14 +36,12 @@ well as cpu-specific portions of the build system, without approval. arm Nick Clifton nickc@redhat.com Richard Earnshaw richard.earnshaw@arm.com -m32c port DJ Delorie dj@redhat.com mn10300 Nick Clifton nickc@redhat.com moxie Anthony Green green@moxielogic.com -rl78 DJ Delorie dj@redhat.com +risc-v Kito Cheng kito.cheng@gmail.com aarch64 Richard Earnshaw richard.earnshaw@arm.com Marcus Shawcroft marcus.shawcroft@arm.com -msp430 DJ Delorie dj@redhat.com - Nick Clifton nickc@redhat.com +msp430 Nick Clifton nickc@redhat.com OS Port Maintainers (OS alphabetical order) @@ -59,7 +57,7 @@ These are users with general write privileges after getting approval: Anthony Green green@moxielogic.com DJ Delorie dj@redhat.com -Jim Wilson wilson@specifixinc.com +Jim Wilson jimw@sifive.com Nick Clifton nickc@redhat.com Eric Blake eblake@redhat.com Will Newton will.newton@linaro.org diff --git a/newlib/Makefile.am b/newlib/Makefile.am index effa2adba..809d49238 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -324,6 +324,10 @@ endif for i in $(srcdir)/libc/include/rpc/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/rpc/`basename $$i`; \ done; \ + $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/ssp; \ + for i in $(srcdir)/libc/include/ssp/*.h; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/ssp/`basename $$i`; \ + done; \ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ for i in $(srcdir)/libc/include/sys/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ @@ -378,6 +382,15 @@ endif done ; \ else true; fi +# Generate Unicode data tables for libc/string/wcwidth and libc/ctype/??w* +unidata: + cd $(srcdir)/libc/string; ./mkunidata + cd $(srcdir)/libc/ctype; ./mkunidata + +unidate-download: + cd $(srcdir)/libc/string; ./mkunidata -u + cd $(srcdir)/libc/ctype; ./mkunidata -u + # Force makedoc to be built before building info files. info-recursive: doc/makedoc dvi-recursive: doc/makedoc diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 7756e7066..c3ee2908f 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -1071,6 +1071,10 @@ install-data-local: install-toollibLIBRARIES for i in $(srcdir)/libc/include/rpc/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/rpc/`basename $$i`; \ done; \ + $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/ssp; \ + for i in $(srcdir)/libc/include/ssp/*.h; do \ + $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/ssp/`basename $$i`; \ + done; \ $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/sys; \ for i in $(srcdir)/libc/include/sys/*.h; do \ $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/sys/`basename $$i`; \ @@ -1125,6 +1129,15 @@ install-data-local: install-toollibLIBRARIES done ; \ else true; fi +# Generate Unicode data tables for libc/string/wcwidth and libc/ctype/??w* +unidata: + cd $(srcdir)/libc/string; ./mkunidata + cd $(srcdir)/libc/ctype; ./mkunidata + +unidate-download: + cd $(srcdir)/libc/string; ./mkunidata -u + cd $(srcdir)/libc/ctype; ./mkunidata -u + # Force makedoc to be built before building info files. info-recursive: doc/makedoc dvi-recursive: doc/makedoc diff --git a/newlib/Makefile.shared b/newlib/Makefile.shared index c9ce5f468..f1152fc62 100644 --- a/newlib/Makefile.shared +++ b/newlib/Makefile.shared @@ -14,8 +14,8 @@ SUFFIXES = .def .xml CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi @@ -39,4 +39,4 @@ docbook: $(DOCBOOK_OUT_FILES) ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \ done -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) diff --git a/newlib/NEWS b/newlib/NEWS index e10042dd3..57b36ea89 100644 --- a/newlib/NEWS +++ b/newlib/NEWS @@ -1,3 +1,16 @@ +*** Major changes in newlib version 3.0.0: + +- K&R support removed in code and docs +- 64-bit time_t support +- riscv platform support added +- new expf, exp2f, logf, and powf implementations +- unification of lock object names +- locking routine retargetting at link time +- new long double complex math routines +- various ARM optimizations +- various POSIX/BSD additions +- further feature test macros overhaul + *** Major changes in newlib version 2.5.0: - memory.h added diff --git a/newlib/README b/newlib/README index 78f4de846..e793d57ce 100644 --- a/newlib/README +++ b/newlib/README @@ -1,9 +1,12 @@ - README for newlib-2.5.0 release + README for newlib-3.0.0 release (mostly cribbed from the README in the gdb-4.13 release) This is `newlib', a simple ANSI C library, math library, and collection of board support packages. +Prior to the 3.0.0 release, newlib supported both ANSI and K&R-style +compilers. As of 3.0.0, K&R is no longer supported. + The newlib and libgloss subdirectories are a collection of software from several sources, each with their own copyright and license. See the file COPYING.NEWLIB for details. The rest of the release tree is under either @@ -17,8 +20,8 @@ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Unpacking and Installation -- quick overview ========================== -When you unpack the newlib-2.5.0.tar.gz file, you'll find a directory -called `newlib-2.5.0', which contains: +When you unpack the newlib-3.0.0.tar.gz file, you'll find a directory +called `newlib-3.0.0', which contains: COPYING config/ install-sh* mpw-configure COPYING.LIB config-ml.in libgloss/ mpw-install @@ -94,13 +97,13 @@ directory. If the path to `configure' would be the same as the argument to `--srcdir', you can leave out the `--srcdir' option; it will be assumed.) - For example, with version 2.5.0, you can build NEWLIB in a separate + For example, with version 3.0.0, you can build NEWLIB in a separate directory for a Sun 4 cross m68k-aout environment like this: - cd newlib-2.5.0 + cd newlib-3.0.0 mkdir ../newlib-m68k-aout cd ../newlib-m68k-aout - ../newlib-2.5.0/configure --host=sun4 --target=m68k-aout + ../newlib-3.0.0/configure --host=sun4 --target=m68k-aout make When `configure' builds a configuration using a remote source @@ -116,8 +119,8 @@ called `configure' (or one of its subdirectories). The `Makefile' that `configure' generates in each source directory also runs recursively. If you type `make' in a source directory such -as `newlib-2.5.0' (or in a separate configured directory configured with -`--srcdir=PATH/newlib-2.5.0'), you will build all the required libraries. +as `newlib-3.0.0' (or in a separate configured directory configured with +`--srcdir=PATH/newlib-3.0.0'), you will build all the required libraries. When you have multiple hosts or targets configured in separate directories, you can run `make' on them in parallel (for example, if @@ -343,6 +346,12 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or disables the optimization and saves size of text and stack. Enabled by default. +`--enable-newlib-long-time_t' + Define time_t to long. On platforms with a 32-bit long type, this gives + raise to the year 2038 problem. The default type for time_t is a signed + 64-bit integer on most systems. + Disabled by default. + `--enable-multilib' Build many library versions. Enabled by default. @@ -595,7 +604,7 @@ Reporting Bugs The correct address for reporting bugs found in NEWLIB is "newlib@sourceware.org". Please email all bug reports to that -address. Please include the NEWLIB version number (e.g., newlib-2.5.0), +address. Please include the NEWLIB version number (e.g., newlib-3.0.0), and how you configured it (e.g., "sun4 host and m68k-aout target"). Since NEWLIB supports many different configurations, it is important that you be precise about this. diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4 index 2b0dd5822..19dfe0864 100644 --- a/newlib/acinclude.m4 +++ b/newlib/acinclude.m4 @@ -1,8 +1,8 @@ dnl This provides configure definitions used by all the newlib dnl configure.in files. -AC_DEFUN([DEF_NEWLIB_MAJOR_VERSION],m4_define([NEWLIB_MAJOR_VERSION],[2])) -AC_DEFUN([DEF_NEWLIB_MINOR_VERSION],m4_define([NEWLIB_MINOR_VERSION],[5])) +AC_DEFUN([DEF_NEWLIB_MAJOR_VERSION],m4_define([NEWLIB_MAJOR_VERSION],[3])) +AC_DEFUN([DEF_NEWLIB_MINOR_VERSION],m4_define([NEWLIB_MINOR_VERSION],[0])) AC_DEFUN([DEF_NEWLIB_PATCHLEVEL_VERSION],m4_define([NEWLIB_PATCHLEVEL_VERSION],[0])) AC_DEFUN([DEF_NEWLIB_VERSION],m4_define([NEWLIB_VERSION],[NEWLIB_MAJOR_VERSION.NEWLIB_MINOR_VERSION.NEWLIB_PATCHLEVEL_VERSION])) @@ -92,6 +92,16 @@ AC_ARG_ENABLE(newlib-supplied-syscalls, AM_CONDITIONAL(MAY_SUPPLY_SYSCALLS, test x[$]{newlib_may_supply_syscalls} = xyes) +dnl Support --disable-newlib-fno-builtin +AC_ARG_ENABLE(newlib-fno-builtin, +[ --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions], +[case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-fno-builtin option) ;; + esac], [newlib_fno_builtin=])dnl + + dnl We may get other options which we don't document: dnl --with-target-subdir, --with-multisrctop, --with-multisubdir @@ -202,8 +212,6 @@ fi . [$]{newlib_basedir}/configure.host -newlib_cflags="[$]{newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} AC_SUBST(NEWLIB_CFLAGS) @@ -221,6 +229,11 @@ AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4) AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes) +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + AC_MSG_WARN([${newlib_msg_warn}]) +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} diff --git a/newlib/configure b/newlib/configure index b2f0b3340..192a0b37a 100755 --- a/newlib/configure +++ b/newlib/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -804,6 +804,7 @@ enable_newlib_unbuf_stream_opt enable_lite_exit enable_newlib_nano_formatted_io enable_newlib_retargetable_locking +enable_newlib_long_time_t enable_multilib enable_target_optspace enable_malloc_debugging @@ -812,6 +813,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode enable_shared @@ -1377,7 +1379,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1447,7 +1449,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1477,6 +1479,7 @@ Optional Features: --enable-lite-exit enable light weight exit --enable-newlib-nano-formatted-io Use nano version formatted IO --enable-newlib-retargetable-locking Allow locking routines to be retargeted at link time + --enable-newlib-long-time_t define time_t to long --enable-multilib build many library versions (default) --enable-target-optspace optimize for space --enable-malloc-debugging indicate malloc debugging requested @@ -1485,6 +1488,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1580,7 +1584,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1858,7 +1862,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2501,6 +2505,19 @@ else fi +# Check whether --enable-newlib-long-time_t was given. +if test "${enable_newlib_long_time_t+set}" = set; then : + enableval=$enable_newlib_long_time_t; if test "${newlib_long_time_t+set}" != set; then + case "${enableval}" in + yes) newlib_long_time_t=yes ;; + no) newlib_long_time_t=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-long-time_t option" "$LINENO" 5 ;; + esac + fi +else + newlib_long_time_t=no +fi + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || @@ -3155,6 +3172,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -3193,7 +3222,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -4001,8 +4030,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -4062,6 +4089,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -11807,7 +11840,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11810 "configure" +#line 11843 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11913,7 +11946,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11916 "configure" +#line 11949 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12391,13 +12424,13 @@ _ACEOF fi -$as_echo "#define _NEWLIB_VERSION \"2.5.0\"" >>confdefs.h +$as_echo "#define _NEWLIB_VERSION \"3.0.0\"" >>confdefs.h -$as_echo "#define __NEWLIB__ 2" >>confdefs.h +$as_echo "#define __NEWLIB__ 3" >>confdefs.h -$as_echo "#define __NEWLIB_MINOR__ 5" >>confdefs.h +$as_echo "#define __NEWLIB_MINOR__ 0" >>confdefs.h $as_echo "#define __NEWLIB_PATCHLEVEL__ 0" >>confdefs.h @@ -12496,6 +12529,13 @@ _ACEOF fi +if test "${newlib_long_time_t}" = "yes"; then +cat >>confdefs.h <<_ACEOF +#define _WANT_USE_LONG_TIME_T 1 +_ACEOF + +fi + if test "x${iconv_encodings}" != "x" \ || test "x${iconv_to_encodings}" != "x" \ @@ -13323,7 +13363,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13389,7 +13429,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/configure.host b/newlib/configure.host index e5aeef4c6..cba2c7080 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -27,6 +27,8 @@ # newlib_io_c99_formats --enable-newlib-io-c99-formats ("yes", "no", "") # newlib_io_long_long --enable-newlib-io-long-long ("yes", "no", "") # newlib_io_long_double --enable-newlib-io-long-double ("yes", "no", "") +# newlib_global_stdio_streams --enable-global-stdio-streams ("yes", "no, "") +# newlib_fno_builtin --disable-newlib-fno-builtin ("yes", "no, "") # It sets the following shell variables: # newlib_cflags Special CFLAGS to use when building @@ -46,6 +48,7 @@ # crt1_dir directory where crt1 object is found # have_crt0 "yes"/"no" if crt0 is/isn't provided. # "" if crt0 is provided when sys_dir is set +# have_init_fini have init/fini ("yes" or "no", set to "yes" by default) # noinclude list of include files to not install newlib_cflags= @@ -64,6 +67,7 @@ mach_add_setjmp= crt1= crt1_dir= have_crt0= +have_init_fini=yes use_libtool=no have_sys_mach_dir=no default_newlib_io_c99_formats=no @@ -75,6 +79,7 @@ default_newlib_nano_malloc=no aext=a oext=o lpfx="lib_a-" +newlib_msg_warn= case "${target_optspace}:${host}" in yes:*) @@ -87,6 +92,19 @@ case "${target_optspace}:${host}" in ;; esac +case "${newlib_fno_builtin}:${host}" in + yes:*) + newlib_cflags="${newlib_cflags} -fno-builtin" + ;; + no:*) + newlib_cflags="${newlib_cflags}" + ;; + *:*) + # For now, all targets default to using -fno-builtin until tested without + newlib_cflags="${newlib_cflags} -fno-builtin" + ;; +esac + # Get the source directories to use for the CPU type. # machine_dir should supply CPU dependent routines, such as setjmp. # newlib_cflags is passed to gcc when compiling. @@ -117,6 +135,12 @@ case "${host_cpu}" in machine_dir=cr16 ;; cris | crisv32) + # The size of the (kernel_)time_t passed from or to a + # simulator or a Linux kernel is mandated by the + # gettimeofday and time system calls and fixed to 32 bits, the + # size of a long. Instead of churning as 64 bits what is anyway + # 32 bits, it makes more sense to default to long. + test -z "${enable_newlib_long_time_t}" && newlib_long_time_t=yes machine_dir=cris ;; crx*) @@ -249,8 +273,13 @@ case "${host_cpu}" in nios2*) machine_dir=nios2 ;; + nvptx*) + machine_dir=nvptx + newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED" + ;; or1k*|or1knd*) machine_dir=or1k + have_init_fini=no ;; powerpc*) machine_dir=powerpc @@ -258,8 +287,9 @@ case "${host_cpu}" in riscv*) libm_machine_dir=riscv machine_dir=riscv - newlib_cflags="${newlib_cflags}" + newlib_cflags="${newlib_cflags} -DHAVE_NANOSLEEP" default_newlib_atexit_dynamic_alloc="no" + have_init_fini=no ;; rl78) machine_dir=rl78 @@ -416,7 +446,11 @@ case "${host}" in sys_dir=a29khif signal_dir= ;; + aarch64*-*-*) + newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" + ;; arm*-*-*) + newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" sys_dir=arm if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then have_crt0="no" @@ -593,7 +627,7 @@ case "${host}" in default_newlib_io_long_double="yes" default_newlib_io_pos_args="yes" CC="${CC} -I${cygwin_srcdir}/include" - newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED" + newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DGETREENT_PROVIDED -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED" syscall_dir=syscalls ;; *-*-jehanne*) @@ -621,12 +655,11 @@ case "${host}" in *-*-rtems*) default_newlib_io_long_long="yes" default_newlib_io_c99_formats="yes" + newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections " newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" - newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" +newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DGETREENT_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" # turn off unsupported items in posix directory newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -D_NO_POSIX_SPAWN" - # turn off using cli/sti in i386 setjmp/longjmp - newlib_cflags="${newlib_cflags} -D_I386MACH_ALLOW_HW_INTERRUPTS" ;; # VxWorks supplies its own version of malloc, and the newlib one # doesn't work because VxWorks does not have sbrk. @@ -932,6 +965,25 @@ if [ "x${xdr_dir}" = "x" ]; then noinclude="${noinclude} rpc/types.h rpc/xdr.h" fi +# Have init/finit if not explicitly specified otherwise +if [ "x${have_init_fini}" != "xno" ]; then + newlib_cflags="${newlib_cflags} -DHAVE_INIT_FINI" +fi + if test -z "${have_crt0}" && test -n "${sys_dir}"; then have_crt0="yes" fi + +# Target-specific defaults +case "${host_cpu}" in + nvptx*) + if [ "x${newlib_elix_level}" = "x0" ]; then + newlib_elix_level=1; + elif [ "x${newlib_elix_level}" != "x1" ]; then + newlib_msg_warn="nvptx does not support elix level > 1"; + fi + if [[ -z ${newlib_global_stdio_streams} ]]; then + newlib_global_stdio_streams="yes"; + fi + ;; +esac diff --git a/newlib/configure.in b/newlib/configure.in index 5b86ee800..adce036bf 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -238,6 +238,17 @@ AC_ARG_ENABLE(newlib-retargetable-locking, *) AC_MSG_ERROR(bad value ${enableval} for newlib-retargetable-locking) ;; esac],[newlib_retargetable_locking=no]) +dnl Support --enable-newlib-long-time_t +AC_ARG_ENABLE(newlib-long-time_t, +[ --enable-newlib-long-time_t define time_t to long], +[if test "${newlib_long_time_t+set}" != set; then + case "${enableval}" in + yes) newlib_long_time_t=yes ;; + no) newlib_long_time_t=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-long-time_t option) ;; + esac + fi], [newlib_long_time_t=no])dnl + NEWLIB_CONFIGURE(.) dnl We have to enable libtool after NEWLIB_CONFIGURE because if we try and @@ -486,6 +497,10 @@ if test "${newlib_retargetable_locking}" = "yes"; then AC_DEFINE_UNQUOTED(_RETARGETABLE_LOCKING) fi +if test "${newlib_long_time_t}" = "yes"; then +AC_DEFINE_UNQUOTED(_WANT_USE_LONG_TIME_T) +fi + dnl dnl Parse --enable-newlib-iconv-encodings option argument dnl diff --git a/newlib/doc/ansidecl.h b/newlib/doc/ansidecl.h deleted file mode 100644 index 1c7708fd5..000000000 --- a/newlib/doc/ansidecl.h +++ /dev/null @@ -1,116 +0,0 @@ -/* ANSI and traditional C compatability macros - Copyright 1991 Free Software Foundation, Inc. - This file is part of the GNU C Library. - -This program 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 2 of the License, or -(at your option) any later version. - -This program 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. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* ANSI and traditional C compatibility macros - - Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - ANSI C is assumed if _HAVE_STDC is #defined. - - Macro ANSI C definition Traditional C definition - ----- ---- - ---------- ----------- - ---------- - PTR `void *' `char *' - LONG_DOUBLE `long double' `double' - CONST `const' `' - VOLATILE `volatile' `' - SIGNED `signed' `' - PTRCONST `void *const' `char *' - - DEFUN(name, arglist, args) - - Defines function NAME. - - ARGLIST lists the arguments, separated by commas and enclosed in - parentheses. ARGLIST becomes the argument list in traditional C. - - ARGS list the arguments with their types. It becomes a prototype in - ANSI C, and the type declarations in traditional C. Arguments should - be separated with `AND'. For functions with a variable number of - arguments, the last thing listed should be `DOTS'. - - DEFUN_VOID(name) - - Defines a function NAME, which takes no arguments. - - EXFUN(name, prototype) - - Is used in an external function declaration. - In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in - parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. - - For example: - extern int EXFUN(printf, (CONST char *format DOTS)); - int DEFUN(fprintf, (stream, format), - FILE *stream AND CONST char *format DOTS) { ... } - void DEFUN_VOID(abort) { ... } -*/ - -#ifndef _ANSIDECL_H - -#define _ANSIDECL_H 1 - - -/* Every source file includes this file, - so they will all get the switch for lint. */ -/* LINTLIBRARY */ - - -#ifdef _HAVE_STDC - -#define PTR void * -#define PTRCONST void *CONST -#define LONG_DOUBLE long double - -#define AND , -#define NOARGS void -#define CONST const -#define VOLATILE volatile -#define SIGNED signed -#define DOTS , ... - -#define EXFUN(name, proto) name proto -#define DEFUN(name, arglist, args) name(args) -#define DEFUN_VOID(name) name(NOARGS) - -#else /* Not ANSI C. */ - -#define PTR char * -#define PTRCONST PTR -#define LONG_DOUBLE double - -#define AND ; -#define NOARGS -#define CONST -#define VOLATILE -#define SIGNED -#define DOTS - -#define const - -#define EXFUN(name, proto) name() -#define DEFUN(name, arglist, args) name arglist args; -#define DEFUN_VOID(name) name() - -#endif /* ANSI C. */ - - -#endif /* ansidecl.h */ diff --git a/newlib/doc/configure b/newlib/doc/configure index d51547b04..f288e6a5c 100755 --- a/newlib/doc/configure +++ b/newlib/doc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1241,7 +1241,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1311,7 +1311,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1402,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1457,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2529,7 +2529,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3398,6 +3398,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4045,7 +4051,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4102,7 +4108,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/doc/doc.str b/newlib/doc/doc.str index 3fc1006f8..b0bfc9ea4 100644 --- a/newlib/doc/doc.str +++ b/newlib/doc/doc.str @@ -17,9 +17,10 @@ : QUICKREF skip_past_newline - get_stuff_in_command - "&&~&&~&&\cr\tablerule\n" - quickref + ; + +: MATHREF + skip_past_newline ; : EXAMPLE @@ -61,25 +62,12 @@ indent catstr "@end example\n" catstr - - ; - -: OLDTRAD_SYNOPSIS - skip_past_newline - "@strong{Traditional Synopsis}\n" catstr - "@example\n" catstr - get_stuff_in_command - do_fancy_stuff - nokill_bogus_lines - indent - catstr - "@end example\n" catstr - + "ANSI_SYNOPSIS is deprecated, use SYNOPSIS instead" warn ; : TRAD_SYNOPSIS skip_past_newline - + "TRAD_SYNOPSIS is obsolete and ignored" warn ; : INDEX @@ -153,6 +141,9 @@ : SEEALSO "@strong{See Also}@*\n" catstr subhead ; +: NOTES + "@strong{Notes}@*\n" catstr subhead ; + : INTERNAL_FUNCTION ; diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c index 96362f782..36a14e535 100644 --- a/newlib/doc/makedoc.c +++ b/newlib/doc/makedoc.c @@ -35,7 +35,6 @@ There is no -#include "ansidecl.h" #include #include #include @@ -67,25 +66,23 @@ typedef struct buffer -static void DEFUN(init_string_with_size,(buffer, size), - string_type *buffer AND - unsigned int size ) +static void +init_string_with_size (string_type *buffer, unsigned int size) { buffer->write_idx = 0; buffer->size = size; buffer->ptr = malloc(size); } -static void DEFUN(init_string,(buffer), - string_type *buffer) +static void +init_string (string_type *buffer) { init_string_with_size(buffer, DEF_SIZE); } -static int DEFUN(find, (str, what), - string_type *str AND - char *what) +static int +find (string_type *str, char *what) { unsigned int i; char *p; @@ -101,30 +98,28 @@ static int DEFUN(find, (str, what), } -static void DEFUN(write_buffer,(buffer), - string_type *buffer) +static void +write_buffer (string_type *buffer) { fwrite(buffer->ptr, buffer->write_idx, 1, stdout); } -static void DEFUN(delete_string,(buffer), - string_type *buffer) +static void +delete_string (string_type *buffer) { free(buffer->ptr); } -static char *DEFUN(addr, (buffer, idx), - string_type *buffer AND - unsigned int idx) +static char * +addr (string_type *buffer, unsigned int idx) { return buffer->ptr + idx; } -static char DEFUN(at,(buffer, pos), - string_type *buffer AND - unsigned int pos) +static char +at (string_type *buffer, unsigned int pos) { if ( pos >= buffer->write_idx) { @@ -133,9 +128,8 @@ static char DEFUN(at,(buffer, pos), return buffer->ptr[pos]; } -static void DEFUN(catchar,(buffer, ch), - string_type *buffer AND - char ch) +static void +catchar (string_type *buffer, char ch) { if (buffer->write_idx == buffer->size) { @@ -147,9 +141,8 @@ static void DEFUN(catchar,(buffer, ch), } -static void DEFUN(overwrite_string,(dst, src), - string_type *dst AND - string_type *src) +static void +overwrite_string (string_type *dst, string_type *src) { free(dst->ptr); dst->size = src->size; @@ -157,9 +150,8 @@ static void DEFUN(overwrite_string,(dst, src), dst->ptr = src->ptr; } -static void DEFUN(catstr,(dst, src), - string_type *dst AND - string_type *src) +static void +catstr (string_type *dst, string_type *src) { unsigned int i; for (i = 0; i < src->write_idx; i++) @@ -169,9 +161,8 @@ static void DEFUN(catstr,(dst, src), } -static void DEFUN(cattext,(buffer, string), - string_type *buffer AND - char *string) +static void +cattext (string_type *buffer, char *string) { while (*string) @@ -181,10 +172,8 @@ static void DEFUN(cattext,(buffer, string), } } -static void DEFUN(catbuf,(buffer, buf, len), - string_type *buffer AND - char *buf AND - unsigned int len) +static void +catbuf (string_type *buffer, char *buf, unsigned int len) { while (len--) @@ -197,9 +186,7 @@ static void DEFUN(catbuf,(buffer, buf, len), static unsigned int -DEFUN(skip_white_and_stars,(src, idx), - string_type *src AND - unsigned int idx) +skip_white_and_stars (string_type *src, unsigned int idx) { while (isspace(at(src,idx)) || (at(src,idx) == '*' && at(src,idx +1) !='/')) @@ -216,7 +203,7 @@ string_type *tos; unsigned int idx = 0; /* Pos in input buffer */ string_type *ptr; /* and the buffer */ -typedef void (*stinst_type)(NOARGS); +typedef void (*stinst_type)(void); stinst_type *pc; stinst_type sstack[STACK]; stinst_type *ssp = &sstack[0]; @@ -238,10 +225,10 @@ struct dict_struct }; typedef struct dict_struct dict_type; -#define WORD(x) static void x(NOARGS) +#define WORD(x) static void x(void) -static void DEFUN(exec,(word), - dict_type *word) +static void +exec (dict_type *word) { pc = word->code; while (*pc) @@ -299,9 +286,7 @@ WORD(push_text) */ static void -DEFUN(remove_noncomments,(src,dst), - string_type *src AND - string_type *dst) +remove_noncomments (string_type *src, string_type *dst) { unsigned int idx = 0; @@ -354,7 +339,7 @@ DEFUN(remove_noncomments,(src,dst), */ static void -DEFUN_VOID(exfunstuff) +exfunstuff (void) { unsigned int openp; unsigned int fname; @@ -444,52 +429,6 @@ WORD(translatecomments) } -/* find something like - QUICKREF - memchar ansi pure - - into - merge with words on tos and output them to stderror - -*/ -WORD(quickref) -{ - string_type *nos = tos-1; - unsigned int nosscan = 0; - unsigned int idx = 0; - - while (at(tos, idx)) - { - if (at(tos,idx) == '~') - { - /* Skip the whitespace */ - while (at(nos, nosscan) == ' ') - nosscan++; - - /* Sub the next word from the nos*/ - while (at(nos, nosscan) != ' ' && - at(nos, nosscan) != 0) - { - fprintf(stderr, "%c", at(nos, nosscan)); - nosscan++; - } - } - - else - { - fprintf(stderr,"%c", at(tos, idx)); - - } - idx++; - } - - delete_string(tos); - delete_string(nos); - tos-=2; - pc++; - -} - #if 0 /* turn everything not starting with a . into a comment */ @@ -528,7 +467,7 @@ WORD(manglecomments) /* Mod tos so that only lines with leading dots remain */ static void -DEFUN_VOID(outputdots) +outputdots (void) { unsigned int idx = 0; string_type out; @@ -772,9 +711,7 @@ WORD(do_fancy_stuff) } /* A command is all upper case,and alone on a line */ static int -DEFUN( iscommand,(ptr, idx), - string_type *ptr AND - unsigned int idx) +iscommand (string_type *ptr, unsigned int idx) { unsigned int len = 0; @@ -803,10 +740,7 @@ DEFUN( iscommand,(ptr, idx), unsigned int -DEFUN(copy_past_newline,(ptr, idx, dst), - string_type *ptr AND - unsigned int idx AND - string_type *dst) +copy_past_newline (string_type *ptr, unsigned int idx, string_type *dst) { while (at(ptr, idx) && at(ptr, idx) != '\n') { @@ -1065,10 +999,19 @@ WORD(maybecatstr) } +/* write tos to stderr */ +WORD(warn) +{ + fputs("Warning: ", stderr); + fwrite(tos->ptr, tos->write_idx, 1, stderr); + fputc('\n', stderr); + delete_string(tos); + tos--; + pc++; +} + char * -DEFUN(nextword,(string, word), - char *string AND - char **word) +nextword (char *string, char **word) { char *word_start; int idx; @@ -1144,8 +1087,7 @@ DEFUN(nextword,(string, word), } dict_type *root; dict_type * -DEFUN(lookup_word,(word), - char *word) +lookup_word (char *word) { dict_type *ptr = root; while (ptr) { @@ -1159,9 +1101,11 @@ DEFUN(lookup_word,(word), } -static void DEFUN_VOID(perform) +static int +perform (void) { tos = stack; + int errors = 0; while (at(ptr, idx)) { /* It's worth looking through the command list */ @@ -1186,6 +1130,7 @@ static void DEFUN_VOID(perform) else { fprintf(stderr,"warning, %s is not recognised\n", next); + errors++; skip_past_newline(); } @@ -1193,11 +1138,11 @@ static void DEFUN_VOID(perform) else skip_past_newline(); } + return errors; } dict_type * -DEFUN(newentry,(word), - char *word) +newentry (char *word) { dict_type *new = (dict_type *)malloc(sizeof(dict_type)); new->word = word; @@ -1212,9 +1157,7 @@ DEFUN(newentry,(word), unsigned int -DEFUN(add_to_definition,(entry, word), - dict_type *entry AND - stinst_type word) +add_to_definition (dict_type *entry, stinst_type word) { if (entry->code_end == entry->code_length) { @@ -1235,9 +1178,7 @@ return entry->code_end++; void -DEFUN(add_intrinsic,(name, func), - char *name AND - void (*func)(NOARGS)) +add_intrinsic (char *name, void (*func)(void)) { dict_type *new = newentry(name); add_to_definition(new, func); @@ -1245,8 +1186,7 @@ DEFUN(add_intrinsic,(name, func), } void -DEFUN(add_var,(name), - char *name) +add_var (char *name) { dict_type *new = newentry(name); add_to_definition(new, push_number); @@ -1259,13 +1199,13 @@ DEFUN(add_var,(name), int -DEFUN(compile, (string), - char *string) - +compile (char *string) { int ret=0; /* add words to the dictionary */ char *word; + dict_type *lookup; + string = nextword(string, &word); while (string && *string && word[0]) { @@ -1317,11 +1257,13 @@ DEFUN(compile, (string), /* Got a number, embedd the magic push number function */ add_to_definition(ptr, push_number); - add_to_definition(ptr, atol(word)); + add_to_definition(ptr, (stinst_type)atol(word)); break; default: add_to_definition(ptr, call); - add_to_definition(ptr, lookup_word(word)); + lookup = lookup_word(word); + if (!lookup) ret++; + add_to_definition(ptr, (stinst_type)lookup); } string = nextword(string, &word); @@ -1340,7 +1282,8 @@ return(ret); } -static void DEFUN_VOID(bang) +static void +bang (void) { *(uintptr_t *)((isp[0])) = isp[-1]; isp-=2; @@ -1363,9 +1306,8 @@ WORD(hello) -static void DEFUN(read_in, (str, file), - string_type *str AND - FILE *file) +static void +read_in (string_type *str, FILE *file) { char buff[10000]; unsigned int r; @@ -1383,19 +1325,19 @@ static void DEFUN(read_in, (str, file), #if 0 -static void DEFUN_VOID(usage) +static void +usage (void) { fprintf(stderr,"usage: -[i|v] -f macrofile file\n"); exit(33); } #endif -int DEFUN(main,(ac,av), -int ac AND -char *av[]) +int +main (int ac, char *av[]) { unsigned int i; - + int status = 0; string_type buffer; string_type pptr; @@ -1428,9 +1370,9 @@ char *av[]) add_intrinsic("translatecomments", translatecomments ); add_intrinsic("kill_bogus_lines", kill_bogus_lines); add_intrinsic("indent", indent); - add_intrinsic("quickref", quickref); add_intrinsic("internalmode", internalmode); - + add_intrinsic("warn", warn); + /* Put a nl at the start */ catchar(&buffer,'\n'); @@ -1457,7 +1399,7 @@ char *av[]) read_in(&b, f); if( compile(b.ptr) ) { fclose(f); exit(1); } - perform(); + status = perform(); fclose(f); } else if (av[i][1] == 'i') @@ -1472,8 +1414,5 @@ char *av[]) } write_buffer(stack+0); - return 0; + return status; } - - - diff --git a/newlib/iconvdata/configure b/newlib/iconvdata/configure index e520005ad..b5db63cd7 100755 --- a/newlib/iconvdata/configure +++ b/newlib/iconvdata/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1322,7 +1322,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1392,7 +1392,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1503,7 +1503,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1781,7 +1781,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2853,7 +2853,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3722,6 +3722,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -11425,7 +11431,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11428 "configure" +#line 11434 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11531,7 +11537,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11534 "configure" +#line 11540 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12378,7 +12384,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12435,7 +12441,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/Makefile.am b/newlib/libc/Makefile.am index 6e97bca52..e27ff5cf1 100644 --- a/newlib/libc/Makefile.am +++ b/newlib/libc/Makefile.am @@ -42,7 +42,7 @@ endif # Do not change the order without considering the doc impact. SUBDIRS = argz stdlib ctype search $(STDIO_SUBDIR) $(STDIO64_SUBDIR) string $(SIGNAL_SUBDIR) time locale sys reent \ $(extra_dir) errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) $(NEWLIB_ICONV_DIRS) \ - $(XDR_SUBDIR) . + $(XDR_SUBDIR) ssp . noinst_DATA = $(CRT0) @@ -64,6 +64,7 @@ SUBLIBS = \ $(LIBC_EXTRA_LIB) \ errno/liberrno.$(aext) \ misc/libmisc.$(aext) \ + ssp/libssp.$(aext) \ $(LIBC_UNIX_LIB) \ $(LIBC_POSIX_LIB) \ $(LIBC_SYSCALL_LIB) \ @@ -87,6 +88,7 @@ SUBLIBS = \ $(LIBC_EXTRA_LIB) \ errno/lib.$(aext) \ misc/lib.$(aext) \ + ssp/lib.$(aext) \ $(LIBC_UNIX_LIB) \ $(LIBC_POSIX_LIB) \ $(LIBC_SYSCALL_LIB) \ diff --git a/newlib/libc/Makefile.in b/newlib/libc/Makefile.in index a597c1d92..c3de3f600 100644 --- a/newlib/libc/Makefile.in +++ b/newlib/libc/Makefile.in @@ -90,9 +90,10 @@ am__DEPENDENCIES_1 = @USE_LIBTOOL_FALSE@ time/lib.$(aext) locale/lib.$(aext) \ @USE_LIBTOOL_FALSE@ reent/lib.$(aext) $(am__DEPENDENCIES_1) \ @USE_LIBTOOL_FALSE@ errno/lib.$(aext) misc/lib.$(aext) \ +@USE_LIBTOOL_FALSE@ ssp/lib.$(aext) $(am__DEPENDENCIES_1) \ @USE_LIBTOOL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@USE_LIBTOOL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ -@USE_LIBTOOL_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@USE_LIBTOOL_FALSE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ +@USE_LIBTOOL_FALSE@ $(am__DEPENDENCIES_1) @USE_LIBTOOL_TRUE@am__DEPENDENCIES_3 = argz/libargz.$(aext) \ @USE_LIBTOOL_TRUE@ stdlib/libstdlib.$(aext) \ @USE_LIBTOOL_TRUE@ ctype/libctype.$(aext) \ @@ -104,9 +105,9 @@ am__DEPENDENCIES_1 = @USE_LIBTOOL_TRUE@ locale/liblocale.$(aext) \ @USE_LIBTOOL_TRUE@ reent/libreent.$(aext) $(am__DEPENDENCIES_1) \ @USE_LIBTOOL_TRUE@ errno/liberrno.$(aext) misc/libmisc.$(aext) \ +@USE_LIBTOOL_TRUE@ ssp/libssp.$(aext) $(am__DEPENDENCIES_1) \ @USE_LIBTOOL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@USE_LIBTOOL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@USE_LIBTOOL_TRUE@ $(am__DEPENDENCIES_1) +@USE_LIBTOOL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libc_la_OBJECTS = libc_la_OBJECTS = $(am_libc_la_OBJECTS) libc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -191,7 +192,7 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = argz stdlib ctype search stdio stdio64 string signal \ time locale sys reent @extra_dir@ errno misc machine unix \ - posix syscalls iconv xdr . + posix syscalls iconv xdr ssp . ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ @@ -353,7 +354,7 @@ AUTOMAKE_OPTIONS = cygnus # Do not change the order without considering the doc impact. SUBDIRS = argz stdlib ctype search $(STDIO_SUBDIR) $(STDIO64_SUBDIR) string $(SIGNAL_SUBDIR) time locale sys reent \ $(extra_dir) errno misc machine $(UNIX_SUBDIR) $(POSIX_SUBDIR) $(SYSCALLS_SUBDIR) $(NEWLIB_ICONV_DIRS) \ - $(XDR_SUBDIR) . + $(XDR_SUBDIR) ssp . noinst_DATA = $(CRT0) @USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libc.la @@ -373,6 +374,7 @@ noinst_DATA = $(CRT0) @USE_LIBTOOL_FALSE@ $(LIBC_EXTRA_LIB) \ @USE_LIBTOOL_FALSE@ errno/lib.$(aext) \ @USE_LIBTOOL_FALSE@ misc/lib.$(aext) \ +@USE_LIBTOOL_FALSE@ ssp/lib.$(aext) \ @USE_LIBTOOL_FALSE@ $(LIBC_UNIX_LIB) \ @USE_LIBTOOL_FALSE@ $(LIBC_POSIX_LIB) \ @USE_LIBTOOL_FALSE@ $(LIBC_SYSCALL_LIB) \ @@ -396,6 +398,7 @@ noinst_DATA = $(CRT0) @USE_LIBTOOL_TRUE@ $(LIBC_EXTRA_LIB) \ @USE_LIBTOOL_TRUE@ errno/liberrno.$(aext) \ @USE_LIBTOOL_TRUE@ misc/libmisc.$(aext) \ +@USE_LIBTOOL_TRUE@ ssp/libssp.$(aext) \ @USE_LIBTOOL_TRUE@ $(LIBC_UNIX_LIB) \ @USE_LIBTOOL_TRUE@ $(LIBC_POSIX_LIB) \ @USE_LIBTOOL_TRUE@ $(LIBC_SYSCALL_LIB) \ diff --git a/newlib/libc/argz/Makefile.in b/newlib/libc/argz/Makefile.in index a129dc0fc..e18a2d117 100644 --- a/newlib/libc/argz/Makefile.in +++ b/newlib/libc/argz/Makefile.in @@ -319,7 +319,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) all: all-am .SUFFIXES: @@ -694,8 +694,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/argz/argz_add.c b/newlib/libc/argz/argz_add.c index 1c3b17025..a1a8d3d0e 100644 --- a/newlib/libc/argz/argz_add.c +++ b/newlib/libc/argz/argz_add.c @@ -11,9 +11,8 @@ #include error_t -_DEFUN (argz_add, (argz, argz_len, str), - char **argz _AND - size_t *argz_len _AND +argz_add (char **argz, + size_t *argz_len, const char *str) { int len_to_add = 0; diff --git a/newlib/libc/argz/argz_add_sep.c b/newlib/libc/argz/argz_add_sep.c index 7dfbb4d6e..f2964e672 100644 --- a/newlib/libc/argz/argz_add_sep.c +++ b/newlib/libc/argz/argz_add_sep.c @@ -11,10 +11,9 @@ #include error_t -_DEFUN (argz_add_sep, (argz, argz_len, str, sep), - char **argz _AND - size_t *argz_len _AND - const char *str _AND +argz_add_sep (char **argz, + size_t *argz_len, + const char *str, int sep) { char *str_argz = 0; diff --git a/newlib/libc/argz/argz_append.c b/newlib/libc/argz/argz_append.c index c6c3dbee9..de0cc82ce 100644 --- a/newlib/libc/argz/argz_append.c +++ b/newlib/libc/argz/argz_append.c @@ -11,10 +11,9 @@ #include error_t -_DEFUN (argz_append, (argz, argz_len, buf, buf_len), - char **argz _AND - size_t *argz_len _AND - const char *buf _AND +argz_append (char **argz, + size_t *argz_len, + const char *buf, size_t buf_len) { if (buf_len) diff --git a/newlib/libc/argz/argz_count.c b/newlib/libc/argz/argz_count.c index 4761275df..4c0007ce2 100644 --- a/newlib/libc/argz/argz_count.c +++ b/newlib/libc/argz/argz_count.c @@ -10,8 +10,7 @@ #include size_t -_DEFUN (argz_count, (argz, argz_len), - const char *argz _AND +argz_count (const char *argz, size_t argz_len) { int i; diff --git a/newlib/libc/argz/argz_create.c b/newlib/libc/argz/argz_create.c index 9d7b2f13d..4ab622d28 100644 --- a/newlib/libc/argz/argz_create.c +++ b/newlib/libc/argz/argz_create.c @@ -11,9 +11,8 @@ #include error_t -_DEFUN (argz_create, (argv, argz, argz_len), - char *const argv[] _AND - char **argz _AND +argz_create (char *const argv[], + char **argz, size_t *argz_len) { int argc = 0; diff --git a/newlib/libc/argz/argz_create_sep.c b/newlib/libc/argz/argz_create_sep.c index 38866e1d5..bf578e6bb 100644 --- a/newlib/libc/argz/argz_create_sep.c +++ b/newlib/libc/argz/argz_create_sep.c @@ -11,10 +11,9 @@ #include error_t -_DEFUN (argz_create_sep, (string, sep, argz, argz_len), - const char *string _AND - int sep _AND - char **argz _AND +argz_create_sep (const char *string, + int sep, + char **argz, size_t *argz_len) { int len = 0; diff --git a/newlib/libc/argz/argz_delete.c b/newlib/libc/argz/argz_delete.c index aa94f6d7a..aa1fe4c75 100644 --- a/newlib/libc/argz/argz_delete.c +++ b/newlib/libc/argz/argz_delete.c @@ -11,9 +11,8 @@ #include error_t -_DEFUN (argz_delete, (argz, argz_len, entry), - char **argz _AND - size_t *argz_len _AND +argz_delete (char **argz, + size_t *argz_len, char *entry) { int len = 0; diff --git a/newlib/libc/argz/argz_extract.c b/newlib/libc/argz/argz_extract.c index a819f3953..e97b76905 100644 --- a/newlib/libc/argz/argz_extract.c +++ b/newlib/libc/argz/argz_extract.c @@ -9,9 +9,8 @@ #include void -_DEFUN (argz_extract, (argz, argz_len, argv), - char *argz _AND - size_t argz_len _AND +argz_extract (char *argz, + size_t argz_len, char **argv) { size_t i = 0; diff --git a/newlib/libc/argz/argz_insert.c b/newlib/libc/argz/argz_insert.c index d0a32eca9..abdfeb0ea 100644 --- a/newlib/libc/argz/argz_insert.c +++ b/newlib/libc/argz/argz_insert.c @@ -13,10 +13,9 @@ #include error_t -_DEFUN (argz_insert, (argz, argz_len, before, entry), - char **argz _AND - size_t *argz_len _AND - char *before _AND +argz_insert (char **argz, + size_t *argz_len, + char *before, const char *entry) { int len = 0; diff --git a/newlib/libc/argz/argz_next.c b/newlib/libc/argz/argz_next.c index 94852f538..0d6f21d70 100644 --- a/newlib/libc/argz/argz_next.c +++ b/newlib/libc/argz/argz_next.c @@ -11,9 +11,8 @@ #include char * -_DEFUN (argz_next, (argz, argz_len, entry), - char *argz _AND - size_t argz_len _AND +argz_next (char *argz, + size_t argz_len, const char *entry) { if (entry) diff --git a/newlib/libc/argz/argz_replace.c b/newlib/libc/argz/argz_replace.c index b274f91b6..f2e0d52b7 100644 --- a/newlib/libc/argz/argz_replace.c +++ b/newlib/libc/argz/argz_replace.c @@ -13,11 +13,10 @@ #include "buf_findstr.h" error_t -_DEFUN (argz_replace, (argz, argz_len, str, with, replace_count), - char **argz _AND - size_t *argz_len _AND - const char *str _AND - const char *with _AND +argz_replace (char **argz, + size_t *argz_len, + const char *str, + const char *with, unsigned *replace_count) { const int str_len = strlen(str); diff --git a/newlib/libc/argz/argz_stringify.c b/newlib/libc/argz/argz_stringify.c index be5f2cf45..98f6c9bc2 100644 --- a/newlib/libc/argz/argz_stringify.c +++ b/newlib/libc/argz/argz_stringify.c @@ -10,9 +10,8 @@ #include void -_DEFUN (argz_stringify, (argz, argz_len, sep), - char *argz _AND - size_t argz_len _AND +argz_stringify (char *argz, + size_t argz_len, int sep) { size_t i; diff --git a/newlib/libc/argz/envz_add.c b/newlib/libc/argz/envz_add.c index 3e91a5867..60ecf17bc 100644 --- a/newlib/libc/argz/envz_add.c +++ b/newlib/libc/argz/envz_add.c @@ -12,10 +12,9 @@ #include error_t -_DEFUN (envz_add, (envz, envz_len, name, value), - char **envz _AND - size_t *envz_len _AND - const char *name _AND +envz_add (char **envz, + size_t *envz_len, + const char *name, const char *value) { char *concat = NULL; diff --git a/newlib/libc/argz/envz_entry.c b/newlib/libc/argz/envz_entry.c index 3d1986ba7..869c332ad 100644 --- a/newlib/libc/argz/envz_entry.c +++ b/newlib/libc/argz/envz_entry.c @@ -13,9 +13,8 @@ #include "buf_findstr.h" char * -_DEFUN (envz_entry, (envz, envz_len, name), - const char *envz _AND - size_t envz_len _AND +envz_entry (const char *envz, + size_t envz_len, const char *name) { char *buf_ptr = (char *)envz; diff --git a/newlib/libc/argz/envz_get.c b/newlib/libc/argz/envz_get.c index b4f7c2806..9863642c7 100644 --- a/newlib/libc/argz/envz_get.c +++ b/newlib/libc/argz/envz_get.c @@ -13,9 +13,8 @@ #include "buf_findstr.h" char * -_DEFUN (envz_get, (envz, envz_len, name), - const char *envz _AND - size_t envz_len _AND +envz_get (const char *envz, + size_t envz_len, const char *name) { char *buf_ptr = (char *)envz; diff --git a/newlib/libc/argz/envz_merge.c b/newlib/libc/argz/envz_merge.c index 8a26bc3c3..3be7c1fbc 100644 --- a/newlib/libc/argz/envz_merge.c +++ b/newlib/libc/argz/envz_merge.c @@ -12,11 +12,10 @@ #include error_t -_DEFUN (envz_merge, (envz, envz_len, envz2, envz2_len, override), - char **envz _AND - size_t *envz_len _AND - const char *envz2 _AND - size_t envz2_len _AND +envz_merge (char **envz, + size_t *envz_len, + const char *envz2, + size_t envz2_len, int override) { char *entry = NULL; diff --git a/newlib/libc/argz/envz_remove.c b/newlib/libc/argz/envz_remove.c index 1882297f0..8fc9e8f16 100644 --- a/newlib/libc/argz/envz_remove.c +++ b/newlib/libc/argz/envz_remove.c @@ -12,9 +12,8 @@ #include void -_DEFUN (envz_remove, (envz, envz_len, name), - char **envz _AND - size_t *envz_len _AND +envz_remove (char **envz, + size_t *envz_len, const char *name) { char *entry = NULL; diff --git a/newlib/libc/argz/envz_strip.c b/newlib/libc/argz/envz_strip.c index e1c461091..8efa5cbb5 100644 --- a/newlib/libc/argz/envz_strip.c +++ b/newlib/libc/argz/envz_strip.c @@ -12,8 +12,7 @@ #include void -_DEFUN (envz_strip, (envz, envz_len), - char **envz _AND +envz_strip (char **envz, size_t *envz_len) { char *entry = 0; diff --git a/newlib/libc/configure b/newlib/libc/configure index dabe44fd9..add8f679c 100755 --- a/newlib/libc/configure +++ b/newlib/libc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -808,6 +808,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode enable_shared @@ -1370,7 +1371,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1440,7 +1441,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1460,6 +1461,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1555,7 +1557,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1833,7 +1835,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2930,6 +2932,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2968,7 +2982,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3776,8 +3790,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3837,6 +3849,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -11549,7 +11567,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11552 "configure" +#line 11570 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11655,7 +11673,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11658 "configure" +#line 11676 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12121,7 +12139,7 @@ fi -ac_config_files="$ac_config_files Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile xdr/Makefile" +ac_config_files="$ac_config_files Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile ssp/Makefile xdr/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -12777,7 +12795,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12834,7 +12852,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -13240,6 +13258,7 @@ do "iconv/ccs/Makefile") CONFIG_FILES="$CONFIG_FILES iconv/ccs/Makefile" ;; "iconv/ccs/binary/Makefile") CONFIG_FILES="$CONFIG_FILES iconv/ccs/binary/Makefile" ;; "iconv/lib/Makefile") CONFIG_FILES="$CONFIG_FILES iconv/lib/Makefile" ;; + "ssp/Makefile") CONFIG_FILES="$CONFIG_FILES ssp/Makefile" ;; "xdr/Makefile") CONFIG_FILES="$CONFIG_FILES xdr/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; diff --git a/newlib/libc/configure.in b/newlib/libc/configure.in index ac25a3933..d3b10a500 100644 --- a/newlib/libc/configure.in +++ b/newlib/libc/configure.in @@ -219,5 +219,5 @@ fi AC_SUBST(LIBC_MACHINE_LIB) AC_SUBST(machine_dir) -AC_CONFIG_FILES([Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile xdr/Makefile]) +AC_CONFIG_FILES([Makefile argz/Makefile ctype/Makefile errno/Makefile locale/Makefile misc/Makefile reent/Makefile search/Makefile stdio/Makefile stdio64/Makefile stdlib/Makefile string/Makefile time/Makefile posix/Makefile signal/Makefile syscalls/Makefile unix/Makefile iconv/Makefile iconv/ces/Makefile iconv/ccs/Makefile iconv/ccs/binary/Makefile iconv/lib/Makefile ssp/Makefile xdr/Makefile]) AC_OUTPUT diff --git a/newlib/libc/ctype/Makefile.am b/newlib/libc/ctype/Makefile.am index 898693571..fa6a70d3a 100644 --- a/newlib/libc/ctype/Makefile.am +++ b/newlib/libc/ctype/Makefile.am @@ -24,6 +24,7 @@ if ELIX_LEVEL_1 ELIX_SOURCES = else ELIX_SOURCES = \ + categories.c \ isalnum_l.c \ isalpha_l.c \ isascii.c \ diff --git a/newlib/libc/ctype/Makefile.in b/newlib/libc/ctype/Makefile.in index f883e1c99..5ad351da0 100644 --- a/newlib/libc/ctype/Makefile.in +++ b/newlib/libc/ctype/Makefile.in @@ -79,7 +79,8 @@ am__objects_1 = lib_a-ctype_.$(OBJEXT) lib_a-isalnum.$(OBJEXT) \ lib_a-ispunct.$(OBJEXT) lib_a-isspace.$(OBJEXT) \ lib_a-isxdigit.$(OBJEXT) lib_a-tolower.$(OBJEXT) \ lib_a-toupper.$(OBJEXT) -@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-isalnum_l.$(OBJEXT) \ +@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-categories.$(OBJEXT) \ +@ELIX_LEVEL_1_FALSE@ lib_a-isalnum_l.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-isalpha_l.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-isascii.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@ lib_a-isascii_l.$(OBJEXT) \ @@ -142,25 +143,25 @@ libctype_la_LIBADD = am__objects_3 = ctype_.lo isalnum.lo isalpha.lo iscntrl.lo isdigit.lo \ islower.lo isupper.lo isprint.lo ispunct.lo isspace.lo \ isxdigit.lo tolower.lo toupper.lo -@ELIX_LEVEL_1_FALSE@am__objects_4 = isalnum_l.lo isalpha_l.lo \ -@ELIX_LEVEL_1_FALSE@ isascii.lo isascii_l.lo isblank.lo \ -@ELIX_LEVEL_1_FALSE@ isblank_l.lo iscntrl_l.lo isdigit_l.lo \ -@ELIX_LEVEL_1_FALSE@ islower_l.lo isupper_l.lo isprint_l.lo \ -@ELIX_LEVEL_1_FALSE@ ispunct_l.lo isspace_l.lo iswalnum.lo \ -@ELIX_LEVEL_1_FALSE@ iswalnum_l.lo iswalpha.lo iswalpha_l.lo \ -@ELIX_LEVEL_1_FALSE@ iswblank.lo iswblank_l.lo iswcntrl.lo \ -@ELIX_LEVEL_1_FALSE@ iswcntrl_l.lo iswctype.lo iswctype_l.lo \ -@ELIX_LEVEL_1_FALSE@ iswdigit.lo iswdigit_l.lo iswgraph.lo \ -@ELIX_LEVEL_1_FALSE@ iswgraph_l.lo iswlower.lo iswlower_l.lo \ -@ELIX_LEVEL_1_FALSE@ iswprint.lo iswprint_l.lo iswpunct.lo \ -@ELIX_LEVEL_1_FALSE@ iswpunct_l.lo iswspace.lo iswspace_l.lo \ -@ELIX_LEVEL_1_FALSE@ iswupper.lo iswupper_l.lo iswxdigit.lo \ -@ELIX_LEVEL_1_FALSE@ iswxdigit_l.lo isxdigit_l.lo jp2uc.lo \ -@ELIX_LEVEL_1_FALSE@ toascii.lo toascii_l.lo tolower_l.lo \ -@ELIX_LEVEL_1_FALSE@ toupper_l.lo towctrans.lo towctrans_l.lo \ -@ELIX_LEVEL_1_FALSE@ towlower.lo towlower_l.lo towupper.lo \ -@ELIX_LEVEL_1_FALSE@ towupper_l.lo wctrans.lo wctrans_l.lo \ -@ELIX_LEVEL_1_FALSE@ wctype.lo wctype_l.lo +@ELIX_LEVEL_1_FALSE@am__objects_4 = categories.lo isalnum_l.lo \ +@ELIX_LEVEL_1_FALSE@ isalpha_l.lo isascii.lo isascii_l.lo \ +@ELIX_LEVEL_1_FALSE@ isblank.lo isblank_l.lo iscntrl_l.lo \ +@ELIX_LEVEL_1_FALSE@ isdigit_l.lo islower_l.lo isupper_l.lo \ +@ELIX_LEVEL_1_FALSE@ isprint_l.lo ispunct_l.lo isspace_l.lo \ +@ELIX_LEVEL_1_FALSE@ iswalnum.lo iswalnum_l.lo iswalpha.lo \ +@ELIX_LEVEL_1_FALSE@ iswalpha_l.lo iswblank.lo iswblank_l.lo \ +@ELIX_LEVEL_1_FALSE@ iswcntrl.lo iswcntrl_l.lo iswctype.lo \ +@ELIX_LEVEL_1_FALSE@ iswctype_l.lo iswdigit.lo iswdigit_l.lo \ +@ELIX_LEVEL_1_FALSE@ iswgraph.lo iswgraph_l.lo iswlower.lo \ +@ELIX_LEVEL_1_FALSE@ iswlower_l.lo iswprint.lo iswprint_l.lo \ +@ELIX_LEVEL_1_FALSE@ iswpunct.lo iswpunct_l.lo iswspace.lo \ +@ELIX_LEVEL_1_FALSE@ iswspace_l.lo iswupper.lo iswupper_l.lo \ +@ELIX_LEVEL_1_FALSE@ iswxdigit.lo iswxdigit_l.lo isxdigit_l.lo \ +@ELIX_LEVEL_1_FALSE@ jp2uc.lo toascii.lo toascii_l.lo \ +@ELIX_LEVEL_1_FALSE@ tolower_l.lo toupper_l.lo towctrans.lo \ +@ELIX_LEVEL_1_FALSE@ towctrans_l.lo towlower.lo towlower_l.lo \ +@ELIX_LEVEL_1_FALSE@ towupper.lo towupper_l.lo wctrans.lo \ +@ELIX_LEVEL_1_FALSE@ wctrans_l.lo wctype.lo wctype_l.lo @USE_LIBTOOL_TRUE@am_libctype_la_OBJECTS = $(am__objects_3) \ @USE_LIBTOOL_TRUE@ $(am__objects_4) libctype_la_OBJECTS = $(am_libctype_la_OBJECTS) @@ -351,6 +352,7 @@ GENERAL_SOURCES = \ toupper.c @ELIX_LEVEL_1_FALSE@ELIX_SOURCES = \ +@ELIX_LEVEL_1_FALSE@ categories.c \ @ELIX_LEVEL_1_FALSE@ isalnum_l.c \ @ELIX_LEVEL_1_FALSE@ isalpha_l.c \ @ELIX_LEVEL_1_FALSE@ isascii.c \ @@ -425,7 +427,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = \ isalnum.def \ isalpha.def \ @@ -609,6 +611,12 @@ lib_a-toupper.o: toupper.c lib_a-toupper.obj: toupper.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-toupper.obj `if test -f 'toupper.c'; then $(CYGPATH_W) 'toupper.c'; else $(CYGPATH_W) '$(srcdir)/toupper.c'; fi` +lib_a-categories.o: categories.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-categories.o `test -f 'categories.c' || echo '$(srcdir)/'`categories.c + +lib_a-categories.obj: categories.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-categories.obj `if test -f 'categories.c'; then $(CYGPATH_W) 'categories.c'; else $(CYGPATH_W) '$(srcdir)/categories.c'; fi` + lib_a-isalnum_l.o: isalnum_l.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-isalnum_l.o `test -f 'isalnum_l.c' || echo '$(srcdir)/'`isalnum_l.c @@ -1124,8 +1132,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/ctype/caseconv.t b/newlib/libc/ctype/caseconv.t new file mode 100644 index 000000000..5e132d3e1 --- /dev/null +++ b/newlib/libc/ctype/caseconv.t @@ -0,0 +1,304 @@ + {0x0041, 25, TOLO, 32}, + {0x0061, 25, TOUP, -32}, + {0x00B5, 0, TOUP, 743}, + {0x00C0, 22, TOLO, 32}, + {0x00D8, 6, TOLO, 32}, + {0x00E0, 22, TOUP, -32}, + {0x00F8, 6, TOUP, -32}, + {0x00FF, 0, TOUP, 121}, + {0x0100, 47, TO1, EVENCAP}, + {0x0130, 0, TOLO, -199}, + {0x0131, 0, TOUP, -232}, + {0x0132, 5, TO1, EVENCAP}, + {0x0139, 15, TO1, ODDCAP}, + {0x014A, 45, TO1, EVENCAP}, + {0x0178, 0, TOLO, -121}, + {0x0179, 5, TO1, ODDCAP}, + {0x017F, 0, TOUP, -300}, + {0x0180, 0, TOUP, 195}, + {0x0181, 0, TOLO, 210}, + {0x0182, 3, TO1, EVENCAP}, + {0x0186, 0, TOLO, 206}, + {0x0187, 1, TO1, ODDCAP}, + {0x0189, 1, TOLO, 205}, + {0x018B, 1, TO1, ODDCAP}, + {0x018E, 0, TOLO, 79}, + {0x018F, 0, TOLO, 202}, + {0x0190, 0, TOLO, 203}, + {0x0191, 1, TO1, ODDCAP}, + {0x0193, 0, TOLO, 205}, + {0x0194, 0, TOLO, 207}, + {0x0195, 0, TOUP, 97}, + {0x0196, 0, TOLO, 211}, + {0x0197, 0, TOLO, 209}, + {0x0198, 1, TO1, EVENCAP}, + {0x019A, 0, TOUP, 163}, + {0x019C, 0, TOLO, 211}, + {0x019D, 0, TOLO, 213}, + {0x019E, 0, TOUP, 130}, + {0x019F, 0, TOLO, 214}, + {0x01A0, 5, TO1, EVENCAP}, + {0x01A6, 0, TOLO, 218}, + {0x01A7, 1, TO1, ODDCAP}, + {0x01A9, 0, TOLO, 218}, + {0x01AC, 1, TO1, EVENCAP}, + {0x01AE, 0, TOLO, 218}, + {0x01AF, 1, TO1, ODDCAP}, + {0x01B1, 1, TOLO, 217}, + {0x01B3, 3, TO1, ODDCAP}, + {0x01B7, 0, TOLO, 219}, + {0x01B8, 1, TO1, EVENCAP}, + {0x01BC, 1, TO1, EVENCAP}, + {0x01BF, 0, TOUP, 56}, + {0x01C4, 0, TOLO, 2}, + {0x01C5, 0, TOBOTH, 0}, + {0x01C6, 0, TOUP, -2}, + {0x01C7, 0, TOLO, 2}, + {0x01C8, 0, TOBOTH, 0}, + {0x01C9, 0, TOUP, -2}, + {0x01CA, 0, TOLO, 2}, + {0x01CB, 0, TOBOTH, 0}, + {0x01CC, 0, TOUP, -2}, + {0x01CD, 15, TO1, ODDCAP}, + {0x01DD, 0, TOUP, -79}, + {0x01DE, 17, TO1, EVENCAP}, + {0x01F1, 0, TOLO, 2}, + {0x01F2, 0, TOBOTH, 0}, + {0x01F3, 0, TOUP, -2}, + {0x01F4, 1, TO1, EVENCAP}, + {0x01F6, 0, TOLO, -97}, + {0x01F7, 0, TOLO, -56}, + {0x01F8, 39, TO1, EVENCAP}, + {0x0220, 0, TOLO, -130}, + {0x0222, 17, TO1, EVENCAP}, + {0x023A, 0, TOLO, 10795}, + {0x023B, 1, TO1, ODDCAP}, + {0x023D, 0, TOLO, -163}, + {0x023E, 0, TOLO, 10792}, + {0x023F, 1, TOUP, 10815}, + {0x0241, 1, TO1, ODDCAP}, + {0x0243, 0, TOLO, -195}, + {0x0244, 0, TOLO, 69}, + {0x0245, 0, TOLO, 71}, + {0x0246, 9, TO1, EVENCAP}, + {0x0250, 0, TOUP, 10783}, + {0x0251, 0, TOUP, 10780}, + {0x0252, 0, TOUP, 10782}, + {0x0253, 0, TOUP, -210}, + {0x0254, 0, TOUP, -206}, + {0x0256, 1, TOUP, -205}, + {0x0259, 0, TOUP, -202}, + {0x025B, 0, TOUP, -203}, + {0x025C, 0, TOUP, 42319}, + {0x0260, 0, TOUP, -205}, + {0x0261, 0, TOUP, 42315}, + {0x0263, 0, TOUP, -207}, + {0x0265, 0, TOUP, 42280}, + {0x0266, 0, TOUP, 42308}, + {0x0268, 0, TOUP, -209}, + {0x0269, 0, TOUP, -211}, + {0x026A, 0, TOUP, 42308}, + {0x026B, 0, TOUP, 10743}, + {0x026C, 0, TOUP, 42305}, + {0x026F, 0, TOUP, -211}, + {0x0271, 0, TOUP, 10749}, + {0x0272, 0, TOUP, -213}, + {0x0275, 0, TOUP, -214}, + {0x027D, 0, TOUP, 10727}, + {0x0280, 0, TOUP, -218}, + {0x0283, 0, TOUP, -218}, + {0x0287, 0, TOUP, 42282}, + {0x0288, 0, TOUP, -218}, + {0x0289, 0, TOUP, -69}, + {0x028A, 1, TOUP, -217}, + {0x028C, 0, TOUP, -71}, + {0x0292, 0, TOUP, -219}, + {0x029D, 0, TOUP, 42261}, + {0x029E, 0, TOUP, 42258}, + {0x0345, 0, TOUP, 84}, + {0x0370, 3, TO1, EVENCAP}, + {0x0376, 1, TO1, EVENCAP}, + {0x037B, 2, TOUP, 130}, + {0x037F, 0, TOLO, 116}, + {0x0386, 0, TOLO, 38}, + {0x0388, 2, TOLO, 37}, + {0x038C, 0, TOLO, 64}, + {0x038E, 1, TOLO, 63}, + {0x0391, 16, TOLO, 32}, + {0x03A3, 8, TOLO, 32}, + {0x03AC, 0, TOUP, -38}, + {0x03AD, 2, TOUP, -37}, + {0x03B1, 16, TOUP, -32}, + {0x03C2, 0, TOUP, -31}, + {0x03C3, 8, TOUP, -32}, + {0x03CC, 0, TOUP, -64}, + {0x03CD, 1, TOUP, -63}, + {0x03CF, 0, TOLO, 8}, + {0x03D0, 0, TOUP, -62}, + {0x03D1, 0, TOUP, -57}, + {0x03D5, 0, TOUP, -47}, + {0x03D6, 0, TOUP, -54}, + {0x03D7, 0, TOUP, -8}, + {0x03D8, 23, TO1, EVENCAP}, + {0x03F0, 0, TOUP, -86}, + {0x03F1, 0, TOUP, -80}, + {0x03F2, 0, TOUP, 7}, + {0x03F3, 0, TOUP, -116}, + {0x03F4, 0, TOLO, -60}, + {0x03F5, 0, TOUP, -96}, + {0x03F7, 1, TO1, ODDCAP}, + {0x03F9, 0, TOLO, -7}, + {0x03FA, 1, TO1, EVENCAP}, + {0x03FD, 2, TOLO, -130}, + {0x0400, 15, TOLO, 80}, + {0x0410, 31, TOLO, 32}, + {0x0430, 31, TOUP, -32}, + {0x0450, 15, TOUP, -80}, + {0x0460, 33, TO1, EVENCAP}, + {0x048A, 53, TO1, EVENCAP}, + {0x04C0, 0, TOLO, 15}, + {0x04C1, 13, TO1, ODDCAP}, + {0x04CF, 0, TOUP, -15}, + {0x04D0, 95, TO1, EVENCAP}, + {0x0531, 37, TOLO, 48}, + {0x0561, 37, TOUP, -48}, + {0x10A0, 37, TOLO, 7264}, + {0x10C7, 0, TOLO, 7264}, + {0x10CD, 0, TOLO, 7264}, + {0x13A0, 79, TOLO, 38864}, + {0x13F0, 5, TOLO, 8}, + {0x13F8, 5, TOUP, -8}, + {0x1C80, 0, TOUP, -6254}, + {0x1C81, 0, TOUP, -6253}, + {0x1C82, 0, TOUP, -6244}, + {0x1C83, 1, TOUP, -6242}, + {0x1C85, 0, TOUP, -6243}, + {0x1C86, 0, TOUP, -6236}, + {0x1C87, 0, TOUP, -6181}, + {0x1C88, 0, TOUP, 35266}, + {0x1D79, 0, TOUP, 35332}, + {0x1D7D, 0, TOUP, 3814}, + {0x1E00, 149, TO1, EVENCAP}, + {0x1E9B, 0, TOUP, -59}, + {0x1E9E, 0, TOLO, -7615}, + {0x1EA0, 95, TO1, EVENCAP}, + {0x1F00, 7, TOUP, 8}, + {0x1F08, 7, TOLO, -8}, + {0x1F10, 5, TOUP, 8}, + {0x1F18, 5, TOLO, -8}, + {0x1F20, 7, TOUP, 8}, + {0x1F28, 7, TOLO, -8}, + {0x1F30, 7, TOUP, 8}, + {0x1F38, 7, TOLO, -8}, + {0x1F40, 5, TOUP, 8}, + {0x1F48, 5, TOLO, -8}, + {0x1F51, 0, TOUP, 8}, + {0x1F53, 0, TOUP, 8}, + {0x1F55, 0, TOUP, 8}, + {0x1F57, 0, TOUP, 8}, + {0x1F59, 0, TOLO, -8}, + {0x1F5B, 0, TOLO, -8}, + {0x1F5D, 0, TOLO, -8}, + {0x1F5F, 0, TOLO, -8}, + {0x1F60, 7, TOUP, 8}, + {0x1F68, 7, TOLO, -8}, + {0x1F70, 1, TOUP, 74}, + {0x1F72, 3, TOUP, 86}, + {0x1F76, 1, TOUP, 100}, + {0x1F78, 1, TOUP, 128}, + {0x1F7A, 1, TOUP, 112}, + {0x1F7C, 1, TOUP, 126}, + {0x1F80, 7, TOUP, 8}, + {0x1F88, 7, TOLO, -8}, + {0x1F90, 7, TOUP, 8}, + {0x1F98, 7, TOLO, -8}, + {0x1FA0, 7, TOUP, 8}, + {0x1FA8, 7, TOLO, -8}, + {0x1FB0, 1, TOUP, 8}, + {0x1FB3, 0, TOUP, 9}, + {0x1FB8, 1, TOLO, -8}, + {0x1FBA, 1, TOLO, -74}, + {0x1FBC, 0, TOLO, -9}, + {0x1FBE, 0, TOUP, -7205}, + {0x1FC3, 0, TOUP, 9}, + {0x1FC8, 3, TOLO, -86}, + {0x1FCC, 0, TOLO, -9}, + {0x1FD0, 1, TOUP, 8}, + {0x1FD8, 1, TOLO, -8}, + {0x1FDA, 1, TOLO, -100}, + {0x1FE0, 1, TOUP, 8}, + {0x1FE5, 0, TOUP, 7}, + {0x1FE8, 1, TOLO, -8}, + {0x1FEA, 1, TOLO, -112}, + {0x1FEC, 0, TOLO, -7}, + {0x1FF3, 0, TOUP, 9}, + {0x1FF8, 1, TOLO, -128}, + {0x1FFA, 1, TOLO, -126}, + {0x1FFC, 0, TOLO, -9}, + {0x2126, 0, TOLO, -7517}, + {0x212A, 0, TOLO, -8383}, + {0x212B, 0, TOLO, -8262}, + {0x2132, 0, TOLO, 28}, + {0x214E, 0, TOUP, -28}, + {0x2160, 15, TOLO, 16}, + {0x2170, 15, TOUP, -16}, + {0x2183, 1, TO1, ODDCAP}, + {0x24B6, 25, TOLO, 26}, + {0x24D0, 25, TOUP, -26}, + {0x2C00, 46, TOLO, 48}, + {0x2C30, 46, TOUP, -48}, + {0x2C60, 1, TO1, EVENCAP}, + {0x2C62, 0, TOLO, -10743}, + {0x2C63, 0, TOLO, -3814}, + {0x2C64, 0, TOLO, -10727}, + {0x2C65, 0, TOUP, -10795}, + {0x2C66, 0, TOUP, -10792}, + {0x2C67, 5, TO1, ODDCAP}, + {0x2C6D, 0, TOLO, -10780}, + {0x2C6E, 0, TOLO, -10749}, + {0x2C6F, 0, TOLO, -10783}, + {0x2C70, 0, TOLO, -10782}, + {0x2C72, 1, TO1, EVENCAP}, + {0x2C75, 1, TO1, ODDCAP}, + {0x2C7E, 1, TOLO, -10815}, + {0x2C80, 99, TO1, EVENCAP}, + {0x2CEB, 3, TO1, ODDCAP}, + {0x2CF2, 1, TO1, EVENCAP}, + {0x2D00, 37, TOUP, -7264}, + {0x2D27, 0, TOUP, -7264}, + {0x2D2D, 0, TOUP, -7264}, + {0xA640, 45, TO1, EVENCAP}, + {0xA680, 27, TO1, EVENCAP}, + {0xA722, 13, TO1, EVENCAP}, + {0xA732, 61, TO1, EVENCAP}, + {0xA779, 3, TO1, ODDCAP}, + {0xA77D, 0, TOLO, -35332}, + {0xA77E, 9, TO1, EVENCAP}, + {0xA78B, 1, TO1, ODDCAP}, + {0xA78D, 0, TOLO, -42280}, + {0xA790, 3, TO1, EVENCAP}, + {0xA796, 19, TO1, EVENCAP}, + {0xA7AA, 0, TOLO, -42308}, + {0xA7AB, 0, TOLO, -42319}, + {0xA7AC, 0, TOLO, -42315}, + {0xA7AD, 0, TOLO, -42305}, + {0xA7AE, 0, TOLO, -42308}, + {0xA7B0, 0, TOLO, -42258}, + {0xA7B1, 0, TOLO, -42282}, + {0xA7B2, 0, TOLO, -42261}, + {0xA7B3, 0, TOLO, 928}, + {0xA7B4, 3, TO1, EVENCAP}, + {0xAB53, 0, TOUP, -928}, + {0xAB70, 79, TOUP, -38864}, + {0xFF21, 25, TOLO, 32}, + {0xFF41, 25, TOUP, -32}, + {0x10400, 39, TOLO, 40}, + {0x10428, 39, TOUP, -40}, + {0x104B0, 35, TOLO, 40}, + {0x104D8, 35, TOUP, -40}, + {0x10C80, 50, TOLO, 64}, + {0x10CC0, 50, TOUP, -64}, + {0x118A0, 31, TOLO, 32}, + {0x118C0, 31, TOUP, -32}, + {0x1E900, 33, TOLO, 34}, + {0x1E922, 33, TOUP, -34}, diff --git a/newlib/libc/ctype/categories.c b/newlib/libc/ctype/categories.c new file mode 100644 index 000000000..85328ef2e --- /dev/null +++ b/newlib/libc/ctype/categories.c @@ -0,0 +1,40 @@ +#include +#include +#include "categories.h" + +struct _category { + enum category cat: 8; + uint_least32_t first: 24; + uint_least16_t delta; +} __attribute__((packed)); + +static const struct _category categories[] = { +#include "categories.t" +}; + +static enum category +bisearch_cat(wint_t ucs, const struct _category *table, int max) +{ + int min = 0; + int mid; + + if (ucs < table[0].first || ucs > table[max].first + table[max].delta) + return 0; + while (max >= min) + { + mid = (min + max) / 2; + if (ucs > table[mid].first + table[mid].delta) + min = mid + 1; + else if (ucs < table[mid].first) + max = mid - 1; + else + return table[mid].cat; + } + return -1; +} + +enum category category(wint_t ucs) +{ + return bisearch_cat(ucs, categories, + sizeof(categories) / sizeof(*categories) - 1); +} diff --git a/newlib/libc/ctype/categories.cat b/newlib/libc/ctype/categories.cat new file mode 100644 index 000000000..cade60a6a --- /dev/null +++ b/newlib/libc/ctype/categories.cat @@ -0,0 +1,29 @@ + CAT_Cc, + CAT_Cf, + CAT_Cs, + CAT_LC, + CAT_Ll, + CAT_Lm, + CAT_Lo, + CAT_Lt, + CAT_Lu, + CAT_Mc, + CAT_Me, + CAT_Mn, + CAT_Nd, + CAT_Nl, + CAT_No, + CAT_Pc, + CAT_Pd, + CAT_Pe, + CAT_Pf, + CAT_Pi, + CAT_Po, + CAT_Ps, + CAT_Sc, + CAT_Sk, + CAT_Sm, + CAT_So, + CAT_Zl, + CAT_Zp, + CAT_Zs, diff --git a/newlib/libc/ctype/categories.h b/newlib/libc/ctype/categories.h new file mode 100644 index 000000000..271038e61 --- /dev/null +++ b/newlib/libc/ctype/categories.h @@ -0,0 +1,7 @@ +/* category data */ + +enum category { +#include "categories.cat" +}; + +extern enum category category(wint_t ucs); diff --git a/newlib/libc/ctype/categories.t b/newlib/libc/ctype/categories.t new file mode 100644 index 000000000..670457713 --- /dev/null +++ b/newlib/libc/ctype/categories.t @@ -0,0 +1,2074 @@ + {CAT_Cc, 0x0000, 31}, + {CAT_Zs, 0x0020, 0}, + {CAT_Po, 0x0021, 2}, + {CAT_Sc, 0x0024, 0}, + {CAT_Po, 0x0025, 2}, + {CAT_Ps, 0x0028, 0}, + {CAT_Pe, 0x0029, 0}, + {CAT_Po, 0x002A, 0}, + {CAT_Sm, 0x002B, 0}, + {CAT_Po, 0x002C, 0}, + {CAT_Pd, 0x002D, 0}, + {CAT_Po, 0x002E, 1}, + {CAT_Nd, 0x0030, 9}, + {CAT_Po, 0x003A, 1}, + {CAT_Sm, 0x003C, 2}, + {CAT_Po, 0x003F, 1}, + {CAT_LC, 0x0041, 25}, + {CAT_Ps, 0x005B, 0}, + {CAT_Po, 0x005C, 0}, + {CAT_Pe, 0x005D, 0}, + {CAT_Sk, 0x005E, 0}, + {CAT_Pc, 0x005F, 0}, + {CAT_Sk, 0x0060, 0}, + {CAT_LC, 0x0061, 25}, + {CAT_Ps, 0x007B, 0}, + {CAT_Sm, 0x007C, 0}, + {CAT_Pe, 0x007D, 0}, + {CAT_Sm, 0x007E, 0}, + {CAT_Cc, 0x007F, 32}, + {CAT_Zs, 0x00A0, 0}, + {CAT_Po, 0x00A1, 0}, + {CAT_Sc, 0x00A2, 3}, + {CAT_So, 0x00A6, 0}, + {CAT_Po, 0x00A7, 0}, + {CAT_Sk, 0x00A8, 0}, + {CAT_So, 0x00A9, 0}, + {CAT_Lo, 0x00AA, 0}, + {CAT_Pi, 0x00AB, 0}, + {CAT_Sm, 0x00AC, 0}, + {CAT_Cf, 0x00AD, 0}, + {CAT_So, 0x00AE, 0}, + {CAT_Sk, 0x00AF, 0}, + {CAT_So, 0x00B0, 0}, + {CAT_Sm, 0x00B1, 0}, + {CAT_No, 0x00B2, 1}, + {CAT_Sk, 0x00B4, 0}, + {CAT_LC, 0x00B5, 0}, + {CAT_Po, 0x00B6, 1}, + {CAT_Sk, 0x00B8, 0}, + {CAT_No, 0x00B9, 0}, + {CAT_Lo, 0x00BA, 0}, + {CAT_Pf, 0x00BB, 0}, + {CAT_No, 0x00BC, 2}, + {CAT_Po, 0x00BF, 0}, + {CAT_LC, 0x00C0, 22}, + {CAT_Sm, 0x00D7, 0}, + {CAT_LC, 0x00D8, 6}, + {CAT_Ll, 0x00DF, 0}, + {CAT_LC, 0x00E0, 22}, + {CAT_Sm, 0x00F7, 0}, + {CAT_LC, 0x00F8, 63}, + {CAT_Ll, 0x0138, 0}, + {CAT_LC, 0x0139, 15}, + {CAT_Ll, 0x0149, 0}, + {CAT_LC, 0x014A, 66}, + {CAT_Ll, 0x018D, 0}, + {CAT_LC, 0x018E, 12}, + {CAT_Ll, 0x019B, 0}, + {CAT_LC, 0x019C, 13}, + {CAT_Ll, 0x01AA, 1}, + {CAT_LC, 0x01AC, 13}, + {CAT_Ll, 0x01BA, 0}, + {CAT_Lo, 0x01BB, 0}, + {CAT_LC, 0x01BC, 1}, + {CAT_Ll, 0x01BE, 0}, + {CAT_LC, 0x01BF, 0}, + {CAT_Lo, 0x01C0, 3}, + {CAT_LC, 0x01C4, 0}, + {CAT_Lt, 0x01C5, 0}, + {CAT_LC, 0x01C6, 1}, + {CAT_Lt, 0x01C8, 0}, + {CAT_LC, 0x01C9, 1}, + {CAT_Lt, 0x01CB, 0}, + {CAT_LC, 0x01CC, 35}, + {CAT_Ll, 0x01F0, 0}, + {CAT_LC, 0x01F1, 0}, + {CAT_Lt, 0x01F2, 0}, + {CAT_LC, 0x01F3, 45}, + {CAT_Ll, 0x0221, 0}, + {CAT_LC, 0x0222, 17}, + {CAT_Ll, 0x0234, 5}, + {CAT_LC, 0x023A, 26}, + {CAT_Ll, 0x0255, 0}, + {CAT_LC, 0x0256, 1}, + {CAT_Ll, 0x0258, 0}, + {CAT_LC, 0x0259, 0}, + {CAT_Ll, 0x025A, 0}, + {CAT_LC, 0x025B, 1}, + {CAT_Ll, 0x025D, 2}, + {CAT_LC, 0x0260, 1}, + {CAT_Ll, 0x0262, 0}, + {CAT_LC, 0x0263, 0}, + {CAT_Ll, 0x0264, 0}, + {CAT_LC, 0x0265, 1}, + {CAT_Ll, 0x0267, 0}, + {CAT_LC, 0x0268, 4}, + {CAT_Ll, 0x026D, 1}, + {CAT_LC, 0x026F, 0}, + {CAT_Ll, 0x0270, 0}, + {CAT_LC, 0x0271, 1}, + {CAT_Ll, 0x0273, 1}, + {CAT_LC, 0x0275, 0}, + {CAT_Ll, 0x0276, 6}, + {CAT_LC, 0x027D, 0}, + {CAT_Ll, 0x027E, 1}, + {CAT_LC, 0x0280, 0}, + {CAT_Ll, 0x0281, 1}, + {CAT_LC, 0x0283, 0}, + {CAT_Ll, 0x0284, 2}, + {CAT_LC, 0x0287, 5}, + {CAT_Ll, 0x028D, 4}, + {CAT_LC, 0x0292, 0}, + {CAT_Ll, 0x0293, 0}, + {CAT_Lo, 0x0294, 0}, + {CAT_Ll, 0x0295, 7}, + {CAT_LC, 0x029D, 1}, + {CAT_Ll, 0x029F, 16}, + {CAT_Lm, 0x02B0, 17}, + {CAT_Sk, 0x02C2, 3}, + {CAT_Lm, 0x02C6, 11}, + {CAT_Sk, 0x02D2, 13}, + {CAT_Lm, 0x02E0, 4}, + {CAT_Sk, 0x02E5, 6}, + {CAT_Lm, 0x02EC, 0}, + {CAT_Sk, 0x02ED, 0}, + {CAT_Lm, 0x02EE, 0}, + {CAT_Sk, 0x02EF, 16}, + {CAT_Mn, 0x0300, 111}, + {CAT_LC, 0x0370, 3}, + {CAT_Lm, 0x0374, 0}, + {CAT_Sk, 0x0375, 0}, + {CAT_LC, 0x0376, 1}, + {CAT_Lm, 0x037A, 0}, + {CAT_LC, 0x037B, 2}, + {CAT_Po, 0x037E, 0}, + {CAT_LC, 0x037F, 0}, + {CAT_Sk, 0x0384, 1}, + {CAT_LC, 0x0386, 0}, + {CAT_Po, 0x0387, 0}, + {CAT_LC, 0x0388, 2}, + {CAT_LC, 0x038C, 0}, + {CAT_LC, 0x038E, 1}, + {CAT_Ll, 0x0390, 0}, + {CAT_LC, 0x0391, 16}, + {CAT_LC, 0x03A3, 12}, + {CAT_Ll, 0x03B0, 0}, + {CAT_LC, 0x03B1, 32}, + {CAT_Lu, 0x03D2, 2}, + {CAT_LC, 0x03D5, 32}, + {CAT_Sm, 0x03F6, 0}, + {CAT_LC, 0x03F7, 4}, + {CAT_Ll, 0x03FC, 0}, + {CAT_LC, 0x03FD, 132}, + {CAT_So, 0x0482, 0}, + {CAT_Mn, 0x0483, 4}, + {CAT_Me, 0x0488, 1}, + {CAT_LC, 0x048A, 165}, + {CAT_LC, 0x0531, 37}, + {CAT_Lm, 0x0559, 0}, + {CAT_Po, 0x055A, 5}, + {CAT_LC, 0x0561, 37}, + {CAT_Ll, 0x0587, 0}, + {CAT_Po, 0x0589, 0}, + {CAT_Pd, 0x058A, 0}, + {CAT_So, 0x058D, 1}, + {CAT_Sc, 0x058F, 0}, + {CAT_Mn, 0x0591, 44}, + {CAT_Pd, 0x05BE, 0}, + {CAT_Mn, 0x05BF, 0}, + {CAT_Po, 0x05C0, 0}, + {CAT_Mn, 0x05C1, 1}, + {CAT_Po, 0x05C3, 0}, + {CAT_Mn, 0x05C4, 1}, + {CAT_Po, 0x05C6, 0}, + {CAT_Mn, 0x05C7, 0}, + {CAT_Lo, 0x05D0, 26}, + {CAT_Lo, 0x05F0, 2}, + {CAT_Po, 0x05F3, 1}, + {CAT_Cf, 0x0600, 5}, + {CAT_Sm, 0x0606, 2}, + {CAT_Po, 0x0609, 1}, + {CAT_Sc, 0x060B, 0}, + {CAT_Po, 0x060C, 1}, + {CAT_So, 0x060E, 1}, + {CAT_Mn, 0x0610, 10}, + {CAT_Po, 0x061B, 0}, + {CAT_Cf, 0x061C, 0}, + {CAT_Po, 0x061E, 1}, + {CAT_Lo, 0x0620, 31}, + {CAT_Lm, 0x0640, 0}, + {CAT_Lo, 0x0641, 9}, + {CAT_Mn, 0x064B, 20}, + {CAT_Nd, 0x0660, 9}, + {CAT_Po, 0x066A, 3}, + {CAT_Lo, 0x066E, 1}, + {CAT_Mn, 0x0670, 0}, + {CAT_Lo, 0x0671, 98}, + {CAT_Po, 0x06D4, 0}, + {CAT_Lo, 0x06D5, 0}, + {CAT_Mn, 0x06D6, 6}, + {CAT_Cf, 0x06DD, 0}, + {CAT_So, 0x06DE, 0}, + {CAT_Mn, 0x06DF, 5}, + {CAT_Lm, 0x06E5, 1}, + {CAT_Mn, 0x06E7, 1}, + {CAT_So, 0x06E9, 0}, + {CAT_Mn, 0x06EA, 3}, + {CAT_Lo, 0x06EE, 1}, + {CAT_Nd, 0x06F0, 9}, + {CAT_Lo, 0x06FA, 2}, + {CAT_So, 0x06FD, 1}, + {CAT_Lo, 0x06FF, 0}, + {CAT_Po, 0x0700, 13}, + {CAT_Cf, 0x070F, 0}, + {CAT_Lo, 0x0710, 0}, + {CAT_Mn, 0x0711, 0}, + {CAT_Lo, 0x0712, 29}, + {CAT_Mn, 0x0730, 26}, + {CAT_Lo, 0x074D, 88}, + {CAT_Mn, 0x07A6, 10}, + {CAT_Lo, 0x07B1, 0}, + {CAT_Nd, 0x07C0, 9}, + {CAT_Lo, 0x07CA, 32}, + {CAT_Mn, 0x07EB, 8}, + {CAT_Lm, 0x07F4, 1}, + {CAT_So, 0x07F6, 0}, + {CAT_Po, 0x07F7, 2}, + {CAT_Lm, 0x07FA, 0}, + {CAT_Lo, 0x0800, 21}, + {CAT_Mn, 0x0816, 3}, + {CAT_Lm, 0x081A, 0}, + {CAT_Mn, 0x081B, 8}, + {CAT_Lm, 0x0824, 0}, + {CAT_Mn, 0x0825, 2}, + {CAT_Lm, 0x0828, 0}, + {CAT_Mn, 0x0829, 4}, + {CAT_Po, 0x0830, 14}, + {CAT_Lo, 0x0840, 24}, + {CAT_Mn, 0x0859, 2}, + {CAT_Po, 0x085E, 0}, + {CAT_Lo, 0x0860, 10}, + {CAT_Lo, 0x08A0, 20}, + {CAT_Lo, 0x08B6, 7}, + {CAT_Mn, 0x08D4, 13}, + {CAT_Cf, 0x08E2, 0}, + {CAT_Mn, 0x08E3, 31}, + {CAT_Mc, 0x0903, 0}, + {CAT_Lo, 0x0904, 53}, + {CAT_Mn, 0x093A, 0}, + {CAT_Mc, 0x093B, 0}, + {CAT_Mn, 0x093C, 0}, + {CAT_Lo, 0x093D, 0}, + {CAT_Mc, 0x093E, 2}, + {CAT_Mn, 0x0941, 7}, + {CAT_Mc, 0x0949, 3}, + {CAT_Mn, 0x094D, 0}, + {CAT_Mc, 0x094E, 1}, + {CAT_Lo, 0x0950, 0}, + {CAT_Mn, 0x0951, 6}, + {CAT_Lo, 0x0958, 9}, + {CAT_Mn, 0x0962, 1}, + {CAT_Po, 0x0964, 1}, + {CAT_Nd, 0x0966, 9}, + {CAT_Po, 0x0970, 0}, + {CAT_Lm, 0x0971, 0}, + {CAT_Lo, 0x0972, 14}, + {CAT_Mn, 0x0981, 0}, + {CAT_Mc, 0x0982, 1}, + {CAT_Lo, 0x0985, 7}, + {CAT_Lo, 0x098F, 1}, + {CAT_Lo, 0x0993, 21}, + {CAT_Lo, 0x09AA, 6}, + {CAT_Lo, 0x09B2, 0}, + {CAT_Lo, 0x09B6, 3}, + {CAT_Mn, 0x09BC, 0}, + {CAT_Lo, 0x09BD, 0}, + {CAT_Mc, 0x09BE, 2}, + {CAT_Mn, 0x09C1, 3}, + {CAT_Mc, 0x09C7, 1}, + {CAT_Mc, 0x09CB, 1}, + {CAT_Mn, 0x09CD, 0}, + {CAT_Lo, 0x09CE, 0}, + {CAT_Mc, 0x09D7, 0}, + {CAT_Lo, 0x09DC, 1}, + {CAT_Lo, 0x09DF, 2}, + {CAT_Mn, 0x09E2, 1}, + {CAT_Nd, 0x09E6, 9}, + {CAT_Lo, 0x09F0, 1}, + {CAT_Sc, 0x09F2, 1}, + {CAT_No, 0x09F4, 5}, + {CAT_So, 0x09FA, 0}, + {CAT_Sc, 0x09FB, 0}, + {CAT_Lo, 0x09FC, 0}, + {CAT_Po, 0x09FD, 0}, + {CAT_Mn, 0x0A01, 1}, + {CAT_Mc, 0x0A03, 0}, + {CAT_Lo, 0x0A05, 5}, + {CAT_Lo, 0x0A0F, 1}, + {CAT_Lo, 0x0A13, 21}, + {CAT_Lo, 0x0A2A, 6}, + {CAT_Lo, 0x0A32, 1}, + {CAT_Lo, 0x0A35, 1}, + {CAT_Lo, 0x0A38, 1}, + {CAT_Mn, 0x0A3C, 0}, + {CAT_Mc, 0x0A3E, 2}, + {CAT_Mn, 0x0A41, 1}, + {CAT_Mn, 0x0A47, 1}, + {CAT_Mn, 0x0A4B, 2}, + {CAT_Mn, 0x0A51, 0}, + {CAT_Lo, 0x0A59, 3}, + {CAT_Lo, 0x0A5E, 0}, + {CAT_Nd, 0x0A66, 9}, + {CAT_Mn, 0x0A70, 1}, + {CAT_Lo, 0x0A72, 2}, + {CAT_Mn, 0x0A75, 0}, + {CAT_Mn, 0x0A81, 1}, + {CAT_Mc, 0x0A83, 0}, + {CAT_Lo, 0x0A85, 8}, + {CAT_Lo, 0x0A8F, 2}, + {CAT_Lo, 0x0A93, 21}, + {CAT_Lo, 0x0AAA, 6}, + {CAT_Lo, 0x0AB2, 1}, + {CAT_Lo, 0x0AB5, 4}, + {CAT_Mn, 0x0ABC, 0}, + {CAT_Lo, 0x0ABD, 0}, + {CAT_Mc, 0x0ABE, 2}, + {CAT_Mn, 0x0AC1, 4}, + {CAT_Mn, 0x0AC7, 1}, + {CAT_Mc, 0x0AC9, 0}, + {CAT_Mc, 0x0ACB, 1}, + {CAT_Mn, 0x0ACD, 0}, + {CAT_Lo, 0x0AD0, 0}, + {CAT_Lo, 0x0AE0, 1}, + {CAT_Mn, 0x0AE2, 1}, + {CAT_Nd, 0x0AE6, 9}, + {CAT_Po, 0x0AF0, 0}, + {CAT_Sc, 0x0AF1, 0}, + {CAT_Lo, 0x0AF9, 0}, + {CAT_Mn, 0x0AFA, 5}, + {CAT_Mn, 0x0B01, 0}, + {CAT_Mc, 0x0B02, 1}, + {CAT_Lo, 0x0B05, 7}, + {CAT_Lo, 0x0B0F, 1}, + {CAT_Lo, 0x0B13, 21}, + {CAT_Lo, 0x0B2A, 6}, + {CAT_Lo, 0x0B32, 1}, + {CAT_Lo, 0x0B35, 4}, + {CAT_Mn, 0x0B3C, 0}, + {CAT_Lo, 0x0B3D, 0}, + {CAT_Mc, 0x0B3E, 0}, + {CAT_Mn, 0x0B3F, 0}, + {CAT_Mc, 0x0B40, 0}, + {CAT_Mn, 0x0B41, 3}, + {CAT_Mc, 0x0B47, 1}, + {CAT_Mc, 0x0B4B, 1}, + {CAT_Mn, 0x0B4D, 0}, + {CAT_Mn, 0x0B56, 0}, + {CAT_Mc, 0x0B57, 0}, + {CAT_Lo, 0x0B5C, 1}, + {CAT_Lo, 0x0B5F, 2}, + {CAT_Mn, 0x0B62, 1}, + {CAT_Nd, 0x0B66, 9}, + {CAT_So, 0x0B70, 0}, + {CAT_Lo, 0x0B71, 0}, + {CAT_No, 0x0B72, 5}, + {CAT_Mn, 0x0B82, 0}, + {CAT_Lo, 0x0B83, 0}, + {CAT_Lo, 0x0B85, 5}, + {CAT_Lo, 0x0B8E, 2}, + {CAT_Lo, 0x0B92, 3}, + {CAT_Lo, 0x0B99, 1}, + {CAT_Lo, 0x0B9C, 0}, + {CAT_Lo, 0x0B9E, 1}, + {CAT_Lo, 0x0BA3, 1}, + {CAT_Lo, 0x0BA8, 2}, + {CAT_Lo, 0x0BAE, 11}, + {CAT_Mc, 0x0BBE, 1}, + {CAT_Mn, 0x0BC0, 0}, + {CAT_Mc, 0x0BC1, 1}, + {CAT_Mc, 0x0BC6, 2}, + {CAT_Mc, 0x0BCA, 2}, + {CAT_Mn, 0x0BCD, 0}, + {CAT_Lo, 0x0BD0, 0}, + {CAT_Mc, 0x0BD7, 0}, + {CAT_Nd, 0x0BE6, 9}, + {CAT_No, 0x0BF0, 2}, + {CAT_So, 0x0BF3, 5}, + {CAT_Sc, 0x0BF9, 0}, + {CAT_So, 0x0BFA, 0}, + {CAT_Mn, 0x0C00, 0}, + {CAT_Mc, 0x0C01, 2}, + {CAT_Lo, 0x0C05, 7}, + {CAT_Lo, 0x0C0E, 2}, + {CAT_Lo, 0x0C12, 22}, + {CAT_Lo, 0x0C2A, 15}, + {CAT_Lo, 0x0C3D, 0}, + {CAT_Mn, 0x0C3E, 2}, + {CAT_Mc, 0x0C41, 3}, + {CAT_Mn, 0x0C46, 2}, + {CAT_Mn, 0x0C4A, 3}, + {CAT_Mn, 0x0C55, 1}, + {CAT_Lo, 0x0C58, 2}, + {CAT_Lo, 0x0C60, 1}, + {CAT_Mn, 0x0C62, 1}, + {CAT_Nd, 0x0C66, 9}, + {CAT_No, 0x0C78, 6}, + {CAT_So, 0x0C7F, 0}, + {CAT_Lo, 0x0C80, 0}, + {CAT_Mn, 0x0C81, 0}, + {CAT_Mc, 0x0C82, 1}, + {CAT_Lo, 0x0C85, 7}, + {CAT_Lo, 0x0C8E, 2}, + {CAT_Lo, 0x0C92, 22}, + {CAT_Lo, 0x0CAA, 9}, + {CAT_Lo, 0x0CB5, 4}, + {CAT_Mn, 0x0CBC, 0}, + {CAT_Lo, 0x0CBD, 0}, + {CAT_Mc, 0x0CBE, 0}, + {CAT_Mn, 0x0CBF, 0}, + {CAT_Mc, 0x0CC0, 4}, + {CAT_Mn, 0x0CC6, 0}, + {CAT_Mc, 0x0CC7, 1}, + {CAT_Mc, 0x0CCA, 1}, + {CAT_Mn, 0x0CCC, 1}, + {CAT_Mc, 0x0CD5, 1}, + {CAT_Lo, 0x0CDE, 0}, + {CAT_Lo, 0x0CE0, 1}, + {CAT_Mn, 0x0CE2, 1}, + {CAT_Nd, 0x0CE6, 9}, + {CAT_Lo, 0x0CF1, 1}, + {CAT_Mn, 0x0D00, 1}, + {CAT_Mc, 0x0D02, 1}, + {CAT_Lo, 0x0D05, 7}, + {CAT_Lo, 0x0D0E, 2}, + {CAT_Lo, 0x0D12, 40}, + {CAT_Mn, 0x0D3B, 1}, + {CAT_Lo, 0x0D3D, 0}, + {CAT_Mc, 0x0D3E, 2}, + {CAT_Mn, 0x0D41, 3}, + {CAT_Mc, 0x0D46, 2}, + {CAT_Mc, 0x0D4A, 2}, + {CAT_Mn, 0x0D4D, 0}, + {CAT_Lo, 0x0D4E, 0}, + {CAT_So, 0x0D4F, 0}, + {CAT_Lo, 0x0D54, 2}, + {CAT_Mc, 0x0D57, 0}, + {CAT_No, 0x0D58, 6}, + {CAT_Lo, 0x0D5F, 2}, + {CAT_Mn, 0x0D62, 1}, + {CAT_Nd, 0x0D66, 9}, + {CAT_No, 0x0D70, 8}, + {CAT_So, 0x0D79, 0}, + {CAT_Lo, 0x0D7A, 5}, + {CAT_Mc, 0x0D82, 1}, + {CAT_Lo, 0x0D85, 17}, + {CAT_Lo, 0x0D9A, 23}, + {CAT_Lo, 0x0DB3, 8}, + {CAT_Lo, 0x0DBD, 0}, + {CAT_Lo, 0x0DC0, 6}, + {CAT_Mn, 0x0DCA, 0}, + {CAT_Mc, 0x0DCF, 2}, + {CAT_Mn, 0x0DD2, 2}, + {CAT_Mn, 0x0DD6, 0}, + {CAT_Mc, 0x0DD8, 7}, + {CAT_Nd, 0x0DE6, 9}, + {CAT_Mc, 0x0DF2, 1}, + {CAT_Po, 0x0DF4, 0}, + {CAT_Lo, 0x0E01, 47}, + {CAT_Mn, 0x0E31, 0}, + {CAT_Lo, 0x0E32, 1}, + {CAT_Mn, 0x0E34, 6}, + {CAT_Sc, 0x0E3F, 0}, + {CAT_Lo, 0x0E40, 5}, + {CAT_Lm, 0x0E46, 0}, + {CAT_Mn, 0x0E47, 7}, + {CAT_Po, 0x0E4F, 0}, + {CAT_Nd, 0x0E50, 9}, + {CAT_Po, 0x0E5A, 1}, + {CAT_Lo, 0x0E81, 1}, + {CAT_Lo, 0x0E84, 0}, + {CAT_Lo, 0x0E87, 1}, + {CAT_Lo, 0x0E8A, 0}, + {CAT_Lo, 0x0E8D, 0}, + {CAT_Lo, 0x0E94, 3}, + {CAT_Lo, 0x0E99, 6}, + {CAT_Lo, 0x0EA1, 2}, + {CAT_Lo, 0x0EA5, 0}, + {CAT_Lo, 0x0EA7, 0}, + {CAT_Lo, 0x0EAA, 1}, + {CAT_Lo, 0x0EAD, 3}, + {CAT_Mn, 0x0EB1, 0}, + {CAT_Lo, 0x0EB2, 1}, + {CAT_Mn, 0x0EB4, 5}, + {CAT_Mn, 0x0EBB, 1}, + {CAT_Lo, 0x0EBD, 0}, + {CAT_Lo, 0x0EC0, 4}, + {CAT_Lm, 0x0EC6, 0}, + {CAT_Mn, 0x0EC8, 5}, + {CAT_Nd, 0x0ED0, 9}, + {CAT_Lo, 0x0EDC, 3}, + {CAT_Lo, 0x0F00, 0}, + {CAT_So, 0x0F01, 2}, + {CAT_Po, 0x0F04, 14}, + {CAT_So, 0x0F13, 0}, + {CAT_Po, 0x0F14, 0}, + {CAT_So, 0x0F15, 2}, + {CAT_Mn, 0x0F18, 1}, + {CAT_So, 0x0F1A, 5}, + {CAT_Nd, 0x0F20, 9}, + {CAT_No, 0x0F2A, 9}, + {CAT_So, 0x0F34, 0}, + {CAT_Mn, 0x0F35, 0}, + {CAT_So, 0x0F36, 0}, + {CAT_Mn, 0x0F37, 0}, + {CAT_So, 0x0F38, 0}, + {CAT_Mn, 0x0F39, 0}, + {CAT_Ps, 0x0F3A, 0}, + {CAT_Pe, 0x0F3B, 0}, + {CAT_Ps, 0x0F3C, 0}, + {CAT_Pe, 0x0F3D, 0}, + {CAT_Mc, 0x0F3E, 1}, + {CAT_Lo, 0x0F40, 7}, + {CAT_Lo, 0x0F49, 35}, + {CAT_Mn, 0x0F71, 13}, + {CAT_Mc, 0x0F7F, 0}, + {CAT_Mn, 0x0F80, 4}, + {CAT_Po, 0x0F85, 0}, + {CAT_Mn, 0x0F86, 1}, + {CAT_Lo, 0x0F88, 4}, + {CAT_Mn, 0x0F8D, 10}, + {CAT_Mn, 0x0F99, 35}, + {CAT_So, 0x0FBE, 7}, + {CAT_Mn, 0x0FC6, 0}, + {CAT_So, 0x0FC7, 5}, + {CAT_So, 0x0FCE, 1}, + {CAT_Po, 0x0FD0, 4}, + {CAT_So, 0x0FD5, 3}, + {CAT_Po, 0x0FD9, 1}, + {CAT_Lo, 0x1000, 42}, + {CAT_Mc, 0x102B, 1}, + {CAT_Mn, 0x102D, 3}, + {CAT_Mc, 0x1031, 0}, + {CAT_Mn, 0x1032, 5}, + {CAT_Mc, 0x1038, 0}, + {CAT_Mn, 0x1039, 1}, + {CAT_Mc, 0x103B, 1}, + {CAT_Mn, 0x103D, 1}, + {CAT_Lo, 0x103F, 0}, + {CAT_Nd, 0x1040, 9}, + {CAT_Po, 0x104A, 5}, + {CAT_Lo, 0x1050, 5}, + {CAT_Mc, 0x1056, 1}, + {CAT_Mn, 0x1058, 1}, + {CAT_Lo, 0x105A, 3}, + {CAT_Mn, 0x105E, 2}, + {CAT_Lo, 0x1061, 0}, + {CAT_Mc, 0x1062, 2}, + {CAT_Lo, 0x1065, 1}, + {CAT_Mc, 0x1067, 6}, + {CAT_Lo, 0x106E, 2}, + {CAT_Mn, 0x1071, 3}, + {CAT_Lo, 0x1075, 12}, + {CAT_Mn, 0x1082, 0}, + {CAT_Mc, 0x1083, 1}, + {CAT_Mn, 0x1085, 1}, + {CAT_Mc, 0x1087, 5}, + {CAT_Mn, 0x108D, 0}, + {CAT_Lo, 0x108E, 0}, + {CAT_Mc, 0x108F, 0}, + {CAT_Nd, 0x1090, 9}, + {CAT_Mc, 0x109A, 2}, + {CAT_Mn, 0x109D, 0}, + {CAT_So, 0x109E, 1}, + {CAT_LC, 0x10A0, 37}, + {CAT_LC, 0x10C7, 0}, + {CAT_LC, 0x10CD, 0}, + {CAT_Lo, 0x10D0, 42}, + {CAT_Po, 0x10FB, 0}, + {CAT_Lm, 0x10FC, 0}, + {CAT_Lo, 0x10FD, 331}, + {CAT_Lo, 0x124A, 3}, + {CAT_Lo, 0x1250, 6}, + {CAT_Lo, 0x1258, 0}, + {CAT_Lo, 0x125A, 3}, + {CAT_Lo, 0x1260, 40}, + {CAT_Lo, 0x128A, 3}, + {CAT_Lo, 0x1290, 32}, + {CAT_Lo, 0x12B2, 3}, + {CAT_Lo, 0x12B8, 6}, + {CAT_Lo, 0x12C0, 0}, + {CAT_Lo, 0x12C2, 3}, + {CAT_Lo, 0x12C8, 14}, + {CAT_Lo, 0x12D8, 56}, + {CAT_Lo, 0x1312, 3}, + {CAT_Lo, 0x1318, 66}, + {CAT_Mn, 0x135D, 2}, + {CAT_Po, 0x1360, 8}, + {CAT_No, 0x1369, 19}, + {CAT_Lo, 0x1380, 15}, + {CAT_So, 0x1390, 9}, + {CAT_LC, 0x13A0, 85}, + {CAT_LC, 0x13F8, 5}, + {CAT_Pd, 0x1400, 0}, + {CAT_Lo, 0x1401, 619}, + {CAT_Po, 0x166D, 1}, + {CAT_Lo, 0x166F, 16}, + {CAT_Zs, 0x1680, 0}, + {CAT_Lo, 0x1681, 25}, + {CAT_Ps, 0x169B, 0}, + {CAT_Pe, 0x169C, 0}, + {CAT_Lo, 0x16A0, 74}, + {CAT_Po, 0x16EB, 2}, + {CAT_Nl, 0x16EE, 2}, + {CAT_Lo, 0x16F1, 7}, + {CAT_Lo, 0x1700, 12}, + {CAT_Lo, 0x170E, 3}, + {CAT_Mn, 0x1712, 2}, + {CAT_Lo, 0x1720, 17}, + {CAT_Mn, 0x1732, 2}, + {CAT_Po, 0x1735, 1}, + {CAT_Lo, 0x1740, 17}, + {CAT_Mn, 0x1752, 1}, + {CAT_Lo, 0x1760, 12}, + {CAT_Lo, 0x176E, 2}, + {CAT_Mn, 0x1772, 1}, + {CAT_Lo, 0x1780, 51}, + {CAT_Mn, 0x17B4, 1}, + {CAT_Mc, 0x17B6, 0}, + {CAT_Mn, 0x17B7, 6}, + {CAT_Mc, 0x17BE, 7}, + {CAT_Mn, 0x17C6, 0}, + {CAT_Mc, 0x17C7, 1}, + {CAT_Mn, 0x17C9, 10}, + {CAT_Po, 0x17D4, 2}, + {CAT_Lm, 0x17D7, 0}, + {CAT_Po, 0x17D8, 2}, + {CAT_Sc, 0x17DB, 0}, + {CAT_Lo, 0x17DC, 0}, + {CAT_Mn, 0x17DD, 0}, + {CAT_Nd, 0x17E0, 9}, + {CAT_No, 0x17F0, 9}, + {CAT_Po, 0x1800, 5}, + {CAT_Pd, 0x1806, 0}, + {CAT_Po, 0x1807, 3}, + {CAT_Mn, 0x180B, 2}, + {CAT_Cf, 0x180E, 0}, + {CAT_Nd, 0x1810, 9}, + {CAT_Lo, 0x1820, 34}, + {CAT_Lm, 0x1843, 0}, + {CAT_Lo, 0x1844, 51}, + {CAT_Lo, 0x1880, 4}, + {CAT_Mn, 0x1885, 1}, + {CAT_Lo, 0x1887, 33}, + {CAT_Mn, 0x18A9, 0}, + {CAT_Lo, 0x18AA, 0}, + {CAT_Lo, 0x18B0, 69}, + {CAT_Lo, 0x1900, 30}, + {CAT_Mn, 0x1920, 2}, + {CAT_Mc, 0x1923, 3}, + {CAT_Mn, 0x1927, 1}, + {CAT_Mc, 0x1929, 2}, + {CAT_Mc, 0x1930, 1}, + {CAT_Mn, 0x1932, 0}, + {CAT_Mc, 0x1933, 5}, + {CAT_Mn, 0x1939, 2}, + {CAT_So, 0x1940, 0}, + {CAT_Po, 0x1944, 1}, + {CAT_Nd, 0x1946, 9}, + {CAT_Lo, 0x1950, 29}, + {CAT_Lo, 0x1970, 4}, + {CAT_Lo, 0x1980, 43}, + {CAT_Lo, 0x19B0, 25}, + {CAT_Nd, 0x19D0, 9}, + {CAT_No, 0x19DA, 0}, + {CAT_So, 0x19DE, 33}, + {CAT_Lo, 0x1A00, 22}, + {CAT_Mn, 0x1A17, 1}, + {CAT_Mc, 0x1A19, 1}, + {CAT_Mn, 0x1A1B, 0}, + {CAT_Po, 0x1A1E, 1}, + {CAT_Lo, 0x1A20, 52}, + {CAT_Mc, 0x1A55, 0}, + {CAT_Mn, 0x1A56, 0}, + {CAT_Mc, 0x1A57, 0}, + {CAT_Mn, 0x1A58, 6}, + {CAT_Mn, 0x1A60, 0}, + {CAT_Mc, 0x1A61, 0}, + {CAT_Mn, 0x1A62, 0}, + {CAT_Mc, 0x1A63, 1}, + {CAT_Mn, 0x1A65, 7}, + {CAT_Mc, 0x1A6D, 5}, + {CAT_Mn, 0x1A73, 9}, + {CAT_Mn, 0x1A7F, 0}, + {CAT_Nd, 0x1A80, 9}, + {CAT_Nd, 0x1A90, 9}, + {CAT_Po, 0x1AA0, 6}, + {CAT_Lm, 0x1AA7, 0}, + {CAT_Po, 0x1AA8, 5}, + {CAT_Mn, 0x1AB0, 13}, + {CAT_Me, 0x1ABE, 0}, + {CAT_Mn, 0x1B00, 3}, + {CAT_Mc, 0x1B04, 0}, + {CAT_Lo, 0x1B05, 46}, + {CAT_Mn, 0x1B34, 0}, + {CAT_Mc, 0x1B35, 0}, + {CAT_Mn, 0x1B36, 4}, + {CAT_Mc, 0x1B3B, 0}, + {CAT_Mn, 0x1B3C, 0}, + {CAT_Mc, 0x1B3D, 4}, + {CAT_Mn, 0x1B42, 0}, + {CAT_Mc, 0x1B43, 1}, + {CAT_Lo, 0x1B45, 6}, + {CAT_Nd, 0x1B50, 9}, + {CAT_Po, 0x1B5A, 6}, + {CAT_So, 0x1B61, 9}, + {CAT_Mn, 0x1B6B, 8}, + {CAT_So, 0x1B74, 8}, + {CAT_Mn, 0x1B80, 1}, + {CAT_Mc, 0x1B82, 0}, + {CAT_Lo, 0x1B83, 29}, + {CAT_Mc, 0x1BA1, 0}, + {CAT_Mn, 0x1BA2, 3}, + {CAT_Mc, 0x1BA6, 1}, + {CAT_Mn, 0x1BA8, 1}, + {CAT_Mc, 0x1BAA, 0}, + {CAT_Mn, 0x1BAB, 2}, + {CAT_Lo, 0x1BAE, 1}, + {CAT_Nd, 0x1BB0, 9}, + {CAT_Lo, 0x1BBA, 43}, + {CAT_Mn, 0x1BE6, 0}, + {CAT_Mc, 0x1BE7, 0}, + {CAT_Mn, 0x1BE8, 1}, + {CAT_Mc, 0x1BEA, 2}, + {CAT_Mn, 0x1BED, 0}, + {CAT_Mc, 0x1BEE, 0}, + {CAT_Mn, 0x1BEF, 2}, + {CAT_Mc, 0x1BF2, 1}, + {CAT_Po, 0x1BFC, 3}, + {CAT_Lo, 0x1C00, 35}, + {CAT_Mc, 0x1C24, 7}, + {CAT_Mn, 0x1C2C, 7}, + {CAT_Mc, 0x1C34, 1}, + {CAT_Mn, 0x1C36, 1}, + {CAT_Po, 0x1C3B, 4}, + {CAT_Nd, 0x1C40, 9}, + {CAT_Lo, 0x1C4D, 2}, + {CAT_Nd, 0x1C50, 9}, + {CAT_Lo, 0x1C5A, 29}, + {CAT_Lm, 0x1C78, 5}, + {CAT_Po, 0x1C7E, 1}, + {CAT_LC, 0x1C80, 8}, + {CAT_Po, 0x1CC0, 7}, + {CAT_Mn, 0x1CD0, 2}, + {CAT_Po, 0x1CD3, 0}, + {CAT_Mn, 0x1CD4, 12}, + {CAT_Mc, 0x1CE1, 0}, + {CAT_Mn, 0x1CE2, 6}, + {CAT_Lo, 0x1CE9, 3}, + {CAT_Mn, 0x1CED, 0}, + {CAT_Lo, 0x1CEE, 3}, + {CAT_Mc, 0x1CF2, 1}, + {CAT_Mn, 0x1CF4, 0}, + {CAT_Lo, 0x1CF5, 1}, + {CAT_Mc, 0x1CF7, 0}, + {CAT_Mn, 0x1CF8, 1}, + {CAT_Ll, 0x1D00, 43}, + {CAT_Lm, 0x1D2C, 62}, + {CAT_Ll, 0x1D6B, 12}, + {CAT_Lm, 0x1D78, 0}, + {CAT_LC, 0x1D79, 0}, + {CAT_Ll, 0x1D7A, 2}, + {CAT_LC, 0x1D7D, 0}, + {CAT_Ll, 0x1D7E, 28}, + {CAT_Lm, 0x1D9B, 36}, + {CAT_Mn, 0x1DC0, 57}, + {CAT_Mn, 0x1DFB, 4}, + {CAT_LC, 0x1E00, 149}, + {CAT_Ll, 0x1E96, 4}, + {CAT_LC, 0x1E9B, 0}, + {CAT_Ll, 0x1E9C, 1}, + {CAT_LC, 0x1E9E, 0}, + {CAT_Ll, 0x1E9F, 0}, + {CAT_LC, 0x1EA0, 117}, + {CAT_LC, 0x1F18, 5}, + {CAT_LC, 0x1F20, 37}, + {CAT_LC, 0x1F48, 5}, + {CAT_Ll, 0x1F50, 0}, + {CAT_LC, 0x1F51, 0}, + {CAT_Ll, 0x1F52, 0}, + {CAT_LC, 0x1F53, 0}, + {CAT_Ll, 0x1F54, 0}, + {CAT_LC, 0x1F55, 0}, + {CAT_Ll, 0x1F56, 0}, + {CAT_LC, 0x1F57, 0}, + {CAT_LC, 0x1F59, 0}, + {CAT_LC, 0x1F5B, 0}, + {CAT_LC, 0x1F5D, 0}, + {CAT_LC, 0x1F5F, 30}, + {CAT_LC, 0x1F80, 7}, + {CAT_Lt, 0x1F88, 7}, + {CAT_LC, 0x1F90, 7}, + {CAT_Lt, 0x1F98, 7}, + {CAT_LC, 0x1FA0, 7}, + {CAT_Lt, 0x1FA8, 7}, + {CAT_LC, 0x1FB0, 1}, + {CAT_Ll, 0x1FB2, 0}, + {CAT_LC, 0x1FB3, 0}, + {CAT_Ll, 0x1FB4, 0}, + {CAT_Ll, 0x1FB6, 1}, + {CAT_LC, 0x1FB8, 3}, + {CAT_Lt, 0x1FBC, 0}, + {CAT_Sk, 0x1FBD, 0}, + {CAT_LC, 0x1FBE, 0}, + {CAT_Sk, 0x1FBF, 2}, + {CAT_Ll, 0x1FC2, 0}, + {CAT_LC, 0x1FC3, 0}, + {CAT_Ll, 0x1FC4, 0}, + {CAT_Ll, 0x1FC6, 1}, + {CAT_LC, 0x1FC8, 3}, + {CAT_Lt, 0x1FCC, 0}, + {CAT_Sk, 0x1FCD, 2}, + {CAT_LC, 0x1FD0, 1}, + {CAT_Ll, 0x1FD2, 1}, + {CAT_Ll, 0x1FD6, 1}, + {CAT_LC, 0x1FD8, 3}, + {CAT_Sk, 0x1FDD, 2}, + {CAT_LC, 0x1FE0, 1}, + {CAT_Ll, 0x1FE2, 2}, + {CAT_LC, 0x1FE5, 0}, + {CAT_Ll, 0x1FE6, 1}, + {CAT_LC, 0x1FE8, 4}, + {CAT_Sk, 0x1FED, 2}, + {CAT_Ll, 0x1FF2, 0}, + {CAT_LC, 0x1FF3, 0}, + {CAT_Ll, 0x1FF4, 0}, + {CAT_Ll, 0x1FF6, 1}, + {CAT_LC, 0x1FF8, 3}, + {CAT_Lt, 0x1FFC, 0}, + {CAT_Sk, 0x1FFD, 1}, + {CAT_Zs, 0x2000, 10}, + {CAT_Cf, 0x200B, 4}, + {CAT_Pd, 0x2010, 5}, + {CAT_Po, 0x2016, 1}, + {CAT_Pi, 0x2018, 0}, + {CAT_Pf, 0x2019, 0}, + {CAT_Ps, 0x201A, 0}, + {CAT_Pi, 0x201B, 1}, + {CAT_Pf, 0x201D, 0}, + {CAT_Ps, 0x201E, 0}, + {CAT_Pi, 0x201F, 0}, + {CAT_Po, 0x2020, 7}, + {CAT_Zl, 0x2028, 0}, + {CAT_Zp, 0x2029, 0}, + {CAT_Cf, 0x202A, 4}, + {CAT_Zs, 0x202F, 0}, + {CAT_Po, 0x2030, 8}, + {CAT_Pi, 0x2039, 0}, + {CAT_Pf, 0x203A, 0}, + {CAT_Po, 0x203B, 3}, + {CAT_Pc, 0x203F, 1}, + {CAT_Po, 0x2041, 2}, + {CAT_Sm, 0x2044, 0}, + {CAT_Ps, 0x2045, 0}, + {CAT_Pe, 0x2046, 0}, + {CAT_Po, 0x2047, 10}, + {CAT_Sm, 0x2052, 0}, + {CAT_Po, 0x2053, 0}, + {CAT_Pc, 0x2054, 0}, + {CAT_Po, 0x2055, 9}, + {CAT_Zs, 0x205F, 0}, + {CAT_Cf, 0x2060, 4}, + {CAT_Cf, 0x2066, 9}, + {CAT_No, 0x2070, 0}, + {CAT_Lm, 0x2071, 0}, + {CAT_No, 0x2074, 5}, + {CAT_Sm, 0x207A, 2}, + {CAT_Ps, 0x207D, 0}, + {CAT_Pe, 0x207E, 0}, + {CAT_Lm, 0x207F, 0}, + {CAT_No, 0x2080, 9}, + {CAT_Sm, 0x208A, 2}, + {CAT_Ps, 0x208D, 0}, + {CAT_Pe, 0x208E, 0}, + {CAT_Lm, 0x2090, 12}, + {CAT_Sc, 0x20A0, 31}, + {CAT_Mn, 0x20D0, 12}, + {CAT_Me, 0x20DD, 3}, + {CAT_Mn, 0x20E1, 0}, + {CAT_Me, 0x20E2, 2}, + {CAT_Mn, 0x20E5, 11}, + {CAT_So, 0x2100, 1}, + {CAT_Lu, 0x2102, 0}, + {CAT_So, 0x2103, 3}, + {CAT_Lu, 0x2107, 0}, + {CAT_So, 0x2108, 1}, + {CAT_Ll, 0x210A, 0}, + {CAT_Lu, 0x210B, 2}, + {CAT_Ll, 0x210E, 1}, + {CAT_Lu, 0x2110, 2}, + {CAT_Ll, 0x2113, 0}, + {CAT_So, 0x2114, 0}, + {CAT_Lu, 0x2115, 0}, + {CAT_So, 0x2116, 1}, + {CAT_Sm, 0x2118, 0}, + {CAT_Lu, 0x2119, 4}, + {CAT_So, 0x211E, 5}, + {CAT_Lu, 0x2124, 0}, + {CAT_So, 0x2125, 0}, + {CAT_LC, 0x2126, 0}, + {CAT_So, 0x2127, 0}, + {CAT_Lu, 0x2128, 0}, + {CAT_So, 0x2129, 0}, + {CAT_LC, 0x212A, 1}, + {CAT_Lu, 0x212C, 1}, + {CAT_So, 0x212E, 0}, + {CAT_Ll, 0x212F, 0}, + {CAT_Lu, 0x2130, 1}, + {CAT_LC, 0x2132, 0}, + {CAT_Lu, 0x2133, 0}, + {CAT_Ll, 0x2134, 0}, + {CAT_Lo, 0x2135, 3}, + {CAT_Ll, 0x2139, 0}, + {CAT_So, 0x213A, 1}, + {CAT_Ll, 0x213C, 1}, + {CAT_Lu, 0x213E, 1}, + {CAT_Sm, 0x2140, 4}, + {CAT_Lu, 0x2145, 0}, + {CAT_Ll, 0x2146, 3}, + {CAT_So, 0x214A, 0}, + {CAT_Sm, 0x214B, 0}, + {CAT_So, 0x214C, 1}, + {CAT_LC, 0x214E, 0}, + {CAT_So, 0x214F, 0}, + {CAT_No, 0x2150, 15}, + {CAT_Nl, 0x2160, 34}, + {CAT_LC, 0x2183, 1}, + {CAT_Nl, 0x2185, 3}, + {CAT_No, 0x2189, 0}, + {CAT_So, 0x218A, 1}, + {CAT_Sm, 0x2190, 4}, + {CAT_So, 0x2195, 4}, + {CAT_Sm, 0x219A, 1}, + {CAT_So, 0x219C, 3}, + {CAT_Sm, 0x21A0, 0}, + {CAT_So, 0x21A1, 1}, + {CAT_Sm, 0x21A3, 0}, + {CAT_So, 0x21A4, 1}, + {CAT_Sm, 0x21A6, 0}, + {CAT_So, 0x21A7, 6}, + {CAT_Sm, 0x21AE, 0}, + {CAT_So, 0x21AF, 30}, + {CAT_Sm, 0x21CE, 1}, + {CAT_So, 0x21D0, 1}, + {CAT_Sm, 0x21D2, 0}, + {CAT_So, 0x21D3, 0}, + {CAT_Sm, 0x21D4, 0}, + {CAT_So, 0x21D5, 30}, + {CAT_Sm, 0x21F4, 267}, + {CAT_So, 0x2300, 7}, + {CAT_Ps, 0x2308, 0}, + {CAT_Pe, 0x2309, 0}, + {CAT_Ps, 0x230A, 0}, + {CAT_Pe, 0x230B, 0}, + {CAT_So, 0x230C, 19}, + {CAT_Sm, 0x2320, 1}, + {CAT_So, 0x2322, 6}, + {CAT_Ps, 0x2329, 0}, + {CAT_Pe, 0x232A, 0}, + {CAT_So, 0x232B, 80}, + {CAT_Sm, 0x237C, 0}, + {CAT_So, 0x237D, 29}, + {CAT_Sm, 0x239B, 24}, + {CAT_So, 0x23B4, 39}, + {CAT_Sm, 0x23DC, 5}, + {CAT_So, 0x23E2, 68}, + {CAT_So, 0x2440, 10}, + {CAT_No, 0x2460, 59}, + {CAT_So, 0x249C, 77}, + {CAT_No, 0x24EA, 21}, + {CAT_So, 0x2500, 182}, + {CAT_Sm, 0x25B7, 0}, + {CAT_So, 0x25B8, 8}, + {CAT_Sm, 0x25C1, 0}, + {CAT_So, 0x25C2, 53}, + {CAT_Sm, 0x25F8, 7}, + {CAT_So, 0x2600, 110}, + {CAT_Sm, 0x266F, 0}, + {CAT_So, 0x2670, 247}, + {CAT_Ps, 0x2768, 0}, + {CAT_Pe, 0x2769, 0}, + {CAT_Ps, 0x276A, 0}, + {CAT_Pe, 0x276B, 0}, + {CAT_Ps, 0x276C, 0}, + {CAT_Pe, 0x276D, 0}, + {CAT_Ps, 0x276E, 0}, + {CAT_Pe, 0x276F, 0}, + {CAT_Ps, 0x2770, 0}, + {CAT_Pe, 0x2771, 0}, + {CAT_Ps, 0x2772, 0}, + {CAT_Pe, 0x2773, 0}, + {CAT_Ps, 0x2774, 0}, + {CAT_Pe, 0x2775, 0}, + {CAT_No, 0x2776, 29}, + {CAT_So, 0x2794, 43}, + {CAT_Sm, 0x27C0, 4}, + {CAT_Ps, 0x27C5, 0}, + {CAT_Pe, 0x27C6, 0}, + {CAT_Sm, 0x27C7, 30}, + {CAT_Ps, 0x27E6, 0}, + {CAT_Pe, 0x27E7, 0}, + {CAT_Ps, 0x27E8, 0}, + {CAT_Pe, 0x27E9, 0}, + {CAT_Ps, 0x27EA, 0}, + {CAT_Pe, 0x27EB, 0}, + {CAT_Ps, 0x27EC, 0}, + {CAT_Pe, 0x27ED, 0}, + {CAT_Ps, 0x27EE, 0}, + {CAT_Pe, 0x27EF, 0}, + {CAT_Sm, 0x27F0, 15}, + {CAT_So, 0x2800, 255}, + {CAT_Sm, 0x2900, 130}, + {CAT_Ps, 0x2983, 0}, + {CAT_Pe, 0x2984, 0}, + {CAT_Ps, 0x2985, 0}, + {CAT_Pe, 0x2986, 0}, + {CAT_Ps, 0x2987, 0}, + {CAT_Pe, 0x2988, 0}, + {CAT_Ps, 0x2989, 0}, + {CAT_Pe, 0x298A, 0}, + {CAT_Ps, 0x298B, 0}, + {CAT_Pe, 0x298C, 0}, + {CAT_Ps, 0x298D, 0}, + {CAT_Pe, 0x298E, 0}, + {CAT_Ps, 0x298F, 0}, + {CAT_Pe, 0x2990, 0}, + {CAT_Ps, 0x2991, 0}, + {CAT_Pe, 0x2992, 0}, + {CAT_Ps, 0x2993, 0}, + {CAT_Pe, 0x2994, 0}, + {CAT_Ps, 0x2995, 0}, + {CAT_Pe, 0x2996, 0}, + {CAT_Ps, 0x2997, 0}, + {CAT_Pe, 0x2998, 0}, + {CAT_Sm, 0x2999, 62}, + {CAT_Ps, 0x29D8, 0}, + {CAT_Pe, 0x29D9, 0}, + {CAT_Ps, 0x29DA, 0}, + {CAT_Pe, 0x29DB, 0}, + {CAT_Sm, 0x29DC, 31}, + {CAT_Ps, 0x29FC, 0}, + {CAT_Pe, 0x29FD, 0}, + {CAT_Sm, 0x29FE, 257}, + {CAT_So, 0x2B00, 47}, + {CAT_Sm, 0x2B30, 20}, + {CAT_So, 0x2B45, 1}, + {CAT_Sm, 0x2B47, 5}, + {CAT_So, 0x2B4D, 38}, + {CAT_So, 0x2B76, 31}, + {CAT_So, 0x2B98, 33}, + {CAT_So, 0x2BBD, 11}, + {CAT_So, 0x2BCA, 8}, + {CAT_So, 0x2BEC, 3}, + {CAT_LC, 0x2C00, 46}, + {CAT_LC, 0x2C30, 46}, + {CAT_LC, 0x2C60, 16}, + {CAT_Ll, 0x2C71, 0}, + {CAT_LC, 0x2C72, 1}, + {CAT_Ll, 0x2C74, 0}, + {CAT_LC, 0x2C75, 1}, + {CAT_Ll, 0x2C77, 4}, + {CAT_Lm, 0x2C7C, 1}, + {CAT_LC, 0x2C7E, 101}, + {CAT_Ll, 0x2CE4, 0}, + {CAT_So, 0x2CE5, 5}, + {CAT_LC, 0x2CEB, 3}, + {CAT_Mn, 0x2CEF, 2}, + {CAT_LC, 0x2CF2, 1}, + {CAT_Po, 0x2CF9, 3}, + {CAT_No, 0x2CFD, 0}, + {CAT_Po, 0x2CFE, 1}, + {CAT_LC, 0x2D00, 37}, + {CAT_LC, 0x2D27, 0}, + {CAT_LC, 0x2D2D, 0}, + {CAT_Lo, 0x2D30, 55}, + {CAT_Lm, 0x2D6F, 0}, + {CAT_Po, 0x2D70, 0}, + {CAT_Mn, 0x2D7F, 0}, + {CAT_Lo, 0x2D80, 22}, + {CAT_Lo, 0x2DA0, 6}, + {CAT_Lo, 0x2DA8, 6}, + {CAT_Lo, 0x2DB0, 6}, + {CAT_Lo, 0x2DB8, 6}, + {CAT_Lo, 0x2DC0, 6}, + {CAT_Lo, 0x2DC8, 6}, + {CAT_Lo, 0x2DD0, 6}, + {CAT_Lo, 0x2DD8, 6}, + {CAT_Mn, 0x2DE0, 31}, + {CAT_Po, 0x2E00, 1}, + {CAT_Pi, 0x2E02, 0}, + {CAT_Pf, 0x2E03, 0}, + {CAT_Pi, 0x2E04, 0}, + {CAT_Pf, 0x2E05, 0}, + {CAT_Po, 0x2E06, 2}, + {CAT_Pi, 0x2E09, 0}, + {CAT_Pf, 0x2E0A, 0}, + {CAT_Po, 0x2E0B, 0}, + {CAT_Pi, 0x2E0C, 0}, + {CAT_Pf, 0x2E0D, 0}, + {CAT_Po, 0x2E0E, 8}, + {CAT_Pd, 0x2E17, 0}, + {CAT_Po, 0x2E18, 1}, + {CAT_Pd, 0x2E1A, 0}, + {CAT_Po, 0x2E1B, 0}, + {CAT_Pi, 0x2E1C, 0}, + {CAT_Pf, 0x2E1D, 0}, + {CAT_Po, 0x2E1E, 1}, + {CAT_Pi, 0x2E20, 0}, + {CAT_Pf, 0x2E21, 0}, + {CAT_Ps, 0x2E22, 0}, + {CAT_Pe, 0x2E23, 0}, + {CAT_Ps, 0x2E24, 0}, + {CAT_Pe, 0x2E25, 0}, + {CAT_Ps, 0x2E26, 0}, + {CAT_Pe, 0x2E27, 0}, + {CAT_Ps, 0x2E28, 0}, + {CAT_Pe, 0x2E29, 0}, + {CAT_Po, 0x2E2A, 4}, + {CAT_Lm, 0x2E2F, 0}, + {CAT_Po, 0x2E30, 9}, + {CAT_Pd, 0x2E3A, 1}, + {CAT_Po, 0x2E3C, 3}, + {CAT_Pd, 0x2E40, 0}, + {CAT_Po, 0x2E41, 0}, + {CAT_Ps, 0x2E42, 0}, + {CAT_Po, 0x2E43, 6}, + {CAT_So, 0x2E80, 25}, + {CAT_So, 0x2E9B, 88}, + {CAT_So, 0x2F00, 213}, + {CAT_So, 0x2FF0, 11}, + {CAT_Zs, 0x3000, 0}, + {CAT_Po, 0x3001, 2}, + {CAT_So, 0x3004, 0}, + {CAT_Lm, 0x3005, 0}, + {CAT_Lo, 0x3006, 0}, + {CAT_Nl, 0x3007, 0}, + {CAT_Ps, 0x3008, 0}, + {CAT_Pe, 0x3009, 0}, + {CAT_Ps, 0x300A, 0}, + {CAT_Pe, 0x300B, 0}, + {CAT_Ps, 0x300C, 0}, + {CAT_Pe, 0x300D, 0}, + {CAT_Ps, 0x300E, 0}, + {CAT_Pe, 0x300F, 0}, + {CAT_Ps, 0x3010, 0}, + {CAT_Pe, 0x3011, 0}, + {CAT_So, 0x3012, 1}, + {CAT_Ps, 0x3014, 0}, + {CAT_Pe, 0x3015, 0}, + {CAT_Ps, 0x3016, 0}, + {CAT_Pe, 0x3017, 0}, + {CAT_Ps, 0x3018, 0}, + {CAT_Pe, 0x3019, 0}, + {CAT_Ps, 0x301A, 0}, + {CAT_Pe, 0x301B, 0}, + {CAT_Pd, 0x301C, 0}, + {CAT_Ps, 0x301D, 0}, + {CAT_Pe, 0x301E, 1}, + {CAT_So, 0x3020, 0}, + {CAT_Nl, 0x3021, 8}, + {CAT_Mn, 0x302A, 3}, + {CAT_Mc, 0x302E, 1}, + {CAT_Pd, 0x3030, 0}, + {CAT_Lm, 0x3031, 4}, + {CAT_So, 0x3036, 1}, + {CAT_Nl, 0x3038, 2}, + {CAT_Lm, 0x303B, 0}, + {CAT_Lo, 0x303C, 0}, + {CAT_Po, 0x303D, 0}, + {CAT_So, 0x303E, 1}, + {CAT_Lo, 0x3041, 85}, + {CAT_Mn, 0x3099, 1}, + {CAT_Sk, 0x309B, 1}, + {CAT_Lm, 0x309D, 1}, + {CAT_Lo, 0x309F, 0}, + {CAT_Pd, 0x30A0, 0}, + {CAT_Lo, 0x30A1, 89}, + {CAT_Po, 0x30FB, 0}, + {CAT_Lm, 0x30FC, 2}, + {CAT_Lo, 0x30FF, 0}, + {CAT_Lo, 0x3105, 41}, + {CAT_Lo, 0x3131, 93}, + {CAT_So, 0x3190, 1}, + {CAT_No, 0x3192, 3}, + {CAT_So, 0x3196, 9}, + {CAT_Lo, 0x31A0, 26}, + {CAT_So, 0x31C0, 35}, + {CAT_Lo, 0x31F0, 15}, + {CAT_So, 0x3200, 30}, + {CAT_No, 0x3220, 9}, + {CAT_So, 0x322A, 29}, + {CAT_No, 0x3248, 7}, + {CAT_So, 0x3250, 0}, + {CAT_No, 0x3251, 14}, + {CAT_So, 0x3260, 31}, + {CAT_No, 0x3280, 9}, + {CAT_So, 0x328A, 38}, + {CAT_No, 0x32B1, 14}, + {CAT_So, 0x32C0, 62}, + {CAT_So, 0x3300, 255}, + {CAT_Lo, 0x3400, 6581}, + {CAT_So, 0x4DC0, 63}, + {CAT_Lo, 0x4E00, 20970}, + {CAT_Lo, 0xA000, 20}, + {CAT_Lm, 0xA015, 0}, + {CAT_Lo, 0xA016, 1142}, + {CAT_So, 0xA490, 54}, + {CAT_Lo, 0xA4D0, 39}, + {CAT_Lm, 0xA4F8, 5}, + {CAT_Po, 0xA4FE, 1}, + {CAT_Lo, 0xA500, 267}, + {CAT_Lm, 0xA60C, 0}, + {CAT_Po, 0xA60D, 2}, + {CAT_Lo, 0xA610, 15}, + {CAT_Nd, 0xA620, 9}, + {CAT_Lo, 0xA62A, 1}, + {CAT_LC, 0xA640, 45}, + {CAT_Lo, 0xA66E, 0}, + {CAT_Mn, 0xA66F, 0}, + {CAT_Me, 0xA670, 2}, + {CAT_Po, 0xA673, 0}, + {CAT_Mn, 0xA674, 9}, + {CAT_Po, 0xA67E, 0}, + {CAT_Lm, 0xA67F, 0}, + {CAT_LC, 0xA680, 27}, + {CAT_Lm, 0xA69C, 1}, + {CAT_Mn, 0xA69E, 1}, + {CAT_Lo, 0xA6A0, 69}, + {CAT_Nl, 0xA6E6, 9}, + {CAT_Mn, 0xA6F0, 1}, + {CAT_Po, 0xA6F2, 5}, + {CAT_Sk, 0xA700, 22}, + {CAT_Lm, 0xA717, 8}, + {CAT_Sk, 0xA720, 1}, + {CAT_LC, 0xA722, 13}, + {CAT_Ll, 0xA730, 1}, + {CAT_LC, 0xA732, 61}, + {CAT_Lm, 0xA770, 0}, + {CAT_Ll, 0xA771, 7}, + {CAT_LC, 0xA779, 14}, + {CAT_Lm, 0xA788, 0}, + {CAT_Sk, 0xA789, 1}, + {CAT_LC, 0xA78B, 2}, + {CAT_Ll, 0xA78E, 0}, + {CAT_Lo, 0xA78F, 0}, + {CAT_LC, 0xA790, 3}, + {CAT_Ll, 0xA794, 1}, + {CAT_LC, 0xA796, 24}, + {CAT_LC, 0xA7B0, 7}, + {CAT_Lo, 0xA7F7, 0}, + {CAT_Lm, 0xA7F8, 1}, + {CAT_Ll, 0xA7FA, 0}, + {CAT_Lo, 0xA7FB, 6}, + {CAT_Mn, 0xA802, 0}, + {CAT_Lo, 0xA803, 2}, + {CAT_Mn, 0xA806, 0}, + {CAT_Lo, 0xA807, 3}, + {CAT_Mn, 0xA80B, 0}, + {CAT_Lo, 0xA80C, 22}, + {CAT_Mc, 0xA823, 1}, + {CAT_Mn, 0xA825, 1}, + {CAT_Mc, 0xA827, 0}, + {CAT_So, 0xA828, 3}, + {CAT_No, 0xA830, 5}, + {CAT_So, 0xA836, 1}, + {CAT_Sc, 0xA838, 0}, + {CAT_So, 0xA839, 0}, + {CAT_Lo, 0xA840, 51}, + {CAT_Po, 0xA874, 3}, + {CAT_Mc, 0xA880, 1}, + {CAT_Lo, 0xA882, 49}, + {CAT_Mc, 0xA8B4, 15}, + {CAT_Mn, 0xA8C4, 1}, + {CAT_Po, 0xA8CE, 1}, + {CAT_Nd, 0xA8D0, 9}, + {CAT_Mn, 0xA8E0, 17}, + {CAT_Lo, 0xA8F2, 5}, + {CAT_Po, 0xA8F8, 2}, + {CAT_Lo, 0xA8FB, 0}, + {CAT_Po, 0xA8FC, 0}, + {CAT_Lo, 0xA8FD, 0}, + {CAT_Nd, 0xA900, 9}, + {CAT_Lo, 0xA90A, 27}, + {CAT_Mn, 0xA926, 7}, + {CAT_Po, 0xA92E, 1}, + {CAT_Lo, 0xA930, 22}, + {CAT_Mn, 0xA947, 10}, + {CAT_Mc, 0xA952, 1}, + {CAT_Po, 0xA95F, 0}, + {CAT_Lo, 0xA960, 28}, + {CAT_Mn, 0xA980, 2}, + {CAT_Mc, 0xA983, 0}, + {CAT_Lo, 0xA984, 46}, + {CAT_Mn, 0xA9B3, 0}, + {CAT_Mc, 0xA9B4, 1}, + {CAT_Mn, 0xA9B6, 3}, + {CAT_Mc, 0xA9BA, 1}, + {CAT_Mn, 0xA9BC, 0}, + {CAT_Mc, 0xA9BD, 3}, + {CAT_Po, 0xA9C1, 12}, + {CAT_Lm, 0xA9CF, 0}, + {CAT_Nd, 0xA9D0, 9}, + {CAT_Po, 0xA9DE, 1}, + {CAT_Lo, 0xA9E0, 4}, + {CAT_Mn, 0xA9E5, 0}, + {CAT_Lm, 0xA9E6, 0}, + {CAT_Lo, 0xA9E7, 8}, + {CAT_Nd, 0xA9F0, 9}, + {CAT_Lo, 0xA9FA, 4}, + {CAT_Lo, 0xAA00, 40}, + {CAT_Mn, 0xAA29, 5}, + {CAT_Mc, 0xAA2F, 1}, + {CAT_Mn, 0xAA31, 1}, + {CAT_Mc, 0xAA33, 1}, + {CAT_Mn, 0xAA35, 1}, + {CAT_Lo, 0xAA40, 2}, + {CAT_Mn, 0xAA43, 0}, + {CAT_Lo, 0xAA44, 7}, + {CAT_Mn, 0xAA4C, 0}, + {CAT_Mc, 0xAA4D, 0}, + {CAT_Nd, 0xAA50, 9}, + {CAT_Po, 0xAA5C, 3}, + {CAT_Lo, 0xAA60, 15}, + {CAT_Lm, 0xAA70, 0}, + {CAT_Lo, 0xAA71, 5}, + {CAT_So, 0xAA77, 2}, + {CAT_Lo, 0xAA7A, 0}, + {CAT_Mc, 0xAA7B, 0}, + {CAT_Mn, 0xAA7C, 0}, + {CAT_Mc, 0xAA7D, 0}, + {CAT_Lo, 0xAA7E, 49}, + {CAT_Mn, 0xAAB0, 0}, + {CAT_Lo, 0xAAB1, 0}, + {CAT_Mn, 0xAAB2, 2}, + {CAT_Lo, 0xAAB5, 1}, + {CAT_Mn, 0xAAB7, 1}, + {CAT_Lo, 0xAAB9, 4}, + {CAT_Mn, 0xAABE, 1}, + {CAT_Lo, 0xAAC0, 0}, + {CAT_Mn, 0xAAC1, 0}, + {CAT_Lo, 0xAAC2, 0}, + {CAT_Lo, 0xAADB, 1}, + {CAT_Lm, 0xAADD, 0}, + {CAT_Po, 0xAADE, 1}, + {CAT_Lo, 0xAAE0, 10}, + {CAT_Mc, 0xAAEB, 0}, + {CAT_Mn, 0xAAEC, 1}, + {CAT_Mc, 0xAAEE, 1}, + {CAT_Po, 0xAAF0, 1}, + {CAT_Lo, 0xAAF2, 0}, + {CAT_Lm, 0xAAF3, 1}, + {CAT_Mc, 0xAAF5, 0}, + {CAT_Mn, 0xAAF6, 0}, + {CAT_Lo, 0xAB01, 5}, + {CAT_Lo, 0xAB09, 5}, + {CAT_Lo, 0xAB11, 5}, + {CAT_Lo, 0xAB20, 6}, + {CAT_Lo, 0xAB28, 6}, + {CAT_Ll, 0xAB30, 34}, + {CAT_LC, 0xAB53, 0}, + {CAT_Ll, 0xAB54, 6}, + {CAT_Sk, 0xAB5B, 0}, + {CAT_Lm, 0xAB5C, 3}, + {CAT_Ll, 0xAB60, 5}, + {CAT_LC, 0xAB70, 79}, + {CAT_Lo, 0xABC0, 34}, + {CAT_Mc, 0xABE3, 1}, + {CAT_Mn, 0xABE5, 0}, + {CAT_Mc, 0xABE6, 1}, + {CAT_Mn, 0xABE8, 0}, + {CAT_Mc, 0xABE9, 1}, + {CAT_Po, 0xABEB, 0}, + {CAT_Mc, 0xABEC, 0}, + {CAT_Mn, 0xABED, 0}, + {CAT_Nd, 0xABF0, 9}, + {CAT_Lo, 0xAC00, 11171}, + {CAT_Lo, 0xD7B0, 22}, + {CAT_Lo, 0xD7CB, 48}, + {CAT_Cs, 0xD800, 2047}, + {CAT_Lo, 0xF900, 365}, + {CAT_Lo, 0xFA70, 105}, + {CAT_Ll, 0xFB00, 6}, + {CAT_Ll, 0xFB13, 4}, + {CAT_Lo, 0xFB1D, 0}, + {CAT_Mn, 0xFB1E, 0}, + {CAT_Lo, 0xFB1F, 9}, + {CAT_Sm, 0xFB29, 0}, + {CAT_Lo, 0xFB2A, 12}, + {CAT_Lo, 0xFB38, 4}, + {CAT_Lo, 0xFB3E, 0}, + {CAT_Lo, 0xFB40, 1}, + {CAT_Lo, 0xFB43, 1}, + {CAT_Lo, 0xFB46, 107}, + {CAT_Sk, 0xFBB2, 15}, + {CAT_Lo, 0xFBD3, 362}, + {CAT_Pe, 0xFD3E, 0}, + {CAT_Ps, 0xFD3F, 0}, + {CAT_Lo, 0xFD50, 63}, + {CAT_Lo, 0xFD92, 53}, + {CAT_Lo, 0xFDF0, 11}, + {CAT_Sc, 0xFDFC, 0}, + {CAT_So, 0xFDFD, 0}, + {CAT_Mn, 0xFE00, 15}, + {CAT_Po, 0xFE10, 6}, + {CAT_Ps, 0xFE17, 0}, + {CAT_Pe, 0xFE18, 0}, + {CAT_Po, 0xFE19, 0}, + {CAT_Mn, 0xFE20, 15}, + {CAT_Po, 0xFE30, 0}, + {CAT_Pd, 0xFE31, 1}, + {CAT_Pc, 0xFE33, 1}, + {CAT_Ps, 0xFE35, 0}, + {CAT_Pe, 0xFE36, 0}, + {CAT_Ps, 0xFE37, 0}, + {CAT_Pe, 0xFE38, 0}, + {CAT_Ps, 0xFE39, 0}, + {CAT_Pe, 0xFE3A, 0}, + {CAT_Ps, 0xFE3B, 0}, + {CAT_Pe, 0xFE3C, 0}, + {CAT_Ps, 0xFE3D, 0}, + {CAT_Pe, 0xFE3E, 0}, + {CAT_Ps, 0xFE3F, 0}, + {CAT_Pe, 0xFE40, 0}, + {CAT_Ps, 0xFE41, 0}, + {CAT_Pe, 0xFE42, 0}, + {CAT_Ps, 0xFE43, 0}, + {CAT_Pe, 0xFE44, 0}, + {CAT_Po, 0xFE45, 1}, + {CAT_Ps, 0xFE47, 0}, + {CAT_Pe, 0xFE48, 0}, + {CAT_Po, 0xFE49, 3}, + {CAT_Pc, 0xFE4D, 2}, + {CAT_Po, 0xFE50, 2}, + {CAT_Po, 0xFE54, 3}, + {CAT_Pd, 0xFE58, 0}, + {CAT_Ps, 0xFE59, 0}, + {CAT_Pe, 0xFE5A, 0}, + {CAT_Ps, 0xFE5B, 0}, + {CAT_Pe, 0xFE5C, 0}, + {CAT_Ps, 0xFE5D, 0}, + {CAT_Pe, 0xFE5E, 0}, + {CAT_Po, 0xFE5F, 2}, + {CAT_Sm, 0xFE62, 0}, + {CAT_Pd, 0xFE63, 0}, + {CAT_Sm, 0xFE64, 2}, + {CAT_Po, 0xFE68, 0}, + {CAT_Sc, 0xFE69, 0}, + {CAT_Po, 0xFE6A, 1}, + {CAT_Lo, 0xFE70, 4}, + {CAT_Lo, 0xFE76, 134}, + {CAT_Cf, 0xFEFF, 0}, + {CAT_Po, 0xFF01, 2}, + {CAT_Sc, 0xFF04, 0}, + {CAT_Po, 0xFF05, 2}, + {CAT_Ps, 0xFF08, 0}, + {CAT_Pe, 0xFF09, 0}, + {CAT_Po, 0xFF0A, 0}, + {CAT_Sm, 0xFF0B, 0}, + {CAT_Po, 0xFF0C, 0}, + {CAT_Pd, 0xFF0D, 0}, + {CAT_Po, 0xFF0E, 1}, + {CAT_Nd, 0xFF10, 9}, + {CAT_Po, 0xFF1A, 1}, + {CAT_Sm, 0xFF1C, 2}, + {CAT_Po, 0xFF1F, 1}, + {CAT_LC, 0xFF21, 25}, + {CAT_Ps, 0xFF3B, 0}, + {CAT_Po, 0xFF3C, 0}, + {CAT_Pe, 0xFF3D, 0}, + {CAT_Sk, 0xFF3E, 0}, + {CAT_Pc, 0xFF3F, 0}, + {CAT_Sk, 0xFF40, 0}, + {CAT_LC, 0xFF41, 25}, + {CAT_Ps, 0xFF5B, 0}, + {CAT_Sm, 0xFF5C, 0}, + {CAT_Pe, 0xFF5D, 0}, + {CAT_Sm, 0xFF5E, 0}, + {CAT_Ps, 0xFF5F, 0}, + {CAT_Pe, 0xFF60, 0}, + {CAT_Po, 0xFF61, 0}, + {CAT_Ps, 0xFF62, 0}, + {CAT_Pe, 0xFF63, 0}, + {CAT_Po, 0xFF64, 1}, + {CAT_Lo, 0xFF66, 9}, + {CAT_Lm, 0xFF70, 0}, + {CAT_Lo, 0xFF71, 44}, + {CAT_Lm, 0xFF9E, 1}, + {CAT_Lo, 0xFFA0, 30}, + {CAT_Lo, 0xFFC2, 5}, + {CAT_Lo, 0xFFCA, 5}, + {CAT_Lo, 0xFFD2, 5}, + {CAT_Lo, 0xFFDA, 2}, + {CAT_Sc, 0xFFE0, 1}, + {CAT_Sm, 0xFFE2, 0}, + {CAT_Sk, 0xFFE3, 0}, + {CAT_So, 0xFFE4, 0}, + {CAT_Sc, 0xFFE5, 1}, + {CAT_So, 0xFFE8, 0}, + {CAT_Sm, 0xFFE9, 3}, + {CAT_So, 0xFFED, 1}, + {CAT_Cf, 0xFFF9, 2}, + {CAT_So, 0xFFFC, 1}, + {CAT_Lo, 0x10000, 11}, + {CAT_Lo, 0x1000D, 25}, + {CAT_Lo, 0x10028, 18}, + {CAT_Lo, 0x1003C, 1}, + {CAT_Lo, 0x1003F, 14}, + {CAT_Lo, 0x10050, 13}, + {CAT_Lo, 0x10080, 122}, + {CAT_Po, 0x10100, 2}, + {CAT_No, 0x10107, 44}, + {CAT_So, 0x10137, 8}, + {CAT_Nl, 0x10140, 52}, + {CAT_No, 0x10175, 3}, + {CAT_So, 0x10179, 16}, + {CAT_No, 0x1018A, 1}, + {CAT_So, 0x1018C, 2}, + {CAT_So, 0x10190, 11}, + {CAT_So, 0x101A0, 0}, + {CAT_So, 0x101D0, 44}, + {CAT_Mn, 0x101FD, 0}, + {CAT_Lo, 0x10280, 28}, + {CAT_Lo, 0x102A0, 48}, + {CAT_Mn, 0x102E0, 0}, + {CAT_No, 0x102E1, 26}, + {CAT_Lo, 0x10300, 31}, + {CAT_No, 0x10320, 3}, + {CAT_Lo, 0x1032D, 19}, + {CAT_Nl, 0x10341, 0}, + {CAT_Lo, 0x10342, 7}, + {CAT_Nl, 0x1034A, 0}, + {CAT_Lo, 0x10350, 37}, + {CAT_Mn, 0x10376, 4}, + {CAT_Lo, 0x10380, 29}, + {CAT_Po, 0x1039F, 0}, + {CAT_Lo, 0x103A0, 35}, + {CAT_Lo, 0x103C8, 7}, + {CAT_Po, 0x103D0, 0}, + {CAT_Nl, 0x103D1, 4}, + {CAT_LC, 0x10400, 79}, + {CAT_Lo, 0x10450, 77}, + {CAT_Nd, 0x104A0, 9}, + {CAT_LC, 0x104B0, 35}, + {CAT_LC, 0x104D8, 35}, + {CAT_Lo, 0x10500, 39}, + {CAT_Lo, 0x10530, 51}, + {CAT_Po, 0x1056F, 0}, + {CAT_Lo, 0x10600, 310}, + {CAT_Lo, 0x10740, 21}, + {CAT_Lo, 0x10760, 7}, + {CAT_Lo, 0x10800, 5}, + {CAT_Lo, 0x10808, 0}, + {CAT_Lo, 0x1080A, 43}, + {CAT_Lo, 0x10837, 1}, + {CAT_Lo, 0x1083C, 0}, + {CAT_Lo, 0x1083F, 22}, + {CAT_Po, 0x10857, 0}, + {CAT_No, 0x10858, 7}, + {CAT_Lo, 0x10860, 22}, + {CAT_So, 0x10877, 1}, + {CAT_No, 0x10879, 6}, + {CAT_Lo, 0x10880, 30}, + {CAT_No, 0x108A7, 8}, + {CAT_Lo, 0x108E0, 18}, + {CAT_Lo, 0x108F4, 1}, + {CAT_No, 0x108FB, 4}, + {CAT_Lo, 0x10900, 21}, + {CAT_No, 0x10916, 5}, + {CAT_Po, 0x1091F, 0}, + {CAT_Lo, 0x10920, 25}, + {CAT_Po, 0x1093F, 0}, + {CAT_Lo, 0x10980, 55}, + {CAT_No, 0x109BC, 1}, + {CAT_Lo, 0x109BE, 1}, + {CAT_No, 0x109C0, 15}, + {CAT_No, 0x109D2, 45}, + {CAT_Lo, 0x10A00, 0}, + {CAT_Mn, 0x10A01, 2}, + {CAT_Mn, 0x10A05, 1}, + {CAT_Mn, 0x10A0C, 3}, + {CAT_Lo, 0x10A10, 3}, + {CAT_Lo, 0x10A15, 2}, + {CAT_Lo, 0x10A19, 26}, + {CAT_Mn, 0x10A38, 2}, + {CAT_Mn, 0x10A3F, 0}, + {CAT_No, 0x10A40, 7}, + {CAT_Po, 0x10A50, 8}, + {CAT_Lo, 0x10A60, 28}, + {CAT_No, 0x10A7D, 1}, + {CAT_Po, 0x10A7F, 0}, + {CAT_Lo, 0x10A80, 28}, + {CAT_No, 0x10A9D, 2}, + {CAT_Lo, 0x10AC0, 7}, + {CAT_So, 0x10AC8, 0}, + {CAT_Lo, 0x10AC9, 27}, + {CAT_Mn, 0x10AE5, 1}, + {CAT_No, 0x10AEB, 4}, + {CAT_Po, 0x10AF0, 6}, + {CAT_Lo, 0x10B00, 53}, + {CAT_Po, 0x10B39, 6}, + {CAT_Lo, 0x10B40, 21}, + {CAT_No, 0x10B58, 7}, + {CAT_Lo, 0x10B60, 18}, + {CAT_No, 0x10B78, 7}, + {CAT_Lo, 0x10B80, 17}, + {CAT_Po, 0x10B99, 3}, + {CAT_No, 0x10BA9, 6}, + {CAT_Lo, 0x10C00, 72}, + {CAT_LC, 0x10C80, 50}, + {CAT_LC, 0x10CC0, 50}, + {CAT_No, 0x10CFA, 5}, + {CAT_No, 0x10E60, 30}, + {CAT_Mc, 0x11000, 0}, + {CAT_Mn, 0x11001, 0}, + {CAT_Mc, 0x11002, 0}, + {CAT_Lo, 0x11003, 52}, + {CAT_Mn, 0x11038, 14}, + {CAT_Po, 0x11047, 6}, + {CAT_No, 0x11052, 19}, + {CAT_Nd, 0x11066, 9}, + {CAT_Mn, 0x1107F, 2}, + {CAT_Mc, 0x11082, 0}, + {CAT_Lo, 0x11083, 44}, + {CAT_Mc, 0x110B0, 2}, + {CAT_Mn, 0x110B3, 3}, + {CAT_Mc, 0x110B7, 1}, + {CAT_Mn, 0x110B9, 1}, + {CAT_Po, 0x110BB, 1}, + {CAT_Cf, 0x110BD, 0}, + {CAT_Po, 0x110BE, 3}, + {CAT_Lo, 0x110D0, 24}, + {CAT_Nd, 0x110F0, 9}, + {CAT_Mn, 0x11100, 2}, + {CAT_Lo, 0x11103, 35}, + {CAT_Mn, 0x11127, 4}, + {CAT_Mc, 0x1112C, 0}, + {CAT_Mn, 0x1112D, 7}, + {CAT_Nd, 0x11136, 9}, + {CAT_Po, 0x11140, 3}, + {CAT_Lo, 0x11150, 34}, + {CAT_Mn, 0x11173, 0}, + {CAT_Po, 0x11174, 1}, + {CAT_Lo, 0x11176, 0}, + {CAT_Mn, 0x11180, 1}, + {CAT_Mc, 0x11182, 0}, + {CAT_Lo, 0x11183, 47}, + {CAT_Mc, 0x111B3, 2}, + {CAT_Mn, 0x111B6, 8}, + {CAT_Mc, 0x111BF, 1}, + {CAT_Lo, 0x111C1, 3}, + {CAT_Po, 0x111C5, 4}, + {CAT_Mn, 0x111CA, 2}, + {CAT_Po, 0x111CD, 0}, + {CAT_Nd, 0x111D0, 9}, + {CAT_Lo, 0x111DA, 0}, + {CAT_Po, 0x111DB, 0}, + {CAT_Lo, 0x111DC, 0}, + {CAT_Po, 0x111DD, 2}, + {CAT_No, 0x111E1, 19}, + {CAT_Lo, 0x11200, 17}, + {CAT_Lo, 0x11213, 24}, + {CAT_Mc, 0x1122C, 2}, + {CAT_Mn, 0x1122F, 2}, + {CAT_Mc, 0x11232, 1}, + {CAT_Mn, 0x11234, 0}, + {CAT_Mc, 0x11235, 0}, + {CAT_Mn, 0x11236, 1}, + {CAT_Po, 0x11238, 5}, + {CAT_Mn, 0x1123E, 0}, + {CAT_Lo, 0x11280, 6}, + {CAT_Lo, 0x11288, 0}, + {CAT_Lo, 0x1128A, 3}, + {CAT_Lo, 0x1128F, 14}, + {CAT_Lo, 0x1129F, 9}, + {CAT_Po, 0x112A9, 0}, + {CAT_Lo, 0x112B0, 46}, + {CAT_Mn, 0x112DF, 0}, + {CAT_Mc, 0x112E0, 2}, + {CAT_Mn, 0x112E3, 7}, + {CAT_Nd, 0x112F0, 9}, + {CAT_Mn, 0x11300, 1}, + {CAT_Mc, 0x11302, 1}, + {CAT_Lo, 0x11305, 7}, + {CAT_Lo, 0x1130F, 1}, + {CAT_Lo, 0x11313, 21}, + {CAT_Lo, 0x1132A, 6}, + {CAT_Lo, 0x11332, 1}, + {CAT_Lo, 0x11335, 4}, + {CAT_Mn, 0x1133C, 0}, + {CAT_Lo, 0x1133D, 0}, + {CAT_Mc, 0x1133E, 1}, + {CAT_Mn, 0x11340, 0}, + {CAT_Mc, 0x11341, 3}, + {CAT_Mc, 0x11347, 1}, + {CAT_Mc, 0x1134B, 2}, + {CAT_Lo, 0x11350, 0}, + {CAT_Mc, 0x11357, 0}, + {CAT_Lo, 0x1135D, 4}, + {CAT_Mc, 0x11362, 1}, + {CAT_Mn, 0x11366, 6}, + {CAT_Mn, 0x11370, 4}, + {CAT_Lo, 0x11400, 52}, + {CAT_Mc, 0x11435, 2}, + {CAT_Mn, 0x11438, 7}, + {CAT_Mc, 0x11440, 1}, + {CAT_Mn, 0x11442, 2}, + {CAT_Mc, 0x11445, 0}, + {CAT_Mn, 0x11446, 0}, + {CAT_Lo, 0x11447, 3}, + {CAT_Po, 0x1144B, 4}, + {CAT_Nd, 0x11450, 9}, + {CAT_Po, 0x1145B, 0}, + {CAT_Po, 0x1145D, 0}, + {CAT_Lo, 0x11480, 47}, + {CAT_Mc, 0x114B0, 2}, + {CAT_Mn, 0x114B3, 5}, + {CAT_Mc, 0x114B9, 0}, + {CAT_Mn, 0x114BA, 0}, + {CAT_Mc, 0x114BB, 3}, + {CAT_Mn, 0x114BF, 1}, + {CAT_Mc, 0x114C1, 0}, + {CAT_Mn, 0x114C2, 1}, + {CAT_Lo, 0x114C4, 1}, + {CAT_Po, 0x114C6, 0}, + {CAT_Lo, 0x114C7, 0}, + {CAT_Nd, 0x114D0, 9}, + {CAT_Lo, 0x11580, 46}, + {CAT_Mc, 0x115AF, 2}, + {CAT_Mn, 0x115B2, 3}, + {CAT_Mc, 0x115B8, 3}, + {CAT_Mn, 0x115BC, 1}, + {CAT_Mc, 0x115BE, 0}, + {CAT_Mn, 0x115BF, 1}, + {CAT_Po, 0x115C1, 22}, + {CAT_Lo, 0x115D8, 3}, + {CAT_Mn, 0x115DC, 1}, + {CAT_Lo, 0x11600, 47}, + {CAT_Mc, 0x11630, 2}, + {CAT_Mn, 0x11633, 7}, + {CAT_Mc, 0x1163B, 1}, + {CAT_Mn, 0x1163D, 0}, + {CAT_Mc, 0x1163E, 0}, + {CAT_Mn, 0x1163F, 1}, + {CAT_Po, 0x11641, 2}, + {CAT_Lo, 0x11644, 0}, + {CAT_Nd, 0x11650, 9}, + {CAT_Po, 0x11660, 12}, + {CAT_Lo, 0x11680, 42}, + {CAT_Mn, 0x116AB, 0}, + {CAT_Mc, 0x116AC, 0}, + {CAT_Mn, 0x116AD, 0}, + {CAT_Mc, 0x116AE, 1}, + {CAT_Mn, 0x116B0, 5}, + {CAT_Mc, 0x116B6, 0}, + {CAT_Mn, 0x116B7, 0}, + {CAT_Nd, 0x116C0, 9}, + {CAT_Lo, 0x11700, 25}, + {CAT_Mn, 0x1171D, 2}, + {CAT_Mc, 0x11720, 1}, + {CAT_Mn, 0x11722, 3}, + {CAT_Mc, 0x11726, 0}, + {CAT_Mn, 0x11727, 4}, + {CAT_Nd, 0x11730, 9}, + {CAT_No, 0x1173A, 1}, + {CAT_Po, 0x1173C, 2}, + {CAT_So, 0x1173F, 0}, + {CAT_LC, 0x118A0, 63}, + {CAT_Nd, 0x118E0, 9}, + {CAT_No, 0x118EA, 8}, + {CAT_Lo, 0x118FF, 0}, + {CAT_Lo, 0x11A00, 0}, + {CAT_Mn, 0x11A01, 5}, + {CAT_Mc, 0x11A07, 1}, + {CAT_Mn, 0x11A09, 1}, + {CAT_Lo, 0x11A0B, 39}, + {CAT_Mn, 0x11A33, 5}, + {CAT_Mc, 0x11A39, 0}, + {CAT_Lo, 0x11A3A, 0}, + {CAT_Mn, 0x11A3B, 3}, + {CAT_Po, 0x11A3F, 7}, + {CAT_Mn, 0x11A47, 0}, + {CAT_Lo, 0x11A50, 0}, + {CAT_Mn, 0x11A51, 5}, + {CAT_Mc, 0x11A57, 1}, + {CAT_Mn, 0x11A59, 2}, + {CAT_Lo, 0x11A5C, 39}, + {CAT_Lo, 0x11A86, 3}, + {CAT_Mn, 0x11A8A, 12}, + {CAT_Mc, 0x11A97, 0}, + {CAT_Mn, 0x11A98, 1}, + {CAT_Po, 0x11A9A, 2}, + {CAT_Po, 0x11A9E, 4}, + {CAT_Lo, 0x11AC0, 56}, + {CAT_Lo, 0x11C00, 8}, + {CAT_Lo, 0x11C0A, 36}, + {CAT_Mc, 0x11C2F, 0}, + {CAT_Mn, 0x11C30, 6}, + {CAT_Mn, 0x11C38, 5}, + {CAT_Mc, 0x11C3E, 0}, + {CAT_Mn, 0x11C3F, 0}, + {CAT_Lo, 0x11C40, 0}, + {CAT_Po, 0x11C41, 4}, + {CAT_Nd, 0x11C50, 9}, + {CAT_No, 0x11C5A, 18}, + {CAT_Po, 0x11C70, 1}, + {CAT_Lo, 0x11C72, 29}, + {CAT_Mn, 0x11C92, 21}, + {CAT_Mc, 0x11CA9, 0}, + {CAT_Mn, 0x11CAA, 6}, + {CAT_Mc, 0x11CB1, 0}, + {CAT_Mn, 0x11CB2, 1}, + {CAT_Mc, 0x11CB4, 0}, + {CAT_Mn, 0x11CB5, 1}, + {CAT_Lo, 0x11D00, 6}, + {CAT_Lo, 0x11D08, 1}, + {CAT_Lo, 0x11D0B, 37}, + {CAT_Mn, 0x11D31, 5}, + {CAT_Mn, 0x11D3A, 0}, + {CAT_Mn, 0x11D3C, 1}, + {CAT_Mn, 0x11D3F, 6}, + {CAT_Lo, 0x11D46, 0}, + {CAT_Mn, 0x11D47, 0}, + {CAT_Nd, 0x11D50, 9}, + {CAT_Lo, 0x12000, 921}, + {CAT_Nl, 0x12400, 110}, + {CAT_Po, 0x12470, 4}, + {CAT_Lo, 0x12480, 195}, + {CAT_Lo, 0x13000, 1070}, + {CAT_Lo, 0x14400, 582}, + {CAT_Lo, 0x16800, 568}, + {CAT_Lo, 0x16A40, 30}, + {CAT_Nd, 0x16A60, 9}, + {CAT_Po, 0x16A6E, 1}, + {CAT_Lo, 0x16AD0, 29}, + {CAT_Mn, 0x16AF0, 4}, + {CAT_Po, 0x16AF5, 0}, + {CAT_Lo, 0x16B00, 47}, + {CAT_Mn, 0x16B30, 6}, + {CAT_Po, 0x16B37, 4}, + {CAT_So, 0x16B3C, 3}, + {CAT_Lm, 0x16B40, 3}, + {CAT_Po, 0x16B44, 0}, + {CAT_So, 0x16B45, 0}, + {CAT_Nd, 0x16B50, 9}, + {CAT_No, 0x16B5B, 6}, + {CAT_Lo, 0x16B63, 20}, + {CAT_Lo, 0x16B7D, 18}, + {CAT_Lo, 0x16F00, 68}, + {CAT_Lo, 0x16F50, 0}, + {CAT_Mc, 0x16F51, 45}, + {CAT_Mn, 0x16F8F, 3}, + {CAT_Lm, 0x16F93, 12}, + {CAT_Lm, 0x16FE0, 1}, + {CAT_Lo, 0x17000, 6124}, + {CAT_Lo, 0x18800, 754}, + {CAT_Lo, 0x1B000, 286}, + {CAT_Lo, 0x1B170, 395}, + {CAT_Lo, 0x1BC00, 106}, + {CAT_Lo, 0x1BC70, 12}, + {CAT_Lo, 0x1BC80, 8}, + {CAT_Lo, 0x1BC90, 9}, + {CAT_So, 0x1BC9C, 0}, + {CAT_Mn, 0x1BC9D, 1}, + {CAT_Po, 0x1BC9F, 0}, + {CAT_Cf, 0x1BCA0, 3}, + {CAT_So, 0x1D000, 245}, + {CAT_So, 0x1D100, 38}, + {CAT_So, 0x1D129, 59}, + {CAT_Mc, 0x1D165, 1}, + {CAT_Mn, 0x1D167, 2}, + {CAT_So, 0x1D16A, 2}, + {CAT_Mc, 0x1D16D, 5}, + {CAT_Cf, 0x1D173, 7}, + {CAT_Mn, 0x1D17B, 7}, + {CAT_So, 0x1D183, 1}, + {CAT_Mn, 0x1D185, 6}, + {CAT_So, 0x1D18C, 29}, + {CAT_Mn, 0x1D1AA, 3}, + {CAT_So, 0x1D1AE, 58}, + {CAT_So, 0x1D200, 65}, + {CAT_Mn, 0x1D242, 2}, + {CAT_So, 0x1D245, 0}, + {CAT_So, 0x1D300, 86}, + {CAT_No, 0x1D360, 17}, + {CAT_Lu, 0x1D400, 25}, + {CAT_Ll, 0x1D41A, 25}, + {CAT_Lu, 0x1D434, 25}, + {CAT_Ll, 0x1D44E, 6}, + {CAT_Ll, 0x1D456, 17}, + {CAT_Lu, 0x1D468, 25}, + {CAT_Ll, 0x1D482, 25}, + {CAT_Lu, 0x1D49C, 0}, + {CAT_Lu, 0x1D49E, 1}, + {CAT_Lu, 0x1D4A2, 0}, + {CAT_Lu, 0x1D4A5, 1}, + {CAT_Lu, 0x1D4A9, 3}, + {CAT_Lu, 0x1D4AE, 7}, + {CAT_Ll, 0x1D4B6, 3}, + {CAT_Ll, 0x1D4BB, 0}, + {CAT_Ll, 0x1D4BD, 6}, + {CAT_Ll, 0x1D4C5, 10}, + {CAT_Lu, 0x1D4D0, 25}, + {CAT_Ll, 0x1D4EA, 25}, + {CAT_Lu, 0x1D504, 1}, + {CAT_Lu, 0x1D507, 3}, + {CAT_Lu, 0x1D50D, 7}, + {CAT_Lu, 0x1D516, 6}, + {CAT_Ll, 0x1D51E, 25}, + {CAT_Lu, 0x1D538, 1}, + {CAT_Lu, 0x1D53B, 3}, + {CAT_Lu, 0x1D540, 4}, + {CAT_Lu, 0x1D546, 0}, + {CAT_Lu, 0x1D54A, 6}, + {CAT_Ll, 0x1D552, 25}, + {CAT_Lu, 0x1D56C, 25}, + {CAT_Ll, 0x1D586, 25}, + {CAT_Lu, 0x1D5A0, 25}, + {CAT_Ll, 0x1D5BA, 25}, + {CAT_Lu, 0x1D5D4, 25}, + {CAT_Ll, 0x1D5EE, 25}, + {CAT_Lu, 0x1D608, 25}, + {CAT_Ll, 0x1D622, 25}, + {CAT_Lu, 0x1D63C, 25}, + {CAT_Ll, 0x1D656, 25}, + {CAT_Lu, 0x1D670, 25}, + {CAT_Ll, 0x1D68A, 27}, + {CAT_Lu, 0x1D6A8, 24}, + {CAT_Sm, 0x1D6C1, 0}, + {CAT_Ll, 0x1D6C2, 24}, + {CAT_Sm, 0x1D6DB, 0}, + {CAT_Ll, 0x1D6DC, 5}, + {CAT_Lu, 0x1D6E2, 24}, + {CAT_Sm, 0x1D6FB, 0}, + {CAT_Ll, 0x1D6FC, 24}, + {CAT_Sm, 0x1D715, 0}, + {CAT_Ll, 0x1D716, 5}, + {CAT_Lu, 0x1D71C, 24}, + {CAT_Sm, 0x1D735, 0}, + {CAT_Ll, 0x1D736, 24}, + {CAT_Sm, 0x1D74F, 0}, + {CAT_Ll, 0x1D750, 5}, + {CAT_Lu, 0x1D756, 24}, + {CAT_Sm, 0x1D76F, 0}, + {CAT_Ll, 0x1D770, 24}, + {CAT_Sm, 0x1D789, 0}, + {CAT_Ll, 0x1D78A, 5}, + {CAT_Lu, 0x1D790, 24}, + {CAT_Sm, 0x1D7A9, 0}, + {CAT_Ll, 0x1D7AA, 24}, + {CAT_Sm, 0x1D7C3, 0}, + {CAT_Ll, 0x1D7C4, 5}, + {CAT_Lu, 0x1D7CA, 0}, + {CAT_Ll, 0x1D7CB, 0}, + {CAT_Nd, 0x1D7CE, 49}, + {CAT_So, 0x1D800, 511}, + {CAT_Mn, 0x1DA00, 54}, + {CAT_So, 0x1DA37, 3}, + {CAT_Mn, 0x1DA3B, 49}, + {CAT_So, 0x1DA6D, 7}, + {CAT_Mn, 0x1DA75, 0}, + {CAT_So, 0x1DA76, 13}, + {CAT_Mn, 0x1DA84, 0}, + {CAT_So, 0x1DA85, 1}, + {CAT_Po, 0x1DA87, 4}, + {CAT_Mn, 0x1DA9B, 4}, + {CAT_Mn, 0x1DAA1, 14}, + {CAT_Mn, 0x1E000, 6}, + {CAT_Mn, 0x1E008, 16}, + {CAT_Mn, 0x1E01B, 6}, + {CAT_Mn, 0x1E023, 1}, + {CAT_Mn, 0x1E026, 4}, + {CAT_Lo, 0x1E800, 196}, + {CAT_No, 0x1E8C7, 8}, + {CAT_Mn, 0x1E8D0, 6}, + {CAT_LC, 0x1E900, 67}, + {CAT_Mn, 0x1E944, 6}, + {CAT_Nd, 0x1E950, 9}, + {CAT_Po, 0x1E95E, 1}, + {CAT_Lo, 0x1EE00, 3}, + {CAT_Lo, 0x1EE05, 26}, + {CAT_Lo, 0x1EE21, 1}, + {CAT_Lo, 0x1EE24, 0}, + {CAT_Lo, 0x1EE27, 0}, + {CAT_Lo, 0x1EE29, 9}, + {CAT_Lo, 0x1EE34, 3}, + {CAT_Lo, 0x1EE39, 0}, + {CAT_Lo, 0x1EE3B, 0}, + {CAT_Lo, 0x1EE42, 0}, + {CAT_Lo, 0x1EE47, 0}, + {CAT_Lo, 0x1EE49, 0}, + {CAT_Lo, 0x1EE4B, 0}, + {CAT_Lo, 0x1EE4D, 2}, + {CAT_Lo, 0x1EE51, 1}, + {CAT_Lo, 0x1EE54, 0}, + {CAT_Lo, 0x1EE57, 0}, + {CAT_Lo, 0x1EE59, 0}, + {CAT_Lo, 0x1EE5B, 0}, + {CAT_Lo, 0x1EE5D, 0}, + {CAT_Lo, 0x1EE5F, 0}, + {CAT_Lo, 0x1EE61, 1}, + {CAT_Lo, 0x1EE64, 0}, + {CAT_Lo, 0x1EE67, 3}, + {CAT_Lo, 0x1EE6C, 6}, + {CAT_Lo, 0x1EE74, 3}, + {CAT_Lo, 0x1EE79, 3}, + {CAT_Lo, 0x1EE7E, 0}, + {CAT_Lo, 0x1EE80, 9}, + {CAT_Lo, 0x1EE8B, 16}, + {CAT_Lo, 0x1EEA1, 2}, + {CAT_Lo, 0x1EEA5, 4}, + {CAT_Lo, 0x1EEAB, 16}, + {CAT_Sm, 0x1EEF0, 1}, + {CAT_So, 0x1F000, 43}, + {CAT_So, 0x1F030, 99}, + {CAT_So, 0x1F0A0, 14}, + {CAT_So, 0x1F0B1, 14}, + {CAT_So, 0x1F0C1, 14}, + {CAT_So, 0x1F0D1, 36}, + {CAT_No, 0x1F100, 12}, + {CAT_So, 0x1F110, 30}, + {CAT_So, 0x1F130, 59}, + {CAT_So, 0x1F170, 60}, + {CAT_So, 0x1F1E6, 28}, + {CAT_So, 0x1F210, 43}, + {CAT_So, 0x1F240, 8}, + {CAT_So, 0x1F250, 1}, + {CAT_So, 0x1F260, 5}, + {CAT_So, 0x1F300, 250}, + {CAT_Sk, 0x1F3FB, 4}, + {CAT_So, 0x1F400, 724}, + {CAT_So, 0x1F6E0, 12}, + {CAT_So, 0x1F6F0, 8}, + {CAT_So, 0x1F700, 115}, + {CAT_So, 0x1F780, 84}, + {CAT_So, 0x1F800, 11}, + {CAT_So, 0x1F810, 55}, + {CAT_So, 0x1F850, 9}, + {CAT_So, 0x1F860, 39}, + {CAT_So, 0x1F890, 29}, + {CAT_So, 0x1F900, 11}, + {CAT_So, 0x1F910, 46}, + {CAT_So, 0x1F940, 12}, + {CAT_So, 0x1F950, 27}, + {CAT_So, 0x1F980, 23}, + {CAT_So, 0x1F9C0, 0}, + {CAT_So, 0x1F9D0, 22}, + {CAT_Lo, 0x20000, 42710}, + {CAT_Lo, 0x2A700, 4148}, + {CAT_Lo, 0x2B740, 221}, + {CAT_Lo, 0x2B820, 5761}, + {CAT_Lo, 0x2CEB0, 7472}, + {CAT_Lo, 0x2F800, 541}, + {CAT_Cf, 0xE0001, 0}, + {CAT_Cf, 0xE0020, 95}, + {CAT_Mn, 0xE0100, 239}, diff --git a/newlib/libc/ctype/ctype_.c b/newlib/libc/ctype/ctype_.c index 9e3cdcf05..28727e8a8 100644 --- a/newlib/libc/ctype/ctype_.c +++ b/newlib/libc/ctype/ctype_.c @@ -87,7 +87,7 @@ static char sccsid[] = "@(#)ctype_.c 5.6 (Berkeley) 6/1/90"; /* No static const on Cygwin since it's referenced and potentially overwritten for compatibility with older applications. */ #ifndef __CYGWIN__ -_CONST +const #endif char _ctype_b[128 + 256] = { _CTYPE_DATA_128_255, @@ -116,7 +116,7 @@ __asm__ (" \n\ # endif # else /* !__CYGWIN__ */ -_CONST char _ctype_[1 + 256] = { +const char _ctype_[1 + 256] = { 0, _CTYPE_DATA_0_127, _CTYPE_DATA_128_255 @@ -125,7 +125,7 @@ _CONST char _ctype_[1 + 256] = { #else /* !ALLOW_NEGATIVE_CTYPE_INDEX */ -_CONST char _ctype_[1 + 256] = { +const char _ctype_[1 + 256] = { 0, _CTYPE_DATA_0_127, _CTYPE_DATA_128_255 diff --git a/newlib/libc/ctype/ctype_.h b/newlib/libc/ctype/ctype_.h index 5356d3815..a73870b3e 100644 --- a/newlib/libc/ctype/ctype_.h +++ b/newlib/libc/ctype/ctype_.h @@ -7,7 +7,7 @@ #ifdef ALLOW_NEGATIVE_CTYPE_INDEX #ifndef __CYGWIN__ - extern _CONST char _ctype_b[]; + extern const char _ctype_b[]; #else extern char _ctype_b[]; #endif diff --git a/newlib/libc/ctype/ctype_cp.h b/newlib/libc/ctype/ctype_cp.h index 004c1e2e8..9370778a2 100644 --- a/newlib/libc/ctype/ctype_cp.h +++ b/newlib/libc/ctype/ctype_cp.h @@ -473,7 +473,7 @@ #if defined(ALLOW_NEGATIVE_CTYPE_INDEX) #ifndef __CYGWIN__ -static _CONST +static const #endif char __ctype_cp[26][128 + 256] = { { _CTYPE_CP437_128_254, @@ -636,7 +636,7 @@ char __ctype_cp[26][128 + 256] = { #else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */ -static _CONST char __ctype_cp[26][1 + 256] = { +static const char __ctype_cp[26][1 + 256] = { { 0, _CTYPE_DATA_0_127, _CTYPE_CP437_128_254, diff --git a/newlib/libc/ctype/ctype_iso.h b/newlib/libc/ctype/ctype_iso.h index ed1d5d674..60087dc92 100644 --- a/newlib/libc/ctype/ctype_iso.h +++ b/newlib/libc/ctype/ctype_iso.h @@ -277,7 +277,7 @@ extern int __iso_8859_index (const char *charset_ext); #if defined(ALLOW_NEGATIVE_CTYPE_INDEX) #ifndef __CYGWIN__ -static _CONST +static const #endif char __ctype_iso[15][128 + 256] = { { _CTYPE_ISO_8859_1_128_254, @@ -374,7 +374,7 @@ char __ctype_iso[15][128 + 256] = { #else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */ -static _CONST char __ctype_iso[15][1 + 256] = { +static const char __ctype_iso[15][1 + 256] = { { 0, _CTYPE_DATA_0_127, _CTYPE_ISO_8859_1_128_254, diff --git a/newlib/libc/ctype/isalnum.c b/newlib/libc/ctype/isalnum.c index 113ef0232..d926f97b7 100644 --- a/newlib/libc/ctype/isalnum.c +++ b/newlib/libc/ctype/isalnum.c @@ -7,17 +7,13 @@ INDEX INDEX isalnum_l -ANSI_SYNOPSIS +SYNOPSIS #include int isalnum(int <[c]>); #include int isalnum_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isalnum(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table @@ -48,7 +44,7 @@ No OS subroutines are required. #undef isalnum int -_DEFUN(isalnum,(c),int c) +isalnum (int c) { return(__CTYPE_PTR[c+1] & (_U|_L|_N)); } diff --git a/newlib/libc/ctype/isalpha.c b/newlib/libc/ctype/isalpha.c index 59511e18e..8b8e78a29 100644 --- a/newlib/libc/ctype/isalpha.c +++ b/newlib/libc/ctype/isalpha.c @@ -8,17 +8,13 @@ INDEX INDEX isalpha_l -ANSI_SYNOPSIS +SYNOPSIS #include int isalpha(int <[c]>); #include int isalpha_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isalpha(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero when <[c]> represents an @@ -47,7 +43,7 @@ No supporting OS subroutines are required. #undef isalpha int -_DEFUN(isalpha,(c),int c) +isalpha (int c) { return(__CTYPE_PTR[c+1] & (_U|_L)); } diff --git a/newlib/libc/ctype/isascii.c b/newlib/libc/ctype/isascii.c index 45e19efd3..5adb81222 100644 --- a/newlib/libc/ctype/isascii.c +++ b/newlib/libc/ctype/isascii.c @@ -8,17 +8,13 @@ INDEX INDEX isascii_l -ANSI_SYNOPSIS +SYNOPSIS #include int isascii(int <[c]>); #include int isascii_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isascii(<[c]>); - DESCRIPTION <> is a macro which returns non-zero when <[c]> is an ASCII character, and 0 otherwise. It is defined for all integer values. @@ -48,7 +44,7 @@ No supporting OS subroutines are required. #undef isascii int -_DEFUN(isascii,(c),int c) +isascii (int c) { return c >= 0 && c< 128; } diff --git a/newlib/libc/ctype/isblank.c b/newlib/libc/ctype/isblank.c index db62a2681..0ebc2192c 100644 --- a/newlib/libc/ctype/isblank.c +++ b/newlib/libc/ctype/isblank.c @@ -8,17 +8,13 @@ INDEX INDEX isblank_l -ANSI_SYNOPSIS +SYNOPSIS #include int isblank(int <[c]>); #include int isblank_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isblank(<[c]>); - DESCRIPTION <> is a function which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for blank characters, and 0 @@ -46,7 +42,7 @@ No supporting OS subroutines are required. #undef isblank int -_DEFUN(isblank,(c),int c) +isblank (int c) { return ((__CTYPE_PTR[c+1] & _B) || (c == '\t')); } diff --git a/newlib/libc/ctype/iscntrl.c b/newlib/libc/ctype/iscntrl.c index d78c957f8..ebbdd7371 100644 --- a/newlib/libc/ctype/iscntrl.c +++ b/newlib/libc/ctype/iscntrl.c @@ -8,17 +8,13 @@ INDEX INDEX iscntrl_l -ANSI_SYNOPSIS +SYNOPSIS #include int iscntrl(int <[c]>); #include int iscntrl_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iscntrl(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for control characters, and 0 @@ -50,7 +46,7 @@ No supporting OS subroutines are required. #undef iscntrl int -_DEFUN(iscntrl,(c),int c) +iscntrl (int c) { return(__CTYPE_PTR[c+1] & _C); } diff --git a/newlib/libc/ctype/isdigit.c b/newlib/libc/ctype/isdigit.c index 06f14221d..a5c511964 100644 --- a/newlib/libc/ctype/isdigit.c +++ b/newlib/libc/ctype/isdigit.c @@ -8,17 +8,13 @@ INDEX INDEX isdigit_l -ANSI_SYNOPSIS +SYNOPSIS #include int isdigit(int <[c]>); #include int isdigit_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isdigit(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for decimal digits, and 0 for @@ -49,7 +45,7 @@ No supporting OS subroutines are required. #undef isdigit int -_DEFUN(isdigit,(c),int c) +isdigit (int c) { return(__CTYPE_PTR[c+1] & _N); } diff --git a/newlib/libc/ctype/islower.c b/newlib/libc/ctype/islower.c index 466252a63..2b3440489 100644 --- a/newlib/libc/ctype/islower.c +++ b/newlib/libc/ctype/islower.c @@ -8,17 +8,13 @@ INDEX INDEX islower_l -ANSI_SYNOPSIS +SYNOPSIS #include int islower(int <[c]>); #include int islower_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int islower(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for minuscules @@ -47,7 +43,7 @@ No supporting OS subroutines are required. #undef islower int -_DEFUN(islower,(c),int c) +islower (int c) { return ((__CTYPE_PTR[c+1] & (_U|_L)) == _L); } diff --git a/newlib/libc/ctype/isprint.c b/newlib/libc/ctype/isprint.c index 21fdf5b1d..e34fbe28a 100644 --- a/newlib/libc/ctype/isprint.c +++ b/newlib/libc/ctype/isprint.c @@ -14,7 +14,7 @@ INDEX INDEX isgraph_l -ANSI_SYNOPSIS +SYNOPSIS #include int isprint(int <[c]>); int isgraph(int <[c]>); @@ -23,11 +23,6 @@ ANSI_SYNOPSIS int isprint_l(int <[c]>, locale_t <[locale]>); int isgraph_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isprint(<[c]>); - int isgraph(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for printable characters, @@ -62,7 +57,7 @@ No supporting OS subroutines are required. #undef isgraph int -_DEFUN(isgraph,(c),int c) +isgraph (int c) { return(__CTYPE_PTR[c+1] & (_P|_U|_L|_N)); } @@ -70,7 +65,7 @@ _DEFUN(isgraph,(c),int c) #undef isprint int -_DEFUN(isprint,(c),int c) +isprint (int c) { return(__CTYPE_PTR[c+1] & (_P|_U|_L|_N|_B)); } diff --git a/newlib/libc/ctype/ispunct.c b/newlib/libc/ctype/ispunct.c index 4fb62197d..9c5a3fcca 100644 --- a/newlib/libc/ctype/ispunct.c +++ b/newlib/libc/ctype/ispunct.c @@ -8,17 +8,13 @@ INDEX INDEX ispunct_l -ANSI_SYNOPSIS +SYNOPSIS #include int ispunct(int <[c]>); #include int ispunct_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int ispunct(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for printable @@ -49,7 +45,7 @@ No supporting OS subroutines are required. #undef ispunct int -_DEFUN(ispunct,(c),int c) +ispunct (int c) { return(__CTYPE_PTR[c+1] & _P); } diff --git a/newlib/libc/ctype/isspace.c b/newlib/libc/ctype/isspace.c index 2a19518eb..0def2c0ce 100644 --- a/newlib/libc/ctype/isspace.c +++ b/newlib/libc/ctype/isspace.c @@ -8,17 +8,13 @@ INDEX INDEX isspace_l -ANSI_SYNOPSIS +SYNOPSIS #include int isspace(int <[c]>); #include int isspace_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isspace(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for whitespace @@ -48,7 +44,7 @@ No supporting OS subroutines are required. #undef isspace int -_DEFUN(isspace,(c),int c) +isspace (int c) { return(__CTYPE_PTR[c+1] & _S); } diff --git a/newlib/libc/ctype/isupper.c b/newlib/libc/ctype/isupper.c index e36b3a35d..aeed383ec 100644 --- a/newlib/libc/ctype/isupper.c +++ b/newlib/libc/ctype/isupper.c @@ -8,17 +8,13 @@ INDEX INDEX isupper_l -ANSI_SYNOPSIS +SYNOPSIS #include int isupper(int <[c]>); #include int isupper_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isupper(<[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for uppercase letters @@ -45,7 +41,7 @@ No supporting OS subroutines are required. #undef isupper int -_DEFUN(isupper,(c),int c) +isupper (int c) { return ((__CTYPE_PTR[c+1] & (_U|_L)) == _U); } diff --git a/newlib/libc/ctype/iswalnum.c b/newlib/libc/ctype/iswalnum.c index 76fa5042c..7b2cac73b 100644 --- a/newlib/libc/ctype/iswalnum.c +++ b/newlib/libc/ctype/iswalnum.c @@ -8,18 +8,13 @@ INDEX INDEX iswalnum_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswalnum(wint_t <[c]>); #include int iswalnum_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswalnum(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are alphanumeric. @@ -42,7 +37,7 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswalnum,(c),wint_t c) +iswalnum (wint_t c) { - return (iswalpha (c) || iswdigit (c)); + return iswalnum_l (c, 0); } diff --git a/newlib/libc/ctype/iswalnum_l.c b/newlib/libc/ctype/iswalnum_l.c index e4ab3dd36..8802273ca 100644 --- a/newlib/libc/ctype/iswalnum_l.c +++ b/newlib/libc/ctype/iswalnum_l.c @@ -1,10 +1,23 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswalnum_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswalpha (c) || iswdigit (c); +#ifdef _MB_CAPABLE + //return iswalpha (c) || iswdigit (c); + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat == CAT_LC || cat == CAT_Lu || cat == CAT_Ll || cat == CAT_Lt + || cat == CAT_Lm || cat == CAT_Lo + || cat == CAT_Nl // Letter_Number + || cat == CAT_Nd // Decimal_Number + ; +#else + return c < (wint_t)0x100 ? isalnum (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswalpha.c b/newlib/libc/ctype/iswalpha.c index 92fad8e04..392877256 100644 --- a/newlib/libc/ctype/iswalpha.c +++ b/newlib/libc/ctype/iswalpha.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswalpha_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswalpha(wint_t <[c]>); #include int iswalpha_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswalpha(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are alphabetic. @@ -68,377 +64,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" - -#ifdef _MB_CAPABLE -#include "utf8alpha.h" -#endif /* _MB_CAPABLE */ int -_DEFUN(iswalpha,(c), wint_t c) +iswalpha (wint_t c) { -#ifdef _MB_CAPABLE - unsigned const char *table; - unsigned char *ptr; - unsigned char ctmp; - int size; - wint_t x; - - c = _jp2uc (c); - - /* Based on and tested against Unicode 5.2 - See utf8alpha.h for a description how to fetch the data. */ - x = (c >> 8); - /* for some large sections, all characters are alphabetic so handle them here */ - if ((x >= 0x34 && x <= 0x4c) || - (x >= 0x4e && x <= 0x9e) || - (x >= 0xac && x <= 0xd6) || - (x >= 0x120 && x <= 0x122) || - (x >= 0x130 && x <= 0x133) || - (x >= 0x200 && x <= 0x2a5) || - (x >= 0x2a7 && x <= 0x2b6)) - return 1; - - switch (x) - { - case 0x00: - table = u0; - size = sizeof(u0); - break; - case 0x01: - case 0x11: - case 0x15: - case 0x1e: - case 0xa0: - case 0xa1: - case 0xa2: - case 0xa3: - case 0xa5: - case 0xf9: - case 0xfc: - case 0x2f8: - case 0x2f9: - return 1; - case 0x02: - table = u2; - size = sizeof(u2); - break; - case 0x03: - table = u3; - size = sizeof(u3); - break; - case 0x04: - table = u4; - size = sizeof(u4); - break; - case 0x05: - table = u5; - size = sizeof(u5); - break; - case 0x06: - table = u6; - size = sizeof(u6); - break; - case 0x07: - table = u7; - size = sizeof(u7); - break; - case 0x08: - table = u8; - size = sizeof(u8); - break; - case 0x09: - table = u9; - size = sizeof(u9); - break; - case 0x0a: - table = ua; - size = sizeof(ua); - break; - case 0x0b: - table = ub; - size = sizeof(ub); - break; - case 0x0c: - table = uc; - size = sizeof(uc); - break; - case 0x0d: - table = ud; - size = sizeof(ud); - break; - case 0x0e: - table = ue; - size = sizeof(ue); - break; - case 0x0f: - table = uf; - size = sizeof(uf); - break; - case 0x10: - table = u10; - size = sizeof(u10); - break; - case 0x12: - table = u12; - size = sizeof(u12); - break; - case 0x13: - table = u13; - size = sizeof(u13); - break; - case 0x14: - table = u14; - size = sizeof(u14); - break; - case 0x16: - table = u16; - size = sizeof(u16); - break; - case 0x17: - table = u17; - size = sizeof(u17); - break; - case 0x18: - table = u18; - size = sizeof(u18); - break; - case 0x19: - table = u19; - size = sizeof(u19); - break; - case 0x1a: - table = u1a; - size = sizeof(u1a); - break; - case 0x1b: - table = u1b; - size = sizeof(u1b); - break; - case 0x1c: - table = u1c; - size = sizeof(u1c); - break; - case 0x1d: - table = u1d; - size = sizeof(u1d); - break; - case 0x1f: - table = u1f; - size = sizeof(u1f); - break; - case 0x20: - table = u20; - size = sizeof(u20); - break; - case 0x21: - table = u21; - size = sizeof(u21); - break; - case 0x24: - table = u24; - size = sizeof(u24); - break; - case 0x2c: - table = u2c; - size = sizeof(u2c); - break; - case 0x2d: - table = u2d; - size = sizeof(u2d); - break; - case 0x2e: - table = u2e; - size = sizeof(u2e); - break; - case 0x30: - table = u30; - size = sizeof(u30); - break; - case 0x31: - table = u31; - size = sizeof(u31); - break; - case 0x4d: - table = u4d; - size = sizeof(u4d); - break; - case 0x9f: - table = u9f; - size = sizeof(u9f); - break; - case 0xa4: - table = ua4; - size = sizeof(ua4); - break; - case 0xa6: - table = ua6; - size = sizeof(ua6); - break; - case 0xa7: - table = ua7; - size = sizeof(ua7); - break; - case 0xa8: - table = ua8; - size = sizeof(ua8); - break; - case 0xa9: - table = ua9; - size = sizeof(ua9); - break; - case 0xaa: - table = uaa; - size = sizeof(uaa); - break; - case 0xab: - table = uab; - size = sizeof(uab); - break; - case 0xd7: - table = ud7; - size = sizeof(ud7); - break; - case 0xfa: - table = ufa; - size = sizeof(ufa); - break; - case 0xfb: - table = ufb; - size = sizeof(ufb); - break; - case 0xfd: - table = ufd; - size = sizeof(ufd); - break; - case 0xfe: - table = ufe; - size = sizeof(ufe); - break; - case 0xff: - table = uff; - size = sizeof(uff); - break; - case 0x100: - table = u100; - size = sizeof(u100); - break; - case 0x101: - table = u101; - size = sizeof(u101); - break; - case 0x102: - table = u102; - size = sizeof(u102); - break; - case 0x103: - table = u103; - size = sizeof(u103); - break; - case 0x104: - table = u104; - size = sizeof(u104); - break; - case 0x108: - table = u108; - size = sizeof(u108); - break; - case 0x109: - table = u109; - size = sizeof(u109); - break; - case 0x10a: - table = u10a; - size = sizeof(u10a); - break; - case 0x10b: - table = u10b; - size = sizeof(u10b); - break; - case 0x10c: - table = u10c; - size = sizeof(u10c); - break; - case 0x110: - table = u110; - size = sizeof(u110); - break; - case 0x123: - table = u123; - size = sizeof(u123); - break; - case 0x124: - table = u124; - size = sizeof(u124); - break; - case 0x134: - table = u134; - size = sizeof(u134); - break; - case 0x1d4: - table = u1d4; - size = sizeof(u1d4); - break; - case 0x1d5: - table = u1d5; - size = sizeof(u1d5); - break; - case 0x1d6: - table = u1d6; - size = sizeof(u1d6); - break; - case 0x1d7: - table = u1d7; - size = sizeof(u1d7); - break; - case 0x1f1: - table = u1f1; - size = sizeof(u1f1); - break; - case 0x2a6: - table = u2a6; - size = sizeof(u2a6); - break; - case 0x2b7: - table = u2b7; - size = sizeof(u2b7); - break; - case 0x2fa: - table = u2fa; - size = sizeof(u2fa); - break; - default: - return 0; - } - /* we have narrowed down to a section of 256 characters to check */ - /* now check if c matches the alphabetic wide-chars within that section */ - ptr = (unsigned char *)table; - ctmp = (unsigned char)c; - while (ptr < table + size) - { - if (ctmp == *ptr) - return 1; - if (ctmp < *ptr) - return 0; - /* otherwise c > *ptr */ - /* look for 0x0 as next element which indicates a range */ - ++ptr; - if (ptr < table + size - 1 && *ptr == 0x0) - { - /* we have a range..see if c falls within range */ - ++ptr; - if (ctmp <= *ptr) - return 1; - ++ptr; - } - } - /* not in table */ - return 0; -#else - return (c < (wint_t)0x100 ? isalpha (c) : 0); -#endif /* _MB_CAPABLE */ + return iswalpha_l (c, 0); } diff --git a/newlib/libc/ctype/iswalpha_l.c b/newlib/libc/ctype/iswalpha_l.c index efcb95afc..922983ed3 100644 --- a/newlib/libc/ctype/iswalpha_l.c +++ b/newlib/libc/ctype/iswalpha_l.c @@ -1,10 +1,21 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswalpha_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswalpha (c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat == CAT_LC || cat == CAT_Lu || cat == CAT_Ll || cat == CAT_Lt + || cat == CAT_Lm || cat == CAT_Lo + || cat == CAT_Nl // Letter_Number + ; +#else + return c < (wint_t)0x100 ? isalpha (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswblank.c b/newlib/libc/ctype/iswblank.c index ca448a997..31779d245 100644 --- a/newlib/libc/ctype/iswblank.c +++ b/newlib/libc/ctype/iswblank.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswblank_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswblank(wint_t <[c]>); #include int iswblank_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswblank(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are categorized as blank. @@ -67,26 +63,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" int -_DEFUN(iswblank,(c), wint_t c) +iswblank (wint_t c) { -#ifdef _MB_CAPABLE - c = _jp2uc (c); - /* Based on Unicode 5.2. Control char 09, plus all characters - from general category "Zs", which are not marked as decomposition - type "noBreak". */ - return (c == 0x0009 || c == 0x0020 || - c == 0x1680 || c == 0x180e || - (c >= 0x2000 && c <= 0x2006) || - (c >= 0x2008 && c <= 0x200a) || - c == 0x205f || c == 0x3000); -#else - return (c < 0x100 ? isblank (c) : 0); -#endif /* _MB_CAPABLE */ + return iswblank_l (c, 0); } diff --git a/newlib/libc/ctype/iswblank_l.c b/newlib/libc/ctype/iswblank_l.c index 696069378..b27ed820a 100644 --- a/newlib/libc/ctype/iswblank_l.c +++ b/newlib/libc/ctype/iswblank_l.c @@ -1,10 +1,20 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswblank_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswblank (c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + enum category cat = category (c); + // exclude ""? + return cat == CAT_Zs + || c == '\t'; +#else + return c < 0x100 ? isblank (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswcntrl.c b/newlib/libc/ctype/iswcntrl.c index d094d19ed..d4b014749 100644 --- a/newlib/libc/ctype/iswcntrl.c +++ b/newlib/libc/ctype/iswcntrl.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswcntrl_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswcntrl(wint_t <[c]>); #include int iswcntrl_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswcntrl(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are categorized as control characters. @@ -67,24 +63,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" int -_DEFUN(iswcntrl,(c), wint_t c) +iswcntrl (wint_t c) { -#ifdef _MB_CAPABLE - c = _jp2uc (c); - - /* Based on Unicode 5.2. All characters from general category "Cc", "Zl", - and "Zp". */ - return ((c >= 0x0000 && c <= 0x001f) || - (c >= 0x007f && c <= 0x009f) || - c == 0x2028 || c == 0x2029); -#else - return (c < 0x100 ? iscntrl (c) : 0); -#endif /* _MB_CAPABLE */ + return iswcntrl_l (c, 0); } diff --git a/newlib/libc/ctype/iswcntrl_l.c b/newlib/libc/ctype/iswcntrl_l.c index 37caba876..6a900a794 100644 --- a/newlib/libc/ctype/iswcntrl_l.c +++ b/newlib/libc/ctype/iswcntrl_l.c @@ -1,10 +1,20 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswcntrl_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswcntrl (c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat == CAT_Cc + || cat == CAT_Zl || cat == CAT_Zp // Line/Paragraph Separator + ; +#else + return c < 0x100 ? iscntrl (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswctype.c b/newlib/libc/ctype/iswctype.c index ff8e3246b..027cb8ae3 100644 --- a/newlib/libc/ctype/iswctype.c +++ b/newlib/libc/ctype/iswctype.c @@ -8,19 +8,13 @@ INDEX INDEX iswctype_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswctype(wint_t <[c]>, wctype_t <[desc]>); #include int iswctype_l(wint_t <[c]>, wctype_t <[desc]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswctype(<[c]>, <[desc]>) - wint_t <[c]>; - wctype_t <[desc]>; - DESCRIPTION <> is a function which classifies wide-character values using the wide-character test specified by <[desc]>. @@ -44,7 +38,7 @@ No supporting OS subroutines are required. #include "local.h" int -_DEFUN(iswctype,(c, desc), wint_t c _AND wctype_t desc) +iswctype (wint_t c, wctype_t desc) { switch (desc) { diff --git a/newlib/libc/ctype/iswctype_l.c b/newlib/libc/ctype/iswctype_l.c index d9e7b2e06..506972d7c 100644 --- a/newlib/libc/ctype/iswctype_l.c +++ b/newlib/libc/ctype/iswctype_l.c @@ -1,10 +1,41 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> #include +#include "local.h" int iswctype_l (wint_t c, wctype_t desc, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswctype (c, desc); + switch (desc) + { + case WC_ALNUM: + return iswalnum_l (c, locale); + case WC_ALPHA: + return iswalpha_l (c, locale); + case WC_BLANK: + return iswblank_l (c, locale); + case WC_CNTRL: + return iswcntrl_l (c, locale); + case WC_DIGIT: + return iswdigit_l (c, locale); + case WC_GRAPH: + return iswgraph_l (c, locale); + case WC_LOWER: + return iswlower_l (c, locale); + case WC_PRINT: + return iswprint_l (c, locale); + case WC_PUNCT: + return iswpunct_l (c, locale); + case WC_SPACE: + return iswspace_l (c, locale); + case WC_UPPER: + return iswupper_l (c, locale); + case WC_XDIGIT: + return iswxdigit_l (c, locale); + default: + return 0; /* eliminate warning */ + } + + /* otherwise unknown */ + return 0; } diff --git a/newlib/libc/ctype/iswdigit.c b/newlib/libc/ctype/iswdigit.c index 7c3ad4be0..d3562f883 100644 --- a/newlib/libc/ctype/iswdigit.c +++ b/newlib/libc/ctype/iswdigit.c @@ -8,18 +8,13 @@ INDEX INDEX iswdigit_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswdigit(wint_t <[c]>); #include int iswdigit_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswdigit(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are decimal digits. @@ -41,7 +36,8 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswdigit,(c), wint_t c) +iswdigit (wint_t c) { - return (c >= (wint_t)'0' && c <= (wint_t)'9'); + return c >= (wint_t)'0' && c <= (wint_t)'9'; + // category (c) == CAT_Nd not to be included as of C-99 } diff --git a/newlib/libc/ctype/iswdigit_l.c b/newlib/libc/ctype/iswdigit_l.c index 98dd94edd..29de9d381 100644 --- a/newlib/libc/ctype/iswdigit_l.c +++ b/newlib/libc/ctype/iswdigit_l.c @@ -4,5 +4,5 @@ int iswdigit_l (wint_t c, struct __locale_t *locale) { - return (c >= (wint_t)'0' && c <= (wint_t)'9'); + return c >= (wint_t)'0' && c <= (wint_t)'9'; } diff --git a/newlib/libc/ctype/iswgraph.c b/newlib/libc/ctype/iswgraph.c index 17e3060e5..bb21c2160 100644 --- a/newlib/libc/ctype/iswgraph.c +++ b/newlib/libc/ctype/iswgraph.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswgraph_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswgraph(wint_t <[c]>); #include int iswgraph_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswgraph(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are graphic. @@ -70,7 +66,7 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswgraph,(c),wint_t c) +iswgraph (wint_t c) { - return (iswprint (c) && !iswspace (c)); + return iswgraph_l (c, 0); } diff --git a/newlib/libc/ctype/iswgraph_l.c b/newlib/libc/ctype/iswgraph_l.c index 9803c1853..b8a5866e9 100644 --- a/newlib/libc/ctype/iswgraph_l.c +++ b/newlib/libc/ctype/iswgraph_l.c @@ -1,10 +1,23 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> #include +#include "local.h" +#include "categories.h" int iswgraph_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswprint (c) && !iswspace (c); +#ifdef _MB_CAPABLE + //return iswprint (c, locale) && !iswspace (c, locale); + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat != -1 + && cat != CAT_Cc && cat != CAT_Cf + && cat != CAT_Cs // Surrogate + && cat != CAT_Zs + && cat != CAT_Zl && cat != CAT_Zp // Line/Paragraph Separator + ; +#else + return iswprint_l (c, locale) && !iswspace_l (c, locale); +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswlower.c b/newlib/libc/ctype/iswlower.c index 9d3b8441f..e1d926b53 100644 --- a/newlib/libc/ctype/iswlower.c +++ b/newlib/libc/ctype/iswlower.c @@ -8,21 +8,16 @@ INDEX INDEX iswlower_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswlower(wint_t <[c]>); #include int iswlower_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswlower(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that -have uppercase translations. +are categorized as lowercase. <> is like <> but performs the check based on the locale specified by the locale object locale. If <[locale]> is @@ -41,7 +36,7 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswlower,(c),wint_t c) +iswlower (wint_t c) { - return (towupper (c) != c); + return iswlower_l (c, 0); } diff --git a/newlib/libc/ctype/iswlower_l.c b/newlib/libc/ctype/iswlower_l.c index d69615bed..644613325 100644 --- a/newlib/libc/ctype/iswlower_l.c +++ b/newlib/libc/ctype/iswlower_l.c @@ -1,10 +1,20 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswlower_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return (towupper (c) != c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + // The wide-character class "lower" contains at least those characters wc + // which are equal to towlower(wc) and different from towupper(wc). + enum category cat = category (c); + return cat == CAT_Ll || (cat == CAT_LC && towlower (c) == c); +#else + return c < 0x100 ? islower (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswprint.c b/newlib/libc/ctype/iswprint.c index aad34acab..5e468feaf 100644 --- a/newlib/libc/ctype/iswprint.c +++ b/newlib/libc/ctype/iswprint.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswprint_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswprint(wint_t <[c]>); #include int iswprint_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswprint(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are printable. @@ -67,440 +63,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" - -#ifdef _MB_CAPABLE -#include "utf8print.h" -#endif /* _MB_CAPABLE */ int -_DEFUN(iswprint,(c), wint_t c) +iswprint (wint_t c) { -#ifdef _MB_CAPABLE - unsigned const char *table; - unsigned char *ptr; - unsigned char ctmp; - int size; - wint_t x; - - c = _jp2uc (c); - - /* Based on and tested against Unicode 5.2 - See utf8print.h for a description how to fetch the data. */ - x = (c >> 8); - /* for some large sections, all characters are printuation so handle them here */ - if ((x >= 0x33 && x <= 0x4c) || - (x >= 0x4e && x <= 0x9e) || - (x >= 0xa0 && x <= 0xa3) || - (x >= 0xac && x <= 0xd6) || - (x >= 0xe0 && x <= 0xf9) || - (x >= 0x120 && x <= 0x122) || - (x >= 0x130 && x <= 0x133) || - (x >= 0x200 && x <= 0x2a5) || - (x >= 0x2a7 && x <= 0x2b6) || - (x >= 0xf00 && x <= 0xffe) || - (x >= 0x1000 && x <= 0x10fe)) - return 1; - - switch (x) - { - case 0x01: - case 0x02: - case 0x04: - case 0x11: - case 0x14: - case 0x15: - case 0x1e: - case 0x22: - case 0x25: - case 0x28: - case 0x29: - case 0x2a: - case 0xa5: - case 0xfc: - case 0x2f8: - case 0x2f9: - return 1; - case 0x00: - table = u0; - size = sizeof(u0); - break; - case 0x03: - table = u3; - size = sizeof(u3); - break; - case 0x05: - table = u5; - size = sizeof(u5); - break; - case 0x06: - table = u6; - size = sizeof(u6); - break; - case 0x07: - table = u7; - size = sizeof(u7); - break; - case 0x08: - table = u8; - size = sizeof(u8); - break; - case 0x09: - table = u9; - size = sizeof(u9); - break; - case 0x0a: - table = ua; - size = sizeof(ua); - break; - case 0x0b: - table = ub; - size = sizeof(ub); - break; - case 0x0c: - table = uc; - size = sizeof(uc); - break; - case 0x0d: - table = ud; - size = sizeof(ud); - break; - case 0x0e: - table = ue; - size = sizeof(ue); - break; - case 0x0f: - table = uf; - size = sizeof(uf); - break; - case 0x10: - table = u10; - size = sizeof(u10); - break; - case 0x12: - table = u12; - size = sizeof(u12); - break; - case 0x13: - table = u13; - size = sizeof(u13); - break; - case 0x16: - table = u16; - size = sizeof(u16); - break; - case 0x17: - table = u17; - size = sizeof(u17); - break; - case 0x18: - table = u18; - size = sizeof(u18); - break; - case 0x19: - table = u19; - size = sizeof(u19); - break; - case 0x1a: - table = u1a; - size = sizeof(u1a); - break; - case 0x1b: - table = u1b; - size = sizeof(u1b); - break; - case 0x1c: - table = u1c; - size = sizeof(u1c); - break; - case 0x1d: - table = u1d; - size = sizeof(u1d); - break; - case 0x1f: - table = u1f; - size = sizeof(u1f); - break; - case 0x20: - table = u20; - size = sizeof(u20); - break; - case 0x21: - table = u21; - size = sizeof(u21); - break; - case 0x23: - table = u23; - size = sizeof(u23); - break; - case 0x24: - table = u24; - size = sizeof(u24); - break; - case 0x26: - table = u26; - size = sizeof(u26); - break; - case 0x27: - table = u27; - size = sizeof(u27); - break; - case 0x2b: - table = u2b; - size = sizeof(u2b); - break; - case 0x2c: - table = u2c; - size = sizeof(u2c); - break; - case 0x2d: - table = u2d; - size = sizeof(u2d); - break; - case 0x2e: - table = u2e; - size = sizeof(u2e); - break; - case 0x2f: - table = u2f; - size = sizeof(u2f); - break; - case 0x30: - table = u30; - size = sizeof(u30); - break; - case 0x31: - table = u31; - size = sizeof(u31); - break; - case 0x32: - table = u32; - size = sizeof(u32); - break; - case 0x4d: - table = u4d; - size = sizeof(u4d); - break; - case 0x9f: - table = u9f; - size = sizeof(u9f); - break; - case 0xa4: - table = ua4; - size = sizeof(ua4); - break; - case 0xa6: - table = ua6; - size = sizeof(ua6); - break; - case 0xa7: - table = ua7; - size = sizeof(ua7); - break; - case 0xa8: - table = ua8; - size = sizeof(ua8); - break; - case 0xa9: - table = ua9; - size = sizeof(ua9); - break; - case 0xaa: - table = uaa; - size = sizeof(uaa); - break; - case 0xab: - table = uab; - size = sizeof(uab); - break; - case 0xd7: - table = ud7; - size = sizeof(ud7); - break; - case 0xfa: - table = ufa; - size = sizeof(ufa); - break; - case 0xfb: - table = ufb; - size = sizeof(ufb); - break; - case 0xfd: - table = ufd; - size = sizeof(ufd); - break; - case 0xfe: - table = ufe; - size = sizeof(ufe); - break; - case 0xff: - table = uff; - size = sizeof(uff); - break; - case 0x100: - table = u100; - size = sizeof(u100); - break; - case 0x101: - table = u101; - size = sizeof(u101); - break; - case 0x102: - table = u102; - size = sizeof(u102); - break; - case 0x103: - table = u103; - size = sizeof(u103); - break; - case 0x104: - table = u104; - size = sizeof(u104); - break; - case 0x108: - table = u108; - size = sizeof(u108); - break; - case 0x109: - table = u109; - size = sizeof(u109); - break; - case 0x10a: - table = u10a; - size = sizeof(u10a); - break; - case 0x10b: - table = u10b; - size = sizeof(u10b); - break; - case 0x10c: - table = u10c; - size = sizeof(u10c); - break; - case 0x10e: - table = u10e; - size = sizeof(u10e); - break; - case 0x110: - table = u110; - size = sizeof(u110); - break; - case 0x123: - table = u123; - size = sizeof(u123); - break; - case 0x124: - table = u124; - size = sizeof(u124); - break; - case 0x134: - table = u134; - size = sizeof(u134); - break; - case 0x1d0: - table = u1d0; - size = sizeof(u1d0); - break; - case 0x1d1: - table = u1d1; - size = sizeof(u1d1); - break; - case 0x1d2: - table = u1d2; - size = sizeof(u1d2); - break; - case 0x1d3: - table = u1d3; - size = sizeof(u1d3); - break; - case 0x1d4: - table = u1d4; - size = sizeof(u1d4); - break; - case 0x1d5: - table = u1d5; - size = sizeof(u1d5); - break; - case 0x1d6: - table = u1d6; - size = sizeof(u1d6); - break; - case 0x1d7: - table = u1d7; - size = sizeof(u1d7); - break; - case 0x1f0: - table = u1f0; - size = sizeof(u1f0); - break; - case 0x1f1: - table = u1f1; - size = sizeof(u1f1); - break; - case 0x1f2: - table = u1f2; - size = sizeof(u1f2); - break; - case 0x2a6: - table = u2a6; - size = sizeof(u2a6); - break; - case 0x2b7: - table = u2b7; - size = sizeof(u2b7); - break; - case 0x2fa: - table = u2fa; - size = sizeof(u2fa); - break; - case 0xe00: - table = ue00; - size = sizeof(ue00); - break; - case 0xe01: - table = ue01; - size = sizeof(ue01); - break; - case 0xfff: - table = ufff; - size = sizeof(ufff); - break; - case 0x10ff: - table = u10ff; - size = sizeof(u10ff); - break; - default: - return 0; - } - /* we have narrowed down to a section of 256 characters to check */ - /* now check if c matches the printuation wide-chars within that section */ - ptr = (unsigned char *)table; - ctmp = (unsigned char)c; - while (ptr < table + size) - { - if (ctmp == *ptr) - return 1; - if (ctmp < *ptr) - return 0; - /* otherwise c > *ptr */ - /* look for 0x0 as next element which indicates a range */ - ++ptr; - if (*ptr == 0x0) - { - /* we have a range..see if c falls within range */ - ++ptr; - if (ctmp <= *ptr) - return 1; - ++ptr; - } - } - /* not in table */ - return 0; -#else - return (c < (wint_t)0x100 ? isprint (c) : 0); -#endif /* _MB_CAPABLE */ + return iswprint_l (c, 0); } diff --git a/newlib/libc/ctype/iswprint_l.c b/newlib/libc/ctype/iswprint_l.c index a8d8686c9..cdf027bde 100644 --- a/newlib/libc/ctype/iswprint_l.c +++ b/newlib/libc/ctype/iswprint_l.c @@ -1,10 +1,21 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswprint_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswprint (c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat != -1 + && cat != CAT_Cc && cat != CAT_Cf + && cat != CAT_Cs // Surrogate + ; +#else + return c < (wint_t)0x100 ? isprint (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswpunct.c b/newlib/libc/ctype/iswpunct.c index 8b1791b03..27a6d656f 100644 --- a/newlib/libc/ctype/iswpunct.c +++ b/newlib/libc/ctype/iswpunct.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswpunct_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswpunct(wint_t <[c]>); #include int iswpunct_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswpunct(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are punctuation. @@ -67,14 +63,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" int -_DEFUN(iswpunct,(c), wint_t c) +iswpunct (wint_t c) { - return (!iswalnum (c) && iswgraph (c)); + return iswpunct_l (c, 0); } diff --git a/newlib/libc/ctype/iswpunct_l.c b/newlib/libc/ctype/iswpunct_l.c index c7acc4e72..4adc1ed83 100644 --- a/newlib/libc/ctype/iswpunct_l.c +++ b/newlib/libc/ctype/iswpunct_l.c @@ -1,10 +1,26 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswpunct_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return !iswalnum (c) && iswgraph (c); +#ifdef _MB_CAPABLE + //return !iswalnum (c) && iswgraph (c); + c = _jp2uc_l (c, locale); + enum category cat = category (c); + return cat == CAT_Pc || cat == CAT_Pd || cat == CAT_Pe || cat == CAT_Pf || cat == CAT_Pi || cat == CAT_Po || cat == CAT_Ps + || cat == CAT_Sm // Math Symbols + // the following are included for backwards consistency: + || cat == CAT_Sc // Currency Symbols + || cat == CAT_Sk // Modifier_Symbol + || cat == CAT_So // Other_Symbol + || cat == CAT_No // Other_Number + ; +#else + return c < (wint_t)0x100 ? ispunct (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswspace.c b/newlib/libc/ctype/iswspace.c index 40a667cd4..ca6a887c4 100644 --- a/newlib/libc/ctype/iswspace.c +++ b/newlib/libc/ctype/iswspace.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX iswspace_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswspace(wint_t <[c]>); #include int iswspace_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswspace(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that are categorized as whitespace. @@ -67,27 +63,10 @@ PORTABILITY No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include -#include -#include -#include "local.h" int -_DEFUN(iswspace,(c), wint_t c) +iswspace (wint_t c) { -#ifdef _MB_CAPABLE - c = _jp2uc (c); - /* Based on Unicode 5.2. Control chars 09-0D, plus all characters - from general category "Zs", which are not marked as decomposition - type "noBreak". */ - return ((c >= 0x0009 && c <= 0x000d) || c == 0x0020 || - c == 0x1680 || c == 0x180e || - (c >= 0x2000 && c <= 0x2006) || - (c >= 0x2008 && c <= 0x200a) || - c == 0x2028 || c == 0x2029 || - c == 0x205f || c == 0x3000); -#else - return (c < 0x100 ? isspace (c) : 0); -#endif /* _MB_CAPABLE */ + return iswspace_l (c, 0); } diff --git a/newlib/libc/ctype/iswspace_l.c b/newlib/libc/ctype/iswspace_l.c index 0c30242a9..e7f47ee31 100644 --- a/newlib/libc/ctype/iswspace_l.c +++ b/newlib/libc/ctype/iswspace_l.c @@ -1,10 +1,21 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswspace_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return iswspace (c); +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + enum category cat = category (c); + // exclude ""? + return cat == CAT_Zs + || cat == CAT_Zl || cat == CAT_Zp // Line/Paragraph Separator + || (c >= 0x9 && c <= 0xD); +#else + return c < 0x100 ? isspace (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswupper.c b/newlib/libc/ctype/iswupper.c index 588e7f173..96b5a0c84 100644 --- a/newlib/libc/ctype/iswupper.c +++ b/newlib/libc/ctype/iswupper.c @@ -8,28 +8,23 @@ INDEX INDEX iswupper_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswupper(wint_t <[c]>); #include int iswupper_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswupper(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide-character values that -have uppercase translations. +are categorized as uppercase. <> is like <> but performs the check based on the locale specified by the locale object locale. If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined. RETURNS -<>, <> return non-zero if <[c]> is a uppercase wide character. +<>, <> return non-zero if <[c]> is an uppercase wide character. PORTABILITY <> is C99. @@ -41,7 +36,7 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswupper,(c),wint_t c) +iswupper (wint_t c) { - return (towlower (c) != c); + return iswupper_l (c, 0); } diff --git a/newlib/libc/ctype/iswupper_l.c b/newlib/libc/ctype/iswupper_l.c index 2555cd08a..e772f929b 100644 --- a/newlib/libc/ctype/iswupper_l.c +++ b/newlib/libc/ctype/iswupper_l.c @@ -1,10 +1,20 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> +#include #include +#include "local.h" +#include "categories.h" int iswupper_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return towlower (c) != c; +#ifdef _MB_CAPABLE + c = _jp2uc_l (c, locale); + // The wide-character class "upper" contains at least those characters wc + // which are equal to towupper(wc) and different from towlower(wc). + enum category cat = category (c); + return cat == CAT_Lu || (cat == CAT_LC && towupper (c) == c); +#else + return c < 0x100 ? isupper (c) : 0; +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/iswxdigit.c b/newlib/libc/ctype/iswxdigit.c index 7cd3abbd5..fce2a4de4 100644 --- a/newlib/libc/ctype/iswxdigit.c +++ b/newlib/libc/ctype/iswxdigit.c @@ -8,18 +8,13 @@ INDEX INDEX iswxdigit_l -ANSI_SYNOPSIS +SYNOPSIS #include int iswxdigit(wint_t <[c]>); #include int iswxdigit_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int iswxdigit(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which classifies wide character values that are hexadecimal digits. @@ -41,9 +36,9 @@ No supporting OS subroutines are required. #include int -_DEFUN(iswxdigit,(c), wint_t c) +iswxdigit (wint_t c) { - return ((c >= (wint_t)'0' && c <= (wint_t)'9') || - (c >= (wint_t)'a' && c <= (wint_t)'f') || - (c >= (wint_t)'A' && c <= (wint_t)'F')); + return (c >= (wint_t)'0' && c <= (wint_t)'9') + || (c >= (wint_t)'a' && c <= (wint_t)'f') + || (c >= (wint_t)'A' && c <= (wint_t)'F'); } diff --git a/newlib/libc/ctype/isxdigit.c b/newlib/libc/ctype/isxdigit.c index b55ba9c13..2bfe18dbf 100644 --- a/newlib/libc/ctype/isxdigit.c +++ b/newlib/libc/ctype/isxdigit.c @@ -8,17 +8,13 @@ INDEX INDEX isxdigit_l -ANSI_SYNOPSIS +SYNOPSIS #include int isxdigit(int <[c]>); #include int isxdigit_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int isxdigit(int <[c]>); - DESCRIPTION <> is a macro which classifies singlebyte charset values by table lookup. It is a predicate returning non-zero for hexadecimal digits, @@ -48,7 +44,7 @@ No supporting OS subroutines are required. #undef isxdigit int -_DEFUN(isxdigit,(c),int c) +isxdigit (int c) { return(__CTYPE_PTR[c+1] & ((_X)|(_N))); } diff --git a/newlib/libc/ctype/jp2uc.c b/newlib/libc/ctype/jp2uc.c index f5bd7dbf2..5e30f09be 100644 --- a/newlib/libc/ctype/jp2uc.c +++ b/newlib/libc/ctype/jp2uc.c @@ -1,7 +1,8 @@ -/* Routine to translate from Japanese characters to Unicode */ +/* Routine to translate between Japanese characters and Unicode */ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff: consider locale, add dummy uc2jp Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +26,7 @@ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -40,15 +41,17 @@ #include #include #include "local.h" -#include "jp2uc.h" /* Japanese encoding types supported */ #define JP_JIS 1 #define JP_SJIS 2 #define JP_EUCJP 3 +/* Japanese to Unicode conversion routine */ +#include "jp2uc.h" + static wint_t -_DEFUN (__jp2uc, (c, type), wint_t c _AND int type) +__jp2uc (wint_t c, int type) { int index, adj; unsigned char byte1, byte2; @@ -104,7 +107,7 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type) return d02f4[index]; } - /* handle smaller ranges here */ + /* handle smaller ranges here */ switch (byte1) { case 0xA1: @@ -148,18 +151,48 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type) return WEOF; } - return WEOF; + return WEOF; +} + +/* Unicode to Japanese conversion routine */ +static wint_t +__uc2jp (wint_t c, int type) +{ +#warning back-conversion Unicode to Japanese not implemented; needed for towupper/towlower + return c; +} + +/* Japanese to Unicode conversion interface */ +wint_t +_jp2uc_l (wint_t c, struct __locale_t * l) +{ + const char * cs = l ? __locale_charset(l) : __current_locale_charset(); + if (0 == strcmp (cs, "JIS")) + c = __jp2uc (c, JP_JIS); + else if (0 == strcmp (cs, "SJIS")) + c = __jp2uc (c, JP_SJIS); + else if (0 == strcmp (cs, "EUCJP")) + c = __jp2uc (c, JP_EUCJP); + return c; } wint_t -_DEFUN (_jp2uc, (c), wint_t c) +_jp2uc (wint_t c) { - if (!strcmp (__current_locale_charset (), "JIS")) - c = __jp2uc (c, JP_JIS); - else if (!strcmp (__current_locale_charset (), "SJIS")) - c = __jp2uc (c, JP_SJIS); - else if (!strcmp (__current_locale_charset (), "EUCJP")) - c = __jp2uc (c, JP_EUCJP); + return _jp2uc_l (c, 0); +} + +/* Unicode to Japanese conversion interface */ +wint_t +_uc2jp_l (wint_t c, struct __locale_t * l) +{ + const char * cs = l ? __locale_charset(l) : __current_locale_charset(); + if (0 == strcmp (cs, "JIS")) + c = __uc2jp (c, JP_JIS); + else if (0 == strcmp (cs, "SJIS")) + c = __uc2jp (c, JP_SJIS); + else if (0 == strcmp (cs, "EUCJP")) + c = __uc2jp (c, JP_EUCJP); return c; } diff --git a/newlib/libc/ctype/local.h b/newlib/libc/ctype/local.h index b3788e218..5c293c83d 100644 --- a/newlib/libc/ctype/local.h +++ b/newlib/libc/ctype/local.h @@ -1,3 +1,5 @@ +/* Modified (m) 2017 Thomas Wolff: fixed locale/wchar handling */ + /* wctrans constants */ #include <_ansi.h> @@ -21,11 +23,22 @@ #define WC_UPPER 11 #define WC_XDIGIT 12 -/* internal function to translate JP to Unicode */ +/* internal functions to translate between JP and Unicode */ +/* note this is not applicable to Cygwin, where wchar_t is always Unicode, + and should not be applicable to most other platforms either; + * platforms for which wchar_t is not Unicode should be explicitly listed + * the transformation should be applied to all non-Unicode locales + (also Chinese, Korean, and even 8-bit locales such as *.CP1252) + * for towupper and towlower, the result must be back-transformed + into the respective locale encoding; currently NOT IMPLEMENTED +*/ #ifdef __CYGWIN__ -/* Under Cygwin, the incoming wide character is already given in UTF due - to the requirements of the underlying OS. */ +/* Under Cygwin, wchar_t (or its extension wint_t) is Unicode */ #define _jp2uc(c) (c) +#define _jp2uc_l(c, l) (c) +#define _uc2jp_l(c, l) (c) #else -wint_t _EXFUN (_jp2uc, (wint_t)); +wint_t _jp2uc (wint_t); +wint_t _jp2uc_l (wint_t, struct __locale_t *); +wint_t _uc2jp_l (wint_t, struct __locale_t *); #endif diff --git a/newlib/libc/ctype/mkcaseconv b/newlib/libc/ctype/mkcaseconv new file mode 100755 index 000000000..ab0571d8f --- /dev/null +++ b/newlib/libc/ctype/mkcaseconv @@ -0,0 +1,128 @@ +#! /bin/sh -f + +# generate a table for Unicode case conversion; entries: +# struct caseconv_entry defined in towctrans_l.c + +if [ -r UnicodeData.txt ] +then UnicodeData=UnicodeData.txt +elif [ -r /usr/share/unicode/ucd/UnicodeData.txt ] +then UnicodeData=/usr/share/unicode/ucd/UnicodeData.txt +else echo UnicodeData.txt not found >&2 + exit 1 +fi + +LC_ALL=C +export LC_ALL + +compact=true + +#0041;LATIN CAPITAL LETTER A;Lu;0;L;;;;;N;;;;0061; +#0061;LATIN SMALL LETTER A;Ll;0;L;;;;;N;;;0041;;0041 +#0130;LATIN CAPITAL LETTER I WITH DOT ABOVE;Lu;0;L;0049 0307;;;;N;LATIN CAPITAL LETTER I DOT;;;0069; +#01C4;LATIN CAPITAL LETTER DZ WITH CARON;Lu;0;L; 0044 017D;;;;N;LATIN CAPITAL LETTER D Z HACEK;;;01C6;01C5 +#01C5;LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON;Lt;0;L; 0044 017E;;;;N;LATIN LETTER CAPITAL D SMALL Z HACEK;;01C4;01C6;01C5 +#01C6;LATIN SMALL LETTER DZ WITH CARON;Ll;0;L; 0064 017E;;;;N;LATIN SMALL LETTER D Z HACEK;;01C4;;01C5 + +tr -d '\015' < $UnicodeData | +sed \ +-e 's,^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;][^;]*\);\([^;]*\);\([^;]*\)$,src \1 upper "\2" lower "\3" title "\4",' \ +-e t \ +-e 's,^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;]*\);\([^;][^;]*\);\([^;]*\)$,src \1 upper "\2" lower "\3" title "\4",' \ +-e t \ +-e 's,^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;]*\);\([^;]*\);\([^;][^;]*\)$,src \1 upper "\2" lower "\3" title "\4",' \ +-e t \ +-e d | +(#src 01C5 upper "01C4" lower "01C6" title "01C5" +if $compact +then + ( + cat <<\/EOS + src () { + if [ -n "$3" ] + then tohi=$(( 0x0$3 - 0x0$1 )) + else tohi=0 + fi + if [ -n "$5" ] + then tolo=$(( 0x0$5 - 0x0$1 )) + else tolo=0 + fi + case "$tolo.$tohi" in + 0.0) true;; + 0.*) + case "$1.$tohi" in + *[02468ACE].1) echo "'#error' U+$1 ODDSML";; + *[02468ACE].-1) echo " 0x$1 TO1 ODDCAP";; + *[13579BDF].1) echo "'#error' U+$1 EVENSML";; + *[13579BDF].-1) echo " 0x$1 TO1 EVENCAP";; + *) echo " 0x$1 TOUP $tohi";; + esac;; + *.0) + case "$1.$tolo" in + *[02468ACE].1) echo " 0x$1 TO1 EVENCAP";; + *[02468ACE].-1) echo "'#error' U+$1 EVENSML";; + *[13579BDF].1) echo " 0x$1 TO1 ODDCAP";; + *[13579BDF].-1) echo "'#error' U+$1 ODDSML";; + *) echo " 0x$1 TOLO $tolo";; + esac;; + *) case "$tolo.$tohi" in + 1.-1) echo " 0x$1 TOBOTH 0";; + *) echo "'#error' U+$1";; + esac;; + esac + } +/EOS + cat + ) | sh | + uniq -f1 --group=append | sed -e "s,^$,range," -e t -e "s,^,item ," | + ( + cat <<\/EOS + first= + diff=-1 + max=255 + range () { + # $diff == $(($last - $first)) + if [ "$diff" -ge 0 ] + then # we have items at all + echo " {$first, $diff, $v2, $v3}," + fi + first= + diff=-1 + } + item () { + if [ "$1" == "#error" ] + then echo "$*" + return + fi + + if [ $diff -eq $max ] + then range + elif [ -n "$first" ] + then if [ $(( $1 )) -ne $(( ${last-0} + 1 )) ] + then range + fi + fi + + if [ -z "$first" ] + then first=$1 + v2=$2 + v3=$3 + fi + + last=$1 + diff=$(( $diff + 1 )) + } +/EOS + cat + ) | sh +elif false +then + sed -e 's/src \([^ ]*\) upper "\([^ ]*\)" lower "\([^ ]*\)" title "\([^ ]*\)"/ {0x\1, 0x\2 - 0x\1, 0x\3 - 0x\1},/' \ + -e 's/0x - 0x[^ ,}]*/0/g' -e 's/0x}/0}/' \ + -e 's/\(0x[0-9A-F][0-9A-F]*\) - \(0x[0-9A-F][0-9A-F]*\)/$((`printf %d \1` - `printf %d \2`))/g' \ + -e 's/^/echo "/' -e 's/$/"/' | + sh +else + sed -e 's/src \([^ ]*\) upper "\([^ ]*\)" lower "\([^ ]*\)" title "\([^ ]*\)"/ {0x\1, 0x\2 - 0x\1, 0x\3 - 0x\1},/' \ + -e 's/0x - 0x[^ ,}]*/0/g' -e 's/0x}/0}/' +fi +) > caseconv.t diff --git a/newlib/libc/ctype/mkcategories b/newlib/libc/ctype/mkcategories new file mode 100755 index 000000000..22c7d4d5a --- /dev/null +++ b/newlib/libc/ctype/mkcategories @@ -0,0 +1,71 @@ +#! /bin/sh + +# generate table of Unicode character category ranges; +# note: undefined characters between two characters of the same category +# are associated to the same category, e.g. +#0A0A;GURMUKHI LETTER UU;Lo +#0A0B..0A0E -> Lo +#0A0F;GURMUKHI LETTER EE;Lo + +if [ -r UnicodeData.txt ] +then UnicodeData=UnicodeData.txt +elif [ -r /usr/share/unicode/ucd/UnicodeData.txt ] +then UnicodeData=/usr/share/unicode/ucd/UnicodeData.txt +else echo UnicodeData.txt not found >&2 + exit 1 +fi + +# the code assumes foldall=false, foldcase=true +foldall=false +foldcase=true + +( +cat <<\/EOS +first= +item () { + if [ -n "$first" ] + then if [ "$2" != "isRangeLast" \ + -a $(( 0x$1 )) -ne $(( 0x${last-0} + 1 )) ] + then range + fi + fi + + if [ -z "$first" ] + then first=$1 + val=$3 + fi + + last=$1 +} +range () { +# echo " {0x$first, 0x$last, CAT_$val}," +# echo " {0x$first, $((0x$last - 0x$first)), CAT_$val}," +# echo " {0x$first | (CAT_$val << 24), $((0x$last - 0x$first))}," + echo " {CAT_$val, 0x$first, $((0x$last - 0x$first))}," + first= +} +/EOS + +cat "$UnicodeData" | +if $foldall +then sed -e "s,;L[lu];,;LC;," -e "s,;C[fs];,;Cfs;," \ + -e "s,;L[mo];,;Lmo;," -e "s,;Nl;,;Lmo;," \ + -e "s,;P.;,;P;," -e "s,;No;,;P;," \ + -e "s,;S.;,;S;," -e "s,;Z[lp];,;Zlp;," \ + -e "s,;C[no];,;X;," -e "s,;M[cen];,;M;," +elif $foldcase +then +# fold Lu/Ll to LC only if lower/upper conversion is available + sed -e '/^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;]*\);\([^;][^;]*\);.*/ s/;Lu;/;LC;/' \ + -e '/^\([^;]*\);[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;\([^;][^;]*\);\([^;]*\);.*/ s/;Ll;/;LC;/' \ + -e '/;Co;/ d' +else cat +fi | +sed -e "s,^\([^;]*\);<[^;]*\, Last>;\([^;]*\);.*,\1 isRangeLast \2," \ + -e "s,^\([^;]*\);[^;]*;\([^;]*\);.*,\1 isNormalOrRangeFirst \2," | +uniq -f2 --group=append | sed -e "s,^$,range," -e t -e "s,^,item ," +) | sh > categories.t + +sed -e "s/.*\(CAT_[A-Za-z]*\).*/ \1,/" categories.t | +sort | uniq > categories.cat + diff --git a/newlib/libc/ctype/mkunidata b/newlib/libc/ctype/mkunidata new file mode 100755 index 000000000..4bdf3bc81 --- /dev/null +++ b/newlib/libc/ctype/mkunidata @@ -0,0 +1,58 @@ +#! /bin/sh + +echo Generating Unicode character properties data for newlib/libc/ctype + +cd `dirname $0` + +############################################################################# +# checks and (with option -u) download + +case "$1" in +-h) echo "Usage: $0 [-h|-u|-i]" + echo "Generate case conversion table caseconv.t and character category table categories.t" + echo "from local Unicode file UnicodeData.txt." + echo "" + echo "Options:" + echo " -u download file from unicode.org first" + echo " -i copy file from /usr/share/unicode/ucd first" + echo " -h show this" + exit + ;; +-u) + wget () { + curl -R -O --connect-timeout 55 -z "`basename $1`" "$1" + } + + echo downloading data from unicode.org + for data in UnicodeData.txt + do wget http://unicode.org/Public/UNIDATA/$data + done + ;; +-i) + echo copying data from /usr/share/unicode/ucd + for data in UnicodeData.txt + do cp /usr/share/unicode/ucd/$data . + done + ;; +esac + +echo checking Unicode data file +for data in UnicodeData.txt +do if [ -r $data ] + then true + else echo $data not available, skipping table generation + exit + fi +done + +############################################################################# +# table generation + +echo generating character category table for "isw*.c" + sh ./mkcategories + +echo generating case conversion table for "tow*.c" + sh ./mkcaseconv + +############################################################################# +# end diff --git a/newlib/libc/ctype/toascii.c b/newlib/libc/ctype/toascii.c index 945e91883..de5b8e1c3 100644 --- a/newlib/libc/ctype/toascii.c +++ b/newlib/libc/ctype/toascii.c @@ -8,18 +8,13 @@ INDEX INDEX toascii_l -ANSI_SYNOPSIS +SYNOPSIS #include int toascii(int <[c]>); #include int toascii_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int toascii(<[c]>); - int (<[c]>); - DESCRIPTION <> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits. @@ -46,7 +41,7 @@ No supporting OS subroutines are required. #undef toascii int -_DEFUN(toascii,(c),int c) +toascii (int c) { return (c)&0177; } diff --git a/newlib/libc/ctype/tolower.c b/newlib/libc/ctype/tolower.c index d1850ede5..aae2ce09e 100644 --- a/newlib/libc/ctype/tolower.c +++ b/newlib/libc/ctype/tolower.c @@ -11,7 +11,7 @@ INDEX INDEX _tolower -ANSI_SYNOPSIS +SYNOPSIS #include int tolower(int <[c]>); int _tolower(int <[c]>); @@ -19,11 +19,6 @@ ANSI_SYNOPSIS #include int tolower_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int tolower(<[c]>); - int _tolower(<[c]>); - DESCRIPTION <> is a macro which converts uppercase characters to lowercase, @@ -67,7 +62,7 @@ No supporting OS subroutines are required. #undef tolower int -_DEFUN(tolower,(c),int c) +tolower (int c) { #if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS) if ((unsigned char) c <= 0x7f) diff --git a/newlib/libc/ctype/toupper.c b/newlib/libc/ctype/toupper.c index dc800e449..61951b00b 100644 --- a/newlib/libc/ctype/toupper.c +++ b/newlib/libc/ctype/toupper.c @@ -11,7 +11,7 @@ INDEX INDEX _toupper -ANSI_SYNOPSIS +SYNOPSIS #include int toupper(int <[c]>); int _toupper(int <[c]>); @@ -19,11 +19,6 @@ ANSI_SYNOPSIS #include int toupper_l(int <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - int toupper(<[c]>); - int _toupper(<[c]>); - DESCRIPTION <> is a macro which converts lowercase characters to uppercase, @@ -67,7 +62,7 @@ No supporting OS subroutines are required. #undef toupper int -_DEFUN(toupper,(c),int c) +toupper (int c) { #if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS) if ((unsigned char) c <= 0x7f) diff --git a/newlib/libc/ctype/towctrans.c b/newlib/libc/ctype/towctrans.c index a9eaf495d..176aa3d9d 100644 --- a/newlib/libc/ctype/towctrans.c +++ b/newlib/libc/ctype/towctrans.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,19 +38,13 @@ INDEX INDEX towctrans_l -ANSI_SYNOPSIS +SYNOPSIS #include wint_t towctrans(wint_t <[c]>, wctrans_t <[w]>); #include wint_t towctrans_l(wint_t <[c]>, wctrans_t <[w]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - wint_t towctrans(<[c]>, <[w]>) - wint_t <[c]>; - wctrans_t <[w]>; - DESCRIPTION <> is a function which converts wide characters based on @@ -75,34 +70,31 @@ No supporting OS subroutines are required. */ #include <_ansi.h> -#include #include #include -#include +//#include #include "local.h" wint_t -_DEFUN (_towctrans_r, (r, c, w), - struct _reent *r _AND - wint_t c _AND +_towctrans_r (struct _reent *r, + wint_t c, wctrans_t w) { - if (w == WCT_TOLOWER) - return towlower (c); - else if (w == WCT_TOUPPER) - return towupper (c); + if (w == WCT_TOLOWER || w == WCT_TOUPPER) + return towctrans_l (c, w, 0); else { - r->_errno = EINVAL; + // skipping this because it was causing trouble (cygwin crash) + // and there is no errno specified for towctrans + //r->_errno = EINVAL; return c; } } #ifndef _REENT_ONLY wint_t -_DEFUN (towctrans, (c, w), - wint_t c _AND - wctrans_t w) +towctrans (wint_t c, + wctrans_t w) { return _towctrans_r (_REENT, c, w); } diff --git a/newlib/libc/ctype/towctrans_l.c b/newlib/libc/ctype/towctrans_l.c index d7369e16b..b829266a4 100644 --- a/newlib/libc/ctype/towctrans_l.c +++ b/newlib/libc/ctype/towctrans_l.c @@ -1,10 +1,162 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> #include +#include +//#include +#include "local.h" + +/* + struct caseconv_entry describes the case conversion behaviour + of a range of Unicode characters. + It was designed to be compact for a minimal table size. + The range is first...first + diff. + Conversion behaviour for a character c in the respective range: + mode == TOLO towlower (c) = c + delta + mode == TOUP towupper (c) = c + delta + mode == TOBOTH (titling case characters) + towlower (c) = c + 1 + towupper (c) = c - 1 + mode == TO1 capital/small letters are alternating + delta == EVENCAP even codes are capital + delta == ODDCAP odd codes are capital + (this correlates with an even/odd first range value + as of Unicode 10.0 but we do not rely on this) + As of Unicode 10.0, the following field lengths are sufficient + first: 17 bits + diff: 8 bits + delta: 17 bits + mode: 2 bits + The reserve of 4 bits (to limit the struct to 6 bytes) + is currently added to the 'first' field; + should a future Unicode version make it necessary to expand the others, + the 'first' field could be reduced as needed, or larger ranges could + be split up (reduce limit max=255 e.g. to max=127 or max=63 in + script mkcaseconv, check increasing table size). + */ +enum {TO1, TOLO, TOUP, TOBOTH}; +enum {EVENCAP, ODDCAP}; +static struct caseconv_entry { + uint_least32_t first: 21; + uint_least32_t diff: 8; + uint_least32_t mode: 2; + int_least32_t delta: 17; +} __attribute__ ((packed)) +caseconv_table [] = { +#include "caseconv.t" +}; +#define first(ce) ce.first +#define last(ce) (ce.first + ce.diff) + +/* auxiliary function for binary search in interval properties table */ +static const struct caseconv_entry * +bisearch (wint_t ucs, const struct caseconv_entry *table, int max) +{ + int min = 0; + int mid; + + if (ucs < first(table[0]) || ucs > last(table[max])) + return 0; + while (max >= min) + { + mid = (min + max) / 2; + if (ucs > last(table[mid])) + min = mid + 1; + else if (ucs < first(table[mid])) + max = mid - 1; + else + return &table[mid]; + } + return 0; +} + +static wint_t +toulower (wint_t c) +{ + const struct caseconv_entry * cce = + bisearch(c, caseconv_table, + sizeof(caseconv_table) / sizeof(*caseconv_table) - 1); + + if (cce) + switch (cce->mode) + { + case TOLO: + return c + cce->delta; + case TOBOTH: + return c + 1; + case TO1: + switch (cce->delta) + { + case EVENCAP: + if (!(c & 1)) + return c + 1; + break; + case ODDCAP: + if (c & 1) + return c + 1; + break; + default: + break; + } + default: + break; + } + + return c; +} + +static wint_t +touupper (wint_t c) +{ + const struct caseconv_entry * cce = + bisearch(c, caseconv_table, + sizeof(caseconv_table) / sizeof(*caseconv_table) - 1); + + if (cce) + switch (cce->mode) + { + case TOUP: + return c + cce->delta; + case TOBOTH: + return c - 1; + case TO1: + switch (cce->delta) + { + case EVENCAP: + if (c & 1) + return c - 1; + break; + case ODDCAP: + if (!(c & 1)) + return c - 1; + break; + default: + break; + } + default: + break; + } + + return c; +} wint_t towctrans_l (wint_t c, wctrans_t w, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ - return towctrans (c, w); + wint_t u = _jp2uc_l (c, locale); + wint_t res; + if (w == WCT_TOLOWER) + res = toulower (u); + else if (w == WCT_TOUPPER) + res = touupper (u); + else + { + // skipping the errno setting that was previously involved + // by delegating to towctrans; it was causing trouble (cygwin crash) + // and there is no errno specified for towctrans + return c; + } + if (res != u) + return _uc2jp_l (res, locale); + else + return c; } diff --git a/newlib/libc/ctype/towlower.c b/newlib/libc/ctype/towlower.c index b69c8ffe5..01de1bd72 100644 --- a/newlib/libc/ctype/towlower.c +++ b/newlib/libc/ctype/towlower.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX towlower_l -ANSI_SYNOPSIS +SYNOPSIS #include wint_t towlower(wint_t <[c]>); #include wint_t towlower_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - wint_t towlower(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which converts uppercase wide characters to @@ -70,511 +66,16 @@ No supporting OS subroutines are required. */ #include <_ansi.h> -#include -#include -#include #include #include #include "local.h" wint_t -_DEFUN(towlower,(c), wint_t c) +towlower (wint_t c) { #ifdef _MB_CAPABLE - c = _jp2uc (c); - /* Based on and tested against Unicode 5.2 */ - - /* Expression used to filter out the characters for the below code: - - awk -F\; '{ if ( $14 != "" ) print $1; }' UnicodeData.txt - */ - if (c < 0x100) - { - if ((c >= 0x0041 && c <= 0x005a) || - (c >= 0x00c0 && c <= 0x00d6) || - (c >= 0x00d8 && c <= 0x00de)) - return (c + 0x20); - - return c; - } - else if (c < 0x300) - { - if ((c >= 0x0100 && c <= 0x012e) || - (c >= 0x0132 && c <= 0x0136) || - (c >= 0x014a && c <= 0x0176) || - (c >= 0x01de && c <= 0x01ee) || - (c >= 0x01f8 && c <= 0x021e) || - (c >= 0x0222 && c <= 0x0232)) - { - if (!(c & 0x01)) - return (c + 1); - return c; - } - - if (c == 0x0130) - return 0x0069; - - if ((c >= 0x0139 && c <= 0x0147) || - (c >= 0x01cd && c <= 0x01db)) - { - if (c & 0x01) - return (c + 1); - return c; - } - - if (c >= 0x178 && c <= 0x01f7) - { - wint_t k; - switch (c) - { - case 0x0178: - k = 0x00ff; - break; - case 0x0179: - case 0x017b: - case 0x017d: - case 0x0182: - case 0x0184: - case 0x0187: - case 0x018b: - case 0x0191: - case 0x0198: - case 0x01a0: - case 0x01a2: - case 0x01a4: - case 0x01a7: - case 0x01ac: - case 0x01af: - case 0x01b3: - case 0x01b5: - case 0x01b8: - case 0x01bc: - case 0x01c5: - case 0x01c8: - case 0x01cb: - case 0x01cd: - case 0x01cf: - case 0x01d1: - case 0x01d3: - case 0x01d5: - case 0x01d7: - case 0x01d9: - case 0x01db: - case 0x01f2: - case 0x01f4: - k = c + 1; - break; - case 0x0181: - k = 0x0253; - break; - case 0x0186: - k = 0x0254; - break; - case 0x0189: - k = 0x0256; - break; - case 0x018a: - k = 0x0257; - break; - case 0x018e: - k = 0x01dd; - break; - case 0x018f: - k = 0x0259; - break; - case 0x0190: - k = 0x025b; - break; - case 0x0193: - k = 0x0260; - break; - case 0x0194: - k = 0x0263; - break; - case 0x0196: - k = 0x0269; - break; - case 0x0197: - k = 0x0268; - break; - case 0x019c: - k = 0x026f; - break; - case 0x019d: - k = 0x0272; - break; - case 0x019f: - k = 0x0275; - break; - case 0x01a6: - k = 0x0280; - break; - case 0x01a9: - k = 0x0283; - break; - case 0x01ae: - k = 0x0288; - break; - case 0x01b1: - k = 0x028a; - break; - case 0x01b2: - k = 0x028b; - break; - case 0x01b7: - k = 0x0292; - break; - case 0x01c4: - case 0x01c7: - case 0x01ca: - case 0x01f1: - k = c + 2; - break; - case 0x01f6: - k = 0x0195; - break; - case 0x01f7: - k = 0x01bf; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - else if (c == 0x0220) - return 0x019e; - else if (c >= 0x023a && c <= 0x024e) - { - wint_t k; - switch (c) - { - case 0x023a: - k = 0x2c65; - break; - case 0x023b: - case 0x0241: - case 0x0246: - case 0x0248: - case 0x024a: - case 0x024c: - case 0x024e: - k = c + 1; - break; - case 0x023d: - k = 0x019a; - break; - case 0x023e: - k = 0x2c66; - break; - case 0x0243: - k = 0x0180; - break; - case 0x0244: - k = 0x0289; - break; - case 0x0245: - k = 0x028c; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - } - else if (c < 0x0400) - { - if (c == 0x0370 || c == 0x0372 || c == 0x0376) - return (c + 1); - if (c >= 0x0391 && c <= 0x03ab && c != 0x03a2) - return (c + 0x20); - if (c >= 0x03d8 && c <= 0x03ee && !(c & 0x01)) - return (c + 1); - if (c >= 0x0386 && c <= 0x03ff) - { - wint_t k; - switch (c) - { - case 0x0386: - k = 0x03ac; - break; - case 0x0388: - k = 0x03ad; - break; - case 0x0389: - k = 0x03ae; - break; - case 0x038a: - k = 0x03af; - break; - case 0x038c: - k = 0x03cc; - break; - case 0x038e: - k = 0x03cd; - break; - case 0x038f: - k = 0x03ce; - break; - case 0x03cf: - k = 0x03d7; - break; - case 0x03f4: - k = 0x03b8; - break; - case 0x03f7: - k = 0x03f8; - break; - case 0x03f9: - k = 0x03f2; - break; - case 0x03fa: - k = 0x03fb; - break; - case 0x03fd: - k = 0x037b; - break; - case 0x03fe: - k = 0x037c; - break; - case 0x03ff: - k = 0x037d; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - } - else if (c < 0x500) - { - if (c >= 0x0400 && c <= 0x040f) - return (c + 0x50); - - if (c >= 0x0410 && c <= 0x042f) - return (c + 0x20); - - if ((c >= 0x0460 && c <= 0x0480) || - (c >= 0x048a && c <= 0x04be) || - (c >= 0x04d0 && c <= 0x04fe)) - { - if (!(c & 0x01)) - return (c + 1); - return c; - } - - if (c == 0x04c0) - return 0x04cf; - - if (c >= 0x04c1 && c <= 0x04cd) - { - if (c & 0x01) - return (c + 1); - return c; - } - } - else if (c < 0x1f00) - { - if ((c >= 0x0500 && c <= 0x050e) || - (c >= 0x0510 && c <= 0x0524) || - (c >= 0x1e00 && c <= 0x1e94) || - (c >= 0x1ea0 && c <= 0x1ef8)) - { - if (!(c & 0x01)) - return (c + 1); - return c; - } - - if (c >= 0x0531 && c <= 0x0556) - return (c + 0x30); - - if (c >= 0x10a0 && c <= 0x10c5) - return (c + 0x1c60); - - if (c == 0x1e9e) - return 0x00df; - - if (c >= 0x1efa && c <= 0x1efe && !(c & 0x01)) - return (c + 1); - } - else if (c < 0x2000) - { - if ((c >= 0x1f08 && c <= 0x1f0f) || - (c >= 0x1f18 && c <= 0x1f1d) || - (c >= 0x1f28 && c <= 0x1f2f) || - (c >= 0x1f38 && c <= 0x1f3f) || - (c >= 0x1f48 && c <= 0x1f4d) || - (c >= 0x1f68 && c <= 0x1f6f) || - (c >= 0x1f88 && c <= 0x1f8f) || - (c >= 0x1f98 && c <= 0x1f9f) || - (c >= 0x1fa8 && c <= 0x1faf)) - return (c - 0x08); - - if (c >= 0x1f59 && c <= 0x1f5f) - { - if (c & 0x01) - return (c - 0x08); - return c; - } - - if (c >= 0x1fb8 && c <= 0x1ffc) - { - wint_t k; - switch (c) - { - case 0x1fb8: - case 0x1fb9: - case 0x1fd8: - case 0x1fd9: - case 0x1fe8: - case 0x1fe9: - k = c - 0x08; - break; - case 0x1fba: - case 0x1fbb: - k = c - 0x4a; - break; - case 0x1fbc: - k = 0x1fb3; - break; - case 0x1fc8: - case 0x1fc9: - case 0x1fca: - case 0x1fcb: - k = c - 0x56; - break; - case 0x1fcc: - k = 0x1fc3; - break; - case 0x1fda: - case 0x1fdb: - k = c - 0x64; - break; - case 0x1fea: - case 0x1feb: - k = c - 0x70; - break; - case 0x1fec: - k = 0x1fe5; - break; - case 0x1ff8: - case 0x1ff9: - k = c - 0x80; - break; - case 0x1ffa: - case 0x1ffb: - k = c - 0x7e; - break; - case 0x1ffc: - k = 0x1ff3; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - } - else if (c < 0x2c00) - { - if (c >= 0x2160 && c <= 0x216f) - return (c + 0x10); - - if (c >= 0x24b6 && c <= 0x24cf) - return (c + 0x1a); - - switch (c) - { - case 0x2126: - return 0x03c9; - case 0x212a: - return 0x006b; - case 0x212b: - return 0x00e5; - case 0x2132: - return 0x214e; - case 0x2183: - return 0x2184; - } - } - else if (c < 0x2d00) - { - if (c >= 0x2c00 && c <= 0x2c2e) - return (c + 0x30); - - if (c >= 0x2c80 && c <= 0x2ce2 && !(c & 0x01)) - return (c + 1); - - switch (c) - { - case 0x2c60: - return 0x2c61; - case 0x2c62: - return 0x026b; - case 0x2c63: - return 0x1d7d; - case 0x2c64: - return 0x027d; - case 0x2c67: - case 0x2c69: - case 0x2c6b: - case 0x2c72: - case 0x2c75: - case 0x2ceb: - case 0x2ced: - return c + 1; - case 0x2c6d: - return 0x0251; - case 0x2c6e: - return 0x0271; - case 0x2c6f: - return 0x0250; - case 0x2c70: - return 0x0252; - case 0x2c7e: - return 0x023f; - case 0x2c7f: - return 0x0240; - } - } - else if (c >= 0xa600 && c < 0xa800) - { - if ((c >= 0xa640 && c <= 0xa65e) || - (c >= 0xa662 && c <= 0xa66c) || - (c >= 0xa680 && c <= 0xa696) || - (c >= 0xa722 && c <= 0xa72e) || - (c >= 0xa732 && c <= 0xa76e) || - (c >= 0xa77f && c <= 0xa786)) - { - if (!(c & 1)) - return (c + 1); - return c; - } - - switch (c) - { - case 0xa779: - case 0xa77b: - case 0xa77e: - case 0xa78b: - return (c + 1); - case 0xa77d: - return 0x1d79; - } - } - else - { - if (c >= 0xff21 && c <= 0xff3a) - return (c + 0x20); - - if (c >= 0x10400 && c <= 0x10427) - return (c + 0x28); - } - return c; + return towctrans (c, WCT_TOLOWER); #else - return (c < 0x00ff ? (wint_t)(tolower ((int)c)) : c); + return c < 0x00ff ? (wint_t)(tolower ((int)c)) : c; #endif /* _MB_CAPABLE */ } - diff --git a/newlib/libc/ctype/towlower_l.c b/newlib/libc/ctype/towlower_l.c index 2e89ec9d0..46e024d44 100644 --- a/newlib/libc/ctype/towlower_l.c +++ b/newlib/libc/ctype/towlower_l.c @@ -1,3 +1,4 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> #include #include @@ -6,7 +7,9 @@ wint_t towlower_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ +#ifdef _MB_CAPABLE + return towctrans_l (c, WCT_TOLOWER, locale); +#else return towlower (c); +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/towupper.c b/newlib/libc/ctype/towupper.c index 1e4d0f5cb..a60e62bf3 100644 --- a/newlib/libc/ctype/towupper.c +++ b/newlib/libc/ctype/towupper.c @@ -1,5 +1,6 @@ /* Copyright (c) 2002 Red Hat Incorporated. All rights reserved. + Modified (m) 2017 Thomas Wolff to refer to generated Unicode data tables. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,18 +38,13 @@ INDEX INDEX towupper_l -ANSI_SYNOPSIS +SYNOPSIS #include wint_t towupper(wint_t <[c]>); #include wint_t towupper_l(wint_t <[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - wint_t towupper(<[c]>) - wint_t <[c]>; - DESCRIPTION <> is a function which converts lowercase wide characters to @@ -78,521 +74,11 @@ No supporting OS subroutines are required. #include "local.h" wint_t -_DEFUN(towupper,(c), wint_t c) +towupper (wint_t c) { #ifdef _MB_CAPABLE - c = _jp2uc (c); - /* Based on and tested against Unicode 5.2 */ - - /* Expression used to filter out the characters for the below code: - - awk -F\; '{ if ( $13 != "" ) print $1; }' UnicodeData.txt - */ - if (c < 0x100) - { - if (c == 0x00b5) - return 0x039c; - - if ((c >= 0x00e0 && c <= 0x00fe && c != 0x00f7) || - (c >= 0x0061 && c <= 0x007a)) - return (c - 0x20); - - if (c == 0xff) - return 0x0178; - - return c; - } - else if (c < 0x300) - { - if ((c >= 0x0101 && c <= 0x012f) || - (c >= 0x0133 && c <= 0x0137) || - (c >= 0x014b && c <= 0x0177) || - (c >= 0x01df && c <= 0x01ef) || - (c >= 0x01f9 && c <= 0x021f) || - (c >= 0x0223 && c <= 0x0233) || - (c >= 0x0247 && c <= 0x024f)) - { - if (c & 0x01) - return (c - 1); - return c; - } - - if ((c >= 0x013a && c <= 0x0148) || - (c >= 0x01ce && c <= 0x01dc) || - c == 0x023c || c == 0x0242) - { - if (!(c & 0x01)) - return (c - 1); - return c; - } - - if (c == 0x0131) - return 0x0049; - - if (c == 0x017a || c == 0x017c || c == 0x017e) - return (c - 1); - - if (c >= 0x017f && c <= 0x0292) - { - wint_t k; - switch (c) - { - case 0x017f: - k = 0x0053; - break; - case 0x0180: - k = 0x0243; - break; - case 0x0183: - k = 0x0182; - break; - case 0x0185: - k = 0x0184; - break; - case 0x0188: - k = 0x0187; - break; - case 0x018c: - k = 0x018b; - break; - case 0x0192: - k = 0x0191; - break; - case 0x0195: - k = 0x01f6; - break; - case 0x0199: - k = 0x0198; - break; - case 0x019a: - k = 0x023d; - break; - case 0x019e: - k = 0x0220; - break; - case 0x01a1: - case 0x01a3: - case 0x01a5: - case 0x01a8: - case 0x01ad: - case 0x01b0: - case 0x01b4: - case 0x01b6: - case 0x01b9: - case 0x01bd: - case 0x01c5: - case 0x01c8: - case 0x01cb: - case 0x01f2: - case 0x01f5: - k = c - 1; - break; - case 0x01bf: - k = 0x01f7; - break; - case 0x01c6: - case 0x01c9: - case 0x01cc: - k = c - 2; - break; - case 0x01dd: - k = 0x018e; - break; - case 0x01f3: - k = 0x01f1; - break; - case 0x023f: - k = 0x2c7e; - break; - case 0x0240: - k = 0x2c7f; - break; - case 0x0250: - k = 0x2c6f; - break; - case 0x0251: - k = 0x2c6d; - break; - case 0x0252: - k = 0x2c70; - break; - case 0x0253: - k = 0x0181; - break; - case 0x0254: - k = 0x0186; - break; - case 0x0256: - k = 0x0189; - break; - case 0x0257: - k = 0x018a; - break; - case 0x0259: - k = 0x018f; - break; - case 0x025b: - k = 0x0190; - break; - case 0x0260: - k = 0x0193; - break; - case 0x0263: - k = 0x0194; - break; - case 0x0268: - k = 0x0197; - break; - case 0x0269: - k = 0x0196; - break; - case 0x026b: - k = 0x2c62; - break; - case 0x026f: - k = 0x019c; - break; - case 0x0271: - k = 0x2c6e; - break; - case 0x0272: - k = 0x019d; - break; - case 0x0275: - k = 0x019f; - break; - case 0x027d: - k = 0x2c64; - break; - case 0x0280: - k = 0x01a6; - break; - case 0x0283: - k = 0x01a9; - break; - case 0x0288: - k = 0x01ae; - break; - case 0x0289: - k = 0x0244; - break; - case 0x028a: - k = 0x01b1; - break; - case 0x028b: - k = 0x01b2; - break; - case 0x028c: - k = 0x0245; - break; - case 0x0292: - k = 0x01b7; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - } - else if (c < 0x0400) - { - wint_t k; - - if (c >= 0x03ad && c <= 0x03af) - return (c - 0x25); - - if (c >= 0x03b1 && c <= 0x03cb && c != 0x03c2) - return (c - 0x20); - - if (c >= 0x03d9 && c <= 0x03ef && (c & 1)) - return (c - 1); - - switch (c) - { - case 0x0345: - k = 0x0399; - break; - case 0x0371: - case 0x0373: - case 0x0377: - case 0x03f8: - case 0x03fb: - k = c - 1; - break; - case 0x037b: - case 0x037c: - case 0x037d: - k = c + 0x82; - break; - case 0x03ac: - k = 0x0386; - break; - case 0x03c2: - k = 0x03a3; - break; - case 0x03cc: - k = 0x038c; - break; - case 0x03cd: - case 0x03ce: - k = c - 0x3f; - break; - case 0x03d0: - k = 0x0392; - break; - case 0x03d1: - k = 0x0398; - break; - case 0x03d5: - k = 0x03a6; - break; - case 0x03d6: - k = 0x03a0; - break; - case 0x03d7: - k = 0x03cf; - break; - case 0x03f0: - k = 0x039a; - break; - case 0x03f1: - k = 0x03a1; - break; - case 0x03f2: - k = 0x03f9; - break; - case 0x03f5: - k = 0x0395; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - else if (c < 0x500) - { - if (c >= 0x0430 && c <= 0x044f) - return (c - 0x20); - - if (c >= 0x0450 && c <= 0x045f) - return (c - 0x50); - - if ((c >= 0x0461 && c <= 0x0481) || - (c >= 0x048b && c <= 0x04bf) || - (c >= 0x04d1 && c <= 0x04ff)) - { - if (c & 0x01) - return (c - 1); - return c; - } - - if (c >= 0x04c2 && c <= 0x04ce) - { - if (!(c & 0x01)) - return (c - 1); - return c; - } - - if (c == 0x04cf) - return 0x04c0; - } - else if (c < 0x0600) - { - if (c >= 0x0501 && c <= 0x0525 && (c & 1)) - return c - 1; - - if (c >= 0x0561 && c <= 0x0586) - return (c - 0x30); - } - else if (c < 0x1f00) - { - if (c == 0x1d79) - return 0xa77d; - - if (c == 0x1d7d) - return 0x2c63; - - if ((c >= 0x1e01 && c <= 0x1e95) || - (c >= 0x1ea1 && c <= 0x1eff)) - { - if (c & 0x01) - return (c - 1); - return c; - } - - if (c == 0x1e9b) - return 0x1e60; - } - else if (c < 0x2000) - { - - if ((c >= 0x1f00 && c <= 0x1f07) || - (c >= 0x1f10 && c <= 0x1f15) || - (c >= 0x1f20 && c <= 0x1f27) || - (c >= 0x1f30 && c <= 0x1f37) || - (c >= 0x1f40 && c <= 0x1f45) || - (c >= 0x1f60 && c <= 0x1f67) || - (c >= 0x1f80 && c <= 0x1f87) || - (c >= 0x1f90 && c <= 0x1f97) || - (c >= 0x1fa0 && c <= 0x1fa7)) - return (c + 0x08); - - if (c >= 0x1f51 && c <= 0x1f57 && (c & 0x01)) - return (c + 0x08); - - if (c >= 0x1f70 && c <= 0x1ff3) - { - wint_t k; - switch (c) - { - case 0x1fb0: - k = 0x1fb8; - break; - case 0x1fb1: - k = 0x1fb9; - break; - case 0x1f70: - k = 0x1fba; - break; - case 0x1f71: - k = 0x1fbb; - break; - case 0x1fb3: - k = 0x1fbc; - break; - case 0x1fbe: - k = 0x0399; - break; - case 0x1f72: - k = 0x1fc8; - break; - case 0x1f73: - k = 0x1fc9; - break; - case 0x1f74: - k = 0x1fca; - break; - case 0x1f75: - k = 0x1fcb; - break; - case 0x1fc3: - k = 0x1fcc; - break; - case 0x1fd0: - k = 0x1fd8; - break; - case 0x1fd1: - k = 0x1fd9; - break; - case 0x1f76: - k = 0x1fda; - break; - case 0x1f77: - k = 0x1fdb; - break; - case 0x1fe0: - k = 0x1fe8; - break; - case 0x1fe1: - k = 0x1fe9; - break; - case 0x1f7a: - k = 0x1fea; - break; - case 0x1f7b: - k = 0x1feb; - break; - case 0x1fe5: - k = 0x1fec; - break; - case 0x1f78: - k = 0x1ff8; - break; - case 0x1f79: - k = 0x1ff9; - break; - case 0x1f7c: - k = 0x1ffa; - break; - case 0x1f7d: - k = 0x1ffb; - break; - case 0x1ff3: - k = 0x1ffc; - break; - default: - k = 0; - } - if (k != 0) - return k; - } - } - else if (c < 0x3000) - { - if (c == 0x214e) - return 0x2132; - - if (c == 0x2184) - return 0x2183; - - if (c >= 0x2170 && c <= 0x217f) - return (c - 0x10); - - if (c >= 0x24d0 && c <= 0x24e9) - return (c - 0x1a); - - if (c >= 0x2c30 && c <= 0x2c5e) - return (c - 0x30); - - if ((c >= 0x2c68 && c <= 0x2c6c && !(c & 1)) || - (c >= 0x2c81 && c <= 0x2ce3 && (c & 1)) || - c == 0x2c73 || c == 0x2c76 || - c == 0x2cec || c == 0x2cee) - return (c - 1); - - if (c >= 0x2c81 && c <= 0x2ce3 && (c & 1)) - return (c - 1); - - if (c >= 0x2d00 && c <= 0x2d25) - return (c - 0x1c60); - - switch (c) - { - case 0x2c61: - return 0x2c60; - case 0x2c65: - return 0x023a; - case 0x2c66: - return 0x023e; - } - } - else if (c >= 0xa000 && c < 0xb000) - { - if (((c >= 0xa641 && c <= 0xa65f) || - (c >= 0xa663 && c <= 0xa66d) || - (c >= 0xa681 && c <= 0xa697) || - (c >= 0xa723 && c <= 0xa72f) || - (c >= 0xa733 && c <= 0xa76f) || - (c >= 0xa77f && c <= 0xa787)) && - (c & 1)) - return (c - 1); - - if (c == 0xa77a || c == 0xa77c || c == 0xa78c) - return (c - 1); - } - else - { - if (c >= 0xff41 && c <= 0xff5a) - return (c - 0x20); - - if (c >= 0x10428 && c <= 0x1044f) - return (c - 0x28); - } - return c; + return towctrans (c, WCT_TOUPPER); #else - return (c < 0x00ff ? (wint_t)(toupper ((int)c)) : c); + return c < 0x00ff ? (wint_t)(toupper ((int)c)) : c; #endif /* _MB_CAPABLE */ } - diff --git a/newlib/libc/ctype/towupper_l.c b/newlib/libc/ctype/towupper_l.c index 5a8384cfb..d7c1adbc8 100644 --- a/newlib/libc/ctype/towupper_l.c +++ b/newlib/libc/ctype/towupper_l.c @@ -1,10 +1,14 @@ +/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */ #include <_ansi.h> #include +#include "local.h" wint_t towupper_l (wint_t c, struct __locale_t *locale) { - /* We're using a locale-independent representation of upper/lower case - based on Unicode data. Thus, the locale doesn't matter. */ +#ifdef _MB_CAPABLE + return towctrans_l (c, WCT_TOUPPER, locale); +#else return towupper (c); +#endif /* _MB_CAPABLE */ } diff --git a/newlib/libc/ctype/utf8alpha.h b/newlib/libc/ctype/utf8alpha.h deleted file mode 100644 index d9306b720..000000000 --- a/newlib/libc/ctype/utf8alpha.h +++ /dev/null @@ -1,355 +0,0 @@ -/* Copyright (c) 2002 Red Hat Incorporated. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* Generated using UnicodeData.txt 5.2 */ - -/* Expression used to filter out the characters for the below tables: - - awk -F\; \ - '{ \ - VAL = strtonum (sprintf("0x%s", $1)); \ - # All of general category "L", except for two Thai characters which \ - # are actually punctuation characters. Old Unicode weirdness. \ - # The character "COMBINING GREEK YPOGEGRAMMENI", as well as all Thai \ - # characters which are in "Mn" category. Old Unicode weirdness. \ - # All numerical digit or letter characters, except the ASCII variants. \ - # This is necessary due to the unfortunate ISO C definition for the \ - # iswdigit class, otherwise these characters are missing in iswalnum. \ - # All "Other Symbols" which are named as "LETTER" characters. \ - # \ - # Before running this test, make sure to expand all Unicode blocks \ - # which are just marked by their first and last character! \ - # \ - if ( (match($3, "^L") && VAL != 0x0e2f && VAL != 0x0e46) \ - || (match($3, "^Mn") && (VAL == 0x0345 || match($2, "\\"))) \ - || (match($3, "^N[dl]") && VAL >= 0x100) \ - || (match($3, "^So") && match($2, "\\"))) \ - print $1; \ - }' UnicodeData.txt -*/ - -static const unsigned char u0[] = { - 0x41, 0x0, 0x5a, 0x61, 0x0, 0x7a, 0xaa, 0xb5, - 0xba, 0xc0, 0x0, 0xd6, 0xd8, 0x0, 0xf6, 0xf8, - 0x0, 0xff }; -/* u1 all alphabetic */ -static const unsigned char u2[] = { - 0x00, 0x0, 0xc1, 0xc6, 0x0, 0xd1, - 0xe0, 0x0, 0xe4, 0xec, 0xee }; -static const unsigned char u3[] = { - 0x45, 0x70, 0x0, 0x74, 0x76, 0x77, - 0x7a, 0x0, 0x7d, 0x86, 0x88, 0x0, 0x8a, 0x8c, - 0x8e, 0x0, 0xa1, 0xa3, 0x0, 0xf5, - 0xf7, 0x0, 0xff }; -static const unsigned char u4[] = { - 0x00, 0x0, 0x81, 0x8a, 0x0, 0xff }; -static const unsigned char u5[] = { - 0x00, 0x0, 0x25, 0x31, 0x0, 0x56, 0x59, - 0x61, 0x0, 0x87, 0xd0, 0x0, 0xea, - 0xf0, 0x0, 0xf2 }; -static const unsigned char u6[] = { - 0x21, 0x0, 0x4a, 0x60, 0x0, 0x69, - 0x6e, 0x0, 0x6f, 0x71, 0x0, 0xd3, - 0xd5, 0xe5, 0x0, 0xe6, 0xee, 0x0, 0xfc, 0xff }; -static const unsigned char u7[] = { - 0x10, 0x12, 0x0, 0x2f, 0x4d, 0x0, 0xa5, 0xb1, - 0xc0, 0x0, 0xea, 0xf4, 0xf5, 0xfa }; -static const unsigned char u8[] = { - 0x00, 0x0, 0x15, 0x1a, 0x24, 0x28 }; -static const unsigned char u9[] = { - 0x04, 0x0, 0x39, 0x3d, 0x50, 0x58, 0x0, 0x61, - 0x66, 0x0, 0x6f, 0x71, 0x72, 0x79, 0x0, 0x7f, - 0x85, 0x0, 0x8c, 0x8f, 0x0, 0x90, - 0x93, 0x0, 0xa8, 0xaa, 0x0, 0xb0, 0xb2, - 0xb6, 0x0, 0xb9, 0xbd, 0xce, 0xdc, 0x0, 0xdd, - 0xdf, 0x0, 0xe1, 0xe6, 0x0, 0xf1 }; -static const unsigned char ua[] = { - 0x05, 0x0, 0x0a, 0x0f, 0x0, 0x10, - 0x13, 0x0, 0x28, 0x2a, 0x0, 0x30, - 0x32, 0x0, 0x33, 0x35, 0x0, 0x36, - 0x38, 0x0, 0x39, 0x59, 0x0, 0x5c, - 0x5e, 0x66, 0x0, 0x6f, 0x72, 0x0, 0x74, - 0x85, 0x0, 0x8d, 0x8f, 0x0, 0x91, - 0x93, 0x0, 0xa8, 0xaa, 0x0, 0xb0, - 0xb2, 0x0, 0xb3, 0xb5, 0x0, 0xb9, - 0xbd, 0xd0, 0xe0, 0xe1, 0xe6, 0x0, 0xef }; -static const unsigned char ub[] = { - 0x05, 0x0, 0x0c, 0x0f, 0x0, 0x10, - 0x13, 0x0, 0x28, 0x2a, 0x0, 0x30, - 0x32, 0x0, 0x33, 0x35, 0x0, 0x39, 0x3d, - 0x5c, 0x0, 0x5d, 0x5f, 0x0, 0x61, - 0x66, 0x0, 0x6f, 0x71, 0x83, 0x85, 0x0, 0x8a, - 0x8e, 0x0, 0x90, 0x92, 0x0, 0x95, - 0x99, 0x0, 0x9a, 0x9c, 0x9e, 0x0, 0x9f, - 0xa3, 0x0, 0xa4, 0xa8, 0x0, 0xaa, - 0xae, 0x0, 0xb9, 0xd0, 0xe6, 0x0, 0xef }; -static const unsigned char uc[] = { - 0x05, 0x0, 0x0c, 0x0e, 0x0, 0x10, - 0x12, 0x0, 0x28, 0x2a, 0x0, 0x33, - 0x35, 0x0, 0x39, 0x3d, 0x58, 0x59, - 0x60, 0x0, 0x61, 0x66, 0x0, 0x6f, - 0x85, 0x0, 0x8c, 0x8e, 0x0, 0x90, - 0x92, 0x0, 0xa8, 0xaa, 0x0, 0xb3, - 0xb5, 0x0, 0xb9, 0xbd, 0xde, 0xe0, 0x0, 0xe1, - 0xe6, 0x0, 0xef }; -static const unsigned char ud[] = { - 0x05, 0x0, 0x0c, 0x0e, 0x0, 0x10, - 0x12, 0x0, 0x28, 0x2a, 0x0, 0x39, 0x3d, - 0x60, 0x0, 0x61, 0x66, 0x0, 0x6f, - 0x7a, 0x0, 0x7f, 0x85, 0x0, 0x96, 0x9a, - 0x0, 0xb1, 0xb3, 0x0, 0xbb, 0xbd, - 0xc0, 0x0, 0xc6 }; -static const unsigned char ue[] = { - 0x01, 0x0, 0x2e, 0x30, 0x0, 0x3a, 0x40, - 0x0, 0x45, 0x47, 0x0, 0x4e, 0x50, 0x0, 0x59, - 0x81, 0x0, 0x82, 0x84, 0x87, 0x0, 0x88, 0x8a, - 0x8d, 0x94, 0x0, 0x97, 0x99, 0x0, 0x9f, 0xa1, - 0x0, 0xa3, 0xa5, 0xa7, 0xaa, 0x0, 0xab, 0xad, - 0x0, 0xb0, 0xb2, 0x0, 0xb3, 0xbd, 0xc0, 0x0, - 0xc4, 0xc6, 0xd0, 0x0, 0xd9, 0xdc, 0x0, 0xdd }; -static const unsigned char uf[] = { - 0x00, 0x20, 0x0, 0x29, 0x40, 0x0, 0x47, 0x49, - 0x0, 0x6c, 0x88, 0x0, 0x8b }; -static const unsigned char u10[] = { - 0x00, 0x0, 0x2a, 0x3f, 0x0, 0x49, - 0x50, 0x0, 0x55, 0x5a, 0x0, 0x5d, - 0x61, 0x65, 0x66, 0x6e, 0x0, 0x70, - 0x75, 0x0, 0x81, 0x8e, 0x90, 0x0, 0x99, - 0xa0, 0x0, 0xc5, 0xd0, 0x0, 0xfa, 0xfc }; -/* u11 all alphabetic */ -static const unsigned char u12[] = { - 0x00, 0x0, 0x48, 0x4a, 0x0, 0x4d, - 0x50, 0x0, 0x56, 0x58, 0x5a, 0x0, 0x5d, - 0x60, 0x0, 0x88, 0x8a, 0x0, 0x8d, - 0x90, 0x0, 0xb0, 0xb2, 0x0, 0xb5, - 0xb8, 0x0, 0xbe, 0xc0, 0xc2, 0x0, 0xc5, - 0xc8, 0x0, 0xd6, 0xd8, 0x0, 0xff }; -static const unsigned char u13[] = { - 0x00, 0x0, 0x10, 0x12, 0x0, 0x15, - 0x18, 0x0, 0x5a, 0x80, 0x0, 0x8f, - 0xa0, 0x0, 0xf4 }; -static const unsigned char u14[] = { - 0x01, 0x0, 0xff }; -/* u15 all alphabetic */ -static const unsigned char u16[] = { - 0x00, 0x0, 0x6c, 0x6f, 0x0, 0x7f, - 0x81, 0x0, 0x9a, 0xa0, 0x0, 0xea, - 0xee, 0x0, 0xf0 }; -static const unsigned char u17[] = { - 0x00, 0x0, 0x0c, 0x0e, 0x0, 0x11, - 0x20, 0x0, 0x31, 0x40, 0x0, 0x51, - 0x60, 0x0, 0x6c, 0x6e, 0x0, 0x70, - 0x80, 0x0, 0xb3, 0xd7, 0xdc, 0xe0, 0x0, 0xe9 }; -static const unsigned char u18[] = { - 0x10, 0x0, 0x19, 0x20, 0x0, 0x77, - 0x80, 0x0, 0xa8, 0xaa, 0xb0, 0x0, 0xf5 }; -static const unsigned char u19[] = { - 0x00, 0x0, 0x1c, 0x46, 0x0, 0x6d, - 0x70, 0x0, 0x74, 0x80, 0x0, 0xab, - 0xc1, 0x0, 0xc7, 0xd0, 0x0, 0xda }; -static const unsigned char u1a[] = { - 0x00, 0x0, 0x16, 0x20, 0x0, 0x54, - 0x80, 0x0, 0x89, 0x90, 0x0, 0x99, 0xa7 }; -static const unsigned char u1b[] = { - 0x05, 0x0, 0x33, 0x45, 0x0, 0x4b, - 0x50, 0x0, 0x59, 0x83, 0x0, 0xa0, - 0xae, 0x0, 0xb9 }; -static const unsigned char u1c[] = { - 0x00, 0x0, 0x23, 0x40, 0x0, 0x49, - 0x4d, 0x0, 0x7d, 0xe9, 0x0, 0xec, - 0xee, 0x0, 0xf1 }; -static const unsigned char u1d[] = { - 0x00, 0x0, 0xbf }; -/* u1e all alphabetic */ -static const unsigned char u1f[] = { - 0x00, 0x0, 0x15, 0x18, 0x0, 0x1d, - 0x20, 0x0, 0x45, 0x48, 0x0, 0x4d, 0x50, 0x0, 0x57, 0x59, - 0x5b, 0x5d, 0x5f, 0x0, 0x7d, 0x80, 0x0, 0xb4, - 0xb6, 0x0, 0xbc, 0xbe, 0xc2, 0x0, 0xc4, 0xc6, - 0x0, 0xcc, 0xd0, 0x0, 0xd3, 0xd6, 0x0, 0xdb, - 0xe0, 0x0, 0xec, 0xf2, 0x0, 0xf4, 0xf6, 0x0, - 0xfc }; -static const unsigned char u20[] = { - 0x71, 0x7f, 0x90, 0x0, 0x94 }; -static const unsigned char u21[] = { - 0x02, 0x07, 0x0a, 0x0, 0x13, 0x15, - 0x19, 0x0, 0x1d, 0x24, 0x26, 0x28, 0x0, 0x2d, - 0x2f, 0x0, 0x39, 0x3c, 0x0, 0x3f, - 0x45, 0x0, 0x49, 0x4e, 0x60, 0x0, 0x88 }; -static const unsigned char u24[] = { - 0x9c, 0x0, 0xe9 }; -static const unsigned char u2c[] = { - 0x00, 0x0, 0x2e, 0x30, 0x0, 0x5e, - 0x60, 0x0, 0xe4, 0xeb, 0x0, 0xee }; -static const unsigned char u2d[] = { - 0x00, 0x0, 0x25, 0x30, 0x0, 0x65, 0x6f, - 0x80, 0x0, 0x96, 0xa0, 0x0, 0xa6, - 0xa8, 0x0, 0xae, 0xb0, 0x0, 0xb6, - 0xb8, 0x0, 0xbe, 0xc0, 0x0, 0xc6, - 0xc8, 0x0, 0xce, 0xd0, 0x0, 0xd6, - 0xd8, 0x0, 0xde }; -static const unsigned char u2e[] = { - 0x2f }; -static const unsigned char u30[] = { - 0x05, 0x0, 0x07, 0x21, 0x0, - 0x29, 0x31, 0x0, 0x35, 0x38, 0x0, 0x3c, 0x41, - 0x0, 0x96, 0x9d, 0x0, 0x9f, 0xa1, 0x0, 0xfa, - 0xfc, 0x0, 0xff }; -static const unsigned char u31[] = { - 0x05, 0x0, 0x2d, 0x31, 0x0, - 0x8e, 0xa0, 0x0, 0xb7, 0xf0, 0x0, 0xff }; -/* u34 to u4c all alphabetic */ -static const unsigned char u4d[] = { - 0x00, 0x0, 0xb5 }; -/* u4e to u9e all alphabetic */ -static const unsigned char u9f[] = { - 0x00, 0x0, 0xcb }; -/* ua0 to ua3 all alphabetic */ -static const unsigned char ua4[] = { - 0x00, 0x0, 0x8c, 0xd0, 0x0, 0xfd }; -/* ua5 all alphabetic */ -static const unsigned char ua6[] = { - 0x00, 0x0, 0x0c, 0x10, 0x0, 0x2b, - 0x40, 0x0, 0x5f, 0x62, 0x0, 0x6e, - 0x7f, 0x0, 0x97, 0xa0, 0x0, 0xef }; -static const unsigned char ua7[] = { - 0x17, 0x0, 0x1f, 0x22, 0x0, 0x88, - 0x8b, 0x8c, - 0xfb, 0x0, 0xff }; -static const unsigned char ua8[] = { - 0x00, 0x01, 0x03, 0x0, 0x05, 0x07, 0x0, 0x0a, - 0x0c, 0x0, 0x22, 0x40, 0x0, 0x73, - 0x82, 0x0, 0xb3, 0xd0, 0x0, 0xd9, - 0xf2, 0x0, 0xf7, 0xfb }; -static const unsigned char ua9[] = { - 0x00, 0x0, 0x25, 0x30, 0x0, 0x46, - 0x60, 0x0, 0x7c, 0x84, 0x0, 0xb2, - 0xcf, 0x0, 0xd9 }; -static const unsigned char uaa[] = { - 0x00, 0x0, 0x28, 0x40, 0x0, 0x42, - 0x44, 0x0, 0x4b, 0x50, 0x0, 0x59, - 0x60, 0x0, 0x76, 0x7a, 0x80, 0x0, 0xaf, - 0xb1, 0xb5, 0xb6, 0xb9, 0x0, 0xbd, - 0xc0, 0xc2, 0xdb, 0x0, 0xdd }; -static const unsigned char uab[] = { - 0xc0, 0x0, 0xe2, 0xf0, 0x0, 0xf9 }; -/* uac to ud6 all alphabetic */ -static const unsigned char ud7[] = { - 0x00, 0x0, 0xa3, 0xb0, 0x0, 0xc6, - 0xcb, 0x0, 0xfb }; -/* uf9 all alphabetic */ -static const unsigned char ufa[] = { - 0x00, 0x0, 0x2d, 0x30, 0x0, 0x6d, - 0x70, 0x0, 0xd9 }; -static const unsigned char ufb[] = { - 0x00, 0x0, 0x06, 0x13, 0x0, 0x17, 0x1d, - 0x1f, 0x0, 0x28, 0x2a, 0x0, 0x36, 0x38, 0x0, - 0x3c, 0x3e, 0x40, 0x0, 0x41, 0x43, 0x0, 0x44, - 0x46, 0x0, 0xb1, 0xd3, 0x0, 0xff }; -/* ufc all alphabetic */ -static const unsigned char ufd[] = { - 0x00, 0x0, 0x3d, 0x50, 0x0, - 0x8f, 0x92, 0x0, 0xc7, 0xf0, 0x0, 0xfb }; -static const unsigned char ufe[] = { - 0x70, - 0x0, 0x74, 0x76, 0x0, 0xfc }; -static const unsigned char uff[] = { - 0x10, 0x0, 0x19, - 0x21, 0x0, 0x3a, 0x41, 0x0, 0x5a, 0x66, 0x0, - 0xbe, 0xc2, 0x0, 0xc7, 0xca, 0x0, 0xcf, 0xd2, - 0x0, 0xd7, 0xda, 0x0, 0xdc }; -static const unsigned char u100[] = { - 0x00, 0x0, 0x0b, 0x0d, 0x0, 0x26, - 0x28, 0x0, 0x3a, 0x3c, 0x3d, 0x3f, 0x0, 0x4d, - 0x50, 0x0, 0x5d, 0x80, 0x0, 0xfa }; -static const unsigned char u101[] = { - 0x40, 0x0, 0x74 }; -static const unsigned char u102[] = { - 0x80, 0x0, 0x9c, 0xa0, 0x0, 0xd0 }; -static const unsigned char u103[] = { - 0x00, 0x0, 0x1e, 0x30, 0x0, 0x4a, - 0x80, 0x0, 0x9d, 0xa0, 0x0, 0xc3, - 0xc8, 0x0, 0xcf, 0xd1, 0x0, 0xd5 }; -static const unsigned char u104[] = { - 0x00, 0x0, 0x9d, 0xa0, 0x0, 0xa9 }; -static const unsigned char u108[] = { - 0x00, 0x0, 0x05, 0x08, 0x0a, 0x0, 0x35, - 0x37, 0x38, 0x3c, 0x3f, 0x0, 0x55 }; -static const unsigned char u109[] = { - 0x00, 0x0, 0x15, 0x20, 0x0, 0x39 }; -static const unsigned char u10a[] = { - 0x00, 0x10, 0x0, 0x13, 0x15, 0x0, 0x17, - 0x19, 0x0, 0x33, 0x60, 0x0, 0x7c }; -static const unsigned char u10b[] = { - 0x00, 0x0, 0x35, 0x40, 0x0, 0x55, - 0x60, 0x0, 0x72 }; -static const unsigned char u10c[] = { - 0x00, 0x0, 0x48 }; -static const unsigned char u110[] = { - 0x83, 0x0, 0xaf }; -/* u120 to u122 all alphabetic */ -static const unsigned char u123[] = { - 0x00, 0x0, 0x6e }; -static const unsigned char u124[] = { - 0x00, 0x0, 0x62 }; -/* u130 to u133 all alphabetic */ -static const unsigned char u134[] = { - 0x00, 0x0, 0x2e }; -static const unsigned char u1d4[] = { - 0x00, 0x0, 0x54, 0x56, 0x0, 0x9c, - 0x9e, 0x0, 0x9f, 0xa2, 0xa5, 0x0, 0xa6, - 0xa9, 0x0, 0xac, 0xae, 0x0, 0xb9, 0xbb, - 0xbd, 0x0, 0xc3, 0xc5, 0x0, 0xff }; -static const unsigned char u1d5[] = { - 0x00, 0x0, 0x05, 0x07, 0x0, - 0x0a, 0x0d, 0x0, 0x14, 0x16, 0x0, 0x1c, 0x1e, - 0x0, 0x39, 0x3b, 0x0, 0x3e, 0x40, 0x0, 0x44, - 0x46, 0x4a, 0x0, 0x50, 0x52, 0x0, 0xff }; -static const unsigned char u1d6[] = { - 0x00, 0x0, 0xa5, 0xa8, 0x0, 0xc0, - 0xc2, 0x0, 0xda, 0xdc, 0x0, 0xfa, - 0xfc, 0x0, 0xff }; -static const unsigned char u1d7[] = { - 0x00, 0x0, 0x14, 0x16, 0x0, 0x34, - 0x36, 0x0, 0x4e, 0x50, 0x0, 0x6e, - 0x70, 0x0, 0x88, 0x8a, 0x0, 0xa8, - 0xaa, 0x0, 0xc2, 0xc4, 0x0, 0xcb, - 0xce, 0x0, 0xff }; -static const unsigned char u1f1[] = { - 0x10, 0x0, 0x2c, 0x31, 0x3d, 0x3f, 0x42, 0x46, - 0x57, 0x5f, 0x79, 0x7b, 0x7c, 0x7f, 0x8a }; -/* u200 to u2a5 all alphabetic */ -static const unsigned char u2a6[] = { - 0x00, 0x0, 0xd6 }; -/* u2a7 to u2b6 all alphabetic */ -static const unsigned char u2b7[] = { - 0x00, 0x0, 0x34 }; -/* u2f8 to u2f9 all alphabetic */ -static const unsigned char u2fa[] = { - 0x00, 0x0, 0x1d }; diff --git a/newlib/libc/ctype/utf8print.h b/newlib/libc/ctype/utf8print.h deleted file mode 100644 index abeb81cb5..000000000 --- a/newlib/libc/ctype/utf8print.h +++ /dev/null @@ -1,389 +0,0 @@ -/* Copyright (c) 2002 Red Hat Incorporated. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - The name of Red Hat Incorporated may not be used to endorse - or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* Generated using UnicodeData.txt 5.2 */ - -/* Expression used to filter out the characters for the below tables: - - awk -F\; \ - '{ \ - VAL = strtonum (sprintf("0x%s", $1)); \ - # All valid characters except from categories Cc (C0 or C1 control code), \ - # Cs (Surrogates), Zl (Line separator), and Zp (Paragraph separator).\ - # \ - # Before running this test, make sure to expand all Unicode blocks \ - # which are just marked by their first and last character! \ - # \ - if (!match($3, "^C[cs]") && !match($3, "^Z[lp]")) \ - print $1; \ - }' UnicodeData.txt -*/ -static const unsigned char u0[] = { - 0x20, 0x0, 0x7e, 0xa0, 0x0, 0xff }; -/* u1 is all-print */ -/* u2 is all-print */ -static const unsigned char u3[] = { - 0x00, 0x0, 0x77, 0x7a, 0x0, 0x7e, - 0x84, 0x0, 0x8a, 0x8c, 0x8e, 0x0, - 0xa1, 0xa3, 0x0, 0xff }; -/* u4 is all-print */ -static const unsigned char u5[] = { - 0x00, 0x0, 0x25, 0x31, 0x0, - 0x56, 0x59, 0x0, 0x5f, 0x61, 0x0, 0x87, 0x89, - 0x0, 0x8a, 0x91, 0x0, 0xc7, 0xd0, 0x0, 0xea, - 0xf0, 0x0, 0xf4 }; -static const unsigned char u6[] = { - 0x00, 0x0, 0x03, 0x06, 0x0, 0x1b, 0x1e, 0x1f, - 0x21, 0x0, 0x5e, 0x60, 0x0, 0xff }; -static const unsigned char u7[] = { - 0x00, 0x0, 0x0d, 0x0f, 0x0, 0x4a, 0x4d, 0x0, 0xb1, - 0xc0, 0x0, 0xfa }; -static const unsigned char u8[] = { - 0x00, 0x0, 0x2d, 0x30, 0x0, 0x3e, }; -static const unsigned char u9[] = { - 0x00, 0x0, 0x39, 0x3c, 0x0, 0x4e, 0x50, 0x0, 0x55, - 0x58, 0x0, 0x72, 0x79, 0x0, 0x7f, 0x81, 0x0, 0x83, - 0x85, 0x0, 0x8c, 0x8f, 0x0, 0x90, 0x93, 0x0, 0xa8, - 0xaa, 0x0, 0xb0, 0xb2, 0xb6, 0x0, 0xb9, 0xbc, - 0x0, 0xc4, 0xc7, 0xc8, 0xcb, 0x0, 0xce, - 0xd7, 0xdc, 0x0, 0xdd, 0xdf, 0x0, 0xe3, 0xe6, - 0x0, 0xfb }; -static const unsigned char ua[] = { - 0x01, 0x0, 0x03, 0x05, 0x0, 0x0a, 0x0f, 0x0, - 0x10, 0x13, 0x0, 0x28, 0x2a, 0x0, 0x30, 0x32, - 0x0, 0x33, 0x35, 0x0, 0x36, 0x38, 0x0, 0x39, - 0x3c, 0x3e, 0x0, 0x42, 0x47, 0x0, 0x48, 0x4b, - 0x0, 0x4d, 0x51, 0x59, 0x0, 0x5c, 0x5e, 0x66, 0x0, - 0x75, 0x81, 0x0, 0x83, 0x85, 0x0, 0x8d, - 0x8f, 0x0, 0x91, 0x93, 0x0, 0xa8, 0xaa, 0x0, - 0xb0, 0xb2, 0x0, 0xb3, 0xb5, 0x0, 0xb9, 0xbc, - 0x0, 0xc5, 0xc7, 0x0, 0xc9, 0xcb, 0x0, 0xcd, - 0xd0, 0xe0, 0x0, 0xe3, 0xe6, 0x0, 0xef, 0xf1 }; -static const unsigned char ub[] = { - 0x01, 0x0, 0x03, - 0x05, 0x0, 0x0c, 0x0f, 0x0, 0x10, 0x13, 0x0, - 0x28, 0x2a, 0x0, 0x30, 0x32, 0x0, 0x33, 0x35, - 0x0, 0x39, 0x3c, 0x0, 0x44, 0x47, 0x0, 0x48, - 0x4b, 0x0, 0x4d, 0x56, 0x0, 0x57, 0x5c, 0x0, - 0x5d, 0x5f, 0x0, 0x63, 0x66, 0x0, 0x71, 0x82, - 0x0, 0x83, 0x85, 0x0, 0x8a, 0x8e, 0x0, 0x90, - 0x92, 0x0, 0x95, 0x99, 0x0, 0x9a, 0x9c, 0x9e, - 0x0, 0x9f, 0xa3, 0x0, 0xa4, 0xa8, 0x0, 0xaa, - 0xae, 0x0, 0xb9, 0xbe, 0x0, - 0xc2, 0xc6, 0x0, 0xc8, 0xca, 0x0, 0xcd, 0xd0, - 0xd7, 0xe6, 0xe7, 0x0, 0xfa }; -static const unsigned char uc[] = { - 0x01, 0x0, 0x03, 0x05, 0x0, - 0x0c, 0x0e, 0x0, 0x10, 0x12, 0x0, 0x28, 0x2a, - 0x0, 0x33, 0x35, 0x0, 0x39, 0x3d, 0x0, 0x44, - 0x46, 0x0, 0x48, 0x4a, 0x0, 0x4d, 0x55, 0x0, - 0x56, 0x58, 0x59, 0x60, 0x0, 0x63, 0x66, 0x0, 0x6f, - 0x78, 0x0, 0x7f, 0x82, 0x83, 0x85, 0x0, 0x8c, - 0x8e, 0x0, 0x90, 0x92, 0x0, 0xa8, 0xaa, 0x0, 0xb3, - 0xb5, 0x0, 0xb9, 0xbc, 0x0, 0xc4, 0xc6, 0x0, 0xc8, - 0xca, 0x0, 0xcd, 0xd5, 0x0, 0xd6, 0xde, 0xe0, 0x0, - 0xe3, 0xe6, 0x0, 0xef, 0xf1, 0xf2 }; -static const unsigned char ud[] = { - 0x02, 0x0, 0x03, 0x05, - 0x0, 0x0c, 0x0e, 0x0, 0x10, 0x12, 0x0, 0x28, - 0x2a, 0x0, 0x39, 0x3d, 0x0, 0x44, 0x46, 0x0, - 0x48, 0x4a, 0x0, 0x4d, 0x57, 0x60, 0x0, 0x63, - 0x66, 0x0, 0x75, 0x79, 0x0, 0x7f, 0x82, 0x0, 0x83, - 0x85, 0x0, 0x96, 0x9a, 0x0, 0xb1, 0xb3, 0x0, 0xbb, - 0xbd, 0xc0, 0x0, 0xc6, 0xca, 0xcf, 0x0, 0xd4, 0xd6, - 0xd8, 0x0, 0xdf, 0xf2, 0x0, 0xf4 }; -static const unsigned char ue[] = { - 0x01, 0x0, - 0x3a, 0x3f, 0x0, 0x5b, 0x81, 0x0, 0x82, 0x84, - 0x87, 0x0, 0x88, 0x8a, 0x8d, 0x94, 0x0, 0x97, - 0x99, 0x0, 0x9f, 0xa1, 0x0, 0xa3, 0xa5, 0xa7, - 0xaa, 0x0, 0xab, 0xad, 0x0, 0xb9, 0xbb, 0x0, - 0xbd, 0xc0, 0x0, 0xc4, 0xc6, 0xc8, 0x0, 0xcd, - 0xd0, 0x0, 0xd9, 0xdc, 0x0, 0xdd }; -static const unsigned char uf[] = { - 0x00, 0x0, 0x47, 0x49, 0x0, 0x6c, - 0x71, 0x0, 0x8b, 0x90, 0x0, 0x97, - 0x99, 0x0, 0xbc, 0xbe, 0x0, 0xcc, - 0xce, 0x0, 0xd8 }; -static const unsigned char u10[] = { - 0x00, 0x0, 0xc5, 0xd0, 0x0, 0xfc }; -/* u11 is all-print */ -static const unsigned char u12[] = { - 0x00, 0x0, 0x48, 0x4a, 0x0, 0x4d, 0x50, 0x0, 0x56, - 0x58, 0x5a, 0x0, 0x5d, 0x60, 0x0, 0x88, - 0x8a, 0x0, 0x8d, 0x90, 0x0, 0xb0, 0xb2, - 0x0, 0xb5, 0xb8, 0x0, 0xbe, 0xc0, 0xc2, 0x0, - 0xc5, 0xc8, 0x0, 0xd6, 0xd8, 0x0, 0xff }; -static const unsigned char u13[] = { - 0x00, 0x0, 0x10, 0x12, 0x0, 0x15, - 0x18, 0x0, 0x5a, 0x5f, 0x0, 0x7c, - 0x80, 0x0, 0x99, 0xa0, 0x0, 0xf4 }; -/* u14 is all-print */ -/* u15 is all-print */ -static const unsigned char u16[] = { - 0x00, 0x0, 0x9c, 0xa0, 0x0, 0xf0 }; -static const unsigned char u17[] = { - 0x00, 0x0, 0x0c, 0x0e, 0x0, 0x14, 0x20, - 0x0, 0x36, 0x40, 0x0, 0x53, 0x60, 0x0, 0x6c, - 0x6e, 0x0, 0x70, 0x72, 0x0, 0x73, 0x80, 0x0, - 0xdd, 0xe0, 0x0, 0xe9, 0xf0, 0x0, 0xf9 }; -static const unsigned char u18[] = { - 0x00, 0x0, 0x0e, 0x10, - 0x0, 0x19, 0x20, 0x0, 0x77, 0x80, 0x0, 0xaa, - 0xb0, 0x0, 0xf5 }; -static const unsigned char u19[] = { - 0x00, 0x0, 0x1c, 0x20, 0x0, 0x2b, - 0x30, 0x0, 0x3b, 0x40, 0x44, 0x0, 0x6d, - 0x70, 0x0, 0x74, 0x80, 0x0, 0xab, - 0xb0, 0x0, 0xc9, 0xd0, 0x0, 0xda, - 0xde, 0x0, 0xff }; -static const unsigned char u1a[] = { - 0x00, 0x0, 0x1b, 0x1e, 0x0, 0x5e, - 0x60, 0x0, 0x7c, 0x7f, 0x0, 0x89, - 0x90, 0x0, 0x99, 0xa0, 0x0, 0xad }; -static const unsigned char u1b[] = { - 0x00, 0x0, 0x4b, 0x50, 0x0, 0x7c, - 0x80, 0x0, 0xaa, 0xae, 0x0, 0xb9 }; -static const unsigned char u1c[] = { - 0x00, 0x0, 0x37, 0x3b, 0x0, 0x49, - 0x4d, 0x0, 0x7f, 0xd0, 0x0, 0xf2 }; -static const unsigned char u1d[] = { - 0x00, 0x0, 0xe6, 0xfd, 0x0, 0xff }; -/* u1e is all-print */ -static const unsigned char u1f[] = { - 0x00, 0x0, - 0x15, 0x18, 0x0, 0x1d, 0x20, 0x0, 0x45, 0x48, - 0x0, 0x4d, 0x50, 0x0, 0x57, 0x59, 0x5b, 0x5d, - 0x5f, 0x0, 0x7d, 0x80, 0x0, 0xb4, 0xb6, 0x0, - 0xc4, 0xc6, 0x0, 0xd3, 0xd6, 0x0, 0xdb, 0xdd, - 0x0, 0xef, 0xf2, 0x0, 0xf4, 0xf6, 0x0, 0xfe }; -static const unsigned char u20[] = { - 0x00, 0x0, 0x27, 0x2a, 0x0, 0x64, - 0x6a, 0x0, 0x71, 0x74, 0x0, 0x8e, - 0x90, 0x0, 0x94, 0xa0, 0x0, 0xb8, - 0xd0, 0x0, 0xf0 }; -static const unsigned char u21[] = { - 0x00, 0x0, 0x89, 0x90, 0x0, 0xff }; -/* u22 is all-print */ -static const unsigned char u23[] = { - 0x00, 0x0, 0xe8 }; -static const unsigned char u24[] = { - 0x00, 0x0, 0x26, 0x40, 0x0, 0x4a, - 0x60, 0x0, 0xff }; -/* u25 is all-print */ -static const unsigned char u26[] = { - 0x00, 0x0, 0xcd, 0xcf, 0x0, 0xe1, - 0xe3, 0xe8, 0x0, 0xff }; -static const unsigned char u27[] = { - 0x01, 0x0, 0x04, 0x06, 0x0, 0x09, - 0x0c, 0x0, 0x27, 0x29, 0x0, 0x4b, 0x4d, - 0x4f, 0x0, 0x52, 0x56, 0x0, 0x5e, - 0x61, 0x0, 0x94, 0x98, 0x0, 0xaf, - 0xb1, 0x0, 0xbe, 0xc0, 0x0, 0xca, 0xcc, - 0xd0, 0x0, 0xff }; -/* u28 to u2a are all-print */ -static const unsigned char u2b[] = { - 0x00, 0x0, 0x4c, 0x50, 0x0, 0x59 }; -static const unsigned char u2c[] = { - 0x00, 0x0, 0x2e, 0x30, 0x0, 0x5e, - 0x60, 0x0, 0xf1, 0xf9, 0x0, 0xff }; -static const unsigned char u2d[] = { - 0x00, 0x0, 0x25, 0x30, 0x0, 0x65, 0x6f, - 0x80, 0x0, 0x96, 0xa0, 0x0, 0xa6, - 0xa8, 0x0, 0xae, 0xb0, 0x0, 0xb6, - 0xb8, 0x0, 0xbe, 0xc0, 0x0, 0xc6, - 0xc8, 0x0, 0xce, 0xd0, 0x0, 0xd6, - 0xd8, 0x0, 0xde, 0xe0, 0x0, 0xff }; -static const unsigned char u2e[] = { - 0x00, 0x0, 0x31, 0x80, 0x0, 0x99, - 0x9b, 0x0, 0xf3 }; -static const unsigned char u2f[] = { - 0x00, 0x0, 0xd5, 0xf0, 0x0, 0xfb }; -static const unsigned char u30[] = { - 0x00, 0x0, - 0x3f, 0x41, 0x0, 0x96, 0x99, 0x0, 0xff }; -static const unsigned char u31[] = { - 0x05, 0x0, 0x2d, 0x31, 0x0, 0x8e, - 0x90, 0x0, 0xb7, 0xc0, 0x0, 0xe3, - 0xf0, 0x0, 0xff }; -static const unsigned char u32[] = { - 0x00, 0x0, 0x1e, 0x20, 0x0, 0xfe }; -/* u33 to u4c is all-print */ -static const unsigned char u4d[] = { - 0x00, 0x0, 0xb5, 0xc0, 0x0, 0xff }; -/* u4e to u9e is all-print */ -static const unsigned char u9f[] = { - 0x00, 0x0, 0xcb }; -/* ua0 to ua3 is all-print */ -static const unsigned char ua4[] = { - 0x00, 0x0, 0x8c, 0x90, 0x0, 0xc6, - 0xd0, 0x0, 0xff }; -/* ua5 is all-print */ -static const unsigned char ua6[] = { - 0x00, 0x0, 0x2b, 0x40, 0x0, 0x5f, - 0x62, 0x0, 0x73, 0x7c, 0x0, 0x97, - 0xa0, 0x0, 0xf7 }; -static const unsigned char ua7[] = { - 0x00, 0x0, 0x8c, 0xfb, 0x0, 0xff }; -static const unsigned char ua8[] = { - 0x00, 0x0, 0x2b, 0x30, 0x0, 0x39, - 0x40, 0x0, 0x77, 0x80, 0x0, 0xc4, - 0xce, 0x0, 0xd9, 0xe0, 0x0, 0xfb }; -static const unsigned char ua9[] = { - 0x00, 0x0, 0x53, 0x5f, 0x0, 0x7c, - 0x80, 0x0, 0xcd, 0xcf, 0x0, 0xd9, - 0xde, 0xdf }; -static const unsigned char uaa[] = { - 0x00, 0x0, 0x36, 0x40, 0x0, 0x4d, - 0x50, 0x0, 0x59, 0x5c, 0x0, 0x7b, - 0x80, 0x0, 0xc2, 0xdb, 0x0, 0xdf }; -static const unsigned char uab[] = { - 0xc0, 0x0, 0xed, 0xf0, 0x0, 0xf9 }; -/* uac to ud6 is all-print */ -static const unsigned char ud7[] = { - 0x00, 0x0, 0xa3, 0xb0, 0x0, 0xc6, - 0xcb, 0x0, 0xfb }; -/* ud8 to udf are UTF-16 surrogates, non-printable */ -/* ue0 to uf9 is all-print */ -static const unsigned char ufa[] = { - 0x00, 0x0, 0x2d, 0x30, 0x0, 0x6d, - 0x70, 0x0, 0xd9 }; -static const unsigned char ufb[] = { - 0x00, 0x0, 0x06, 0x13, 0x0, 0x17, - 0x1d, 0x0, 0x36, 0x38, 0x0, 0x3c, - 0x3e, 0x40, 0x41, 0x43, 0x44, - 0x46, 0x0, 0xb1, 0xd3, 0x0, 0xff }; -/* ufc is all-print */ -static const unsigned char ufd[] = { - 0x00, 0x0, 0x3f, 0x50, 0x0, 0x8f, - 0x92, 0x0, 0xc7, 0xf0, 0x0, 0xfd }; -static const unsigned char ufe[] = { - 0x00, 0x0, 0x19, 0x20, 0x0, 0x26, - 0x30, 0x0, 0x52, 0x54, 0x0, 0x66, - 0x68, 0x0, 0x6b, 0x70, 0x0, 0x74, - 0x76, 0x0, 0xfc, 0xff }; -static const unsigned char uff[] = { - 0x01, 0x0, 0xbe, 0xc2, 0x0, 0xc7, 0xca, 0x0, - 0xcf, 0xd2, 0x0, 0xd7, 0xda, 0x0, 0xdc, 0xe0, - 0x0, 0xe6, 0xe8, 0x0, 0xee, 0xf9, 0x0, 0xfd }; -static const unsigned char u100[] = { - 0x00, 0x0, 0x0b, 0x0d, 0x0, 0x26, - 0x28, 0x0, 0x3a, 0x3c, 0x3d, 0x3f, 0x0, 0x4d, - 0x50, 0x0, 0x5d, 0x80, 0x0, 0xfa }; -static const unsigned char u101[] = { - 0x00, 0x0, 0x02, 0x07, 0x0, 0x33, - 0x37, 0x0, 0x8a, 0x90, 0x0, 0x9b, - 0xd0, 0x0, 0xfd }; -static const unsigned char u102[] = { - 0x80, 0x0, 0x9c, 0xa0, 0x0, 0xd0 }; -static const unsigned char u103[] = { - 0x00, 0x0, 0x1e, 0x20, 0x0, 0x23, - 0x30, 0x0, 0x4a, 0x80, 0x0, 0x9d, - 0x9f, 0x0, 0xc3, 0xc8, 0x0, 0xd5 }; -static const unsigned char u104[] = { - 0x00, 0x0, 0x9d, 0xa0, 0x0, 0xa9 }; -static const unsigned char u108[] = { - 0x00, 0x0, 0x05, 0x08, 0x0a, 0x0, 0x35, - 0x37, 0x38, 0x3c, 0x3f, 0x0, 0x55, - 0x57, 0x0, 0x5f }; -static const unsigned char u109[] = { - 0x00, 0x0, 0x1b, 0x1f, 0x0, 0x39, 0x3f }; -static const unsigned char u10a[] = { - 0x00, 0x0, 0x03, 0x05, 0x06, 0x0c, 0x0, 0x13, - 0x15, 0x0, 0x17, 0x19, 0x0, 0x33, - 0x38, 0x0, 0x3a, 0x3f, 0x0, 0x47, - 0x50, 0x0, 0x58, 0x60, 0x0, 0x7f }; -static const unsigned char u10b[] = { - 0x00, 0x0, 0x35, 0x39, 0x0, 0x55, - 0x58, 0x0, 0x72, 0x78, 0x0, 0x7f }; -static const unsigned char u10c[] = { - 0x00, 0x0, 0x48 }; -static const unsigned char u10e[] = { - 0x60, 0x0, 0x7e }; -static const unsigned char u110[] = { - 0x80, 0x0, 0xc1 }; -/* u120 to u122 is all-print */ -static const unsigned char u123[] = { - 0x00, 0x0, 0x6e }; -static const unsigned char u124[] = { - 0x00, 0x0, 0x62, 0x70, 0x0, 0x73 }; -/* u130 to u133 is all-print */ -static const unsigned char u134[] = { - 0x00, 0x0, 0x2e }; -static const unsigned char u1d0[] = { - 0x00, 0x0, 0xf5 }; -static const unsigned char u1d1[] = { - 0x00, 0x0, 0x26, 0x29, 0x0, 0xdd }; -static const unsigned char u1d2[] = { - 0x00, 0x0, 0x45 }; -static const unsigned char u1d3[] = { - 0x00, 0x0, 0x56, 0x60, 0x0, 0x71 }; -static const unsigned char u1d4[] = { - 0x00, 0x0, 0x54, 0x56, 0x0, 0x9c, 0x9e, 0x0, - 0x9f, 0xa2, 0xa5, 0x0, 0xa6, 0xa9, 0x0, 0xac, - 0xae, 0x0, 0xb9, 0xbb, 0xbd, 0x0, 0xc3, - 0xc5, 0x0, 0xff }; -static const unsigned char u1d5[] = { - 0x00, 0x0, 0x05, 0x07, 0x0, 0x0a, - 0x0d, 0x0, 0x14, 0x16, 0x0, 0x1c, 0x1e, 0x0, - 0x39, 0x3b, 0x0, 0x3e, 0x40, 0x0, 0x44, 0x46, - 0x4a, 0x0, 0x50, 0x52, 0x0, 0xff }; -static const unsigned char u1d6[] = { - 0x00, 0x0, 0xa5, 0xa8, 0x0, 0xff }; -static const unsigned char u1d7[] = { - 0x00, 0x0, 0xcb, 0xce, 0x0, 0xff }; -static const unsigned char u1f0[] = { - 0x00, 0x0, 0x2b, 0x30, 0x0, 0x93 }; -static const unsigned char u1f1[] = { - 0x00, 0x0, 0x0a, 0x10, 0x0, 0x2e, - 0x31, 0x3d, 0x3f, 0x42, 0x46, 0x4a, 0x0, 0x4e, - 0x57, 0x5f, 0x79, 0x7b, 0x7c, 0x7f, 0x8a, 0x0, - 0x8c, 0x8d, 0x90 }; -static const unsigned char u1f2[] = { - 0x00, 0x10, 0x0, 0x31, 0x40, 0x0, 0x48 }; -/* u200 to u2a5 is all-print */ -static const unsigned char u2a6[] = { - 0x00, 0x0, 0xd6 }; -/* u2a7 to u2b6 is all-print */ -static const unsigned char u2b7[] = { - 0x00, 0x0, 0x34 }; -/* u2f8 to u2f9 is all-print */ -static const unsigned char u2fa[] = { - 0x00, - 0x0, 0x1d }; -static const unsigned char ue00[] = { - 0x01, 0x20, 0x0, 0x7f }; -static const unsigned char ue01[] = { - 0x00, 0x0, 0xef }; -/* uf00 to uffe is all-print */ -static const unsigned char ufff[] = { - 0x00, 0x0, 0xfd }; -/* u1000 to u10fe is all-print */ -static const unsigned char u10ff[] = { - 0x00, 0x0, 0xfd }; diff --git a/newlib/libc/ctype/wctrans.c b/newlib/libc/ctype/wctrans.c index b3ad0bbdb..4a58df152 100644 --- a/newlib/libc/ctype/wctrans.c +++ b/newlib/libc/ctype/wctrans.c @@ -37,18 +37,13 @@ INDEX INDEX wctrans_l -ANSI_SYNOPSIS +SYNOPSIS #include wctrans_t wctrans(const char *<[c]>); #include wctrans_t wctrans_l(const char *<[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - wctrans_t wctrans(<[c]>) - const char * <[c]>; - DESCRIPTION <> is a function which takes a string <[c]> and gives back @@ -80,8 +75,7 @@ No supporting OS subroutines are required. #include "local.h" wctrans_t -_DEFUN (_wctrans_r, (r, c), - struct _reent *r _AND +_wctrans_r (struct _reent *r, const char *c) { if (!strcmp (c, "tolower")) @@ -97,8 +91,7 @@ _DEFUN (_wctrans_r, (r, c), #ifndef _REENT_ONLY wctrans_t -_DEFUN (wctrans, (c), - const char *c) +wctrans (const char *c) { return _wctrans_r (_REENT, c); } diff --git a/newlib/libc/ctype/wctype.c b/newlib/libc/ctype/wctype.c index f32c42151..5f2ae7a25 100644 --- a/newlib/libc/ctype/wctype.c +++ b/newlib/libc/ctype/wctype.c @@ -37,18 +37,13 @@ INDEX INDEX wctype_l -ANSI_SYNOPSIS +SYNOPSIS #include wctype_t wctype(const char *<[c]>); #include wctype_t wctype_l(const char *<[c]>, locale_t <[locale]>); -TRAD_SYNOPSIS - #include - wctype_t wctype(<[c]>) - const char * <[c]>; - DESCRIPTION <> is a function which takes a string <[c]> and gives back @@ -81,8 +76,7 @@ No supporting OS subroutines are required. #include "local.h" wctype_t -_DEFUN (_wctype_r, (r, c), - struct _reent *r _AND +_wctype_r (struct _reent *r, const char *c) { switch (*c) @@ -140,8 +134,7 @@ _DEFUN (_wctype_r, (r, c), #ifndef _REENT_ONLY wctype_t -_DEFUN (wctype, (c), - const char *c) +wctype (const char *c) { return _wctype_r (_REENT, c); } diff --git a/newlib/libc/errno/Makefile.in b/newlib/libc/errno/Makefile.in index 4855f926b..724def236 100644 --- a/newlib/libc/errno/Makefile.in +++ b/newlib/libc/errno/Makefile.in @@ -269,7 +269,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = CHAPTERS = all: all-am @@ -532,8 +532,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/Makefile.in b/newlib/libc/iconv/Makefile.in index 1bdf44b34..3bc64c587 100644 --- a/newlib/libc/iconv/Makefile.in +++ b/newlib/libc/iconv/Makefile.in @@ -276,7 +276,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = iconv.def CHAPTERS = iconv.tex all: all-recursive @@ -606,8 +606,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/ccs/Makefile.in b/newlib/libc/iconv/ccs/Makefile.in index 4de6bc9ad..ff849d544 100644 --- a/newlib/libc/iconv/ccs/Makefile.in +++ b/newlib/libc/iconv/ccs/Makefile.in @@ -360,7 +360,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) all: all-recursive .SUFFIXES: @@ -942,8 +942,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/ccs/big5.c b/newlib/libc/iconv/ccs/big5.c index 45ea59b64..02b20a195 100644 --- a/newlib/libc/iconv/ccs/big5.c +++ b/newlib/libc/iconv/ccs/big5.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_BIG5) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_big5[] = { /* Heading Block */ @@ -2972,7 +2972,7 @@ to_ucs_speed_big5[] = #if defined (ICONV_TO_UCS_CCS_BIG5) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_big5[] = { 0x00B0, /* Ranges number */ @@ -5092,7 +5092,7 @@ to_ucs_size_big5[] = #if defined (ICONV_FROM_UCS_CCS_BIG5) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_big5[] = { /* Heading Block */ @@ -8407,7 +8407,7 @@ from_ucs_speed_big5[] = #if defined (ICONV_FROM_UCS_CCS_BIG5) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_big5[] = { 0x0235, /* Ranges number */ @@ -12579,7 +12579,7 @@ from_ucs_size_big5[] = * big5 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_big5 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/binary/Makefile.in b/newlib/libc/iconv/ccs/binary/Makefile.in index be683c638..0748e7936 100644 --- a/newlib/libc/iconv/ccs/binary/Makefile.in +++ b/newlib/libc/iconv/ccs/binary/Makefile.in @@ -273,7 +273,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) all: all-am .SUFFIXES: @@ -466,8 +466,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/ccs/ccs.h b/newlib/libc/iconv/ccs/ccs.h index d17f4ab91..c640b6444 100644 --- a/newlib/libc/iconv/ccs/ccs.h +++ b/newlib/libc/iconv/ccs/ccs.h @@ -131,12 +131,12 @@ typedef struct { __uint16_t ver; /* Table version */ - _CONST char *name; /* CCS name */ + const char *name; /* CCS name */ __uint16_t bits; /* CCS's bits number */ int from_ucs_type; /* UCS -> CCS table optimization type */ - _CONST __uint16_t *from_ucs; /* UCS -> CCS table */ + const __uint16_t *from_ucs; /* UCS -> CCS table */ int to_ucs_type; /* CCS -> UCS table optimization type */ - _CONST __uint16_t *to_ucs; /* CCS -> UCS table */ + const __uint16_t *to_ucs; /* CCS -> UCS table */ } iconv_ccs_t; /* @@ -147,11 +147,11 @@ typedef struct int bits; /* CCS's bits number */ int type; /* Table type (builtin/external) */ int optimization; /* Table optimization type (speed/size) */ - _CONST __uint16_t *tbl; /* Table's data */ + const __uint16_t *tbl; /* Table's data */ } iconv_ccs_desc_t; /* Array containing all built-in CCS tables */ -extern _CONST iconv_ccs_t * +extern const iconv_ccs_t * _iconv_ccs[]; #endif /* __CCS_H__ */ diff --git a/newlib/libc/iconv/ccs/ccsbi.c b/newlib/libc/iconv/ccs/ccsbi.c index d79a2ce91..6bb489aa6 100644 --- a/newlib/libc/iconv/ccs/ccsbi.c +++ b/newlib/libc/iconv/ccs/ccsbi.c @@ -8,7 +8,7 @@ /* * The following array contains the list of built-in CCS tables. */ -_CONST iconv_ccs_t * +const iconv_ccs_t * _iconv_ccs[] = { #if defined (ICONV_TO_UCS_CCS_CP775) \ diff --git a/newlib/libc/iconv/ccs/ccsbi.h b/newlib/libc/iconv/ccs/ccsbi.h index 268cac30e..97a88a0e7 100644 --- a/newlib/libc/iconv/ccs/ccsbi.h +++ b/newlib/libc/iconv/ccs/ccsbi.h @@ -310,207 +310,207 @@ */ #if defined (ICONV_TO_UCS_CCS_BIG5) \ || defined (ICONV_FROM_UCS_CCS_BIG5) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_big5; #endif #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE1) \ || defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE1) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cns11643_plane1; #endif #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE14) \ || defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE14) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cns11643_plane14; #endif #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \ || defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cns11643_plane2; #endif #if defined (ICONV_TO_UCS_CCS_CP775) \ || defined (ICONV_FROM_UCS_CCS_CP775) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cp775; #endif #if defined (ICONV_TO_UCS_CCS_CP850) \ || defined (ICONV_FROM_UCS_CCS_CP850) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cp850; #endif #if defined (ICONV_TO_UCS_CCS_CP852) \ || defined (ICONV_FROM_UCS_CCS_CP852) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cp852; #endif #if defined (ICONV_TO_UCS_CCS_CP855) \ || defined (ICONV_FROM_UCS_CCS_CP855) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cp855; #endif #if defined (ICONV_TO_UCS_CCS_CP866) \ || defined (ICONV_FROM_UCS_CCS_CP866) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_cp866; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_1) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_1) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_1; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_10) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_10) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_10; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_11) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_11) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_11; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_13) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_13) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_13; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_14) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_14) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_14; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_15) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_15) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_15; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_2) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_2) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_2; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_3) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_3) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_3; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_4) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_4) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_4; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_5) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_5) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_5; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_6) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_6) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_6; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_7) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_7) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_7; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_8) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_8) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_8; #endif #if defined (ICONV_TO_UCS_CCS_ISO_8859_9) \ || defined (ICONV_FROM_UCS_CCS_ISO_8859_9) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_8859_9; #endif #if defined (ICONV_TO_UCS_CCS_ISO_IR_111) \ || defined (ICONV_FROM_UCS_CCS_ISO_IR_111) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_iso_ir_111; #endif #if defined (ICONV_TO_UCS_CCS_JIS_X0201_1976) \ || defined (ICONV_FROM_UCS_CCS_JIS_X0201_1976) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_jis_x0201_1976; #endif #if defined (ICONV_TO_UCS_CCS_JIS_X0208_1990) \ || defined (ICONV_FROM_UCS_CCS_JIS_X0208_1990) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_jis_x0208_1990; #endif #if defined (ICONV_TO_UCS_CCS_JIS_X0212_1990) \ || defined (ICONV_FROM_UCS_CCS_JIS_X0212_1990) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_jis_x0212_1990; #endif #if defined (ICONV_TO_UCS_CCS_KOI8_R) \ || defined (ICONV_FROM_UCS_CCS_KOI8_R) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_koi8_r; #endif #if defined (ICONV_TO_UCS_CCS_KOI8_RU) \ || defined (ICONV_FROM_UCS_CCS_KOI8_RU) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_koi8_ru; #endif #if defined (ICONV_TO_UCS_CCS_KOI8_U) \ || defined (ICONV_FROM_UCS_CCS_KOI8_U) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_koi8_u; #endif #if defined (ICONV_TO_UCS_CCS_KOI8_UNI) \ || defined (ICONV_FROM_UCS_CCS_KOI8_UNI) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_koi8_uni; #endif #if defined (ICONV_TO_UCS_CCS_KSX1001) \ || defined (ICONV_FROM_UCS_CCS_KSX1001) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_ksx1001; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1250) \ || defined (ICONV_FROM_UCS_CCS_WIN_1250) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1250; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1251) \ || defined (ICONV_FROM_UCS_CCS_WIN_1251) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1251; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1252) \ || defined (ICONV_FROM_UCS_CCS_WIN_1252) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1252; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1253) \ || defined (ICONV_FROM_UCS_CCS_WIN_1253) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1253; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1254) \ || defined (ICONV_FROM_UCS_CCS_WIN_1254) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1254; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1255) \ || defined (ICONV_FROM_UCS_CCS_WIN_1255) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1255; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1256) \ || defined (ICONV_FROM_UCS_CCS_WIN_1256) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1256; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1257) \ || defined (ICONV_FROM_UCS_CCS_WIN_1257) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1257; #endif #if defined (ICONV_TO_UCS_CCS_WIN_1258) \ || defined (ICONV_FROM_UCS_CCS_WIN_1258) -extern _CONST iconv_ccs_t +extern const iconv_ccs_t _iconv_ccs_win_1258; #endif diff --git a/newlib/libc/iconv/ccs/cns11643_plane1.c b/newlib/libc/iconv/ccs/cns11643_plane1.c index 37e31a9a8..da1c0597c 100644 --- a/newlib/libc/iconv/ccs/cns11643_plane1.c +++ b/newlib/libc/iconv/ccs/cns11643_plane1.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE1) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cns11643_plane1[] = { /* Heading Block */ @@ -2213,7 +2213,7 @@ to_ucs_speed_cns11643_plane1[] = #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE1) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_cns11643_plane1[] = { 0x0042, /* Ranges number */ @@ -3118,7 +3118,7 @@ to_ucs_size_cns11643_plane1[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE1) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_cns11643_plane1[] = { /* Heading Block */ @@ -6367,7 +6367,7 @@ from_ucs_speed_cns11643_plane1[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE1) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_cns11643_plane1[] = { 0x017D, /* Ranges number */ @@ -11175,7 +11175,7 @@ from_ucs_size_cns11643_plane1[] = * cns11643_plane1 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cns11643_plane1 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cns11643_plane14.c b/newlib/libc/iconv/ccs/cns11643_plane14.c index 18230d5ab..507cdef65 100644 --- a/newlib/libc/iconv/ccs/cns11643_plane14.c +++ b/newlib/libc/iconv/ccs/cns11643_plane14.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE14) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cns11643_plane14[] = { /* Heading Block */ @@ -2411,7 +2411,7 @@ to_ucs_speed_cns11643_plane14[] = #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE14) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_cns11643_plane14[] = { 0x00DE, /* Ranges number */ @@ -4011,7 +4011,7 @@ to_ucs_size_cns11643_plane14[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE14) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_cns11643_plane14[] = { /* Heading Block */ @@ -6765,7 +6765,7 @@ from_ucs_speed_cns11643_plane14[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE14) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_cns11643_plane14[] = { 0x00C5, /* Ranges number */ @@ -10727,7 +10727,7 @@ from_ucs_size_cns11643_plane14[] = * cns11643_plane14 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cns11643_plane14 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cns11643_plane2.c b/newlib/libc/iconv/ccs/cns11643_plane2.c index c591ce38d..15c287f0b 100644 --- a/newlib/libc/iconv/ccs/cns11643_plane2.c +++ b/newlib/libc/iconv/ccs/cns11643_plane2.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cns11643_plane2[] = { /* Heading Block */ @@ -2774,7 +2774,7 @@ to_ucs_speed_cns11643_plane2[] = #if defined (ICONV_TO_UCS_CCS_CNS11643_PLANE2) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_cns11643_plane2[] = { 0x0052, /* Ranges number */ @@ -3936,7 +3936,7 @@ to_ucs_size_cns11643_plane2[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_cns11643_plane2[] = { /* Heading Block */ @@ -6690,7 +6690,7 @@ from_ucs_speed_cns11643_plane2[] = #if defined (ICONV_FROM_UCS_CCS_CNS11643_PLANE2) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_cns11643_plane2[] = { 0x027E, /* Ranges number */ @@ -11912,7 +11912,7 @@ from_ucs_size_cns11643_plane2[] = * cns11643_plane2 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cns11643_plane2 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cp775.c b/newlib/libc/iconv/ccs/cp775.c index c35a87c11..f7c4af58c 100644 --- a/newlib/libc/iconv/ccs/cp775.c +++ b/newlib/libc/iconv/ccs/cp775.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_CP775) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cp775[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_cp775[] = #if defined (ICONV_FROM_UCS_CCS_CP775) -static _CONST unsigned char +static const unsigned char from_ucs_speed_cp775[] = { W(0x00A0), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_cp775[] = * cp775 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cp775 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cp850.c b/newlib/libc/iconv/ccs/cp850.c index 305ae85d1..57f5906d1 100644 --- a/newlib/libc/iconv/ccs/cp850.c +++ b/newlib/libc/iconv/ccs/cp850.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_CP850) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cp850[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_cp850[] = #if defined (ICONV_FROM_UCS_CCS_CP850) -static _CONST unsigned char +static const unsigned char from_ucs_speed_cp850[] = { W(0x00A0), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -284,7 +284,7 @@ from_ucs_speed_cp850[] = * cp850 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cp850 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cp852.c b/newlib/libc/iconv/ccs/cp852.c index 73a1e0f03..c622da499 100644 --- a/newlib/libc/iconv/ccs/cp852.c +++ b/newlib/libc/iconv/ccs/cp852.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_CP852) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cp852[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_cp852[] = #if defined (ICONV_FROM_UCS_CCS_CP852) -static _CONST unsigned char +static const unsigned char from_ucs_speed_cp852[] = { W(0x00A0), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -284,7 +284,7 @@ from_ucs_speed_cp852[] = * cp852 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cp852 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cp855.c b/newlib/libc/iconv/ccs/cp855.c index 2add727ea..41c52ed93 100644 --- a/newlib/libc/iconv/ccs/cp855.c +++ b/newlib/libc/iconv/ccs/cp855.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_CP855) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cp855[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_cp855[] = #if defined (ICONV_FROM_UCS_CCS_CP855) -static _CONST unsigned char +static const unsigned char from_ucs_speed_cp855[] = { W(0x00A0), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -284,7 +284,7 @@ from_ucs_speed_cp855[] = * cp855 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cp855 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/cp866.c b/newlib/libc/iconv/ccs/cp866.c index 678ea4232..c1dacd8f1 100644 --- a/newlib/libc/iconv/ccs/cp866.c +++ b/newlib/libc/iconv/ccs/cp866.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_CP866) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_cp866[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_cp866[] = #if defined (ICONV_FROM_UCS_CCS_CP866) -static _CONST unsigned char +static const unsigned char from_ucs_speed_cp866[] = { W(0x00A0), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_cp866[] = * cp866 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_cp866 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_1.c b/newlib/libc/iconv/ccs/iso_8859_1.c index a23947775..775bca654 100644 --- a/newlib/libc/iconv/ccs/iso_8859_1.c +++ b/newlib/libc/iconv/ccs/iso_8859_1.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_1) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_1[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_1[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_1) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_1[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -185,7 +185,7 @@ from_ucs_speed_iso_8859_1[] = * iso_8859_1 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_1 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_10.c b/newlib/libc/iconv/ccs/iso_8859_10.c index 1848afd66..b221a6a82 100644 --- a/newlib/libc/iconv/ccs/iso_8859_10.c +++ b/newlib/libc/iconv/ccs/iso_8859_10.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_10) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_10[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_10[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_10) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_10[] = { W(0x0138), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_10[] = * iso_8859_10 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_10 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_11.c b/newlib/libc/iconv/ccs/iso_8859_11.c index 97cc0757e..ebb5ec6d9 100644 --- a/newlib/libc/iconv/ccs/iso_8859_11.c +++ b/newlib/libc/iconv/ccs/iso_8859_11.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_11) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_11[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_11[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_11) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_11[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -218,7 +218,7 @@ from_ucs_speed_iso_8859_11[] = * iso_8859_11 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_11 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_13.c b/newlib/libc/iconv/ccs/iso_8859_13.c index 88a2a6f40..3905cef65 100644 --- a/newlib/libc/iconv/ccs/iso_8859_13.c +++ b/newlib/libc/iconv/ccs/iso_8859_13.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_13) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_13[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_13[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_13) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_13[] = { W(0x2019), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_13[] = * iso_8859_13 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_13 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_14.c b/newlib/libc/iconv/ccs/iso_8859_14.c index 28052a7b7..114d2df33 100644 --- a/newlib/libc/iconv/ccs/iso_8859_14.c +++ b/newlib/libc/iconv/ccs/iso_8859_14.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_14) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_14[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_14[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_14) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_14[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_14[] = * iso_8859_14 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_14 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_15.c b/newlib/libc/iconv/ccs/iso_8859_15.c index da3cfc3bb..52dff022b 100644 --- a/newlib/libc/iconv/ccs/iso_8859_15.c +++ b/newlib/libc/iconv/ccs/iso_8859_15.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_15) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_15[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_15[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_15) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_15[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_15[] = * iso_8859_15 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_15 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_2.c b/newlib/libc/iconv/ccs/iso_8859_2.c index 5a1966632..ecb374e4d 100644 --- a/newlib/libc/iconv/ccs/iso_8859_2.c +++ b/newlib/libc/iconv/ccs/iso_8859_2.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_2) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_2[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_2[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_2) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_2[] = { W(0x02D9), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_2[] = * iso_8859_2 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_2 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_3.c b/newlib/libc/iconv/ccs/iso_8859_3.c index a69fcb362..6f8003402 100644 --- a/newlib/libc/iconv/ccs/iso_8859_3.c +++ b/newlib/libc/iconv/ccs/iso_8859_3.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_3) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_3[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_3[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_3) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_3[] = { W(0x02D9), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_3[] = * iso_8859_3 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_3 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_4.c b/newlib/libc/iconv/ccs/iso_8859_4.c index 0cec45823..b080e2d29 100644 --- a/newlib/libc/iconv/ccs/iso_8859_4.c +++ b/newlib/libc/iconv/ccs/iso_8859_4.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_4) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_4[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_4[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_4) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_4[] = { W(0x02D9), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_4[] = * iso_8859_4 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_4 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_5.c b/newlib/libc/iconv/ccs/iso_8859_5.c index e4765ffef..b4b0c3f47 100644 --- a/newlib/libc/iconv/ccs/iso_8859_5.c +++ b/newlib/libc/iconv/ccs/iso_8859_5.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_5) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_5[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_5[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_5) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_5[] = { W(0x045F), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_5[] = * iso_8859_5 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_5 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_6.c b/newlib/libc/iconv/ccs/iso_8859_6.c index 783cf1f36..9967841f4 100644 --- a/newlib/libc/iconv/ccs/iso_8859_6.c +++ b/newlib/libc/iconv/ccs/iso_8859_6.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_6) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_6[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_6[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_6) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_6[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -218,7 +218,7 @@ from_ucs_speed_iso_8859_6[] = * iso_8859_6 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_6 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_7.c b/newlib/libc/iconv/ccs/iso_8859_7.c index e964a02e6..41d3400ce 100644 --- a/newlib/libc/iconv/ccs/iso_8859_7.c +++ b/newlib/libc/iconv/ccs/iso_8859_7.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_7) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_7[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_7[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_7) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_7[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_7[] = * iso_8859_7 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_7 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_8.c b/newlib/libc/iconv/ccs/iso_8859_8.c index bf49604db..029a4b873 100644 --- a/newlib/libc/iconv/ccs/iso_8859_8.c +++ b/newlib/libc/iconv/ccs/iso_8859_8.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_8) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_8[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_8[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_8) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_8[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_8859_8[] = * iso_8859_8 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_8 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_8859_9.c b/newlib/libc/iconv/ccs/iso_8859_9.c index 20fbb8424..b787b9815 100644 --- a/newlib/libc/iconv/ccs/iso_8859_9.c +++ b/newlib/libc/iconv/ccs/iso_8859_9.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_8859_9) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_8859_9[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_8859_9[] = #if defined (ICONV_FROM_UCS_CCS_ISO_8859_9) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_8859_9[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -218,7 +218,7 @@ from_ucs_speed_iso_8859_9[] = * iso_8859_9 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_8859_9 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/iso_ir_111.c b/newlib/libc/iconv/ccs/iso_ir_111.c index 0e9bcc4da..7d05ef4d5 100644 --- a/newlib/libc/iconv/ccs/iso_ir_111.c +++ b/newlib/libc/iconv/ccs/iso_ir_111.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_ISO_IR_111) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_iso_ir_111[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_iso_ir_111[] = #if defined (ICONV_FROM_UCS_CCS_ISO_IR_111) -static _CONST unsigned char +static const unsigned char from_ucs_speed_iso_ir_111[] = { W(0x042A), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -251,7 +251,7 @@ from_ucs_speed_iso_ir_111[] = * iso_ir_111 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_iso_ir_111 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/jis_x0201_1976.c b/newlib/libc/iconv/ccs/jis_x0201_1976.c index e5cdb5fdd..ca949861d 100644 --- a/newlib/libc/iconv/ccs/jis_x0201_1976.c +++ b/newlib/libc/iconv/ccs/jis_x0201_1976.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_JIS_X0201_1976) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_jis_x0201_1976[] = { INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC,INVALC, @@ -75,7 +75,7 @@ to_ucs_speed_jis_x0201_1976[] = #if defined (ICONV_FROM_UCS_CCS_JIS_X0201_1976) -static _CONST unsigned char +static const unsigned char from_ucs_speed_jis_x0201_1976[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -185,7 +185,7 @@ from_ucs_speed_jis_x0201_1976[] = * jis_x0201_1976 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_jis_x0201_1976 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/jis_x0208_1990.c b/newlib/libc/iconv/ccs/jis_x0208_1990.c index c12d13482..070e0e4b0 100644 --- a/newlib/libc/iconv/ccs/jis_x0208_1990.c +++ b/newlib/libc/iconv/ccs/jis_x0208_1990.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_JIS_X0208_1990) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_jis_x0208_1990[] = { /* Heading Block */ @@ -2609,7 +2609,7 @@ to_ucs_speed_jis_x0208_1990[] = #if defined (ICONV_TO_UCS_CCS_JIS_X0208_1990) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_jis_x0208_1990[] = { 0x0055, /* Ranges number */ @@ -3684,7 +3684,7 @@ to_ucs_size_jis_x0208_1990[] = #if defined (ICONV_FROM_UCS_CCS_JIS_X0208_1990) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_jis_x0208_1990[] = { /* Heading Block */ @@ -6801,7 +6801,7 @@ from_ucs_speed_jis_x0208_1990[] = #if defined (ICONV_FROM_UCS_CCS_JIS_X0208_1990) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_jis_x0208_1990[] = { 0x01E9, /* Ranges number */ @@ -12125,7 +12125,7 @@ from_ucs_size_jis_x0208_1990[] = * jis_x0208_1990 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_jis_x0208_1990 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/jis_x0212_1990.c b/newlib/libc/iconv/ccs/jis_x0212_1990.c index eb8882f46..613de7d35 100644 --- a/newlib/libc/iconv/ccs/jis_x0212_1990.c +++ b/newlib/libc/iconv/ccs/jis_x0212_1990.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_JIS_X0212_1990) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_jis_x0212_1990[] = { /* Heading Block */ @@ -2312,7 +2312,7 @@ to_ucs_speed_jis_x0212_1990[] = #if defined (ICONV_TO_UCS_CCS_JIS_X0212_1990) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_jis_x0212_1990[] = { 0x0049, /* Ranges number */ @@ -3262,7 +3262,7 @@ to_ucs_size_jis_x0212_1990[] = #if defined (ICONV_FROM_UCS_CCS_JIS_X0212_1990) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_jis_x0212_1990[] = { /* Heading Block */ @@ -6214,7 +6214,7 @@ from_ucs_speed_jis_x0212_1990[] = #if defined (ICONV_FROM_UCS_CCS_JIS_X0212_1990) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_jis_x0212_1990[] = { 0x01AA, /* Ranges number */ @@ -11349,7 +11349,7 @@ from_ucs_size_jis_x0212_1990[] = * jis_x0212_1990 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_jis_x0212_1990 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/koi8_r.c b/newlib/libc/iconv/ccs/koi8_r.c index cccb7c1d5..698652e74 100644 --- a/newlib/libc/iconv/ccs/koi8_r.c +++ b/newlib/libc/iconv/ccs/koi8_r.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_KOI8_R) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_koi8_r[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_koi8_r[] = #if defined (ICONV_FROM_UCS_CCS_KOI8_R) -static _CONST unsigned char +static const unsigned char from_ucs_speed_koi8_r[] = { W(0x042A), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_koi8_r[] = * koi8_r CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_koi8_r = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/koi8_ru.c b/newlib/libc/iconv/ccs/koi8_ru.c index 704ce95b0..956dc7802 100644 --- a/newlib/libc/iconv/ccs/koi8_ru.c +++ b/newlib/libc/iconv/ccs/koi8_ru.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_KOI8_RU) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_koi8_ru[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_koi8_ru[] = #if defined (ICONV_FROM_UCS_CCS_KOI8_RU) -static _CONST unsigned char +static const unsigned char from_ucs_speed_koi8_ru[] = { W(0x042A), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -350,7 +350,7 @@ from_ucs_speed_koi8_ru[] = * koi8_ru CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_koi8_ru = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/koi8_u.c b/newlib/libc/iconv/ccs/koi8_u.c index ebe0c9172..d271e7e88 100644 --- a/newlib/libc/iconv/ccs/koi8_u.c +++ b/newlib/libc/iconv/ccs/koi8_u.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_KOI8_U) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_koi8_u[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_koi8_u[] = #if defined (ICONV_FROM_UCS_CCS_KOI8_U) -static _CONST unsigned char +static const unsigned char from_ucs_speed_koi8_u[] = { W(0x042A), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_koi8_u[] = * koi8_u CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_koi8_u = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/koi8_uni.c b/newlib/libc/iconv/ccs/koi8_uni.c index 5596c2d91..4523d1c78 100644 --- a/newlib/libc/iconv/ccs/koi8_uni.c +++ b/newlib/libc/iconv/ccs/koi8_uni.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_KOI8_UNI) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_koi8_uni[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_koi8_uni[] = #if defined (ICONV_FROM_UCS_CCS_KOI8_UNI) -static _CONST unsigned char +static const unsigned char from_ucs_speed_koi8_uni[] = { W(0x042A), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -350,7 +350,7 @@ from_ucs_speed_koi8_uni[] = * koi8_uni CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_koi8_uni = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/ksx1001.c b/newlib/libc/iconv/ccs/ksx1001.c index ad2c30d73..5690e4acc 100644 --- a/newlib/libc/iconv/ccs/ksx1001.c +++ b/newlib/libc/iconv/ccs/ksx1001.c @@ -21,7 +21,7 @@ #if defined (ICONV_TO_UCS_CCS_KSX1001) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_ksx1001[] = { /* Heading Block */ @@ -3005,7 +3005,7 @@ to_ucs_speed_ksx1001[] = #if defined (ICONV_TO_UCS_CCS_KSX1001) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t to_ucs_size_ksx1001[] = { 0x005D, /* Ranges number */ @@ -4266,7 +4266,7 @@ to_ucs_size_ksx1001[] = #if defined (ICONV_FROM_UCS_CCS_KSX1001) \ && !(defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_speed_ksx1001[] = { /* Heading Block */ @@ -9099,7 +9099,7 @@ from_ucs_speed_ksx1001[] = #if defined (ICONV_FROM_UCS_CCS_KSX1001) \ && (defined (TABLE_USE_SIZE_OPTIMIZATION)) -static _CONST __uint16_t +static const __uint16_t from_ucs_size_ksx1001[] = { 0x01B6, /* Ranges number */ @@ -15576,7 +15576,7 @@ from_ucs_size_ksx1001[] = * ksx1001 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_ksx1001 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/mktbl.pl b/newlib/libc/iconv/ccs/mktbl.pl index c3b87932b..633511e4d 100755 --- a/newlib/libc/iconv/ccs/mktbl.pl +++ b/newlib/libc/iconv/ccs/mktbl.pl @@ -343,7 +343,7 @@ if ($Source) * $CCSName CCS description table. * $Separator */ -_CONST $TypeBICCS +const $TypeBICCS $VarBICCS = { \t$MacroVer1Table, /* Table version */ @@ -807,7 +807,7 @@ sub Output8bitToUCS(;$) */ #if defined ($GuardToUCS) -static _CONST __uint16_t +static const __uint16_t ${VarToUCSSpeed}\[] = {\n\t"; } @@ -872,7 +872,7 @@ sub Output8bitFromUCS(;$) #if defined ($GuardFromUCS) -static _CONST unsigned char +static const unsigned char ${VarFromUCSSpeed}\[] = { "; @@ -995,7 +995,7 @@ sub OutputSpeed($;$) #if defined ($GuardToUCS) \\ && !($GuardSize) -static _CONST __uint16_t +static const __uint16_t ${VarToUCSSpeed}\[] = { "; @@ -1018,7 +1018,7 @@ ${VarToUCSSpeed}\[] = #if defined ($GuardFromUCS) \\ && !($GuardSize) -static _CONST __uint16_t +static const __uint16_t ${VarFromUCSSpeed}\[] = { "; @@ -1149,7 +1149,7 @@ sub OutputSize($;$) #if defined ($GuardToUCS) \\ && ($GuardSize) -static _CONST __uint16_t +static const __uint16_t ${VarToUCSSize}\[] = { "; @@ -1171,7 +1171,7 @@ ${VarToUCSSize}\[] = #if defined ($GuardFromUCS) \\ && ($GuardSize) -static _CONST __uint16_t +static const __uint16_t ${VarFromUCSSize}\[] = { "; diff --git a/newlib/libc/iconv/ccs/win_1250.c b/newlib/libc/iconv/ccs/win_1250.c index e43eb8d3e..d86d6a0ad 100644 --- a/newlib/libc/iconv/ccs/win_1250.c +++ b/newlib/libc/iconv/ccs/win_1250.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1250) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1250[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1250[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1250) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1250[] = { W(0x02D9), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_win_1250[] = * win_1250 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1250 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1251.c b/newlib/libc/iconv/ccs/win_1251.c index 7e9b4c339..195fc0a60 100644 --- a/newlib/libc/iconv/ccs/win_1251.c +++ b/newlib/libc/iconv/ccs/win_1251.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1251) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1251[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1251[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1251) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1251[] = { W(0x044F), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -284,7 +284,7 @@ from_ucs_speed_win_1251[] = * win_1251 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1251 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1252.c b/newlib/libc/iconv/ccs/win_1252.c index 659054fc4..463cabdfb 100644 --- a/newlib/libc/iconv/ccs/win_1252.c +++ b/newlib/libc/iconv/ccs/win_1252.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1252) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1252[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1252[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1252) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1252[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_win_1252[] = * win_1252 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1252 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1253.c b/newlib/libc/iconv/ccs/win_1253.c index 450813320..c9abd81da 100644 --- a/newlib/libc/iconv/ccs/win_1253.c +++ b/newlib/libc/iconv/ccs/win_1253.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1253) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1253[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1253[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1253) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1253[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_win_1253[] = * win_1253 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1253 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1254.c b/newlib/libc/iconv/ccs/win_1254.c index 3c1599add..05ed88efb 100644 --- a/newlib/libc/iconv/ccs/win_1254.c +++ b/newlib/libc/iconv/ccs/win_1254.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1254) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1254[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1254[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1254) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1254[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_win_1254[] = * win_1254 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1254 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1255.c b/newlib/libc/iconv/ccs/win_1255.c index 937afca5b..47e9c0129 100644 --- a/newlib/libc/iconv/ccs/win_1255.c +++ b/newlib/libc/iconv/ccs/win_1255.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1255) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1255[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1255[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1255) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1255[] = { W(0xFFFF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -350,7 +350,7 @@ from_ucs_speed_win_1255[] = * win_1255 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1255 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1256.c b/newlib/libc/iconv/ccs/win_1256.c index 44d451987..93a1f074d 100644 --- a/newlib/libc/iconv/ccs/win_1256.c +++ b/newlib/libc/iconv/ccs/win_1256.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1256) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1256[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1256[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1256) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1256[] = { W(0x06D2), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -350,7 +350,7 @@ from_ucs_speed_win_1256[] = * win_1256 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1256 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1257.c b/newlib/libc/iconv/ccs/win_1257.c index ad497cbf4..4f9fa39a7 100644 --- a/newlib/libc/iconv/ccs/win_1257.c +++ b/newlib/libc/iconv/ccs/win_1257.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1257) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1257[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1257[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1257) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1257[] = { W(0x02D9), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -317,7 +317,7 @@ from_ucs_speed_win_1257[] = * win_1257 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1257 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ccs/win_1258.c b/newlib/libc/iconv/ccs/win_1258.c index 7331d78d9..42ec24724 100644 --- a/newlib/libc/iconv/ccs/win_1258.c +++ b/newlib/libc/iconv/ccs/win_1258.c @@ -28,7 +28,7 @@ */ #if defined (ICONV_TO_UCS_CCS_WIN_1258) -static _CONST __uint16_t +static const __uint16_t to_ucs_speed_win_1258[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, @@ -75,7 +75,7 @@ to_ucs_speed_win_1258[] = #if defined (ICONV_FROM_UCS_CCS_WIN_1258) -static _CONST unsigned char +static const unsigned char from_ucs_speed_win_1258[] = { W(0x00FF), /* Real 0xFF mapping. 0xFF is used to mark invalid codes */ @@ -350,7 +350,7 @@ from_ucs_speed_win_1258[] = * win_1258 CCS description table. * ====================================================================== */ -_CONST iconv_ccs_t +const iconv_ccs_t _iconv_ccs_win_1258 = { TABLE_VERSION_1, /* Table version */ diff --git a/newlib/libc/iconv/ces/Makefile.in b/newlib/libc/iconv/ces/Makefile.in index b4c17c536..ab3836096 100644 --- a/newlib/libc/iconv/ces/Makefile.in +++ b/newlib/libc/iconv/ces/Makefile.in @@ -296,7 +296,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = CHAPTERS = all: all-am @@ -607,8 +607,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/ces/cesbi.c b/newlib/libc/iconv/ces/cesbi.c index c2e6520a3..5fa5d1b4c 100644 --- a/newlib/libc/iconv/ces/cesbi.c +++ b/newlib/libc/iconv/ces/cesbi.c @@ -12,7 +12,7 @@ */ #if defined (ICONV_TO_UCS_CES_EUC) \ || defined (ICONV_FROM_UCS_CES_EUC) -static _CONST char * +static const char * iconv_ces_names_euc[] = { # if defined (_ICONV_FROM_ENCODING_EUC_JP) \ @@ -33,7 +33,7 @@ iconv_ces_names_euc[] = #if defined (ICONV_TO_UCS_CES_TABLE) \ || defined (ICONV_FROM_UCS_CES_TABLE) -static _CONST char * +static const char * iconv_ces_names_table[] = { # if defined (_ICONV_FROM_ENCODING_CP775) \ @@ -174,7 +174,7 @@ iconv_ces_names_table[] = #if defined (ICONV_TO_UCS_CES_TABLE_PCS) \ || defined (ICONV_FROM_UCS_CES_TABLE_PCS) -static _CONST char * +static const char * iconv_ces_names_table_pcs[] = { # if defined (_ICONV_FROM_ENCODING_BIG5) \ @@ -187,7 +187,7 @@ iconv_ces_names_table_pcs[] = #if defined (ICONV_TO_UCS_CES_UCS_2) \ || defined (ICONV_FROM_UCS_CES_UCS_2) -static _CONST char * +static const char * iconv_ces_names_ucs_2[] = { # if defined (_ICONV_FROM_ENCODING_UCS_2) \ @@ -208,7 +208,7 @@ iconv_ces_names_ucs_2[] = #if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL) \ || defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL) -static _CONST char * +static const char * iconv_ces_names_ucs_2_internal[] = { # if defined (_ICONV_FROM_ENCODING_UCS_2_INTERNAL) \ @@ -221,7 +221,7 @@ iconv_ces_names_ucs_2_internal[] = #if defined (ICONV_TO_UCS_CES_UCS_4) \ || defined (ICONV_FROM_UCS_CES_UCS_4) -static _CONST char * +static const char * iconv_ces_names_ucs_4[] = { # if defined (_ICONV_FROM_ENCODING_UCS_4) \ @@ -242,7 +242,7 @@ iconv_ces_names_ucs_4[] = #if defined (ICONV_TO_UCS_CES_UCS_4_INTERNAL) \ || defined (ICONV_FROM_UCS_CES_UCS_4_INTERNAL) -static _CONST char * +static const char * iconv_ces_names_ucs_4_internal[] = { # if defined (_ICONV_FROM_ENCODING_UCS_4_INTERNAL) \ @@ -255,7 +255,7 @@ iconv_ces_names_ucs_4_internal[] = #if defined (ICONV_TO_UCS_CES_US_ASCII) \ || defined (ICONV_FROM_UCS_CES_US_ASCII) -static _CONST char * +static const char * iconv_ces_names_us_ascii[] = { # if defined (_ICONV_FROM_ENCODING_US_ASCII) \ @@ -268,7 +268,7 @@ iconv_ces_names_us_ascii[] = #if defined (ICONV_TO_UCS_CES_UTF_16) \ || defined (ICONV_FROM_UCS_CES_UTF_16) -static _CONST char * +static const char * iconv_ces_names_utf_16[] = { # if defined (_ICONV_FROM_ENCODING_UTF_16) \ @@ -289,7 +289,7 @@ iconv_ces_names_utf_16[] = #if defined (ICONV_TO_UCS_CES_UTF_8) \ || defined (ICONV_FROM_UCS_CES_UTF_8) -static _CONST char * +static const char * iconv_ces_names_utf_8[] = { # if defined (_ICONV_FROM_ENCODING_UTF_8) \ @@ -303,99 +303,99 @@ iconv_ces_names_utf_8[] = /* * The following structure contains the list of "to UCS" linked-in CES converters. */ -_CONST iconv_to_ucs_ces_t +const iconv_to_ucs_ces_t _iconv_to_ucs_ces[] = { #ifdef ICONV_TO_UCS_CES_EUC - {(_CONST char **)iconv_ces_names_euc, + {(const char **)iconv_ces_names_euc, &_iconv_to_ucs_ces_handlers_euc}, #endif #ifdef ICONV_TO_UCS_CES_TABLE - {(_CONST char **)iconv_ces_names_table, + {(const char **)iconv_ces_names_table, &_iconv_to_ucs_ces_handlers_table}, #endif #ifdef ICONV_TO_UCS_CES_TABLE_PCS - {(_CONST char **)iconv_ces_names_table_pcs, + {(const char **)iconv_ces_names_table_pcs, &_iconv_to_ucs_ces_handlers_table_pcs}, #endif #ifdef ICONV_TO_UCS_CES_UCS_2 - {(_CONST char **)iconv_ces_names_ucs_2, + {(const char **)iconv_ces_names_ucs_2, &_iconv_to_ucs_ces_handlers_ucs_2}, #endif #ifdef ICONV_TO_UCS_CES_UCS_2_INTERNAL - {(_CONST char **)iconv_ces_names_ucs_2_internal, + {(const char **)iconv_ces_names_ucs_2_internal, &_iconv_to_ucs_ces_handlers_ucs_2_internal}, #endif #ifdef ICONV_TO_UCS_CES_UCS_4 - {(_CONST char **)iconv_ces_names_ucs_4, + {(const char **)iconv_ces_names_ucs_4, &_iconv_to_ucs_ces_handlers_ucs_4}, #endif #ifdef ICONV_TO_UCS_CES_UCS_4_INTERNAL - {(_CONST char **)iconv_ces_names_ucs_4_internal, + {(const char **)iconv_ces_names_ucs_4_internal, &_iconv_to_ucs_ces_handlers_ucs_4_internal}, #endif #ifdef ICONV_TO_UCS_CES_US_ASCII - {(_CONST char **)iconv_ces_names_us_ascii, + {(const char **)iconv_ces_names_us_ascii, &_iconv_to_ucs_ces_handlers_us_ascii}, #endif #ifdef ICONV_TO_UCS_CES_UTF_16 - {(_CONST char **)iconv_ces_names_utf_16, + {(const char **)iconv_ces_names_utf_16, &_iconv_to_ucs_ces_handlers_utf_16}, #endif #ifdef ICONV_TO_UCS_CES_UTF_8 - {(_CONST char **)iconv_ces_names_utf_8, + {(const char **)iconv_ces_names_utf_8, &_iconv_to_ucs_ces_handlers_utf_8}, #endif - {(_CONST char **)NULL, + {(const char **)NULL, (iconv_to_ucs_ces_handlers_t *)NULL} }; /* * The following structure contains the list of "from UCS" linked-in CES converters. */ -_CONST iconv_from_ucs_ces_t +const iconv_from_ucs_ces_t _iconv_from_ucs_ces[] = { #ifdef ICONV_FROM_UCS_CES_EUC - {(_CONST char **)iconv_ces_names_euc, + {(const char **)iconv_ces_names_euc, &_iconv_from_ucs_ces_handlers_euc}, #endif #ifdef ICONV_FROM_UCS_CES_TABLE - {(_CONST char **)iconv_ces_names_table, + {(const char **)iconv_ces_names_table, &_iconv_from_ucs_ces_handlers_table}, #endif #ifdef ICONV_FROM_UCS_CES_TABLE_PCS - {(_CONST char **)iconv_ces_names_table_pcs, + {(const char **)iconv_ces_names_table_pcs, &_iconv_from_ucs_ces_handlers_table_pcs}, #endif #ifdef ICONV_FROM_UCS_CES_UCS_2 - {(_CONST char **)iconv_ces_names_ucs_2, + {(const char **)iconv_ces_names_ucs_2, &_iconv_from_ucs_ces_handlers_ucs_2}, #endif #ifdef ICONV_FROM_UCS_CES_UCS_2_INTERNAL - {(_CONST char **)iconv_ces_names_ucs_2_internal, + {(const char **)iconv_ces_names_ucs_2_internal, &_iconv_from_ucs_ces_handlers_ucs_2_internal}, #endif #ifdef ICONV_FROM_UCS_CES_UCS_4 - {(_CONST char **)iconv_ces_names_ucs_4, + {(const char **)iconv_ces_names_ucs_4, &_iconv_from_ucs_ces_handlers_ucs_4}, #endif #ifdef ICONV_FROM_UCS_CES_UCS_4_INTERNAL - {(_CONST char **)iconv_ces_names_ucs_4_internal, + {(const char **)iconv_ces_names_ucs_4_internal, &_iconv_from_ucs_ces_handlers_ucs_4_internal}, #endif #ifdef ICONV_FROM_UCS_CES_US_ASCII - {(_CONST char **)iconv_ces_names_us_ascii, + {(const char **)iconv_ces_names_us_ascii, &_iconv_from_ucs_ces_handlers_us_ascii}, #endif #ifdef ICONV_FROM_UCS_CES_UTF_16 - {(_CONST char **)iconv_ces_names_utf_16, + {(const char **)iconv_ces_names_utf_16, &_iconv_from_ucs_ces_handlers_utf_16}, #endif #ifdef ICONV_FROM_UCS_CES_UTF_8 - {(_CONST char **)iconv_ces_names_utf_8, + {(const char **)iconv_ces_names_utf_8, &_iconv_from_ucs_ces_handlers_utf_8}, #endif - {(_CONST char **)NULL, + {(const char **)NULL, (iconv_from_ucs_ces_handlers_t *)NULL} }; diff --git a/newlib/libc/iconv/ces/cesbi.h b/newlib/libc/iconv/ces/cesbi.h index 67e85ef3c..2b157c216 100644 --- a/newlib/libc/iconv/ces/cesbi.h +++ b/newlib/libc/iconv/ces/cesbi.h @@ -183,92 +183,92 @@ * These handlers are actually defined in correspondent CES converter files. */ #ifdef ICONV_TO_UCS_CES_EUC -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_euc; #endif #ifdef ICONV_FROM_UCS_CES_EUC -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_euc; #endif #ifdef ICONV_TO_UCS_CES_TABLE -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_table; #endif #ifdef ICONV_FROM_UCS_CES_TABLE -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_table; #endif #ifdef ICONV_TO_UCS_CES_TABLE_PCS -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_table_pcs; #endif #ifdef ICONV_FROM_UCS_CES_TABLE_PCS -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_table_pcs; #endif #ifdef ICONV_TO_UCS_CES_UCS_2 -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_2; #endif #ifdef ICONV_FROM_UCS_CES_UCS_2 -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_2; #endif #ifdef ICONV_TO_UCS_CES_UCS_2_INTERNAL -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_2_internal; #endif #ifdef ICONV_FROM_UCS_CES_UCS_2_INTERNAL -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_2_internal; #endif #ifdef ICONV_TO_UCS_CES_UCS_4 -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_4; #endif #ifdef ICONV_FROM_UCS_CES_UCS_4 -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_4; #endif #ifdef ICONV_TO_UCS_CES_UCS_4_INTERNAL -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_4_internal; #endif #ifdef ICONV_FROM_UCS_CES_UCS_4_INTERNAL -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_4_internal; #endif #ifdef ICONV_TO_UCS_CES_US_ASCII -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_us_ascii; #endif #ifdef ICONV_FROM_UCS_CES_US_ASCII -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_us_ascii; #endif #ifdef ICONV_TO_UCS_CES_UTF_16 -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_utf_16; #endif #ifdef ICONV_FROM_UCS_CES_UTF_16 -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_utf_16; #endif #ifdef ICONV_TO_UCS_CES_UTF_8 -extern _CONST iconv_to_ucs_ces_handlers_t +extern const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_utf_8; #endif #ifdef ICONV_FROM_UCS_CES_UTF_8 -extern _CONST iconv_from_ucs_ces_handlers_t +extern const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_utf_8; #endif diff --git a/newlib/libc/iconv/ces/euc.c b/newlib/libc/iconv/ces/euc.c index 749269766..29d36f941 100644 --- a/newlib/libc/iconv/ces/euc.c +++ b/newlib/libc/iconv/ces/euc.c @@ -62,7 +62,7 @@ typedef struct int mb_cur_max; euc_cs_desc_t *desc; - _VOID_PTR data[MAX_CS_NUM]; + void *data[MAX_CS_NUM]; } euc_data_t; #if defined (_ICONV_TO_ENCODING_EUC_JP) \ @@ -100,10 +100,9 @@ static euc_cs_desc_t euc_kr_cs_desc [] = #endif #if defined (ICONV_FROM_UCS_CES_EUC) -static _VOID_PTR -_DEFUN(euc_from_ucs_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +euc_from_ucs_init (struct _reent *rptr, + const char *encoding) { int i; euc_data_t *data; @@ -160,14 +159,13 @@ error: _iconv_from_ucs_ces_handlers_table.close (rptr, data); return NULL; error1: - _free_r (rptr, (_VOID_PTR)data); + _free_r (rptr, (void *)data); return NULL; } static size_t -_DEFUN(euc_from_ucs_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +euc_from_ucs_close (struct _reent *rptr, + void *data) { int i; size_t res = 0; @@ -185,10 +183,9 @@ _DEFUN(euc_from_ucs_close, (rptr, data), } static size_t -_DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - register ucs4_t in _AND - unsigned char **outbuf _AND +euc_convert_from_ucs (void *data, + register ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { int i; @@ -260,10 +257,9 @@ _DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft), #endif /* ICONV_FROM_UCS_CES_EUC */ #if defined (ICONV_TO_UCS_CES_EUC) -static _VOID_PTR -_DEFUN(euc_to_ucs_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +euc_to_ucs_init (struct _reent *rptr, + const char *encoding) { int i; euc_data_t *data; @@ -320,14 +316,13 @@ error: _iconv_to_ucs_ces_handlers_table.close (rptr, data); return NULL; error1: - _free_r (rptr, (_VOID_PTR)data); + _free_r (rptr, (void *)data); return NULL; } static size_t -_DEFUN(euc_to_ucs_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +euc_to_ucs_close (struct _reent *rptr, + void *data) { int i; size_t res = 0; @@ -345,9 +340,8 @@ _DEFUN(euc_to_ucs_close, (rptr, data), } static ucs4_t -_DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +euc_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { int i; @@ -366,8 +360,8 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), for (i = 1; d->desc[i].csname != NULL; i++) { - if (memcmp((_CONST _VOID_PTR)(*inbuf), - (_CONST _VOID_PTR)d->desc[i].prefix, + if (memcmp((const void *)(*inbuf), + (const void *)d->desc[i].prefix, d->desc[i].prefixbytes) == 0) { if (((int)*inbytesleft - d->desc[i].prefixbytes - d->desc[i].bytes) < 0) @@ -388,7 +382,7 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), res = _iconv_to_ucs_ces_handlers_table.convert_to_ucs ( d->data[i], - (_CONST unsigned char **)&inbuf1, + (const unsigned char **)&inbuf1, &inbytesleft1); if (((__int32_t)res) > 0) { @@ -419,7 +413,7 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), res = _iconv_to_ucs_ces_handlers_table.convert_to_ucs ( d->data[0], - (_CONST unsigned char **)&inbuf1, + (const unsigned char **)&inbuf1, &inbytesleft1); if (((__int32_t)res) > 0) { @@ -432,14 +426,13 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_EUC */ static int -_DEFUN(euc_get_mb_cur_max, (data), - _VOID_PTR data) +euc_get_mb_cur_max (void *data) { return ((euc_data_t *)data)->mb_cur_max; } #if defined (ICONV_FROM_UCS_CES_EUC) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_euc = { euc_from_ucs_init, @@ -453,7 +446,7 @@ _iconv_from_ucs_ces_handlers_euc = #endif #if defined (ICONV_TO_UCS_CES_EUC) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_euc = { euc_to_ucs_init, diff --git a/newlib/libc/iconv/ces/mkdeps.pl b/newlib/libc/iconv/ces/mkdeps.pl index 92dd20dfb..d78dfe8f8 100755 --- a/newlib/libc/iconv/ces/mkdeps.pl +++ b/newlib/libc/iconv/ces/mkdeps.pl @@ -524,12 +524,12 @@ sub generate_cesbi_h($$) foreach my $ces (@ces) { print CESBI_H "#ifdef $macro_to_ucs_ces\U$ces\n"; - print CESBI_H "extern _CONST iconv_to_ucs_ces_handlers_t\n"; + print CESBI_H "extern const iconv_to_ucs_ces_handlers_t\n"; print CESBI_H "$var_to_ucs_handlers$ces;\n"; print CESBI_H "#endif\n"; print CESBI_H "#ifdef $macro_from_ucs_ces\U$ces\n"; - print CESBI_H "extern _CONST iconv_from_ucs_ces_handlers_t\n"; + print CESBI_H "extern const iconv_from_ucs_ces_handlers_t\n"; print CESBI_H "$var_from_ucs_handlers$ces;\n"; print CESBI_H "#endif\n\n"; } @@ -584,7 +584,7 @@ sub generate_aliasesbi_c($) print ALIASESBI_C "$comment_automatic\n\n"; print ALIASESBI_C "#include <_ansi.h>\n"; print ALIASESBI_C "#include \"encnames.h\"\n\n"; - print ALIASESBI_C "_CONST char *\n"; + print ALIASESBI_C "const char *\n"; print ALIASESBI_C "$var_aliases =\n"; print ALIASESBI_C "{\n"; @@ -749,7 +749,7 @@ sub generate_ccsbi_h($) { print CCSBI_H "#if defined ($macro_to_ucs_ccs\U$ccs) \\\n"; print CCSBI_H " || defined ($macro_from_ucs_ccs\U$ccs)\n"; - print CCSBI_H "extern _CONST iconv_ccs_t\n"; + print CCSBI_H "extern const iconv_ccs_t\n"; print CCSBI_H "$var_ccs$ccs;\n"; print CCSBI_H "#endif\n"; } @@ -789,7 +789,7 @@ sub generate_cesbi_c($) { print CESBI_C "#if defined ($macro_to_ucs_ces\U$ces) \\\n"; print CESBI_C " || defined ($macro_from_ucs_ces\U$ces)\n"; - print CESBI_C "static _CONST char *\n"; + print CESBI_C "static const char *\n"; print CESBI_C "$var_ces_names${ces}\[] =\n"; print CESBI_C "{\n"; my @encodings = sort @{$cesenc{$ces}}; @@ -808,36 +808,36 @@ sub generate_cesbi_c($) print CESBI_C "/*\n"; print CESBI_C " * The following structure contains the list of \"to UCS\" linked-in CES converters.\n"; print CESBI_C " */\n"; - print CESBI_C "_CONST iconv_to_ucs_ces_t\n"; + print CESBI_C "const iconv_to_ucs_ces_t\n"; print CESBI_C "_iconv_to_ucs_ces[] =\n"; print CESBI_C "{\n"; foreach my $ces (@ces) { print CESBI_C "#ifdef $macro_to_ucs_ces\U$ces\n"; - print CESBI_C " {(_CONST char **)$var_ces_names$ces,\n"; + print CESBI_C " {(const char **)$var_ces_names$ces,\n"; print CESBI_C " &$var_to_ucs_handlers$ces},\n"; print CESBI_C "#endif\n"; } - print CESBI_C " {(_CONST char **)NULL,\n"; + print CESBI_C " {(const char **)NULL,\n"; print CESBI_C " (iconv_to_ucs_ces_handlers_t *)NULL}\n"; print CESBI_C "};\n\n"; print CESBI_C "/*\n"; print CESBI_C " * The following structure contains the list of \"from UCS\" linked-in CES converters.\n"; print CESBI_C " */\n"; - print CESBI_C "_CONST iconv_from_ucs_ces_t\n"; + print CESBI_C "const iconv_from_ucs_ces_t\n"; print CESBI_C "_iconv_from_ucs_ces[] =\n"; print CESBI_C "{\n"; foreach my $ces (@ces) { print CESBI_C "#ifdef $macro_from_ucs_ces\U$ces\n"; - print CESBI_C " {(_CONST char **)$var_ces_names$ces,\n"; + print CESBI_C " {(const char **)$var_ces_names$ces,\n"; print CESBI_C " &$var_from_ucs_handlers$ces},\n"; print CESBI_C "#endif\n"; } - print CESBI_C " {(_CONST char **)NULL,\n"; + print CESBI_C " {(const char **)NULL,\n"; print CESBI_C " (iconv_from_ucs_ces_handlers_t *)NULL}\n"; print CESBI_C "};\n"; @@ -866,7 +866,7 @@ sub generate_ccsbi_c($) print CESBI_C " * The following array contains the list of built-in CCS tables.\n"; print CESBI_C " */\n"; - print CESBI_C "_CONST iconv_ccs_t *\n"; + print CESBI_C "const iconv_ccs_t *\n"; print CESBI_C "_iconv_ccs[] =\n"; print CESBI_C "{\n"; diff --git a/newlib/libc/iconv/ces/table-pcs.c b/newlib/libc/iconv/ces/table-pcs.c index fc46e27f2..45cfe6267 100644 --- a/newlib/libc/iconv/ces/table-pcs.c +++ b/newlib/libc/iconv/ces/table-pcs.c @@ -40,10 +40,9 @@ #if defined (ICONV_FROM_UCS_CES_TABLE_PCS) static size_t -_DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - ucs4_t in _AND - unsigned char **outbuf _AND +table_pcs_convert_from_ucs (void *data, + ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if (*outbytesleft < 1) @@ -64,25 +63,22 @@ _DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft), outbytesleft); } -static _VOID_PTR -_DEFUN(table_pcs_from_ucs_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +table_pcs_from_ucs_init (struct _reent *rptr, + const char *encoding) { return _iconv_from_ucs_ces_handlers_table.init (rptr, encoding); } static size_t -_DEFUN(table_pcs_from_ucs_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +table_pcs_from_ucs_close (struct _reent *rptr, + void *data) { return _iconv_from_ucs_ces_handlers_table.close (rptr, data); } static int -_DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data), - _VOID_PTR data) +table_pcs_from_ucs_get_mb_cur_max (void *data) { return _iconv_from_ucs_ces_handlers_table.get_mb_cur_max (data); } @@ -91,9 +87,8 @@ _DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data), #if defined (ICONV_TO_UCS_CES_TABLE_PCS) static ucs4_t -_DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +table_pcs_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { if (*inbytesleft < 1) @@ -112,25 +107,22 @@ _DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft), inbytesleft); } -static _VOID_PTR -_DEFUN(table_pcs_to_ucs_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +table_pcs_to_ucs_init (struct _reent *rptr, + const char *encoding) { return _iconv_to_ucs_ces_handlers_table.init (rptr, encoding); } static size_t -_DEFUN(table_pcs_to_ucs_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +table_pcs_to_ucs_close (struct _reent *rptr, + void *data) { return _iconv_to_ucs_ces_handlers_table.close (rptr, data); } static int -_DEFUN(table_pcs_to_ucs_get_mb_cur_max, (data), - _VOID_PTR data) +table_pcs_to_ucs_get_mb_cur_max (void *data) { return _iconv_to_ucs_ces_handlers_table.get_mb_cur_max (data); } @@ -138,7 +130,7 @@ _DEFUN(table_pcs_to_ucs_get_mb_cur_max, (data), #endif /* ICONV_TO_UCS_CES_TABLE_PCS */ #if defined (ICONV_FROM_UCS_CES_TABLE_PCS) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_table_pcs = { table_pcs_from_ucs_init, @@ -152,7 +144,7 @@ _iconv_from_ucs_ces_handlers_table_pcs = #endif #if defined (ICONV_TO_UCS_CES_TABLE_PCS) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_table_pcs = { table_pcs_to_ucs_init, diff --git a/newlib/libc/iconv/ces/table.c b/newlib/libc/iconv/ces/table.c index e43e23faa..c8ef218a1 100644 --- a/newlib/libc/iconv/ces/table.c +++ b/newlib/libc/iconv/ces/table.c @@ -57,44 +57,42 @@ */ static ucs2_t -_EXFUN(find_code_size, (ucs2_t code, _CONST __uint16_t *tblp)); +find_code_size (ucs2_t code, const __uint16_t *tblp); static __inline ucs2_t -_EXFUN(find_code_speed, (ucs2_t code, _CONST __uint16_t *tblp)); +find_code_speed (ucs2_t code, const __uint16_t *tblp); static __inline ucs2_t -_EXFUN(find_code_speed_8bit, (ucs2_t code, _CONST unsigned char *tblp)); +find_code_speed_8bit (ucs2_t code, const unsigned char *tblp); #ifdef _ICONV_ENABLE_EXTERNAL_CCS -static _CONST iconv_ccs_desc_t * -_EXFUN(load_file, (struct _reent *rptr, _CONST char *name, int direction)); +static const iconv_ccs_desc_t * +load_file (struct _reent *rptr, const char *name, int direction); #endif /* * Interface data and functions implementation. */ static size_t -_DEFUN(table_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +table_close (struct _reent *rptr, + void *data) { - _CONST iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; + const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; if (ccsp->type == TABLE_EXTERNAL) - _free_r (rptr, (_VOID_PTR)ccsp->tbl); + _free_r (rptr, (void *)ccsp->tbl); - _free_r( rptr, (_VOID_PTR)ccsp); + _free_r( rptr, (void *)ccsp); return 0; } #if defined (ICONV_FROM_UCS_CES_TABLE) -static _VOID_PTR -_DEFUN(table_init_from_ucs, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +table_init_from_ucs (struct _reent *rptr, + const char *encoding) { int i; - _CONST iconv_ccs_t *biccsp = NULL; + const iconv_ccs_t *biccsp = NULL; iconv_ccs_desc_t *ccsp; for (i = 0; _iconv_ccs[i] != NULL; i++) @@ -116,24 +114,23 @@ _DEFUN(table_init_from_ucs, (rptr, encoding), ccsp->optimization = biccsp->from_ucs_type; ccsp->tbl = biccsp->from_ucs; - return (_VOID_PTR)ccsp; + return (void *)ccsp; } #ifdef _ICONV_ENABLE_EXTERNAL_CCS - return (_VOID_PTR)load_file (rptr, encoding, 1); + return (void *)load_file (rptr, encoding, 1); #else return NULL; #endif } static size_t -_DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - ucs4_t in _AND - unsigned char **outbuf _AND +table_convert_from_ucs (void *data, + ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { - _CONST iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; + const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; ucs2_t code; if (in > 0xFFFF || in == INVALC) @@ -142,7 +139,7 @@ _DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft), if (ccsp->bits == TABLE_8BIT) { code = find_code_speed_8bit ((ucs2_t)in, - (_CONST unsigned char *)ccsp->tbl); + (const unsigned char *)ccsp->tbl); if (code == INVALC) return (size_t)ICONV_CES_INVALID_CHARACTER; **outbuf = (unsigned char)code; @@ -171,13 +168,12 @@ _DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft), #endif /* ICONV_FROM_UCS_CES_TABLE */ #if defined (ICONV_TO_UCS_CES_TABLE) -static _VOID_PTR -_DEFUN(table_init_to_ucs, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +table_init_to_ucs (struct _reent *rptr, + const char *encoding) { int i; - _CONST iconv_ccs_t *biccsp = NULL; + const iconv_ccs_t *biccsp = NULL; iconv_ccs_desc_t *ccsp; for (i = 0; _iconv_ccs[i] != NULL; i++) @@ -199,23 +195,22 @@ _DEFUN(table_init_to_ucs, (rptr, encoding), ccsp->optimization = biccsp->to_ucs_type; ccsp->tbl = biccsp->to_ucs; - return (_VOID_PTR)ccsp; + return (void *)ccsp; } #ifdef _ICONV_ENABLE_EXTERNAL_CCS - return (_VOID_PTR)load_file (rptr, encoding, 0); + return (void *)load_file (rptr, encoding, 0); #else return NULL; #endif } static ucs4_t -_DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +table_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { - _CONST iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; + const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; ucs2_t ucs; if (ccsp->bits == TABLE_8BIT) @@ -253,15 +248,14 @@ _DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_TABLE */ static int -_DEFUN(table_get_mb_cur_max, (data), - _VOID_PTR data) +table_get_mb_cur_max (void *data) { return ((iconv_ccs_desc_t *)data)->bits/8; } #if defined (ICONV_TO_UCS_CES_TABLE) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_table = { table_init_to_ucs, @@ -275,7 +269,7 @@ _iconv_to_ucs_ces_handlers_table = #endif /* ICONV_FROM_UCS_CES_TABLE */ #if defined (ICONV_FROM_UCS_CES_TABLE) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_table = { table_init_from_ucs, @@ -297,15 +291,14 @@ _iconv_from_ucs_ces_handlers_table = * * PARAMETERS: * ucs2_t code - code whose mapping to find. - * _CONST __uint16_t *tblp - table pointer. + * const __uint16_t *tblp - table pointer. * * RETURN: * Code that corresponds to 'code'. */ static __inline ucs2_t -_DEFUN(find_code_speed, (code, tblp), - ucs2_t code _AND - _CONST __uint16_t *tblp) +find_code_speed (ucs2_t code, + const __uint16_t *tblp) { int idx = tblp[code >> 8]; @@ -320,15 +313,14 @@ _DEFUN(find_code_speed, (code, tblp), * * PARAMETERS: * ucs2_t code - code whose mapping to find. - * _CONST __uint16_t *tblp - table pointer. + * const __uint16_t *tblp - table pointer. * * RETURN: * Code that corresponds to 'code'. */ static __inline ucs2_t -_DEFUN(find_code_speed_8bit, (code, tblp), - ucs2_t code _AND - _CONST unsigned char *tblp) +find_code_speed_8bit (ucs2_t code, + const unsigned char *tblp) { int idx; unsigned char ccs; @@ -360,15 +352,14 @@ _DEFUN(find_code_speed_8bit, (code, tblp), * * PARAMETERS: * ucs2_t code - code whose mapping to find. - * _CONST __uint16_t *tblp - table pointer. + * const __uint16_t *tblp - table pointer. * * RETURN: * Code that corresponds to 'code'. */ static ucs2_t -_DEFUN(find_code_size, (code, tblp), - ucs2_t code _AND - _CONST __uint16_t *tblp) +find_code_size (ucs2_t code, + const __uint16_t *tblp) { int first, last, cur, center; @@ -447,7 +438,7 @@ _DEFUN(find_code_size, (code, tblp), * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _CONST char *name - encoding name. + * const char *name - encoding name. * int direction - conversion direction. * * DESCRIPTION: @@ -459,17 +450,16 @@ _DEFUN(find_code_size, (code, tblp), * RETURN: * iconv_ccs_desc_t * pointer is success, NULL if failure. */ -static _CONST iconv_ccs_desc_t * -_DEFUN(load_file, (rptr, name, direction), - struct _reent *rptr _AND - _CONST char *name _AND +static const iconv_ccs_desc_t * +load_file (struct _reent *rptr, + const char *name, int direction) { int fd; - _CONST unsigned char *buf; + const unsigned char *buf; int tbllen, hdrlen; off_t off; - _CONST char *fname; + const char *fname; iconv_ccs_desc_t *ccsp = NULL; int nmlen = strlen(name); /* Since CCS table name length can vary - it is aligned (by adding extra @@ -487,10 +477,10 @@ _DEFUN(load_file, (rptr, name, direction), if ((fd = _open_r (rptr, fname, O_RDONLY, S_IRUSR)) == -1) goto error1; - if ((buf = (_CONST unsigned char *)_malloc_r (rptr, hdrlen)) == NULL) + if ((buf = (const unsigned char *)_malloc_r (rptr, hdrlen)) == NULL) goto error2; - if (_read_r (rptr, fd, (_VOID_PTR)buf, hdrlen) != hdrlen) + if (_read_r (rptr, fd, (void *)buf, hdrlen) != hdrlen) goto error3; if (_16BIT_ELT (EXTTABLE_VERSION_OFF) != TABLE_VERSION_1 @@ -559,33 +549,33 @@ _DEFUN(load_file, (rptr, name, direction), goto error4; if (_lseek_r (rptr, fd, off, SEEK_SET) == (off_t)-1 - || _read_r (rptr, fd, (_VOID_PTR)ccsp->tbl, tbllen) != tbllen) + || _read_r (rptr, fd, (void *)ccsp->tbl, tbllen) != tbllen) goto error5; goto normal_exit; error5: - _free_r (rptr, (_VOID_PTR)ccsp->tbl); + _free_r (rptr, (void *)ccsp->tbl); ccsp->tbl = NULL; error4: - _free_r (rptr, (_VOID_PTR)ccsp); + _free_r (rptr, (void *)ccsp); ccsp = NULL; error3: normal_exit: - _free_r (rptr, (_VOID_PTR)buf); + _free_r (rptr, (void *)buf); error2: if (_close_r (rptr, fd) == -1) { if (ccsp != NULL) { if (ccsp->tbl != NULL) - _free_r (rptr, (_VOID_PTR)ccsp->tbl); - _free_r (rptr, (_VOID_PTR)ccsp); + _free_r (rptr, (void *)ccsp->tbl); + _free_r (rptr, (void *)ccsp); } ccsp = NULL; } error1: - _free_r (rptr, (_VOID_PTR)fname); + _free_r (rptr, (void *)fname); return ccsp; } #endif diff --git a/newlib/libc/iconv/ces/ucs-2-internal.c b/newlib/libc/iconv/ces/ucs-2-internal.c index 893bdd429..3473444cf 100644 --- a/newlib/libc/iconv/ces/ucs-2-internal.c +++ b/newlib/libc/iconv/ces/ucs-2-internal.c @@ -44,10 +44,9 @@ #if defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL) static size_t -_DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - register ucs4_t in _AND - unsigned char **outbuf _AND +ucs_2_internal_convert_from_ucs (void *data, + register ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if (in > 0x0000FFFF) @@ -66,9 +65,8 @@ _DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL) static ucs4_t -_DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +ucs_2_internal_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { register ucs4_t res; @@ -89,14 +87,13 @@ _DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UCS_2_INTERNAL */ static int -_DEFUN(ucs_2_internal_get_mb_cur_max, (data), - _VOID_PTR data) +ucs_2_internal_get_mb_cur_max (void *data) { return 2; } #if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_2_internal = { NULL, @@ -110,7 +107,7 @@ _iconv_to_ucs_ces_handlers_ucs_2_internal = #endif #if defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_2_internal = { NULL, diff --git a/newlib/libc/iconv/ces/ucs-2.c b/newlib/libc/iconv/ces/ucs-2.c index 6f796ca54..5e965b080 100644 --- a/newlib/libc/iconv/ces/ucs-2.c +++ b/newlib/libc/iconv/ces/ucs-2.c @@ -49,28 +49,26 @@ #define UCS_2BE "ucs_2be" #define UCS_2LE "ucs_2le" -static _VOID_PTR -_DEFUN(ucs_2_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +ucs_2_init (struct _reent *rptr, + const char *encoding) { int *data; if ((data = (int *) _malloc_r(rptr, sizeof (int))) == NULL) - return (_VOID_PTR)NULL; + return (void *)NULL; if (strcmp (encoding, UCS_2LE) == 0) *data = UCS_2_LITTLE_ENDIAN; else *data = UCS_2_BIG_ENDIAN; - return (_VOID_PTR)data; + return (void *)data; } static size_t -_DEFUN(ucs_2_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +ucs_2_close (struct _reent *rptr, + void *data) { _free_r (rptr, data); return 0; @@ -78,10 +76,9 @@ _DEFUN(ucs_2_close, (rptr, data), #if defined (ICONV_FROM_UCS_CES_UCS_2) static size_t -_DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - ucs4_t in _AND - unsigned char **outbuf _AND +ucs_2_convert_from_ucs (void *data, + ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if ((in >= 0x0000D800 && in <= 0x0000DFFF) /* Surrogate character */ @@ -105,9 +102,8 @@ _DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_UCS_2) static ucs4_t -_DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +ucs_2_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { ucs4_t res; @@ -132,14 +128,13 @@ _DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UCS_2 */ static int -_DEFUN(ucs_2_get_mb_cur_max, (data), - _VOID_PTR data) +ucs_2_get_mb_cur_max (void *data) { return 2; } #if defined (ICONV_TO_UCS_CES_UCS_2) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_2 = { ucs_2_init, @@ -153,7 +148,7 @@ _iconv_to_ucs_ces_handlers_ucs_2 = #endif #if defined (ICONV_FROM_UCS_CES_UCS_2) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_2 = { ucs_2_init, diff --git a/newlib/libc/iconv/ces/ucs-4-internal.c b/newlib/libc/iconv/ces/ucs-4-internal.c index d8df9b157..d10952c55 100644 --- a/newlib/libc/iconv/ces/ucs-4-internal.c +++ b/newlib/libc/iconv/ces/ucs-4-internal.c @@ -44,10 +44,9 @@ #if defined (ICONV_FROM_UCS_CES_UCS_4_INTERNAL) static size_t -_DEFUN(ucs_4_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - register ucs4_t in _AND - unsigned char **outbuf _AND +ucs_4_internal_convert_from_ucs (void *data, + register ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if (in > 0x7FFFFFFF) @@ -66,9 +65,8 @@ _DEFUN(ucs_4_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_UCS_4_INTERNAL) static ucs4_t -_DEFUN(ucs_4_internal_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +ucs_4_internal_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { register ucs4_t res; @@ -89,14 +87,13 @@ _DEFUN(ucs_4_internal_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UCS_4_INTERNAL */ static int -_DEFUN(ucs_4_internal_get_mb_cur_max, (data), - _VOID_PTR data) +ucs_4_internal_get_mb_cur_max (void *data) { return 2; } #if defined (ICONV_TO_UCS_CES_UCS_4_INTERNAL) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_4_internal = { NULL, @@ -110,7 +107,7 @@ _iconv_to_ucs_ces_handlers_ucs_4_internal = #endif #if defined (ICONV_FROM_UCS_CES_UCS_4_INTERNAL) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_4_internal = { NULL, diff --git a/newlib/libc/iconv/ces/ucs-4.c b/newlib/libc/iconv/ces/ucs-4.c index cfa7b367d..290cc71f8 100644 --- a/newlib/libc/iconv/ces/ucs-4.c +++ b/newlib/libc/iconv/ces/ucs-4.c @@ -50,28 +50,26 @@ #define UCS_4BE "ucs_4be" #define UCS_4LE "ucs_4le" -static _VOID_PTR -_DEFUN(ucs_4_init, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +ucs_4_init (struct _reent *rptr, + const char *encoding) { int *data; if ((data = (int *)_malloc_r (rptr, sizeof(int))) == NULL) - return (_VOID_PTR)NULL; + return (void *)NULL; if (strcmp (encoding, UCS_4LE) == 0) *data = UCS_4_LITTLE_ENDIAN; else *data = UCS_4_BIG_ENDIAN; - return (_VOID_PTR)data; + return (void *)data; } static size_t -_DEFUN(ucs_4_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +ucs_4_close (struct _reent *rptr, + void *data) { _free_r(rptr, data); return 0; @@ -80,10 +78,9 @@ _DEFUN(ucs_4_close, (rptr, data), #if defined (ICONV_FROM_UCS_CES_UCS_4) static size_t -_DEFUN(ucs_4_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - ucs4_t in _AND - unsigned char **outbuf _AND +ucs_4_convert_from_ucs (void *data, + ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if ((in >= 0x0000D800 && in <= 0x0000DFFF) /* Surrogate character */ @@ -107,9 +104,8 @@ _DEFUN(ucs_4_convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_UCS_4) static ucs4_t -_DEFUN(ucs_4_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +ucs_4_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { ucs4_t res; @@ -134,14 +130,13 @@ _DEFUN(ucs_4_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UCS_4 */ static int -_DEFUN(ucs_4_get_mb_cur_max, (data), - _VOID_PTR data) +ucs_4_get_mb_cur_max (void *data) { return 4; } #if defined (ICONV_TO_UCS_CES_UCS_4) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_ucs_4 = { ucs_4_init, @@ -155,7 +150,7 @@ _iconv_to_ucs_ces_handlers_ucs_4 = #endif #if defined (ICONV_FROM_UCS_CES_UCS_4) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_ucs_4 = { ucs_4_init, diff --git a/newlib/libc/iconv/ces/us-ascii.c b/newlib/libc/iconv/ces/us-ascii.c index 2f213a7ed..164679178 100644 --- a/newlib/libc/iconv/ces/us-ascii.c +++ b/newlib/libc/iconv/ces/us-ascii.c @@ -40,10 +40,9 @@ #if defined (ICONV_FROM_UCS_CES_US_ASCII) static size_t -_DEFUN(us_ascii_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - ucs4_t in _AND - unsigned char **outbuf _AND +us_ascii_convert_from_ucs (void *data, + ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { if (in > 0x7F) @@ -60,9 +59,8 @@ _DEFUN(us_ascii_convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_US_ASCII) static ucs4_t -_DEFUN(us_ascii_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +us_ascii_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { ucs4_t res; @@ -83,14 +81,13 @@ _DEFUN(us_ascii_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_US_ASCII */ static int -_DEFUN(us_ascii_get_mb_cur_max, (data), - _VOID_PTR data) +us_ascii_get_mb_cur_max (void *data) { return 2; } #if defined (ICONV_TO_UCS_CES_US_ASCII) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_us_ascii = { NULL, @@ -104,7 +101,7 @@ _iconv_to_ucs_ces_handlers_us_ascii = #endif #if defined (ICONV_FROM_UCS_CES_US_ASCII) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_us_ascii = { NULL, diff --git a/newlib/libc/iconv/ces/utf-16.c b/newlib/libc/iconv/ces/utf-16.c index 4b2ff77a1..a3491bb3c 100644 --- a/newlib/libc/iconv/ces/utf-16.c +++ b/newlib/libc/iconv/ces/utf-16.c @@ -58,24 +58,22 @@ #define UTF_16LE "utf_16le" static size_t -_DEFUN(utf_16_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +utf_16_close (struct _reent *rptr, + void *data) { _free_r(rptr, data); return 0; } #if defined (ICONV_FROM_UCS_CES_UTF_16) -static _VOID_PTR -_DEFUN(utf_16_init_from_ucs, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +utf_16_init_from_ucs (struct _reent *rptr, + const char *encoding) { int *data; if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL) - return (_VOID_PTR)NULL; + return (void *)NULL; if (strcmp (encoding, UTF_16LE) == 0) *data = UTF16_LITTLE_ENDIAN; @@ -84,14 +82,13 @@ _DEFUN(utf_16_init_from_ucs, (rptr, encoding), else *data = UTF16_SYSTEM_ENDIAN; - return (_VOID_PTR)data; + return (void *)data; } static size_t -_DEFUN(utf_16_convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - register ucs4_t in _AND - unsigned char **outbuf _AND +utf_16_convert_from_ucs (void *data, + register ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { register ucs2_t *cp; @@ -169,15 +166,14 @@ _DEFUN(utf_16_convert_from_ucs, (data, in, outbuf, outbytesleft), #endif /* ICONV_FROM_UCS_CES_UTF_16 */ #if defined (ICONV_TO_UCS_CES_UTF_16) -static _VOID_PTR -_DEFUN(utf_16_init_to_ucs, (rptr, encoding), - struct _reent *rptr _AND - _CONST char *encoding) +static void * +utf_16_init_to_ucs (struct _reent *rptr, + const char *encoding) { int *data; if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL) - return (_VOID_PTR)NULL; + return (void *)NULL; if (strcmp (encoding, UTF_16BE) == 0) *data = UTF16_BIG_ENDIAN; @@ -186,13 +182,12 @@ _DEFUN(utf_16_init_to_ucs, (rptr, encoding), else *data = UTF16_UNDEFINED; - return (_VOID_PTR)data; + return (void *)data; } static ucs4_t -_DEFUN(utf_16_convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +utf_16_convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { register ucs2_t w1; @@ -268,14 +263,13 @@ _DEFUN(utf_16_convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UTF_16 */ static int -_DEFUN(utf_16_get_mb_cur_max, (data), - _VOID_PTR data) +utf_16_get_mb_cur_max (void *data) { return 6; } #if defined (ICONV_TO_UCS_CES_UTF_16) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_utf_16 = { utf_16_init_to_ucs, @@ -289,7 +283,7 @@ _iconv_to_ucs_ces_handlers_utf_16 = #endif #if defined (ICONV_FROM_UCS_CES_UTF_16) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_utf_16 = { utf_16_init_from_ucs, diff --git a/newlib/libc/iconv/ces/utf-8.c b/newlib/libc/iconv/ces/utf-8.c index fda1e6e3b..116f25925 100644 --- a/newlib/libc/iconv/ces/utf-8.c +++ b/newlib/libc/iconv/ces/utf-8.c @@ -43,10 +43,9 @@ #if defined (ICONV_FROM_UCS_CES_UTF_8) static size_t -_DEFUN(convert_from_ucs, (data, in, outbuf, outbytesleft), - _VOID_PTR data _AND - register ucs4_t in _AND - unsigned char **outbuf _AND +convert_from_ucs (void *data, + register ucs4_t in, + unsigned char **outbuf, size_t *outbytesleft) { register unsigned char *cp; @@ -125,12 +124,11 @@ _DEFUN(convert_from_ucs, (data, in, outbuf, outbytesleft), #if defined (ICONV_TO_UCS_CES_UTF_8) static ucs4_t -_DEFUN(convert_to_ucs, (data, inbuf, inbytesleft), - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND +convert_to_ucs (void *data, + const unsigned char **inbuf, size_t *inbytesleft) { - register _CONST unsigned char *in = *inbuf; + register const unsigned char *in = *inbuf; register size_t bytes; ucs4_t res; @@ -259,14 +257,13 @@ _DEFUN(convert_to_ucs, (data, inbuf, inbytesleft), #endif /* ICONV_TO_UCS_CES_UTF_8 */ static int -_DEFUN(get_mb_cur_max, (data), - _VOID_PTR data) +get_mb_cur_max (void *data) { return UTF8_MB_CUR_MAX; } #if defined (ICONV_TO_UCS_CES_UTF_8) -_CONST iconv_to_ucs_ces_handlers_t +const iconv_to_ucs_ces_handlers_t _iconv_to_ucs_ces_handlers_utf_8 = { NULL, @@ -280,7 +277,7 @@ _iconv_to_ucs_ces_handlers_utf_8 = #endif #if defined (ICONV_FROM_UCS_CES_UTF_8) -_CONST iconv_from_ucs_ces_handlers_t +const iconv_from_ucs_ces_handlers_t _iconv_from_ucs_ces_handlers_utf_8 = { NULL, diff --git a/newlib/libc/iconv/lib/Makefile.in b/newlib/libc/iconv/lib/Makefile.in index 85e3394e7..ee4510a38 100644 --- a/newlib/libc/iconv/lib/Makefile.in +++ b/newlib/libc/iconv/lib/Makefile.in @@ -279,7 +279,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = iconv.def CHAPTER = all: all-am @@ -560,8 +560,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/iconv/lib/aliasesbi.c b/newlib/libc/iconv/lib/aliasesbi.c index 36c434e16..dfd7090d0 100644 --- a/newlib/libc/iconv/lib/aliasesbi.c +++ b/newlib/libc/iconv/lib/aliasesbi.c @@ -5,7 +5,7 @@ #include <_ansi.h> #include "encnames.h" -_CONST char * +const char * _iconv_aliases = { #if defined (_ICONV_FROM_ENCODING_BIG5) \ diff --git a/newlib/libc/iconv/lib/aliasesi.c b/newlib/libc/iconv/lib/aliasesi.c index f94ac8fb9..d04cebb57 100644 --- a/newlib/libc/iconv/lib/aliasesi.c +++ b/newlib/libc/iconv/lib/aliasesi.c @@ -33,55 +33,12 @@ #include #include "local.h" -/* - * strnstr - locate a substring in a fixed-size string. - * - * PARAMETERS: - * _CONST char *haystack - the string in which to search. - * _CONST char *needle - the string which to search. - * int length - the maximum 'haystack' string length. - * - * DESCRIPTION: - * The strstr() function finds the first occurrence of the substring - * 'needle' in the string 'haystack'. At most 'length' bytes are searched. - * - * RETURN: - * Returns a pointer to the beginning of substring, or NULL if substring - * was not found. - */ -static char * -_DEFUN(strnstr, (haystack, needle, length), - _CONST char *haystack _AND - _CONST char *needle _AND - int length) -{ - _CONST char *max = haystack + length; - - if (*haystack == '\0') - return *needle == '\0' ? (char *)haystack : (char *)NULL; - - while (haystack < max) - { - int i = 0; - while (1) - { - if (needle[i] == '\0') - return (char *)haystack; - if (needle[i] != haystack[i]) - break; - i += 1; - } - haystack += 1; - } - return (char *)NULL; -} - /* * canonical_form - canonize 'str'. * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _CONST char *str - string to canonize. + * const char *str - string to canonize. * * DESCRIPTION: * Converts all letters to small and substitute all '-' characters by '_' @@ -90,15 +47,14 @@ _DEFUN(strnstr, (haystack, needle, length), * RETURN: * Returns canonical form of 'str' if success, NULL if failure. */ -static _CONST char * -_DEFUN(canonical_form, (rptr, str), - struct _reent *rptr _AND - _CONST char *str) +static const char * +canonical_form (struct _reent *rptr, + const char *str) { char *p, *p1; if (str == NULL || (p = p1 = _strdup_r (rptr, str)) == NULL) - return (_CONST char *)NULL; + return (const char *)NULL; for (; *str; str++, p++) { @@ -108,7 +64,7 @@ _DEFUN(canonical_form, (rptr, str), *p = tolower (*str); } - return (_CONST char *)p1; + return (const char *)p1; } /* @@ -116,8 +72,8 @@ _DEFUN(canonical_form, (rptr, str), * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _CONST char *alias - alias by which "official" name should be found. - * _CONST char *table - aliases table. + * const char *alias - alias by which "official" name should be found. + * const char *table - aliases table. * int len - aliases table length. * * DESCRIPTION: @@ -136,17 +92,16 @@ _DEFUN(canonical_form, (rptr, str), * and sets current thread's/process's errno. */ static char * -_DEFUN(find_alias, (rptr, alias, table, len), - struct _reent *rptr _AND - _CONST char *alias _AND - _CONST char *table _AND +find_alias (struct _reent *rptr, + const char *alias, + const char *table, int len) { - _CONST char *end; - _CONST char *p; + const char *end; + const char *p; int l = strlen (alias); - _CONST char *ptable = table; - _CONST char *table_end = table + len; + const char *ptable = table; + const char *table_end = table + len; if (table == NULL || alias == NULL || *table == '\0' || *alias == '\0') return NULL; @@ -179,7 +134,7 @@ search_again: * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _CONST char *ca - encoding alias to resolve. + * const char *ca - encoding alias to resolve. * * DESCRIPTION: * First, tries to find 'ca' among built-in aliases. If not found, tries to @@ -190,9 +145,8 @@ search_again: * and sets current thread's/process's errno. */ char * -_DEFUN(_iconv_resolve_encoding_name, (rptr, cname, path), - struct _reent *rptr _AND - _CONST char *ca) +_iconv_resolve_encoding_name (struct _reent *rptr, + const char *ca) { char *p = (char *)ca; @@ -206,7 +160,7 @@ _DEFUN(_iconv_resolve_encoding_name, (rptr, cname, path), p = find_alias (rptr, ca, _iconv_aliases, strlen (_iconv_aliases)); - _free_r (rptr, (_VOID_PTR)ca); + _free_r (rptr, (void *)ca); return p; } diff --git a/newlib/libc/iconv/lib/conv.h b/newlib/libc/iconv/lib/conv.h index 550f44949..658ab9152 100644 --- a/newlib/libc/iconv/lib/conv.h +++ b/newlib/libc/iconv/lib/conv.h @@ -52,8 +52,8 @@ typedef struct * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process; - * _CONST char *to - output encoding's normalized name; - * _CONST char *from - input encoding's normalized name. + * const char *to - output encoding's normalized name; + * const char *from - input encoding's normalized name. * * DESCRIPTION: * This function is called from iconv_open() to open conversion. Returns @@ -63,16 +63,16 @@ typedef struct * Pointer to conversion-specific data if success. In case of error * returns NULL and sets current thread's/process's errno. */ - _VOID_PTR _EXFNPTR(open, (struct _reent *rptr, - _CONST char *to, - _CONST char *from)); + void *(*open) (struct _reent *rptr, + const char *to, + const char *from); /* * close - close conversion. * * PARAMETRS: * struct _reent *rptr - reent structure of current thread/process; - * _VOID_PTR data - conversion-specific data. + * void *data - conversion-specific data. * * DESCRIPTION: * This function is called from iconv_close() to close conversion. @@ -81,15 +81,15 @@ typedef struct * When successful, returns (size_t)0. In case of error, sets current * thread's/process's errno and returns (size_t)-1 (same as iconv_open()). */ - size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + size_t (*close) (struct _reent *rptr, + void *data); /* convert - perform encoding conversion. * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _VOID_PTR data - conversion-specific data; - * _CONST unsigned char **inbuf - input data buffer; + * void *data - conversion-specific data; + * const unsigned char **inbuf - input data buffer; * size_t *inbytesleft - input buffer's length; * unsigned char **outbuf - output data buffer; * size_t *outbytesleft - output buffer free space; @@ -114,19 +114,19 @@ typedef struct * Reversible conversions are not counted. In case of error, sets current * thread's/process's errno and returns (size_t)-1 (same as iconv()). */ - size_t _EXFNPTR(convert, (struct _reent *rptr, - _VOID_PTR data, - _CONST unsigned char **inbuf, + size_t (*convert) (struct _reent *rptr, + void *data, + const unsigned char **inbuf, size_t *inbytesleft, unsigned char **outbuf, size_t *outbytesleft, - int flags)); + int flags); /* * get_state - get current shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object where shift state will be written; * int direction - 0-"from", 1-"to". * @@ -135,15 +135,15 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, + void (*get_state) (void *data, mbstate_t *state, - int direction)); + int direction); /* * set_state - set shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object to which shift state will be set. * int direction - 0-"from", 1-"to". * @@ -154,15 +154,15 @@ typedef struct * "to" encoding is set. * Returns 0 if '*state' object has right format, -1 else. */ - int _EXFNPTR(set_state, (_VOID_PTR data, + int (*set_state) (void *data, mbstate_t *state, - int direction)); + int direction); /* * get_mb_cur_max - get maximum character length in bytes. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * int direction - 0-"from", 1-"to". * * DESCRIPTION: @@ -170,14 +170,14 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data, - int direction)); + int (*get_mb_cur_max) (void *data, + int direction); /* * is_stateful - is encoding stateful or stateless. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * int direction - 0-"from", 1-"to". * * DESCRIPTION: @@ -185,8 +185,8 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - int _EXFNPTR(is_stateful, (_VOID_PTR data, - int direction)); + int (*is_stateful) (void *data, + int direction); } iconv_conversion_handlers_t; @@ -199,22 +199,22 @@ typedef struct typedef struct { /* Iconv conversion handlers. */ - _CONST iconv_conversion_handlers_t *handlers; + const iconv_conversion_handlers_t *handlers; /* * Conversion-specific data (e.g., points to iconv_ucs_conversion_t * object if UCS-based conversion is used). */ - _VOID_PTR data; + void *data; } iconv_conversion_t; /* UCS-based conversion handlers */ -extern _CONST iconv_conversion_handlers_t +extern const iconv_conversion_handlers_t _iconv_ucs_conversion_handlers; /* Null conversion handlers */ -extern _CONST iconv_conversion_handlers_t +extern const iconv_conversion_handlers_t _iconv_null_conversion_handlers; #endif /* !__ICONV_CONVERSION_H__ */ diff --git a/newlib/libc/iconv/lib/iconv.c b/newlib/libc/iconv/lib/iconv.c index 8214a7874..02c749d7f 100644 --- a/newlib/libc/iconv/lib/iconv.c +++ b/newlib/libc/iconv/lib/iconv.c @@ -41,7 +41,7 @@ INDEX INDEX _iconv_close_r -ANSI_SYNOPSIS +SYNOPSIS #include iconv_t iconv_open (const char *<[to]>, const char *<[from]>); int iconv_close (iconv_t <[cd]>); @@ -58,44 +58,6 @@ ANSI_SYNOPSIS size_t *<[inbytesleft]>, char **<[outbuf]>, size_t *<[outbytesleft]>); -TRAD_SYNOPSIS - #include - size_t iconv (<[cd]>, <[in]>, <[inleft]>, <[out]>, <[outleft]>); - iconv_t <[cd]>; - char **<[in]>; - size_t *<[inleft]>; - char **<[out]>; - size_t *<[outleft]>); - - #include - iconv_t iconv_open (<[to]>, <[from]>); - const char *<[to]>; - const char *<[from]>; - - #include - int iconv_close (<[cd]>); - iconv_t <[cd]>; - - #include - size_t _iconv_r (<[rptr]>, <[cd]>, <[in]>, <[inleft]>, <[out]>, <[outleft]>); - struct _reent *<[rptr]>; - iconv_t <[cd]>; - const char **<[in]>; - size_t *<[inleft]>; - char **<[out]>; - size_t *<[outleft]>); - - #include - iconv_t _iconv_open_r (<[rptr]>, <[to]>, <[from]>); - struct _reent *<[rptr]>; - const char *<[to]>; - const char *<[from]>; - - #include - int iconv_close (<[rptr]>, <[cd]>); - struct _reent *<[rptr]>; - iconv_t <[cd]>; - DESCRIPTION The function <> converts characters from <[in]> which are in one encoding to characters of another encoding, outputting them to <[out]>. @@ -158,29 +120,27 @@ No supporting OS subroutine calls are required. */ iconv_t -_DEFUN(iconv_open, (to, from), - _CONST char *to _AND - _CONST char *from) +iconv_open (const char *to, + const char *from) { return _iconv_open_r (_REENT, to, from); } size_t -_DEFUN(iconv, (cd, inbuf, inbytesleft, outbuf, outbytesleft), - iconv_t cd _AND - char **__restrict inbuf _AND - size_t *__restrict inbytesleft _AND - char **__restrict outbuf _AND +iconv (iconv_t cd, + char **__restrict inbuf, + size_t *__restrict inbytesleft, + char **__restrict outbuf, size_t *__restrict outbytesleft) { - return _iconv_r (_REENT, cd, (_CONST char **) inbuf, inbytesleft, + return _iconv_r (_REENT, cd, (const char **) inbuf, inbytesleft, outbuf, outbytesleft); } int -_DEFUN(iconv_close, (cd), iconv_t cd) +iconv_close (iconv_t cd) { return _iconv_close_r (_REENT, cd); } @@ -188,22 +148,21 @@ _DEFUN(iconv_close, (cd), iconv_t cd) #ifndef _REENT_ONLY iconv_t -_DEFUN(_iconv_open_r, (rptr, to, from), - struct _reent *rptr _AND - _CONST char *to _AND - _CONST char *from) +_iconv_open_r (struct _reent *rptr, + const char *to, + const char *from) { iconv_conversion_t *ic; if (to == NULL || from == NULL || *to == '\0' || *from == '\0') return (iconv_t)-1; - if ((to = (_CONST char *)_iconv_resolve_encoding_name (rptr, to)) == NULL) + if ((to = (const char *)_iconv_resolve_encoding_name (rptr, to)) == NULL) return (iconv_t)-1; - if ((from = (_CONST char *)_iconv_resolve_encoding_name (rptr, from)) == NULL) + if ((from = (const char *)_iconv_resolve_encoding_name (rptr, from)) == NULL) { - _free_r (rptr, (_VOID_PTR)to); + _free_r (rptr, (void *)to); return (iconv_t)-1; } @@ -225,31 +184,30 @@ _DEFUN(_iconv_open_r, (rptr, to, from), ic->data = ic->handlers->open (rptr, to, from); } - _free_r (rptr, (_VOID_PTR)to); - _free_r (rptr, (_VOID_PTR)from); + _free_r (rptr, (void *)to); + _free_r (rptr, (void *)from); if (ic->data == NULL) { - _free_r (rptr, (_VOID_PTR)ic); + _free_r (rptr, (void *)ic); return (iconv_t)-1; } - return (_VOID_PTR)ic; + return (void *)ic; } size_t -_DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), - struct _reent *rptr _AND - iconv_t cd _AND - _CONST char **inbuf _AND - size_t *inbytesleft _AND - char **outbuf _AND +_iconv_r (struct _reent *rptr, + iconv_t cd, + const char **inbuf, + size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -287,7 +245,7 @@ _DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), if (*outbytesleft >= state_null.__count) { - memcpy ((_VOID_PTR)(*outbuf), (_VOID_PTR)&state_null, state_null.__count); + memcpy ((void *)(*outbuf), (void *)&state_null, state_null.__count); *outbuf += state_null.__count; *outbytesleft -= state_null.__count; @@ -317,7 +275,7 @@ _DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), return ic->handlers->convert (rptr, ic->data, - (_CONST unsigned char**)inbuf, + (const unsigned char**)inbuf, inbytesleft, (unsigned char**)outbuf, outbytesleft, @@ -326,14 +284,13 @@ _DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), int -_DEFUN(_iconv_close_r, (rptr, cd), - struct _reent *rptr _AND +_iconv_close_r (struct _reent *rptr, iconv_t cd) { int res; iconv_conversion_t *ic = (iconv_conversion_t *)cd; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -343,7 +300,7 @@ _DEFUN(_iconv_close_r, (rptr, cd), res = (int)ic->handlers->close (rptr, ic->data); - _free_r (rptr, (_VOID_PTR)cd); + _free_r (rptr, (void *)cd); return res; } diff --git a/newlib/libc/iconv/lib/iconvnls.c b/newlib/libc/iconv/lib/iconvnls.c index 1b42f2c7b..ed8f3a7ba 100644 --- a/newlib/libc/iconv/lib/iconvnls.c +++ b/newlib/libc/iconv/lib/iconvnls.c @@ -46,9 +46,9 @@ * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _CONST char *file - the name of file. - * _CONST char *dir - the name of subdirectory; - * _CONST char *ext - file extension. + * const char *file - the name of file. + * const char *dir - the name of subdirectory; + * const char *ext - file extension. * * DESCRIPTION: * Function constructs patch to icionv-related file. @@ -58,12 +58,11 @@ * The pointer to file name if success, In case of error returns NULL * and sets current thread's/process's errno. */ -_CONST char * -_DEFUN(_iconv_nls_construct_filename, (rptr, file, ext), - struct _reent *rptr _AND - _CONST char *file _AND - _CONST char *dir _AND - _CONST char *ext) +const char * +_iconv_nls_construct_filename (struct _reent *rptr, + const char *file, + const char *dir, + const char *ext) { int len1, len2, len3; char *path; @@ -78,7 +77,7 @@ _DEFUN(_iconv_nls_construct_filename, (rptr, file, ext), len3 = strlen (ext); if ((p = _malloc_r (rptr, len1 + dirlen + len2 + len3 + 3)) == NULL) - return (_CONST char *)NULL; + return (const char *)NULL; memcpy (p, path, len1); if (p[len1 - 1] != '/') @@ -95,7 +94,7 @@ _DEFUN(_iconv_nls_construct_filename, (rptr, file, ext), } p[len1] = '\0'; - return (_CONST char *)p; + return (const char *)p; } @@ -114,8 +113,7 @@ _DEFUN(_iconv_nls_construct_filename, (rptr, file, ext), * "to" encoding's value if 'direction' isn't 0. */ int -_DEFUN(_iconv_nls_get_mb_cur_max, (cd, direction), - iconv_t cd _AND +_iconv_nls_get_mb_cur_max (iconv_t cd, int direction) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; @@ -137,8 +135,7 @@ _DEFUN(_iconv_nls_get_mb_cur_max, (cd, direction), */ int -_DEFUN(_iconv_nls_is_stateful, (cd, direction), - iconv_t cd _AND +_iconv_nls_is_stateful (iconv_t cd, int direction) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; @@ -166,18 +163,17 @@ _DEFUN(_iconv_nls_is_stateful, (cd, direction), * Same as _iconv_r. */ size_t -_DEFUN(_iconv_nls_conv, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), - struct _reent *rptr _AND - iconv_t cd _AND - _CONST char **inbuf _AND - size_t *inbytesleft _AND - char **outbuf _AND +_iconv_nls_conv (struct _reent *rptr, + iconv_t cd, + const char **inbuf, + size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; int flags = ICONV_FAIL_BIT; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -199,7 +195,7 @@ _DEFUN(_iconv_nls_conv, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), return ic->handlers->convert (rptr, ic->data, - (_CONST unsigned char**)inbuf, + (const unsigned char**)inbuf, inbytesleft, (unsigned char**)outbuf, outbytesleft, @@ -219,10 +215,9 @@ _DEFUN(_iconv_nls_conv, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), * shift state if 'direction' is 0 and "to" encodings's shift state * if 'direction' isn't 0. */ -_VOID -_DEFUN(_iconv_nls_get_state, (cd, ps, direction), - iconv_t cd _AND - mbstate_t *ps _AND +void +_iconv_nls_get_state (iconv_t cd, + mbstate_t *ps, int direction) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; @@ -247,9 +242,8 @@ _DEFUN(_iconv_nls_get_state, (cd, ps, direction), * 0 if success, -1 if failure. */ int -_DEFUN(_iconv_nls_set_state, (cd, ps, direction), - iconv_t cd _AND - mbstate_t *ps _AND +_iconv_nls_set_state (iconv_t cd, + mbstate_t *ps, int direction) { iconv_conversion_t *ic = (iconv_conversion_t *)cd; @@ -259,10 +253,9 @@ _DEFUN(_iconv_nls_set_state, (cd, ps, direction), /* Same as iconv_open() but don't perform name resolving */ static iconv_t -_DEFUN(iconv_open1, (rptr, to, from), - struct _reent *rptr _AND - _CONST char *to _AND - _CONST char *from) +iconv_open1 (struct _reent *rptr, + const char *to, + const char *from) { iconv_conversion_t *ic; @@ -289,11 +282,11 @@ _DEFUN(iconv_open1, (rptr, to, from), if (ic->data == NULL) { - _free_r (rptr, (_VOID_PTR)ic); + _free_r (rptr, (void *)ic); return (iconv_t)-1; } - return (_VOID_PTR)ic; + return (void *)ic; } /* @@ -301,7 +294,7 @@ _DEFUN(iconv_open1, (rptr, to, from), * * PARAMETERS: * struct _reent *rptr - process's reent structure; - * _CONST char *encoding - encoding name; + * const char *encoding - encoding name; * iconv_t *tomb - wchar -> encoding iconv descriptor pointer; * iconv_t *towc - encoding -> wchar iconv descriptor pointer; * int flag - perform encoding name resolving flag. @@ -316,14 +309,13 @@ _DEFUN(iconv_open1, (rptr, to, from), * If successful - return 0, else set errno and return -1. */ int -_DEFUN(_iconv_nls_open, (rptr, encoding, towc, tomb), - struct _reent *rptr _AND - _CONST char *encoding _AND - iconv_t *tomb _AND - iconv_t *towc _AND +_iconv_nls_open (struct _reent *rptr, + const char *encoding, + iconv_t *tomb, + iconv_t *towc, int flag) { - _CONST char *wchar_encoding; + const char *wchar_encoding; if (sizeof (wchar_t) > 2 && WCHAR_MAX > 0xFFFF) wchar_encoding = "ucs_4_internal"; diff --git a/newlib/libc/iconv/lib/local.h b/newlib/libc/iconv/lib/local.h index fd386c5fb..bd9dcddca 100644 --- a/newlib/libc/iconv/lib/local.h +++ b/newlib/libc/iconv/lib/local.h @@ -30,9 +30,6 @@ #include #include -/* void* type for K&R compilers compatibility */ -#define _VOID_PTR _PTR - /* Encodings aliases file */ #define ICONV_ALIASES_FNAME "encoding.aliases" /* iconv CCS data path */ @@ -62,7 +59,7 @@ typedef __uint32_t ucs4_t; /* The list of built-in encoding names and aliases */ -extern _CONST char * +extern const char * _iconv_aliases; #endif /* !__ICONV_LIB_LOCAL_H__ */ diff --git a/newlib/libc/iconv/lib/nullconv.c b/newlib/libc/iconv/lib/nullconv.c index d35027f9c..e75d83376 100644 --- a/newlib/libc/iconv/lib/nullconv.c +++ b/newlib/libc/iconv/lib/nullconv.c @@ -35,34 +35,30 @@ static int null_conversion_dummy_data; -static _VOID_PTR -_DEFUN(null_conversion_open, (rptr, to, from), - struct _reent *rptr _AND - _CONST char *to _AND - _CONST char *from) +static void * +null_conversion_open (struct _reent *rptr, + const char *to, + const char *from) { - return (_VOID_PTR)&null_conversion_dummy_data; + return (void *)&null_conversion_dummy_data; } static size_t -_DEFUN(null_conversion_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +null_conversion_close (struct _reent *rptr, + void *data) { return 0; } static size_t -_DEFUN(null_conversion_convert, - (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft), - struct _reent *rptr _AND - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND - size_t *inbytesleft _AND - unsigned char **outbuf _AND - size_t *outbytesleft _AND +null_conversion_convert (struct _reent *rptr, + void *data, + const unsigned char **inbuf, + size_t *inbytesleft, + unsigned char **outbuf, + size_t *outbytesleft, int flags) { size_t result; @@ -93,18 +89,16 @@ _DEFUN(null_conversion_convert, static int -_DEFUN(null_conversion_get_mb_cur_max, (data, direction), - _VOID_PTR data _AND +null_conversion_get_mb_cur_max (void *data, int direction) { return ICONV_MB_LEN_MAX; } -static _VOID -_DEFUN(null_conversion_get_state, (data, state, size), - _VOID_PTR data _AND - mbstate_t *state _AND +static void +null_conversion_get_state (void *data, + mbstate_t *state, int direction) { return; @@ -112,24 +106,22 @@ _DEFUN(null_conversion_get_state, (data, state, size), static int -_DEFUN(null_conversion_set_state, (data, state, direction), - _VOID_PTR data _AND - mbstate_t *state _AND +null_conversion_set_state (void *data, + mbstate_t *state, int direction) { return 0; } static int -_DEFUN(null_conversion_is_stateful, (data, direction), - _VOID_PTR data _AND +null_conversion_is_stateful (void *data, int direction) { return 0; } /* Null conversion definition object */ -_CONST iconv_conversion_handlers_t +const iconv_conversion_handlers_t _iconv_null_conversion_handlers = { null_conversion_open, diff --git a/newlib/libc/iconv/lib/ucsconv.c b/newlib/libc/iconv/lib/ucsconv.c index cc5ceb953..59f4f993d 100644 --- a/newlib/libc/iconv/lib/ucsconv.c +++ b/newlib/libc/iconv/lib/ucsconv.c @@ -36,23 +36,22 @@ static int fake_data; static int -_EXFUN(find_encoding_name, (_CONST char *searchee, - _CONST char **names)); +find_encoding_name (const char *searchee, + const char **names); /* * UCS-based conversion interface functions implementation. */ -static _VOID_PTR -_DEFUN(ucs_based_conversion_open, (rptr, to, from), - struct _reent *rptr _AND - _CONST char *to _AND - _CONST char *from) +static void * +ucs_based_conversion_open (struct _reent *rptr, + const char *to, + const char *from) { iconv_ucs_conversion_t *uc; - _CONST iconv_to_ucs_ces_t *to_ucs_bices; - _CONST iconv_from_ucs_ces_t *from_ucs_bices; + const iconv_to_ucs_ces_t *to_ucs_bices; + const iconv_from_ucs_ces_t *from_ucs_bices; uc = (iconv_ucs_conversion_t *) _calloc_r (rptr, 1, sizeof (iconv_ucs_conversion_t)); @@ -97,7 +96,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from), goto error; } else - uc->to_ucs.data = (_VOID_PTR)&fake_data; + uc->to_ucs.data = (void *)&fake_data; /* Initialize "from UCS" CES converter */ @@ -108,7 +107,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from), goto error; } else - uc->from_ucs.data = (_VOID_PTR)&fake_data; + uc->from_ucs.data = (void *)&fake_data; return uc; @@ -116,16 +115,15 @@ error: if (uc->to_ucs.data != NULL && uc->to_ucs.handlers->close != NULL) uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); - _free_r (rptr, (_VOID_PTR)uc); + _free_r (rptr, (void *)uc); return NULL; } static size_t -_DEFUN(ucs_based_conversion_close, (rptr, data), - struct _reent *rptr _AND - _VOID_PTR data) +ucs_based_conversion_close (struct _reent *rptr, + void *data) { iconv_ucs_conversion_t *uc; size_t res = 0; @@ -137,21 +135,19 @@ _DEFUN(ucs_based_conversion_close, (rptr, data), if (uc->to_ucs.handlers->close != NULL) res |= uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); - _free_r (rptr, (_VOID_PTR)data); + _free_r (rptr, (void *)data); return res; } static size_t -_DEFUN(ucs_based_conversion_convert, - (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft, flags), - struct _reent *rptr _AND - _VOID_PTR data _AND - _CONST unsigned char **inbuf _AND - size_t *inbytesleft _AND - unsigned char **outbuf _AND - size_t *outbytesleft _AND +ucs_based_conversion_convert (struct _reent *rptr, + void *data, + const unsigned char **inbuf, + size_t *inbytesleft, + unsigned char **outbuf, + size_t *outbytesleft, int flags) { unsigned char outbuf1[ICONV_MB_LEN_MAX]; @@ -163,7 +159,7 @@ _DEFUN(ucs_based_conversion_convert, { register size_t bytes; register ucs4_t ch; - _CONST unsigned char *inbuf_save = *inbuf; + const unsigned char *inbuf_save = *inbuf; size_t inbyteslef_save = *inbytesleft; if (*outbytesleft == 0) @@ -238,8 +234,7 @@ _DEFUN(ucs_based_conversion_convert, static int -_DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction), - _VOID_PTR data _AND +ucs_based_conversion_get_mb_cur_max (void *data, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; @@ -251,10 +246,9 @@ _DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction), } -static _VOID -_DEFUN(ucs_based_conversion_get_state, (data, state, direction), - _VOID_PTR data _AND - mbstate_t *state _AND +static void +ucs_based_conversion_get_state (void *data, + mbstate_t *state, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; @@ -280,9 +274,8 @@ _DEFUN(ucs_based_conversion_get_state, (data, state, direction), static int -_DEFUN(ucs_based_conversion_set_state, (data, state, direction), - _VOID_PTR data _AND - mbstate_t *state _AND +ucs_based_conversion_set_state (void *data, + mbstate_t *state, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; @@ -302,8 +295,7 @@ _DEFUN(ucs_based_conversion_set_state, (data, state, direction), } static int -_DEFUN(ucs_based_conversion_is_stateful, (data, direction), - _VOID_PTR data _AND +ucs_based_conversion_is_stateful (void *data, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; @@ -324,7 +316,7 @@ _DEFUN(ucs_based_conversion_is_stateful, (data, direction), /* UCS-based conversion definition object */ -_CONST iconv_conversion_handlers_t +const iconv_conversion_handlers_t _iconv_ucs_conversion_handlers = { ucs_based_conversion_open, @@ -342,11 +334,10 @@ _iconv_ucs_conversion_handlers = */ static int -_DEFUN(find_encoding_name, (searchee, names), - _CONST char *searchee _AND - _CONST char **names) +find_encoding_name (const char *searchee, + const char **names) { - _CONST char *p; + const char *p; for (p = *names; p != NULL; p = *(names++)) if (strcmp (p, searchee) == 0) diff --git a/newlib/libc/iconv/lib/ucsconv.h b/newlib/libc/iconv/lib/ucsconv.h index 4bf7174bf..2c3d8c647 100644 --- a/newlib/libc/iconv/lib/ucsconv.h +++ b/newlib/libc/iconv/lib/ucsconv.h @@ -57,7 +57,7 @@ typedef struct * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process; - * _CONST char *encoding - encoding name. + * const char *encoding - encoding name. * * DESCRIPTION: * Initializes CES converter. CES converter may deal with a series of @@ -68,15 +68,15 @@ typedef struct * Returns CES-specific data pointer if success. In case of error returns * NULL and sets current thread's/process's errno. */ - _VOID_PTR _EXFNPTR(init, (struct _reent *rptr, - _CONST char *encoding)); + void *(*init) (struct _reent *rptr, + const char *encoding); /* * close - close CES converter. * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process; - * _VOID_PTR data - CES converter-specific data. + * void *data - CES converter-specific data. * * DESCRIPTION: * Preforms CES converter closing. * @@ -84,38 +84,38 @@ typedef struct * Returns (size_t)0 if success. In case of error returns (size_t)-1 and * sets current thread's/process's errno. */ - size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + size_t (*close) (struct _reent *rptr, + void *data); /* * get_mb_cur_max - get maximum character length in bytes. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * * DESCRIPTION: * Returns encoding's maximum character length. */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data)); + int (*get_mb_cur_max) (void *data); /* * get_state - get current shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object where shift state will be stored; * * DESCRIPTION: * Returns encoding's current shift sequence. */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, - mbstate_t *state)); + void (*get_state) (void *data, + mbstate_t *state); /* * set_state - set shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t value to which shift state will be set. * * DESCRIPTION: @@ -123,26 +123,26 @@ typedef struct * object is zero-object - reset current shift state. * Returns 0 if '*state' object has right format, -1 else. */ - int _EXFNPTR(set_state, (_VOID_PTR data, - mbstate_t *state)); + int (*set_state) (void *data, + mbstate_t *state); /* * is_stateful - is encoding stateful state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * * DESCRIPTION: * Returns 0 if encoding is stateless, else returns 1. */ - int _EXFNPTR(is_stateful, (_VOID_PTR data)); + int (*is_stateful) (void *data); /* * convert_to_ucs - convert character to UCS. * * PARAMETERS: - * _VOID_PTR data - CES converter-specific data; - * _CONST unsigned char **inbuf - buffer with input character byte sequence; + * void *data - CES converter-specific data; + * const unsigned char **inbuf - buffer with input character byte sequence; * size_t *inbytesleft - output buffer bytes count. * * DESCRIPTION: @@ -155,9 +155,9 @@ typedef struct * returns ICONV_CES_INVALID_CHARACTER. If invalid or incomplete bytes * sequence was met, returns ICONV_CES_BAD_SEQUENCE. */ - ucs4_t _EXFNPTR(convert_to_ucs, (_VOID_PTR data, - _CONST unsigned char **inbuf, - size_t *inbytesleft)); + ucs4_t (*convert_to_ucs) (void *data, + const unsigned char **inbuf, + size_t *inbytesleft); } iconv_to_ucs_ces_handlers_t; @@ -172,32 +172,32 @@ typedef struct typedef struct { /* Same as in iconv_to_ucs_ces_handlers_t */ - _VOID_PTR _EXFNPTR(init, (struct _reent *rptr, - _CONST char *encoding)); + void *(*init) (struct _reent *rptr, + const char *encoding); /* Same as in iconv_to_ucs_ces_handlers_t */ - size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + size_t (*close) (struct _reent *rptr, + void *data); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data)); + int (*get_mb_cur_max) (void *data); /* Same as in iconv_to_ucs_ces_handlers_t */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, - mbstate_t *state)); + void (*get_state) (void *data, + mbstate_t *state); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(set_state, (_VOID_PTR data, - mbstate_t *state)); + int (*set_state) (void *data, + mbstate_t *state); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(is_stateful, (_VOID_PTR data)); + int (*is_stateful) (void *data); /* * convert_from_ucs - convert UCS character to destination encoding. * * PARAMETERS: - * _VOID_PTR data - CES converter-specific data; + * void *data - CES converter-specific data; * ucs4_t in - input UCS-4 character; * unsigned char **outbuf - output buffer for the result; * size_t *outbytesleft - output buffer bytes count. @@ -215,10 +215,10 @@ typedef struct * If there is no corresponding character in destination encoding, returns * ICONV_CES_INVALID_CHARACTER. */ - size_t _EXFNPTR(convert_from_ucs, (_VOID_PTR data, + size_t (*convert_from_ucs) (void *data, ucs4_t in, unsigned char **outbuf, - size_t *outbytesleft)); + size_t *outbytesleft); } iconv_from_ucs_ces_handlers_t; @@ -231,10 +231,10 @@ typedef struct typedef struct { /* CES converter handlers */ - _CONST iconv_to_ucs_ces_handlers_t *handlers; + const iconv_to_ucs_ces_handlers_t *handlers; /* "to_ucs" CES converter-specific data. */ - _VOID_PTR data; + void *data; } iconv_to_ucs_ces_desc_t; @@ -247,10 +247,10 @@ typedef struct typedef struct { /* CES converter handlers */ - _CONST iconv_from_ucs_ces_handlers_t *handlers; + const iconv_from_ucs_ces_handlers_t *handlers; /* "from_ucs" CES converter-specific data. */ - _VOID_PTR data; + void *data; } iconv_from_ucs_ces_desc_t; @@ -290,10 +290,10 @@ typedef struct * An array of encodings names, supported by CES converter. * The end of array should be marked by NULL pointer. */ - _CONST char **names; + const char **names; /* CES converter description structure */ - _CONST iconv_to_ucs_ces_handlers_t *handlers; + const iconv_to_ucs_ces_handlers_t *handlers; } iconv_to_ucs_ces_t; @@ -308,19 +308,19 @@ typedef struct * An array of encodings names, supported by CES converter. * The end of array should be marked by NULL pointer. */ - _CONST char **names; + const char **names; /* CES converter description structure */ - _CONST iconv_from_ucs_ces_handlers_t *handlers; + const iconv_from_ucs_ces_handlers_t *handlers; } iconv_from_ucs_ces_t; /* List of "to UCS" linked-in CES converters. */ -extern _CONST iconv_to_ucs_ces_t +extern const iconv_to_ucs_ces_t _iconv_to_ucs_ces[]; /* List of "from UCS" linked-in CES converters. */ -extern _CONST iconv_from_ucs_ces_t +extern const iconv_from_ucs_ces_t _iconv_from_ucs_ces[]; #endif /* !__ICONV_UCS_CONVERSION_H__ */ diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h index 5fb990700..6c7497efd 100644 --- a/newlib/libc/include/_ansi.h +++ b/newlib/libc/include/_ansi.h @@ -1,11 +1,6 @@ /* Provide support for both ANSI and non-ANSI environments. */ -/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will +/* To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header files aren't affected). */ @@ -15,14 +10,6 @@ #include #include -/* First try to figure out whether we really are in an ANSI C environment. */ -/* FIXME: This probably needs some work. Perhaps sys/config.h can be - prevailed upon to give us a clue. */ - -#ifdef __STDC__ -#define _HAVE_STDC -#endif - /* ISO C++. */ #ifdef __cplusplus @@ -46,54 +33,9 @@ #define _NOTHROW #endif -#ifdef _HAVE_STDC -#define _PTR void * -#define _AND , -#define _NOARGS void -#define _CONST const -#define _VOLATILE volatile -#define _SIGNED signed -#define _DOTS , ... -#define _VOID void -#ifdef __CYGWIN__ -#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW -#define _EXFUN(name, proto) __cdecl name proto -#define _EXPARM(name, proto) (* __cdecl name) proto -#define _EXFNPTR(name, proto) (__cdecl * name) proto -#else -#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW -#define _EXFUN(name, proto) name proto -#define _EXPARM(name, proto) (* name) proto -#define _EXFNPTR(name, proto) (* name) proto -#endif -#define _DEFUN(name, arglist, args) name(args) -#define _DEFUN_VOID(name) name(_NOARGS) -#define _CAST_VOID (void) #ifndef _LONG_DOUBLE #define _LONG_DOUBLE long double #endif -#ifndef _PARAMS -#define _PARAMS(paramlist) paramlist -#endif -#else -#define _PTR char * -#define _AND ; -#define _NOARGS -#define _CONST -#define _VOLATILE -#define _SIGNED -#define _DOTS -#define _VOID void -#define _EXFUN(name, proto) name() -#define _EXFUN_NOTHROW(name, proto) name() -#define _DEFUN(name, arglist, args) name arglist args; -#define _DEFUN_VOID(name) name() -#define _CAST_VOID -#define _LONG_DOUBLE double -#ifndef _PARAMS -#define _PARAMS(paramlist) () -#endif -#endif /* Support gcc's __attribute__ facility. */ diff --git a/newlib/libc/include/alloca.h b/newlib/libc/include/alloca.h index 2ea0fd9b3..5d3631891 100644 --- a/newlib/libc/include/alloca.h +++ b/newlib/libc/include/alloca.h @@ -15,7 +15,7 @@ #ifdef __GNUC__ #define alloca(size) __builtin_alloca(size) #else -void * _EXFUN(alloca,(size_t)); +void * alloca (size_t); #endif #endif diff --git a/newlib/libc/include/assert.h b/newlib/libc/include/assert.h index 91bb040ca..b9e5e9b4a 100644 --- a/newlib/libc/include/assert.h +++ b/newlib/libc/include/assert.h @@ -36,10 +36,10 @@ extern "C" { # endif /* !__ASSERT_FUNC */ #endif /* !NDEBUG */ -void _EXFUN(__assert, (const char *, int, const char *) - _ATTRIBUTE ((__noreturn__))); -void _EXFUN(__assert_func, (const char *, int, const char *, const char *) - _ATTRIBUTE ((__noreturn__))); +void __assert (const char *, int, const char *) + _ATTRIBUTE ((__noreturn__)); +void __assert_func (const char *, int, const char *, const char *) + _ATTRIBUTE ((__noreturn__)); #if __STDC_VERSION__ >= 201112L && !defined __cplusplus # define static_assert _Static_assert diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index 06458cbda..1cee6953b 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -10,27 +10,27 @@ _BEGIN_STD_C -int _EXFUN(isalnum, (int __c)); -int _EXFUN(isalpha, (int __c)); -int _EXFUN(iscntrl, (int __c)); -int _EXFUN(isdigit, (int __c)); -int _EXFUN(isgraph, (int __c)); -int _EXFUN(islower, (int __c)); -int _EXFUN(isprint, (int __c)); -int _EXFUN(ispunct, (int __c)); -int _EXFUN(isspace, (int __c)); -int _EXFUN(isupper, (int __c)); -int _EXFUN(isxdigit,(int __c)); -int _EXFUN(tolower, (int __c)); -int _EXFUN(toupper, (int __c)); +int isalnum (int __c); +int isalpha (int __c); +int iscntrl (int __c); +int isdigit (int __c); +int isgraph (int __c); +int islower (int __c); +int isprint (int __c); +int ispunct (int __c); +int isspace (int __c); +int isupper (int __c); +int isxdigit (int __c); +int tolower (int __c); +int toupper (int __c); #if __ISO_C_VISIBLE >= 1999 -int _EXFUN(isblank, (int __c)); +int isblank (int __c); #endif #if __MISC_VISIBLE || __XSI_VISIBLE -int _EXFUN(isascii, (int __c)); -int _EXFUN(toascii, (int __c)); +int isascii (int __c); +int toascii (int __c); #define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a') #define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A') #endif @@ -66,7 +66,12 @@ extern int toascii_l (int __c, locale_t __l); #define _X 0100 #define _B 0200 +#ifdef __HAVE_LOCALE_INFO__ const char *__locale_ctype_ptr (void); +#else +#define __locale_ctype_ptr() _ctype_ +#endif + # define __CTYPE_PTR (__locale_ctype_ptr ()) #ifndef __cplusplus @@ -100,7 +105,11 @@ const char *__locale_ctype_ptr (void); #endif #if __POSIX_VISIBLE >= 200809 +#ifdef __HAVE_LOCALE_INFO__ const char *__locale_ctype_ptr_l (locale_t); +#else +#define __locale_ctype_ptr_l(l) _ctype_ +#endif #define __ctype_lookup_l(__c,__l) ((__locale_ctype_ptr_l(__l)+sizeof(""[__c]))[(int)(__c)]) #define isalpha_l(__c,__l) (__ctype_lookup_l(__c,__l)&(_U|_L)) @@ -162,7 +171,7 @@ const char *__locale_ctype_ptr_l (locale_t); #endif /* !__cplusplus */ /* For C++ backward-compatibility only. */ -extern __IMPORT _CONST char _ctype_[]; +extern __IMPORT const char _ctype_[]; _END_STD_C diff --git a/newlib/libc/include/dirent.h b/newlib/libc/include/dirent.h index 6135b9f6e..5d566a81e 100644 --- a/newlib/libc/include/dirent.h +++ b/newlib/libc/include/dirent.h @@ -1,8 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dirent.h 8.3 (Berkeley) 8/10/94 + * $FreeBSD: head/include/dirent.h 326024 2017-11-20 19:45:28Z pfg $ + */ + #ifndef _DIRENT_H_ -#define _DIRENT_H_ -#ifdef __cplusplus -extern "C" { -#endif +#define _DIRENT_H_ + #include #include @@ -10,7 +42,44 @@ extern "C" { #define MAXNAMLEN 1024 #endif -#ifdef __cplusplus -} +__BEGIN_DECLS +#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 +int alphasort(const struct dirent **, const struct dirent **); +int dirfd(DIR *); #endif +#if __BSD_VISIBLE +int fdclosedir(DIR *); +#endif +DIR *opendir(const char *); +DIR *fdopendir(int); +struct dirent * + readdir(DIR *); +#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 +int readdir_r(DIR *__restrict, struct dirent *__restrict, + struct dirent **__restrict); +#endif +void rewinddir(DIR *); +#if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 +int scandir(const char *, struct dirent ***, + int (*)(const struct dirent *), int (*)(const struct dirent **, + const struct dirent **)); +#endif +#ifdef _COMPILING_NEWLIB +void _seekdir(DIR *, long); +#endif +#if __MISC_VISIBLE || __XSI_VISIBLE +#ifndef __INSIDE_CYGWIN__ +void seekdir(DIR *, long); +long telldir(DIR *); +#endif +#endif +int closedir(DIR *); +#if __GNU_VISIBLE +int scandirat(int, const char *, struct dirent ***, + int (*) (const struct dirent *), int (*) (const struct dirent **, + const struct dirent **)); +int versionsort(const struct dirent **, const struct dirent **); +#endif +__END_DECLS + #endif /*_DIRENT_H_*/ diff --git a/newlib/libc/include/elf.h b/newlib/libc/include/elf.h index 1b62db530..79d3b974b 100644 --- a/newlib/libc/include/elf.h +++ b/newlib/libc/include/elf.h @@ -686,6 +686,7 @@ typedef struct { #define NT_ARM_HW_BREAK 0x402 #define NT_ARM_HW_WATCH 0x403 #define NT_ARM_SYSTEM_CALL 0x404 +#define NT_ARM_SVE 0x405 #define NT_METAG_CBUF 0x500 #define NT_METAG_RPIPE 0x501 #define NT_METAG_TLS 0x502 diff --git a/newlib/libc/include/envlock.h b/newlib/libc/include/envlock.h index 9bb6a813e..799cf7f9e 100644 --- a/newlib/libc/include/envlock.h +++ b/newlib/libc/include/envlock.h @@ -9,7 +9,7 @@ #define ENV_LOCK __env_lock(reent_ptr) #define ENV_UNLOCK __env_unlock(reent_ptr) -void _EXFUN(__env_lock,(struct _reent *reent)); -void _EXFUN(__env_unlock,(struct _reent *reent)); +void __env_lock (struct _reent *reent); +void __env_unlock (struct _reent *reent); #endif /* _INCLUDE_ENVLOCK_H_ */ diff --git a/newlib/libc/include/getopt.h b/newlib/libc/include/getopt.h index e12d253d4..ac88524ea 100644 --- a/newlib/libc/include/getopt.h +++ b/newlib/libc/include/getopt.h @@ -129,7 +129,7 @@ extern "C" /* The GETOPT_DATA_INITIALIZER macro is used to initialize a statically- allocated variable of type struct getopt_data. */ - #define GETOPT_DATA_INITIALIZER {0,0,0,0,0} + #define GETOPT_DATA_INITIALIZER {0,0,0,0,0,0,0} /* These #defines are to make accessing the reentrant functions easier. */ #define getopt_r __getopt_r @@ -142,6 +142,7 @@ extern "C" { char *optarg; int optind, opterr, optopt, optwhere; + int permute_from, num_nonopts; } getopt_data; #endif /* __need_getopt_newlib */ @@ -153,31 +154,25 @@ extern "C" extern int optopt; /* function prototypes */ - int _EXFUN (getopt, - (int __argc, char *const __argv[], const char *__optstring)); + int getopt (int __argc, char *const __argv[], const char *__optstring); - int _EXFUN (getopt_long, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); + int getopt_long (int __argc, char *const __argv[], const char *__shortopts, + const struct option * __longopts, int *__longind); - int _EXFUN (getopt_long_only, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); + int getopt_long_only (int __argc, char *const __argv[], const char *__shortopts, + const struct option * __longopts, int *__longind); #ifdef __need_getopt_newlib - int _EXFUN (__getopt_r, - (int __argc, char *const __argv[], const char *__optstring, - struct getopt_data * __data)); + int __getopt_r (int __argc, char *const __argv[], const char *__optstring, + struct getopt_data * __data); - int _EXFUN (__getopt_long_r, - (int __argc, char *const __argv[], const char *__shortopts, + int __getopt_long_r (int __argc, char *const __argv[], const char *__shortopts, const struct option * __longopts, int *__longind, - struct getopt_data * __data)); + struct getopt_data * __data); - int _EXFUN (__getopt_long_only_r, - (int __argc, char *const __argv[], const char *__shortopts, + int __getopt_long_only_r (int __argc, char *const __argv[], const char *__shortopts, const struct option * __longopts, int *__longind, - struct getopt_data * __data)); + struct getopt_data * __data); #endif /* __need_getopt_newlib */ #ifdef __cplusplus diff --git a/newlib/libc/include/iconv.h b/newlib/libc/include/iconv.h index 4c023e9df..37feb882f 100644 --- a/newlib/libc/include/iconv.h +++ b/newlib/libc/include/iconv.h @@ -38,25 +38,25 @@ _BEGIN_STD_C #ifndef _REENT_ONLY iconv_t -_EXFUN(iconv_open, (_CONST char *, _CONST char *)); +iconv_open (const char *, const char *); size_t -_EXFUN(iconv, (iconv_t, char **__restrict, size_t *__restrict, - char **__restrict, size_t *__restrict)); +iconv (iconv_t, char **__restrict, size_t *__restrict, + char **__restrict, size_t *__restrict); int -_EXFUN(iconv_close, (iconv_t)); +iconv_close (iconv_t); #endif iconv_t -_EXFUN(_iconv_open_r, (struct _reent *, _CONST char *, _CONST char *)); +_iconv_open_r (struct _reent *, const char *, const char *); size_t -_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **, - size_t *, char **, size_t *)); +_iconv_r (struct _reent *, iconv_t, const char **, + size_t *, char **, size_t *); int -_EXFUN(_iconv_close_r, (struct _reent *, iconv_t)); +_iconv_close_r (struct _reent *, iconv_t); _END_STD_C diff --git a/newlib/libc/include/ieeefp.h b/newlib/libc/include/ieeefp.h index 2c042848b..2d6421a4c 100644 --- a/newlib/libc/include/ieeefp.h +++ b/newlib/libc/include/ieeefp.h @@ -215,8 +215,8 @@ typedef int fp_rnd; #define FP_RP 2 /* Round up */ #define FP_RZ 3 /* Round to zero (trunate) */ -fp_rnd _EXFUN(fpgetround,(void)); -fp_rnd _EXFUN(fpsetround, (fp_rnd)); +fp_rnd fpgetround (void); +fp_rnd fpsetround (fp_rnd); /* EXCEPTIONS */ @@ -227,10 +227,10 @@ typedef int fp_except; #define FP_X_UFL 0x02 /* Underflow exception */ #define FP_X_IMP 0x01 /* imprecise exception */ -fp_except _EXFUN(fpgetmask,(void)); -fp_except _EXFUN(fpsetmask,(fp_except)); -fp_except _EXFUN(fpgetsticky,(void)); -fp_except _EXFUN(fpsetsticky, (fp_except)); +fp_except fpgetmask (void); +fp_except fpsetmask (fp_except); +fp_except fpgetsticky (void); +fp_except fpsetsticky (fp_except); /* INTEGER ROUNDING */ @@ -238,8 +238,8 @@ typedef int fp_rdi; #define FP_RDI_TOZ 0 /* Round to Zero */ #define FP_RDI_RD 1 /* Follow float mode */ -fp_rdi _EXFUN(fpgetroundtoi,(void)); -fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); +fp_rdi fpgetroundtoi (void); +fp_rdi fpsetroundtoi (fp_rdi); #define __IEEE_DBL_EXPBIAS 1023 #define __IEEE_FLT_EXPBIAS 127 diff --git a/newlib/libc/include/langinfo.h b/newlib/libc/include/langinfo.h index 59381d6b6..d2b7a031c 100644 --- a/newlib/libc/include/langinfo.h +++ b/newlib/libc/include/langinfo.h @@ -29,16 +29,18 @@ #ifndef _LANGINFO_H_ #define _LANGINFO_H_ -#include -#include #include +#include #if __POSIX_VISIBLE >= 200809 #include #endif -typedef int nl_item; +#ifndef _NL_ITEM_DECLARED +typedef __nl_item nl_item; +#define _NL_ITEM_DECLARED +#endif -enum __nl_item +enum { /* POSIX and BSD defined items have to stick to the original values to maintain backward compatibility. */ diff --git a/newlib/libc/include/libgen.h b/newlib/libc/include/libgen.h index 3c717c5b0..414b5aa18 100644 --- a/newlib/libc/include/libgen.h +++ b/newlib/libc/include/libgen.h @@ -26,8 +26,8 @@ extern "C" { sure here. */ #undef basename #define basename __xpg_basename -char *_EXFUN(basename, (char *)) __asm__(__ASMNAME("basename")); -char *_EXFUN(dirname, (char *)); +char *basename (char *) __asm__(__ASMNAME("basename")); +char *dirname (char *); #ifdef __cplusplus } diff --git a/newlib/libc/include/limits.h b/newlib/libc/include/limits.h index dd09c1cee..893f10834 100644 --- a/newlib/libc/include/limits.h +++ b/newlib/libc/include/limits.h @@ -3,6 +3,7 @@ #include #include +#include # ifdef _MB_LEN_MAX # define MB_LEN_MAX _MB_LEN_MAX diff --git a/newlib/libc/include/locale.h b/newlib/libc/include/locale.h index 8ba88a90c..d11eb00fb 100644 --- a/newlib/libc/include/locale.h +++ b/newlib/libc/include/locale.h @@ -68,8 +68,8 @@ struct lconv }; struct _reent; -char *_EXFUN(_setlocale_r,(struct _reent *, int, const char *)); -struct lconv *_EXFUN(_localeconv_r,(struct _reent *)); +char *_setlocale_r (struct _reent *, int, const char *); +struct lconv *_localeconv_r (struct _reent *); struct __locale_t *_newlocale_r (struct _reent *, int, const char *, struct __locale_t *); @@ -79,8 +79,8 @@ struct __locale_t *_uselocale_r (struct _reent *, struct __locale_t *); #ifndef _REENT_ONLY -char *_EXFUN(setlocale,(int, const char *)); -struct lconv *_EXFUN(localeconv,(void)); +char *setlocale (int, const char *); +struct lconv *localeconv (void); #if __POSIX_VISIBLE >= 200809 locale_t newlocale (int, const char *, locale_t); diff --git a/newlib/libc/include/machine/fastmath.h b/newlib/libc/include/machine/fastmath.h index b13befa22..d13ab3b73 100644 --- a/newlib/libc/include/machine/fastmath.h +++ b/newlib/libc/include/machine/fastmath.h @@ -46,7 +46,6 @@ double EXFUN(fast_loge,(double)); #define log2(x) fast_log2(x) #define loge(x) fast_loge(x) -#ifdef _HAVE_STDC /* These functions are in assembler, they really do take floats. This can only be used with a real ANSI compiler */ @@ -94,7 +93,6 @@ float EXFUN(fast_logef,(float)); #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 */ diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h index 29c08fa43..a40975248 100644 --- a/newlib/libc/include/machine/ieeefp.h +++ b/newlib/libc/include/machine/ieeefp.h @@ -48,6 +48,23 @@ This represents what type a float arg is passed as. It is used when the type is not promoted to double. + + __OBSOLETE_MATH_DEFAULT + + Default value for __OBSOLETE_MATH if that's not set by the user. + It should be set here based on predefined feature macros. + + __OBSOLETE_MATH + + If set to 1 then some new math code will be disabled and older libm + code will be used instead. This is necessary because the new math + code does not support all targets, it assumes that the toolchain has + ISO C99 support (hexfloat literals, standard fenv semantics), the + target has IEEE-754 conforming binary32 float and binary64 double + (not mixed endian) representation, standard SNaN representation, + double and single precision arithmetics has similar latency and it + has no legacy SVID matherr support, only POSIX errno and fenv + exception based error handling. */ #if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__) @@ -61,6 +78,9 @@ # else # define __IEEE_BIG_ENDIAN # endif +# if __ARM_FP & 0x8 +# define __OBSOLETE_MATH_DEFAULT 0 +# endif #else # define __IEEE_BIG_ENDIAN # ifdef __ARMEL__ @@ -75,6 +95,7 @@ #else #define __IEEE_BIG_ENDIAN #endif +#define __OBSOLETE_MATH_DEFAULT 0 #endif #ifdef __epiphany__ @@ -186,6 +207,10 @@ #define __IEEE_BIG_ENDIAN #endif +#ifdef __nvptx__ +#define __IEEE_LITTLE_ENDIAN +#endif + #if defined(_C4x) || defined(_C3x) #define __IEEE_BIG_ENDIAN #define _DOUBLE_IS_32BITS @@ -427,6 +452,18 @@ #define __IEEE_BIG_ENDIAN #endif +#ifdef __CYGWIN__ +#define __OBSOLETE_MATH_DEFAULT 0 +#endif + +#ifndef __OBSOLETE_MATH_DEFAULT +/* Use old math code by default. */ +#define __OBSOLETE_MATH_DEFAULT 1 +#endif +#ifndef __OBSOLETE_MATH +#define __OBSOLETE_MATH __OBSOLETE_MATH_DEFAULT +#endif + #ifndef __IEEE_BIG_ENDIAN #ifndef __IEEE_LITTLE_ENDIAN #error Endianess not declared!! diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h index b33f437d7..9212f840b 100644 --- a/newlib/libc/include/machine/setjmp.h +++ b/newlib/libc/include/machine/setjmp.h @@ -359,7 +359,9 @@ _BEGIN_STD_C #endif #ifdef __riscv -#define _JBTYPE long +/* _JBTYPE using long long to make sure the alignment is align to 8 byte, + otherwise in rv32imafd, store/restore FPR may mis-align. */ +#define _JBTYPE long long #ifdef __riscv_32e #define _JBLEN ((4*sizeof(long))/sizeof(long)) #else diff --git a/newlib/libc/include/malloc.h b/newlib/libc/include/malloc.h index 41b5efdc0..a9dc5bca6 100644 --- a/newlib/libc/include/malloc.h +++ b/newlib/libc/include/malloc.h @@ -34,113 +34,117 @@ struct mallinfo { /* The routines. */ -extern _PTR malloc _PARAMS ((size_t)); +extern void *malloc (size_t); #ifdef __CYGWIN__ #undef _malloc_r #define _malloc_r(r, s) malloc (s) #else -extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t)); +extern void *_malloc_r (struct _reent *, size_t); #endif -extern _VOID free _PARAMS ((_PTR)); +extern void free (void *); #ifdef __CYGWIN__ #undef _free_r #define _free_r(r, p) free (p) #else -extern _VOID _free_r _PARAMS ((struct _reent *, _PTR)); +extern void _free_r (struct _reent *, void *); #endif -extern _PTR realloc _PARAMS ((_PTR, size_t)); +extern void *realloc (void *, size_t); #ifdef __CYGWIN__ #undef _realloc_r #define _realloc_r(r, p, s) realloc (p, s) #else -extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t)); +extern void *_realloc_r (struct _reent *, void *, size_t); #endif -extern _PTR calloc _PARAMS ((size_t, size_t)); +extern void *calloc (size_t, size_t); #ifdef __CYGWIN__ #undef _calloc_r #define _calloc_r(r, s1, s2) calloc (s1, s2); #else -extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t)); +extern void *_calloc_r (struct _reent *, size_t, size_t); #endif -extern _PTR memalign _PARAMS ((size_t, size_t)); +extern void *memalign (size_t, size_t); #ifdef __CYGWIN__ #undef _memalign_r #define _memalign_r(r, s1, s2) memalign (s1, s2); #else -extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t)); +extern void *_memalign_r (struct _reent *, size_t, size_t); #endif -extern struct mallinfo mallinfo _PARAMS ((void)); +extern struct mallinfo mallinfo (void); #ifdef __CYGWIN__ #undef _mallinfo_r #define _mallinfo_r(r) mallinfo () #else -extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *)); +extern struct mallinfo _mallinfo_r (struct _reent *); #endif -extern void malloc_stats _PARAMS ((void)); +extern void malloc_stats (void); #ifdef __CYGWIN__ #undef _malloc_stats_r #define _malloc_stats_r(r) malloc_stats () #else -extern void _malloc_stats_r _PARAMS ((struct _reent *)); +extern void _malloc_stats_r (struct _reent *); #endif -extern int mallopt _PARAMS ((int, int)); +extern int mallopt (int, int); #ifdef __CYGWIN__ #undef _mallopt_r #define _mallopt_r(i1, i2) mallopt (i1, i2) #else -extern int _mallopt_r _PARAMS ((struct _reent *, int, int)); +extern int _mallopt_r (struct _reent *, int, int); #endif -extern size_t malloc_usable_size _PARAMS ((_PTR)); +extern size_t malloc_usable_size (void *); #ifdef __CYGWIN__ #undef _malloc_usable_size_r #define _malloc_usable_size_r(r, p) malloc_usable_size (p) #else -extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR)); +extern size_t _malloc_usable_size_r (struct _reent *, void *); #endif /* These aren't too useful on an embedded system, but we define them anyhow. */ -extern _PTR valloc _PARAMS ((size_t)); +extern void *valloc (size_t); #ifdef __CYGWIN__ #undef _valloc_r #define _valloc_r(r, s) valloc (s) #else -extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t)); +extern void *_valloc_r (struct _reent *, size_t); #endif -extern _PTR pvalloc _PARAMS ((size_t)); +extern void *pvalloc (size_t); #ifdef __CYGWIN__ #undef _pvalloc_r #define _pvalloc_r(r, s) pvalloc (s) #else -extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t)); +extern void *_pvalloc_r (struct _reent *, size_t); #endif -extern int malloc_trim _PARAMS ((size_t)); +extern int malloc_trim (size_t); #ifdef __CYGWIN__ #undef _malloc_trim_r #define _malloc_trim_r(r, s) malloc_trim (s) #else -extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t)); +extern int _malloc_trim_r (struct _reent *, size_t); #endif +extern void __malloc_lock(struct _reent *); + +extern void __malloc_unlock(struct _reent *); + /* A compatibility routine for an earlier version of the allocator. */ -extern _VOID mstats _PARAMS ((char *)); +extern void mstats (char *); #ifdef __CYGWIN__ #undef _mstats_r #define _mstats_r(r, p) mstats (p) #else -extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); +extern void _mstats_r (struct _reent *, char *); #endif /* SVID2/XPG mallopt options */ @@ -159,7 +163,7 @@ extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); #ifndef __CYGWIN__ /* Some systems provide this, so do too for compatibility. */ -extern void cfree _PARAMS ((_PTR)); +extern void cfree (void *); #endif /* __CYGWIN__ */ #ifdef __cplusplus diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 2a322ee26..893a5d064 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -83,54 +83,54 @@ _BEGIN_STD_C /* Reentrant ANSI C functions. */ #ifndef __math_68881 -extern double atan _PARAMS((double)); -extern double cos _PARAMS((double)); -extern double sin _PARAMS((double)); -extern double tan _PARAMS((double)); -extern double tanh _PARAMS((double)); -extern double frexp _PARAMS((double, int *)); -extern double modf _PARAMS((double, double *)); -extern double ceil _PARAMS((double)); -extern double fabs _PARAMS((double)); -extern double floor _PARAMS((double)); +extern double atan (double); +extern double cos (double); +extern double sin (double); +extern double tan (double); +extern double tanh (double); +extern double frexp (double, int *); +extern double modf (double, double *); +extern double ceil (double); +extern double fabs (double); +extern double floor (double); #endif /* ! defined (__math_68881) */ /* Non reentrant ANSI C functions. */ #ifndef _REENT_ONLY #ifndef __math_68881 -extern double acos _PARAMS((double)); -extern double asin _PARAMS((double)); -extern double atan2 _PARAMS((double, double)); -extern double cosh _PARAMS((double)); -extern double sinh _PARAMS((double)); -extern double exp _PARAMS((double)); -extern double ldexp _PARAMS((double, int)); -extern double log _PARAMS((double)); -extern double log10 _PARAMS((double)); -extern double pow _PARAMS((double, double)); -extern double sqrt _PARAMS((double)); -extern double fmod _PARAMS((double, double)); +extern double acos (double); +extern double asin (double); +extern double atan2 (double, double); +extern double cosh (double); +extern double sinh (double); +extern double exp (double); +extern double ldexp (double, int); +extern double log (double); +extern double log10 (double); +extern double pow (double, double); +extern double sqrt (double); +extern double fmod (double, double); #endif /* ! defined (__math_68881) */ #endif /* ! defined (_REENT_ONLY) */ #if __MISC_VISIBLE -extern int finite _PARAMS((double)); -extern int finitef _PARAMS((float)); -extern int finitel _PARAMS((long double)); -extern int isinff _PARAMS((float)); -extern int isnanf _PARAMS((float)); +extern int finite (double); +extern int finitef (float); +extern int finitel (long double); +extern int isinff (float); +extern int isnanf (float); #ifdef __CYGWIN__ /* not implemented in newlib yet */ -extern int isinfl _PARAMS((long double)); -extern int isnanl _PARAMS((long double)); +extern int isinfl (long double); +extern int isnanl (long double); #endif #if !defined(__cplusplus) || __cplusplus < 201103L -extern int isinf _PARAMS((double)); +extern int isinf (double); #endif #endif /* __MISC_VISIBLE */ #if (__MISC_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 600)) \ && (!defined(__cplusplus) || __cplusplus < 201103L) -extern int isnan _PARAMS((double)); +extern int isnan (double); #endif #if __ISO_C_VISIBLE >= 1999 @@ -287,128 +287,128 @@ extern int __signbitd (double x); /* Non ANSI double precision functions. */ -extern double infinity _PARAMS((void)); -extern double nan _PARAMS((const char *)); -extern double copysign _PARAMS((double, double)); -extern double logb _PARAMS((double)); -extern int ilogb _PARAMS((double)); +extern double infinity (void); +extern double nan (const char *); +extern double copysign (double, double); +extern double logb (double); +extern int ilogb (double); -extern double asinh _PARAMS((double)); -extern double cbrt _PARAMS((double)); -extern double nextafter _PARAMS((double, double)); -extern double rint _PARAMS((double)); -extern double scalbn _PARAMS((double, int)); +extern double asinh (double); +extern double cbrt (double); +extern double nextafter (double, double); +extern double rint (double); +extern double scalbn (double, int); -extern double exp2 _PARAMS((double)); -extern double scalbln _PARAMS((double, long int)); -extern double tgamma _PARAMS((double)); -extern double nearbyint _PARAMS((double)); -extern long int lrint _PARAMS((double)); -extern long long int llrint _PARAMS((double)); -extern double round _PARAMS((double)); -extern long int lround _PARAMS((double)); -extern long long int llround _PARAMS((double)); -extern double trunc _PARAMS((double)); -extern double remquo _PARAMS((double, double, int *)); -extern double fdim _PARAMS((double, double)); -extern double fmax _PARAMS((double, double)); -extern double fmin _PARAMS((double, double)); -extern double fma _PARAMS((double, double, double)); +extern double exp2 (double); +extern double scalbln (double, long int); +extern double tgamma (double); +extern double nearbyint (double); +extern long int lrint (double); +extern long long int llrint (double); +extern double round (double); +extern long int lround (double); +extern long long int llround (double); +extern double trunc (double); +extern double remquo (double, double, int *); +extern double fdim (double, double); +extern double fmax (double, double); +extern double fmin (double, double); +extern double fma (double, double, double); #ifndef __math_68881 -extern double log1p _PARAMS((double)); -extern double expm1 _PARAMS((double)); +extern double log1p (double); +extern double expm1 (double); #endif /* ! defined (__math_68881) */ #ifndef _REENT_ONLY -extern double acosh _PARAMS((double)); -extern double atanh _PARAMS((double)); -extern double remainder _PARAMS((double, double)); -extern double gamma _PARAMS((double)); -extern double lgamma _PARAMS((double)); -extern double erf _PARAMS((double)); -extern double erfc _PARAMS((double)); -extern double log2 _PARAMS((double)); +extern double acosh (double); +extern double atanh (double); +extern double remainder (double, double); +extern double gamma (double); +extern double lgamma (double); +extern double erf (double); +extern double erfc (double); +extern double log2 (double); #if !defined(__cplusplus) #define log2(x) (log (x) / _M_LN2) #endif #ifndef __math_68881 -extern double hypot _PARAMS((double, double)); +extern double hypot (double, double); #endif #endif /* ! defined (_REENT_ONLY) */ /* Single precision versions of ANSI functions. */ -extern float atanf _PARAMS((float)); -extern float cosf _PARAMS((float)); -extern float sinf _PARAMS((float)); -extern float tanf _PARAMS((float)); -extern float tanhf _PARAMS((float)); -extern float frexpf _PARAMS((float, int *)); -extern float modff _PARAMS((float, float *)); -extern float ceilf _PARAMS((float)); -extern float fabsf _PARAMS((float)); -extern float floorf _PARAMS((float)); +extern float atanf (float); +extern float cosf (float); +extern float sinf (float); +extern float tanf (float); +extern float tanhf (float); +extern float frexpf (float, int *); +extern float modff (float, float *); +extern float ceilf (float); +extern float fabsf (float); +extern float floorf (float); #ifndef _REENT_ONLY -extern float acosf _PARAMS((float)); -extern float asinf _PARAMS((float)); -extern float atan2f _PARAMS((float, float)); -extern float coshf _PARAMS((float)); -extern float sinhf _PARAMS((float)); -extern float expf _PARAMS((float)); -extern float ldexpf _PARAMS((float, int)); -extern float logf _PARAMS((float)); -extern float log10f _PARAMS((float)); -extern float powf _PARAMS((float, float)); -extern float sqrtf _PARAMS((float)); -extern float fmodf _PARAMS((float, float)); +extern float acosf (float); +extern float asinf (float); +extern float atan2f (float, float); +extern float coshf (float); +extern float sinhf (float); +extern float expf (float); +extern float ldexpf (float, int); +extern float logf (float); +extern float log10f (float); +extern float powf (float, float); +extern float sqrtf (float); +extern float fmodf (float, float); #endif /* ! defined (_REENT_ONLY) */ /* Other single precision functions. */ -extern float exp2f _PARAMS((float)); -extern float scalblnf _PARAMS((float, long int)); -extern float tgammaf _PARAMS((float)); -extern float nearbyintf _PARAMS((float)); -extern long int lrintf _PARAMS((float)); -extern long long int llrintf _PARAMS((float)); -extern float roundf _PARAMS((float)); -extern long int lroundf _PARAMS((float)); -extern long long int llroundf _PARAMS((float)); -extern float truncf _PARAMS((float)); -extern float remquof _PARAMS((float, float, int *)); -extern float fdimf _PARAMS((float, float)); -extern float fmaxf _PARAMS((float, float)); -extern float fminf _PARAMS((float, float)); -extern float fmaf _PARAMS((float, float, float)); +extern float exp2f (float); +extern float scalblnf (float, long int); +extern float tgammaf (float); +extern float nearbyintf (float); +extern long int lrintf (float); +extern long long int llrintf (float); +extern float roundf (float); +extern long int lroundf (float); +extern long long int llroundf (float); +extern float truncf (float); +extern float remquof (float, float, int *); +extern float fdimf (float, float); +extern float fmaxf (float, float); +extern float fminf (float, float); +extern float fmaf (float, float, float); -extern float infinityf _PARAMS((void)); -extern float nanf _PARAMS((const char *)); -extern float copysignf _PARAMS((float, float)); -extern float logbf _PARAMS((float)); -extern int ilogbf _PARAMS((float)); +extern float infinityf (void); +extern float nanf (const char *); +extern float copysignf (float, float); +extern float logbf (float); +extern int ilogbf (float); -extern float asinhf _PARAMS((float)); -extern float cbrtf _PARAMS((float)); -extern float nextafterf _PARAMS((float, float)); -extern float rintf _PARAMS((float)); -extern float scalbnf _PARAMS((float, int)); -extern float log1pf _PARAMS((float)); -extern float expm1f _PARAMS((float)); +extern float asinhf (float); +extern float cbrtf (float); +extern float nextafterf (float, float); +extern float rintf (float); +extern float scalbnf (float, int); +extern float log1pf (float); +extern float expm1f (float); #ifndef _REENT_ONLY -extern float acoshf _PARAMS((float)); -extern float atanhf _PARAMS((float)); -extern float remainderf _PARAMS((float, float)); -extern float gammaf _PARAMS((float)); -extern float lgammaf _PARAMS((float)); -extern float erff _PARAMS((float)); -extern float erfcf _PARAMS((float)); -extern float log2f _PARAMS((float)); -extern float hypotf _PARAMS((float, float)); +extern float acoshf (float); +extern float atanhf (float); +extern float remainderf (float, float); +extern float gammaf (float); +extern float lgammaf (float); +extern float erff (float); +extern float erfcf (float); +extern float log2f (float); +extern float hypotf (float, float); #endif /* ! defined (_REENT_ONLY) */ /* Newlib doesn't fully support long double math functions so far. @@ -419,141 +419,141 @@ extern float hypotf _PARAMS((float, float)); #if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__) /* Reentrant ANSI C functions. */ #ifndef __math_68881 -extern long double atanl _PARAMS((long double)); -extern long double cosl _PARAMS((long double)); -extern long double sinl _PARAMS((long double)); -extern long double tanl _PARAMS((long double)); -extern long double tanhl _PARAMS((long double)); -extern long double frexpl _PARAMS((long double, int *)); -extern long double modfl _PARAMS((long double, long double *)); -extern long double ceill _PARAMS((long double)); -extern long double fabsl _PARAMS((long double)); -extern long double floorl _PARAMS((long double)); -extern long double log1pl _PARAMS((long double)); -extern long double expm1l _PARAMS((long double)); +extern long double atanl (long double); +extern long double cosl (long double); +extern long double sinl (long double); +extern long double tanl (long double); +extern long double tanhl (long double); +extern long double frexpl (long double, int *); +extern long double modfl (long double, long double *); +extern long double ceill (long double); +extern long double fabsl (long double); +extern long double floorl (long double); +extern long double log1pl (long double); +extern long double expm1l (long double); #endif /* ! defined (__math_68881) */ /* Non reentrant ANSI C functions. */ #ifndef _REENT_ONLY #ifndef __math_68881 -extern long double acosl _PARAMS((long double)); -extern long double asinl _PARAMS((long double)); -extern long double atan2l _PARAMS((long double, long double)); -extern long double coshl _PARAMS((long double)); -extern long double sinhl _PARAMS((long double)); -extern long double expl _PARAMS((long double)); -extern long double ldexpl _PARAMS((long double, int)); -extern long double logl _PARAMS((long double)); -extern long double log10l _PARAMS((long double)); -extern long double powl _PARAMS((long double, long double)); -extern long double sqrtl _PARAMS((long double)); -extern long double fmodl _PARAMS((long double, long double)); -extern long double hypotl _PARAMS((long double, long double)); +extern long double acosl (long double); +extern long double asinl (long double); +extern long double atan2l (long double, long double); +extern long double coshl (long double); +extern long double sinhl (long double); +extern long double expl (long double); +extern long double ldexpl (long double, int); +extern long double logl (long double); +extern long double log10l (long double); +extern long double powl (long double, long double); +extern long double sqrtl (long double); +extern long double fmodl (long double, long double); +extern long double hypotl (long double, long double); #endif /* ! defined (__math_68881) */ #endif /* ! defined (_REENT_ONLY) */ -extern long double copysignl _PARAMS((long double, long double)); -extern long double nanl _PARAMS((const char *)); -extern int ilogbl _PARAMS((long double)); -extern long double asinhl _PARAMS((long double)); -extern long double cbrtl _PARAMS((long double)); -extern long double nextafterl _PARAMS((long double, long double)); -extern float nexttowardf _PARAMS((float, long double)); -extern double nexttoward _PARAMS((double, long double)); -extern long double nexttowardl _PARAMS((long double, long double)); -extern long double logbl _PARAMS((long double)); -extern long double log2l _PARAMS((long double)); -extern long double rintl _PARAMS((long double)); -extern long double scalbnl _PARAMS((long double, int)); -extern long double exp2l _PARAMS((long double)); -extern long double scalblnl _PARAMS((long double, long)); -extern long double tgammal _PARAMS((long double)); -extern long double nearbyintl _PARAMS((long double)); -extern long int lrintl _PARAMS((long double)); -extern long long int llrintl _PARAMS((long double)); -extern long double roundl _PARAMS((long double)); -extern long lroundl _PARAMS((long double)); -extern long long int llroundl _PARAMS((long double)); -extern long double truncl _PARAMS((long double)); -extern long double remquol _PARAMS((long double, long double, int *)); -extern long double fdiml _PARAMS((long double, long double)); -extern long double fmaxl _PARAMS((long double, long double)); -extern long double fminl _PARAMS((long double, long double)); -extern long double fmal _PARAMS((long double, long double, long double)); +extern long double copysignl (long double, long double); +extern long double nanl (const char *); +extern int ilogbl (long double); +extern long double asinhl (long double); +extern long double cbrtl (long double); +extern long double nextafterl (long double, long double); +extern float nexttowardf (float, long double); +extern double nexttoward (double, long double); +extern long double nexttowardl (long double, long double); +extern long double logbl (long double); +extern long double log2l (long double); +extern long double rintl (long double); +extern long double scalbnl (long double, int); +extern long double exp2l (long double); +extern long double scalblnl (long double, long); +extern long double tgammal (long double); +extern long double nearbyintl (long double); +extern long int lrintl (long double); +extern long long int llrintl (long double); +extern long double roundl (long double); +extern long lroundl (long double); +extern long long int llroundl (long double); +extern long double truncl (long double); +extern long double remquol (long double, long double, int *); +extern long double fdiml (long double, long double); +extern long double fmaxl (long double, long double); +extern long double fminl (long double, long double); +extern long double fmal (long double, long double, long double); #ifndef _REENT_ONLY -extern long double acoshl _PARAMS((long double)); -extern long double atanhl _PARAMS((long double)); -extern long double remainderl _PARAMS((long double, long double)); -extern long double lgammal _PARAMS((long double)); -extern long double erfl _PARAMS((long double)); -extern long double erfcl _PARAMS((long double)); +extern long double acoshl (long double); +extern long double atanhl (long double); +extern long double remainderl (long double, long double); +extern long double lgammal (long double); +extern long double erfl (long double); +extern long double erfcl (long double); #endif /* ! defined (_REENT_ONLY) */ #else /* !_LDBL_EQ_DBL && !__CYGWIN__ */ -extern long double hypotl _PARAMS((long double, long double)); -extern long double sqrtl _PARAMS((long double)); +extern long double hypotl (long double, long double); +extern long double sqrtl (long double); #ifdef __i386__ /* Other long double precision functions. */ -extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); -extern long int lrintl _PARAMS((_LONG_DOUBLE)); -extern long long int llrintl _PARAMS((_LONG_DOUBLE)); +extern _LONG_DOUBLE rintl (_LONG_DOUBLE); +extern long int lrintl (_LONG_DOUBLE); +extern long long int llrintl (_LONG_DOUBLE); #endif /* __i386__ */ #endif /* !_LDBL_EQ_DBL && !__CYGWIN__ */ #endif /* __ISO_C_VISIBLE >= 1999 */ #if __MISC_VISIBLE -extern double drem _PARAMS((double, double)); -extern float dremf _PARAMS((float, float)); +extern double drem (double, double); +extern float dremf (float, float); #ifdef __CYGWIN__ -extern float dreml _PARAMS((long double, long double)); +extern float dreml (long double, long double); #endif /* __CYGWIN__ */ -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 *)); +extern double gamma_r (double, int *); +extern double lgamma_r (double, int *); +extern float gammaf_r (float, int *); +extern float lgammaf_r (float, int *); #endif #if __MISC_VISIBLE || __XSI_VISIBLE -extern double y0 _PARAMS((double)); -extern double y1 _PARAMS((double)); -extern double yn _PARAMS((int, double)); -extern double j0 _PARAMS((double)); -extern double j1 _PARAMS((double)); -extern double jn _PARAMS((int, double)); +extern double y0 (double); +extern double y1 (double); +extern double yn (int, double); +extern double j0 (double); +extern double j1 (double); +extern double jn (int, double); #endif #if __MISC_VISIBLE || __XSI_VISIBLE >= 600 -extern float y0f _PARAMS((float)); -extern float y1f _PARAMS((float)); -extern float ynf _PARAMS((int, float)); -extern float j0f _PARAMS((float)); -extern float j1f _PARAMS((float)); -extern float jnf _PARAMS((int, float)); +extern float y0f (float); +extern float y1f (float); +extern float ynf (int, float); +extern float j0f (float); +extern float j1f (float); +extern float jnf (int, float); #endif /* GNU extensions */ #if __GNU_VISIBLE -extern void sincos _PARAMS((double, double *, double *)); -extern void sincosf _PARAMS((float, float *, float *)); +extern void sincos (double, double *, double *); +extern void sincosf (float, float *, float *); #ifdef __CYGWIN__ -extern void sincosl _PARAMS((long double, long double *, long double *)); +extern void sincosl (long double, long double *, long double *); #endif /* __CYGWIN__ */ # ifndef exp10 -extern double exp10 _PARAMS((double)); +extern double exp10 (double); # endif # ifndef pow10 -extern double pow10 _PARAMS((double)); +extern double pow10 (double); # endif # ifndef exp10f -extern float exp10f _PARAMS((float)); +extern float exp10f (float); # endif # ifndef pow10f -extern float pow10f _PARAMS((float)); +extern float pow10f (float); # endif #ifdef __CYGWIN__ # ifndef exp10l -extern float exp10l _PARAMS((float)); +extern float exp10l (float); # endif # ifndef pow10l -extern float pow10l _PARAMS((float)); +extern float pow10l (float); # endif #endif /* __CYGWIN__ */ #endif /* __GNU_VISIBLE */ @@ -562,7 +562,7 @@ extern float pow10l _PARAMS((float)); /* The gamma functions use a global variable, signgam. */ #ifndef _REENT_ONLY #define signgam (*__signgam()) -extern int *__signgam _PARAMS((void)); +extern int *__signgam (void); #endif /* ! defined (_REENT_ONLY) */ #define __signgam_r(ptr) _REENT_SIGNGAM(ptr) @@ -587,9 +587,9 @@ struct exception }; #ifdef __cplusplus -extern int matherr _PARAMS((struct __exception *e)); +extern int matherr (struct __exception *e); #else -extern int matherr _PARAMS((struct exception *e)); +extern int matherr (struct exception *e); #endif /* Values for the type field of struct exception. */ diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h index 516131d83..c9d24d6e0 100644 --- a/newlib/libc/include/pthread.h +++ b/newlib/libc/include/pthread.h @@ -39,34 +39,32 @@ struct _pthread_cleanup_context { }; /* Register Fork Handlers */ -int _EXFUN(pthread_atfork,(void (*prepare)(void), void (*parent)(void), - void (*child)(void))); +int pthread_atfork (void (*prepare)(void), void (*parent)(void), + void (*child)(void)); /* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ -int _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_destroy, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_getpshared, - (_CONST pthread_mutexattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_mutexattr_setpshared, - (pthread_mutexattr_t *__attr, int __pshared)); +int pthread_mutexattr_init (pthread_mutexattr_t *__attr); +int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); +int pthread_mutexattr_getpshared (const pthread_mutexattr_t *__attr, + int *__pshared); +int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, + int __pshared); #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) /* Single UNIX Specification 2 Mutex Attributes types */ -int _EXFUN(pthread_mutexattr_gettype, - (_CONST pthread_mutexattr_t *__attr, int *__kind)); -int _EXFUN(pthread_mutexattr_settype, - (pthread_mutexattr_t *__attr, int __kind)); +int pthread_mutexattr_gettype (const pthread_mutexattr_t *__attr, int *__kind); +int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind); #endif /* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */ -int _EXFUN(pthread_mutex_init, - (pthread_mutex_t *__mutex, _CONST pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *__mutex)); +int pthread_mutex_init (pthread_mutex_t *__mutex, + const pthread_mutexattr_t *__attr); +int pthread_mutex_destroy (pthread_mutex_t *__mutex); /* This is used to statically initialize a pthread_mutex_t. Example: @@ -78,38 +76,36 @@ int _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *__mutex)); /* Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ -int _EXFUN(pthread_mutex_lock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex)); +int pthread_mutex_lock (pthread_mutex_t *__mutex); +int pthread_mutex_trylock (pthread_mutex_t *__mutex); +int pthread_mutex_unlock (pthread_mutex_t *__mutex); #if defined(_POSIX_TIMEOUTS) -int _EXFUN(pthread_mutex_timedlock, - (pthread_mutex_t *__mutex, _CONST struct timespec *__timeout)); +int pthread_mutex_timedlock (pthread_mutex_t *__mutex, + const struct timespec *__timeout); #endif /* _POSIX_TIMEOUTS */ /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ -int _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr)); -int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr)); +int pthread_condattr_init (pthread_condattr_t *__attr); +int 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 pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr, + clockid_t *__restrict __clock_id); +int 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, - (pthread_condattr_t *__attr, int __pshared)); +int pthread_condattr_getpshared (const pthread_condattr_t *__attr, + int *__pshared); +int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared); /* Initializing and Destroying a Condition Variable, P1003.1c/Draft 10, p. 87 */ -int _EXFUN(pthread_cond_init, - (pthread_cond_t *__cond, _CONST pthread_condattr_t *__attr)); -int _EXFUN(pthread_cond_destroy, (pthread_cond_t *__mutex)); +int pthread_cond_init (pthread_cond_t *__cond, + const pthread_condattr_t *__attr); +int pthread_cond_destroy (pthread_cond_t *__mutex); /* This is used to statically initialize a pthread_cond_t. Example: @@ -120,74 +116,71 @@ int _EXFUN(pthread_cond_destroy, (pthread_cond_t *__mutex)); /* Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ -int _EXFUN(pthread_cond_signal, (pthread_cond_t *__cond)); -int _EXFUN(pthread_cond_broadcast, (pthread_cond_t *__cond)); +int pthread_cond_signal (pthread_cond_t *__cond); +int pthread_cond_broadcast (pthread_cond_t *__cond); /* Waiting on a Condition, P1003.1c/Draft 10, p. 105 */ -int _EXFUN(pthread_cond_wait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex)); +int pthread_cond_wait (pthread_cond_t *__cond, pthread_mutex_t *__mutex); -int _EXFUN(pthread_cond_timedwait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex, - _CONST struct timespec *__abstime)); +int pthread_cond_timedwait (pthread_cond_t *__cond, + pthread_mutex_t *__mutex, + const struct timespec *__abstime); #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) /* Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 */ -int _EXFUN(pthread_attr_setscope, - (pthread_attr_t *__attr, int __contentionscope)); -int _EXFUN(pthread_attr_getscope, - (_CONST pthread_attr_t *__attr, int *__contentionscope)); -int _EXFUN(pthread_attr_setinheritsched, - (pthread_attr_t *__attr, int __inheritsched)); -int _EXFUN(pthread_attr_getinheritsched, - (_CONST pthread_attr_t *__attr, int *__inheritsched)); -int _EXFUN(pthread_attr_setschedpolicy, - (pthread_attr_t *__attr, int __policy)); -int _EXFUN(pthread_attr_getschedpolicy, - (_CONST pthread_attr_t *__attr, int *__policy)); +int pthread_attr_setscope (pthread_attr_t *__attr, int __contentionscope); +int pthread_attr_getscope (const pthread_attr_t *__attr, + int *__contentionscope); +int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inheritsched); +int pthread_attr_getinheritsched (const pthread_attr_t *__attr, + int *__inheritsched); +int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy); +int pthread_attr_getschedpolicy (const pthread_attr_t *__attr, + int *__policy); #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ -int _EXFUN(pthread_attr_setschedparam, - (pthread_attr_t *__attr, _CONST struct sched_param *__param)); -int _EXFUN(pthread_attr_getschedparam, - (_CONST pthread_attr_t *__attr, struct sched_param *__param)); +int pthread_attr_setschedparam (pthread_attr_t *__attr, + const struct sched_param *__param); +int pthread_attr_getschedparam (const pthread_attr_t *__attr, + struct sched_param *__param); #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) /* Dynamic Thread Scheduling Parameters Access, P1003.1c/Draft 10, p. 124 */ -int _EXFUN(pthread_getschedparam, - (pthread_t __pthread, int *__policy, struct sched_param *__param)); -int _EXFUN(pthread_setschedparam, - (pthread_t __pthread, int __policy, struct sched_param *__param)); +int pthread_getschedparam (pthread_t __pthread, int *__policy, + struct sched_param *__param); +int pthread_setschedparam (pthread_t __pthread, int __policy, + const struct sched_param *__param); /* Set Scheduling Priority of a Thread */ -int _EXFUN(pthread_setschedprio, (pthread_t thread, int prio)); +int pthread_setschedprio (pthread_t thread, int prio); #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ #if __GNU_VISIBLE -int pthread_getname_np(pthread_t, char *, size_t) __nonnull(2); +int pthread_getname_np(pthread_t, char *, size_t) __nonnull((2)); -int pthread_setname_np(pthread_t, const char *) __nonnull(2); +int pthread_setname_np(pthread_t, const char *) __nonnull((2)); #endif #if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) /* Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 */ -int _EXFUN(pthread_mutexattr_setprotocol, - (pthread_mutexattr_t *__attr, int __protocol)); -int _EXFUN(pthread_mutexattr_getprotocol, - (_CONST pthread_mutexattr_t *__attr, int *__protocol)); -int _EXFUN(pthread_mutexattr_setprioceiling, - (pthread_mutexattr_t *__attr, int __prioceiling)); -int _EXFUN(pthread_mutexattr_getprioceiling, - (_CONST pthread_mutexattr_t *__attr, int *__prioceiling)); +int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, + int __protocol); +int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *__attr, + int *__protocol); +int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, + int __prioceiling); +int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *__attr, + int *__prioceiling); #endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */ @@ -195,37 +188,33 @@ int _EXFUN(pthread_mutexattr_getprioceiling, /* Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 */ -int _EXFUN(pthread_mutex_setprioceiling, - (pthread_mutex_t *__mutex, int __prioceiling, int *__old_ceiling)); -int _EXFUN(pthread_mutex_getprioceiling, - (pthread_mutex_t *__mutex, int *__prioceiling)); +int pthread_mutex_setprioceiling (pthread_mutex_t *__mutex, + int __prioceiling, int *__old_ceiling); +int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex, + int *__prioceiling); #endif /* _POSIX_THREAD_PRIO_PROTECT */ /* Thread Creation Attributes, P1003.1c/Draft 10, p, 140 */ -int _EXFUN(pthread_attr_init, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_destroy, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_setstack, (pthread_attr_t *attr, - void *__stackaddr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstack, (_CONST pthread_attr_t *attr, - void **__stackaddr, size_t *__stacksize)); -int _EXFUN(pthread_attr_getstacksize, - (_CONST pthread_attr_t *__attr, size_t *__stacksize)); -int _EXFUN(pthread_attr_setstacksize, - (pthread_attr_t *__attr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstackaddr, - (_CONST pthread_attr_t *__attr, void **__stackaddr)); -int _EXFUN(pthread_attr_setstackaddr, - (pthread_attr_t *__attr, void *__stackaddr)); -int _EXFUN(pthread_attr_getdetachstate, - (_CONST pthread_attr_t *__attr, int *__detachstate)); -int _EXFUN(pthread_attr_setdetachstate, - (pthread_attr_t *__attr, int __detachstate)); -int _EXFUN(pthread_attr_getguardsize, - (_CONST pthread_attr_t *__attr, size_t *__guardsize)); -int _EXFUN(pthread_attr_setguardsize, - (pthread_attr_t *__attr, size_t __guardsize)); +int pthread_attr_init (pthread_attr_t *__attr); +int pthread_attr_destroy (pthread_attr_t *__attr); +int pthread_attr_setstack (pthread_attr_t *attr, + void *__stackaddr, size_t __stacksize); +int pthread_attr_getstack (const pthread_attr_t *attr, + void **__stackaddr, size_t *__stacksize); +int pthread_attr_getstacksize (const pthread_attr_t *__attr, + size_t *__stacksize); +int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize); +int pthread_attr_getstackaddr (const pthread_attr_t *__attr, + void **__stackaddr); +int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr); +int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate); +int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate); +int pthread_attr_getguardsize (const pthread_attr_t *__attr, + size_t *__guardsize); +int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize); /* POSIX thread APIs beyond the POSIX standard but provided * in GNU/Linux. They may be provided by other OSes for @@ -233,59 +222,55 @@ int _EXFUN(pthread_attr_setguardsize, */ #if __GNU_VISIBLE #if defined(__rtems__) -int _EXFUN(pthread_attr_setaffinity_np, - (pthread_attr_t *__attr, size_t __cpusetsize, - const cpu_set_t *__cpuset)); -int _EXFUN(pthread_attr_getaffinity_np, - (const pthread_attr_t *__attr, size_t __cpusetsize, - cpu_set_t *__cpuset)); +int pthread_attr_setaffinity_np (pthread_attr_t *__attr, + size_t __cpusetsize, + const cpu_set_t *__cpuset); +int pthread_attr_getaffinity_np (const pthread_attr_t *__attr, + size_t __cpusetsize, cpu_set_t *__cpuset); -int _EXFUN(pthread_setaffinity_np, - (pthread_t __id, size_t __cpusetsize, const cpu_set_t *__cpuset)); -int _EXFUN(pthread_getaffinity_np, - (const pthread_t __id, size_t __cpusetsize, cpu_set_t *__cpuset)); +int pthread_setaffinity_np (pthread_t __id, size_t __cpusetsize, + const cpu_set_t *__cpuset); +int pthread_getaffinity_np (const pthread_t __id, size_t __cpusetsize, + cpu_set_t *__cpuset); -int _EXFUN(pthread_getattr_np, - (pthread_t __id, pthread_attr_t *__attr)); +int pthread_getattr_np (pthread_t __id, pthread_attr_t *__attr); #endif /* defined(__rtems__) */ #endif /* __GNU_VISIBLE */ /* Thread Creation, P1003.1c/Draft 10, p. 144 */ -int _EXFUN(pthread_create, - (pthread_t *__pthread, _CONST pthread_attr_t *__attr, - void *(*__start_routine)( void * ), void *__arg)); +int pthread_create (pthread_t *__pthread, const pthread_attr_t *__attr, + void *(*__start_routine)(void *), void *__arg); /* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */ -int _EXFUN(pthread_join, (pthread_t __pthread, void **__value_ptr)); +int pthread_join (pthread_t __pthread, void **__value_ptr); /* Detaching a Thread, P1003.1c/Draft 10, p. 149 */ -int _EXFUN(pthread_detach, (pthread_t __pthread)); +int pthread_detach (pthread_t __pthread); /* Thread Termination, p1003.1c/Draft 10, p. 150 */ -void _EXFUN(pthread_exit, (void *__value_ptr)) __dead2; +void pthread_exit (void *__value_ptr) __dead2; /* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */ -pthread_t _EXFUN(pthread_self, (void)); +pthread_t pthread_self (void); /* Compare Thread IDs, p1003.1c/Draft 10, p. 153 */ -int _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2)); +int 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)); +int 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)); +int pthread_setconcurrency (int new_level); +int pthread_getconcurrency (void); #if __BSD_VISIBLE || __GNU_VISIBLE -void _EXFUN(pthread_yield, (void)); +void pthread_yield (void); #endif /* Dynamic Package Initialization */ @@ -298,23 +283,22 @@ void _EXFUN(pthread_yield, (void)); #define PTHREAD_ONCE_INIT _PTHREAD_ONCE_INIT -int _EXFUN(pthread_once, - (pthread_once_t *__once_control, void (*__init_routine)(void))); +int pthread_once (pthread_once_t *__once_control, + void (*__init_routine)(void)); /* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ -int _EXFUN(pthread_key_create, - (pthread_key_t *__key, void (*__destructor)( void * ))); +int pthread_key_create (pthread_key_t *__key, + void (*__destructor)(void *)); /* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */ -int _EXFUN(pthread_setspecific, - (pthread_key_t __key, _CONST void *__value)); -void * _EXFUN(pthread_getspecific, (pthread_key_t __key)); +int pthread_setspecific (pthread_key_t __key, const void *__value); +void * pthread_getspecific (pthread_key_t __key); /* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */ -int _EXFUN(pthread_key_delete, (pthread_key_t __key)); +int pthread_key_delete (pthread_key_t __key); /* Execution of a Thread, P1003.1c/Draft 10, p. 181 */ @@ -326,23 +310,21 @@ int _EXFUN(pthread_key_delete, (pthread_key_t __key)); #define PTHREAD_CANCELED ((void *) -1) -int _EXFUN(pthread_cancel, (pthread_t __pthread)); +int pthread_cancel (pthread_t __pthread); /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ -int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); -int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); -void _EXFUN(pthread_testcancel, (void)); +int pthread_setcancelstate (int __state, int *__oldstate); +int pthread_setcanceltype (int __type, int *__oldtype); +void pthread_testcancel (void); /* Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 */ -void _EXFUN(_pthread_cleanup_push, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); +void _pthread_cleanup_push (struct _pthread_cleanup_context *_context, + void (*_routine)(void *), void *_arg); -void _EXFUN(_pthread_cleanup_pop, - (struct _pthread_cleanup_context *_context, - int _execute)); +void _pthread_cleanup_pop (struct _pthread_cleanup_context *_context, + int _execute); /* It is intentional to open and close the scope in two different macros */ #define pthread_cleanup_push(_routine, _arg) \ @@ -355,13 +337,11 @@ void _EXFUN(_pthread_cleanup_pop, } while (0) #if __GNU_VISIBLE -void _EXFUN(_pthread_cleanup_push_defer, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); +void _pthread_cleanup_push_defer (struct _pthread_cleanup_context *_context, + void (*_routine)(void *), void *_arg); -void _EXFUN(_pthread_cleanup_pop_restore, - (struct _pthread_cleanup_context *_context, - int _execute)); +void _pthread_cleanup_pop_restore (struct _pthread_cleanup_context *_context, + int _execute); /* It is intentional to open and close the scope in two different macros */ #define pthread_cleanup_push_defer_np(_routine, _arg) \ @@ -378,8 +358,7 @@ void _EXFUN(_pthread_cleanup_pop_restore, /* Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58 */ -int _EXFUN(pthread_getcpuclockid, - (pthread_t __pthread_id, clockid_t *__clock_id)); +int pthread_getcpuclockid (pthread_t __pthread_id, clockid_t *__clock_id); #endif /* defined(_POSIX_THREAD_CPUTIME) */ @@ -388,31 +367,30 @@ int _EXFUN(pthread_getcpuclockid, #if defined(_POSIX_BARRIERS) -int _EXFUN(pthread_barrierattr_init, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_destroy, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_getpshared, - (_CONST pthread_barrierattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_barrierattr_setpshared, - (pthread_barrierattr_t *__attr, int __pshared)); +int pthread_barrierattr_init (pthread_barrierattr_t *__attr); +int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr); +int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__attr, + int *__pshared); +int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared); #define PTHREAD_BARRIER_SERIAL_THREAD -1 -int _EXFUN(pthread_barrier_init, - (pthread_barrier_t *__barrier, - _CONST pthread_barrierattr_t *__attr, unsigned __count)); -int _EXFUN(pthread_barrier_destroy, (pthread_barrier_t *__barrier)); -int _EXFUN(pthread_barrier_wait,(pthread_barrier_t *__barrier)); +int pthread_barrier_init (pthread_barrier_t *__barrier, + const pthread_barrierattr_t *__attr, + unsigned __count); +int pthread_barrier_destroy (pthread_barrier_t *__barrier); +int pthread_barrier_wait (pthread_barrier_t *__barrier); #endif /* defined(_POSIX_BARRIERS) */ #if defined(_POSIX_SPIN_LOCKS) -int _EXFUN(pthread_spin_init, - (pthread_spinlock_t *__spinlock, int __pshared)); -int _EXFUN(pthread_spin_destroy, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_lock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_trylock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_unlock, (pthread_spinlock_t *__spinlock)); +int pthread_spin_init (pthread_spinlock_t *__spinlock, int __pshared); +int pthread_spin_destroy (pthread_spinlock_t *__spinlock); +int pthread_spin_lock (pthread_spinlock_t *__spinlock); +int pthread_spin_trylock (pthread_spinlock_t *__spinlock); +int pthread_spin_unlock (pthread_spinlock_t *__spinlock); #endif /* defined(_POSIX_SPIN_LOCKS) */ @@ -425,25 +403,25 @@ int _EXFUN(pthread_spin_unlock, (pthread_spinlock_t *__spinlock)); #define PTHREAD_RWLOCK_INITIALIZER _PTHREAD_RWLOCK_INITIALIZER -int _EXFUN(pthread_rwlockattr_init, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_destroy, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_getpshared, - (_CONST pthread_rwlockattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_rwlockattr_setpshared, - (pthread_rwlockattr_t *__attr, int __pshared)); +int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr); +int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr); +int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__attr, + int *__pshared); +int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared); -int _EXFUN(pthread_rwlock_init, - (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedrdlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); -int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedwrlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); +int pthread_rwlock_init (pthread_rwlock_t *__rwlock, + const pthread_rwlockattr_t *__attr); +int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); +int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); +int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); +int pthread_rwlock_timedrdlock (pthread_rwlock_t *__rwlock, + const struct timespec *__abstime); +int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); +int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); +int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); +int pthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock, + const struct timespec *__abstime); #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ diff --git a/newlib/libc/include/reent.h b/newlib/libc/include/reent.h index b7664b0b9..2b01fbe8f 100644 --- a/newlib/libc/include/reent.h +++ b/newlib/libc/include/reent.h @@ -136,29 +136,29 @@ struct timezone; #else /* Reentrant versions of system calls. */ -extern int _close_r _PARAMS ((struct _reent *, int)); -extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *)); -extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); -extern int _fork_r _PARAMS ((struct _reent *)); -extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); -extern int _getpid_r _PARAMS ((struct _reent *)); -extern int _isatty_r _PARAMS ((struct _reent *, int)); -extern int _kill_r _PARAMS ((struct _reent *, int, int)); -extern int _link_r _PARAMS ((struct _reent *, const char *, const char *)); -extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int)); -extern int _mkdir_r _PARAMS ((struct _reent *, const char *, int)); -extern int _open_r _PARAMS ((struct _reent *, const char *, int, int)); -extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t)); -extern int _rename_r _PARAMS ((struct _reent *, const char *, const char *)); -extern void *_sbrk_r _PARAMS ((struct _reent *, ptrdiff_t)); -extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); -extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); -extern int _unlink_r _PARAMS ((struct _reent *, const char *)); -extern int _wait_r _PARAMS ((struct _reent *, int *)); -extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); +extern int _close_r (struct _reent *, int); +extern int _execve_r (struct _reent *, const char *, char *const *, char *const *); +extern int _fcntl_r (struct _reent *, int, int, int); +extern int _fork_r (struct _reent *); +extern int _fstat_r (struct _reent *, int, struct stat *); +extern int _getpid_r (struct _reent *); +extern int _isatty_r (struct _reent *, int); +extern int _kill_r (struct _reent *, int, int); +extern int _link_r (struct _reent *, const char *, const char *); +extern _off_t _lseek_r (struct _reent *, int, _off_t, int); +extern int _mkdir_r (struct _reent *, const char *, int); +extern int _open_r (struct _reent *, const char *, int, int); +extern _ssize_t _read_r (struct _reent *, int, void *, size_t); +extern int _rename_r (struct _reent *, const char *, const char *); +extern void *_sbrk_r (struct _reent *, ptrdiff_t); +extern int _stat_r (struct _reent *, const char *, struct stat *); +extern _CLOCK_T_ _times_r (struct _reent *, struct tms *); +extern int _unlink_r (struct _reent *, const char *); +extern int _wait_r (struct _reent *, int *); +extern _ssize_t _write_r (struct _reent *, int, const void *, size_t); /* This one is not guaranteed to be available on all targets. */ -extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void *__tzp)); +extern int _gettimeofday_r (struct _reent *, struct timeval *__tp, void *__tzp); #ifdef __LARGE64_FILES @@ -168,10 +168,10 @@ extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void #endif struct stat64; -extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); -extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); -extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); -extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *)); +extern _off64_t _lseek64_r (struct _reent *, int, _off64_t, int); +extern int _fstat64_r (struct _reent *, int, struct stat64 *); +extern int _open64_r (struct _reent *, const char *, int, int); +extern int _stat64_r (struct _reent *, const char *, struct stat64 *); /* Don't pollute namespace if not building newlib. */ #if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB) diff --git a/newlib/libc/include/rpc/xdr.h b/newlib/libc/include/rpc/xdr.h index 4f93bf38e..139e0c7ce 100644 --- a/newlib/libc/include/rpc/xdr.h +++ b/newlib/libc/include/rpc/xdr.h @@ -108,37 +108,37 @@ enum xdr_op typedef struct __rpc_xdr { enum xdr_op x_op; /* operation; fast additional param */ - _CONST struct xdr_ops + const struct xdr_ops { /* get a long from underlying stream */ - bool_t _EXFNPTR (x_getlong, (struct __rpc_xdr *, long *)); + bool_t (*x_getlong) (struct __rpc_xdr *, long *); /* put a long to " */ - bool_t _EXFNPTR (x_putlong, (struct __rpc_xdr *, _CONST long *)); + bool_t (*x_putlong) (struct __rpc_xdr *, const long *); /* get some bytes from " */ - bool_t _EXFNPTR (x_getbytes, (struct __rpc_xdr *, char *, u_int)); + bool_t (*x_getbytes) (struct __rpc_xdr *, char *, u_int); /* put some bytes to " */ - bool_t _EXFNPTR (x_putbytes, (struct __rpc_xdr *, _CONST char *, u_int)); + bool_t (*x_putbytes) (struct __rpc_xdr *, const char *, u_int); /* returns bytes off from beginning */ - u_int _EXFNPTR (x_getpostn, (struct __rpc_xdr *)); + u_int (*x_getpostn) (struct __rpc_xdr *); /* lets you reposition the stream */ - bool_t _EXFNPTR (x_setpostn, (struct __rpc_xdr *, u_int)); + bool_t (*x_setpostn) (struct __rpc_xdr *, u_int); /* buf quick ptr to buffered data */ - int32_t * _EXFNPTR (x_inline, (struct __rpc_xdr *, u_int)); + int32_t * (*x_inline) (struct __rpc_xdr *, u_int); /* free privates of this xdr_stream */ - void _EXFNPTR (x_destroy, (struct __rpc_xdr *)); + void (*x_destroy) (struct __rpc_xdr *); /* get an int32 from this xdr_stream */ - bool_t _EXFNPTR (x_getint32, (struct __rpc_xdr *, int32_t *)); + bool_t (*x_getint32) (struct __rpc_xdr *, int32_t *); /* put an int32 to the underlying stream */ - bool_t _EXFNPTR (x_putint32, (struct __rpc_xdr *, _CONST int32_t *)); + bool_t (*x_putint32) (struct __rpc_xdr *, const int32_t *); } *x_ops; char *x_public; /* users' data */ @@ -156,7 +156,7 @@ typedef struct __rpc_xdr * allocate dynamic storage of the appropriate size and return it. * bool_t (*xdrproc_t)(XDR *, some_type *) */ -typedef bool_t _EXFNPTR(xdrproc_t, (XDR *, ...)); +typedef bool_t (*xdrproc_t) (XDR *, ...); /* * Operations defined on a XDR handle @@ -292,51 +292,51 @@ struct xdr_discrim /* * These are the "generic" xdr routines. */ -extern bool_t _EXFUN (xdr_void, (void)); -extern bool_t _EXFUN (xdr_short, (XDR *, short *)); -extern bool_t _EXFUN (xdr_u_short, (XDR *, u_short *)); -extern bool_t _EXFUN (xdr_int, (XDR *, int *)); -extern bool_t _EXFUN (xdr_u_int, (XDR *, u_int *)); -extern bool_t _EXFUN (xdr_long, (XDR *, long *)); -extern bool_t _EXFUN (xdr_u_long, (XDR *, u_long *)); -extern bool_t _EXFUN (xdr_int8_t, (XDR *, int8_t *)); -extern bool_t _EXFUN (xdr_uint8_t, (XDR *, uint8_t *)); -extern bool_t _EXFUN (xdr_u_int8_t, (XDR *, u_int8_t *)); -extern bool_t _EXFUN (xdr_int16_t, (XDR *, int16_t *)); -extern bool_t _EXFUN (xdr_uint16_t, (XDR *, uint16_t *)); -extern bool_t _EXFUN (xdr_u_int16_t, (XDR *, u_int16_t *)); -extern bool_t _EXFUN (xdr_int32_t, (XDR *, int32_t *)); -extern bool_t _EXFUN (xdr_uint32_t, (XDR *, uint32_t *)); -extern bool_t _EXFUN (xdr_u_int32_t, (XDR *, u_int32_t *)); +extern bool_t xdr_void (void); +extern bool_t xdr_short (XDR *, short *); +extern bool_t xdr_u_short (XDR *, u_short *); +extern bool_t xdr_int (XDR *, int *); +extern bool_t xdr_u_int (XDR *, u_int *); +extern bool_t xdr_long (XDR *, long *); +extern bool_t xdr_u_long (XDR *, u_long *); +extern bool_t xdr_int8_t (XDR *, int8_t *); +extern bool_t xdr_uint8_t (XDR *, uint8_t *); +extern bool_t xdr_u_int8_t (XDR *, u_int8_t *); +extern bool_t xdr_int16_t (XDR *, int16_t *); +extern bool_t xdr_uint16_t (XDR *, uint16_t *); +extern bool_t xdr_u_int16_t (XDR *, u_int16_t *); +extern bool_t xdr_int32_t (XDR *, int32_t *); +extern bool_t xdr_uint32_t (XDR *, uint32_t *); +extern bool_t xdr_u_int32_t (XDR *, u_int32_t *); #if defined(___int64_t_defined) -extern bool_t _EXFUN (xdr_int64_t, (XDR *, int64_t *)); -extern bool_t _EXFUN (xdr_uint64_t, (XDR *, uint64_t *)); -extern bool_t _EXFUN (xdr_u_int64_t, (XDR *, u_int64_t *)); +extern bool_t xdr_int64_t (XDR *, int64_t *); +extern bool_t xdr_uint64_t (XDR *, uint64_t *); +extern bool_t xdr_u_int64_t (XDR *, u_int64_t *); #endif /* ___int64_t_defined */ -extern bool_t _EXFUN (xdr_bool, (XDR *, bool_t *)); -extern bool_t _EXFUN (xdr_enum, (XDR *, enum_t *)); -extern bool_t _EXFUN (xdr_array, (XDR *, char **, u_int *, u_int, u_int, xdrproc_t)); -extern bool_t _EXFUN (xdr_bytes, (XDR *, char **, u_int *, u_int)); -extern bool_t _EXFUN (xdr_opaque, (XDR *, char *, u_int)); -extern bool_t _EXFUN (xdr_string, (XDR *, char **, u_int)); -extern bool_t _EXFUN (xdr_union, (XDR *, enum_t *, char *, - _CONST struct xdr_discrim *, xdrproc_t)); -extern bool_t _EXFUN (xdr_char, (XDR *, char *)); -extern bool_t _EXFUN (xdr_u_char, (XDR *, u_char *)); -extern bool_t _EXFUN (xdr_vector, (XDR *, char *, u_int, u_int, xdrproc_t)); -extern bool_t _EXFUN (xdr_float, (XDR *, float *)); -extern bool_t _EXFUN (xdr_double, (XDR *, double *)); -/* extern bool_t _EXFUN (xdr_quadruple, (XDR *, long double *)); */ -extern bool_t _EXFUN (xdr_reference, (XDR *, char **, u_int, xdrproc_t)); -extern bool_t _EXFUN (xdr_pointer, (XDR *, char **, u_int, xdrproc_t)); -extern bool_t _EXFUN (xdr_wrapstring, (XDR *, char **)); +extern bool_t xdr_bool (XDR *, bool_t *); +extern bool_t xdr_enum (XDR *, enum_t *); +extern bool_t xdr_array (XDR *, char **, u_int *, u_int, u_int, xdrproc_t); +extern bool_t xdr_bytes (XDR *, char **, u_int *, u_int); +extern bool_t xdr_opaque (XDR *, char *, u_int); +extern bool_t xdr_string (XDR *, char **, u_int); +extern bool_t xdr_union (XDR *, enum_t *, char *, + const struct xdr_discrim *, xdrproc_t); +extern bool_t xdr_char (XDR *, char *); +extern bool_t xdr_u_char (XDR *, u_char *); +extern bool_t xdr_vector (XDR *, char *, u_int, u_int, xdrproc_t); +extern bool_t xdr_float (XDR *, float *); +extern bool_t xdr_double (XDR *, double *); +/* extern bool_t xdr_quadruple (XDR *, long double *); */ +extern bool_t xdr_reference (XDR *, char **, u_int, xdrproc_t); +extern bool_t xdr_pointer (XDR *, char **, u_int, xdrproc_t); +extern bool_t xdr_wrapstring (XDR *, char **); #if defined(___int64_t_defined) -extern bool_t _EXFUN (xdr_hyper, (XDR *, quad_t *)); -extern bool_t _EXFUN (xdr_u_hyper, (XDR *, u_quad_t *)); -extern bool_t _EXFUN (xdr_longlong_t, (XDR *, quad_t *)); -extern bool_t _EXFUN (xdr_u_longlong_t, (XDR *, u_quad_t *)); +extern bool_t xdr_hyper (XDR *, quad_t *); +extern bool_t xdr_u_hyper (XDR *, u_quad_t *); +extern bool_t xdr_longlong_t (XDR *, quad_t *); +extern bool_t xdr_u_longlong_t (XDR *, u_quad_t *); #endif /* ___int64_t_defined */ -extern u_long _EXFUN (xdr_sizeof, (xdrproc_t, void *)); +extern u_long xdr_sizeof (xdrproc_t, void *); /* * Common opaque bytes objects used by many rpc protocols; @@ -349,7 +349,7 @@ struct netobj char *n_bytes; }; typedef struct netobj netobj; -extern bool_t _EXFUN (xdr_netobj, (XDR *, struct netobj *)); +extern bool_t xdr_netobj (XDR *, struct netobj *); /* * These are the public routines for the various implementations of @@ -357,30 +357,30 @@ extern bool_t _EXFUN (xdr_netobj, (XDR *, struct netobj *)); */ /* XDR using memory buffers */ -extern void _EXFUN (xdrmem_create, (XDR *, char *, u_int, enum xdr_op)); +extern void xdrmem_create (XDR *, char *, u_int, enum xdr_op); /* XDR using stdio library */ #if defined(_STDIO_H_) -extern void _EXFUN (xdrstdio_create, (XDR *, FILE *, enum xdr_op)); +extern void xdrstdio_create (XDR *, FILE *, enum xdr_op); #endif /* XDR pseudo records for tcp */ -extern void _EXFUN (xdrrec_create, (XDR *, u_int, u_int, void *, - int _EXPARM (, (void *, void *, int)), - int _EXPARM (, (void *, void *, int)))); +extern void xdrrec_create (XDR *, u_int, u_int, void *, + int (*) (void *, void *, int), + int (*) (void *, void *, int)); /* make end of xdr record */ -extern bool_t _EXFUN (xdrrec_endofrecord, (XDR *, bool_t)); +extern bool_t xdrrec_endofrecord (XDR *, bool_t); /* move to beginning of next record */ -extern bool_t _EXFUN (xdrrec_skiprecord, (XDR *)); +extern bool_t xdrrec_skiprecord (XDR *); /* true if no more input */ -extern bool_t _EXFUN (xdrrec_eof, (XDR *)); -extern u_int _EXFUN (xdrrec_readbytes, (XDR *, caddr_t, u_int)); +extern bool_t xdrrec_eof (XDR *); +extern u_int xdrrec_readbytes (XDR *, caddr_t, u_int); /* free memory buffers for xdr */ -extern void _EXFUN (xdr_free, (xdrproc_t, void *)); +extern void xdr_free (xdrproc_t, void *); #ifdef __cplusplus } diff --git a/newlib/libc/include/sched.h b/newlib/libc/include/sched.h index 504ad5274..1016235bb 100644 --- a/newlib/libc/include/sched.h +++ b/newlib/libc/include/sched.h @@ -90,6 +90,10 @@ int sched_yield( void ); #endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ +#if __GNU_VISIBLE +int sched_getcpu(void); +#endif + #ifdef __cplusplus } #endif diff --git a/newlib/libc/include/setjmp.h b/newlib/libc/include/setjmp.h index 521eac5a1..a2830b275 100644 --- a/newlib/libc/include/setjmp.h +++ b/newlib/libc/include/setjmp.h @@ -12,12 +12,12 @@ _BEGIN_STD_C #ifdef __GNUC__ -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)) +void longjmp (jmp_buf __jmpb, int __retval) __attribute__ ((__noreturn__)); #else -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)); +void longjmp (jmp_buf __jmpb, int __retval); #endif -int _EXFUN(setjmp,(jmp_buf __jmpb)); +int setjmp (jmp_buf __jmpb); _END_STD_C diff --git a/newlib/libc/include/signal.h b/newlib/libc/include/signal.h index 0324ae71a..23a9863e6 100644 --- a/newlib/libc/include/signal.h +++ b/newlib/libc/include/signal.h @@ -21,13 +21,13 @@ typedef _sig_func_ptr sighandler_t; /* glibc naming */ struct _reent; -_sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); -int _EXFUN(_raise_r, (struct _reent *, int)); +_sig_func_ptr _signal_r (struct _reent *, int, _sig_func_ptr); +int _raise_r (struct _reent *, int); #ifndef _REENT_ONLY -_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); -int _EXFUN(raise, (int)); -void _EXFUN(psignal, (int, const char *)); +_sig_func_ptr signal (int, _sig_func_ptr); +int raise (int); +void psignal (int, const char *); #endif _END_STD_C diff --git a/newlib/libc/include/spawn.h b/newlib/libc/include/spawn.h index 5a6692f11..d172177b1 100644 --- a/newlib/libc/include/spawn.h +++ b/newlib/libc/include/spawn.h @@ -53,67 +53,52 @@ _BEGIN_STD_C * XXX both arrays should be __restrict, but this does not work when GCC * is invoked with -std=c99. */ -int _EXFUN(posix_spawn, (pid_t * __restrict, const char * __restrict, +int posix_spawn (pid_t * __restrict, const char * __restrict, const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); -int _EXFUN(posix_spawnp, (pid_t * __restrict, const char * __restrict, + char * const [], char * const []); +int posix_spawnp (pid_t * __restrict, const char * __restrict, const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); + char * const [], char * const []); /* * File descriptor actions */ -int _EXFUN(posix_spawn_file_actions_init, (posix_spawn_file_actions_t *)); -int _EXFUN(posix_spawn_file_actions_destroy, (posix_spawn_file_actions_t *)); +int posix_spawn_file_actions_init (posix_spawn_file_actions_t *); +int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *); -int _EXFUN(posix_spawn_file_actions_addopen, - (posix_spawn_file_actions_t * __restrict, int, const char * __restrict, int, mode_t) -); -int _EXFUN(posix_spawn_file_actions_adddup2, - (posix_spawn_file_actions_t *, int, int) -); -int _EXFUN(posix_spawn_file_actions_addclose, - (posix_spawn_file_actions_t *, int) -); +int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t * __restrict, + int, const char * __restrict, int, mode_t); +int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *, int, int); +int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *, int); /* * Spawn attributes */ -int _EXFUN(posix_spawnattr_init, (posix_spawnattr_t *)); -int _EXFUN(posix_spawnattr_destroy, (posix_spawnattr_t *)); +int posix_spawnattr_init (posix_spawnattr_t *); +int posix_spawnattr_destroy (posix_spawnattr_t *); -int _EXFUN(posix_spawnattr_getflags, - (const posix_spawnattr_t * __restrict, short * __restrict) -); -int _EXFUN(posix_spawnattr_getpgroup, - (const posix_spawnattr_t * __restrict, pid_t * __restrict)); -int _EXFUN(posix_spawnattr_getschedparam, - (const posix_spawnattr_t * __restrict, struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_getschedpolicy, - (const posix_spawnattr_t * __restrict, int * __restrict) -); -int _EXFUN(posix_spawnattr_getsigdefault, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_getsigmask, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); +int posix_spawnattr_getflags (const posix_spawnattr_t * __restrict, + short * __restrict); +int posix_spawnattr_getpgroup (const posix_spawnattr_t * __restrict, + pid_t * __restrict); +int posix_spawnattr_getschedparam (const posix_spawnattr_t * __restrict, + struct sched_param * __restrict); +int posix_spawnattr_getschedpolicy (const posix_spawnattr_t * __restrict, + int * __restrict); +int posix_spawnattr_getsigdefault (const posix_spawnattr_t * __restrict, + sigset_t * __restrict); +int posix_spawnattr_getsigmask (const posix_spawnattr_t * __restrict, + sigset_t * __restrict); -int _EXFUN(posix_spawnattr_setflags, (posix_spawnattr_t *, short)); -int _EXFUN(posix_spawnattr_setpgroup, (posix_spawnattr_t *, pid_t)); -int _EXFUN(posix_spawnattr_setschedparam, - (posix_spawnattr_t * __restrict, const struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_setschedpolicy, (posix_spawnattr_t *, int)); -int _EXFUN(posix_spawnattr_setsigdefault, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_setsigmask, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); +int posix_spawnattr_setflags (posix_spawnattr_t *, short); +int posix_spawnattr_setpgroup (posix_spawnattr_t *, pid_t); +int posix_spawnattr_setschedparam (posix_spawnattr_t * __restrict, + const struct sched_param * __restrict); +int posix_spawnattr_setschedpolicy (posix_spawnattr_t *, int); +int posix_spawnattr_setsigdefault (posix_spawnattr_t * __restrict, + const sigset_t * __restrict); +int posix_spawnattr_setsigmask (posix_spawnattr_t * __restrict, + const sigset_t * __restrict); _END_STD_C #endif /* !_SPAWN_H_ */ diff --git a/newlib/libc/include/ssp/ssp.h b/newlib/libc/include/ssp/ssp.h new file mode 100644 index 000000000..922908659 --- /dev/null +++ b/newlib/libc/include/ssp/ssp.h @@ -0,0 +1,76 @@ +/* $NetBSD: ssp.h,v 1.13 2015/09/03 20:43:47 plunky Exp $ */ + +/*- + * Copyright (c) 2006, 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SSP_H_ +#define _SSP_SSP_H_ + +#include + +/* __ssp_real is used by the implementation in libc */ +#if __SSP_FORTIFY_LEVEL == 0 +#define __ssp_real_(fun) fun +#else +#define __ssp_real_(fun) __ssp_real_ ## fun +#endif +#define __ssp_real(fun) __ssp_real_(fun) + +#define __ssp_inline extern __inline__ __attribute__((__always_inline__, __gnu_inline__)) + +#define __ssp_bos(ptr) __builtin_object_size(ptr, __SSP_FORTIFY_LEVEL > 1) +#define __ssp_bos0(ptr) __builtin_object_size(ptr, 0) + +#define __ssp_check(buf, len, bos) \ + if (bos(buf) != (size_t)-1 && len > bos(buf)) \ + __chk_fail() +#define __ssp_decl(rtype, fun, args) \ +rtype __ssp_real_(fun) args __asm__(__ASMNAME(#fun)); \ +__ssp_inline rtype fun args +#define __ssp_redirect_raw(rtype, fun, args, call, cond, bos) \ +__ssp_decl(rtype, fun, args) \ +{ \ + if (cond) \ + __ssp_check(__buf, __len, bos); \ + return __ssp_real_(fun) call; \ +} + +#define __ssp_redirect(rtype, fun, args, call) \ + __ssp_redirect_raw(rtype, fun, args, call, 1, __ssp_bos) +#define __ssp_redirect0(rtype, fun, args, call) \ + __ssp_redirect_raw(rtype, fun, args, call, 1, __ssp_bos0) + +#define __ssp_overlap(a, b, l) \ + (((a) <= (b) && (b) < (a) + (l)) || ((b) <= (a) && (a) < (b) + (l))) + +__BEGIN_DECLS +void __stack_chk_fail(void) __dead2; +void __chk_fail(void) __dead2; +__END_DECLS + +#endif /* _SSP_SSP_H_ */ diff --git a/newlib/libc/include/ssp/stdio.h b/newlib/libc/include/ssp/stdio.h new file mode 100644 index 000000000..df2cd1859 --- /dev/null +++ b/newlib/libc/include/ssp/stdio.h @@ -0,0 +1,101 @@ +/* $NetBSD: stdio.h,v 1.5 2011/07/17 20:54:34 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STDIO_H_ +#define _SSP_STDIO_H_ + +#include + +__BEGIN_DECLS +int __sprintf_chk(char *__restrict, int, size_t, const char *__restrict, ...) + __printflike(4, 5); +int __vsprintf_chk(char *__restrict, int, size_t, const char *__restrict, + __va_list) + __printflike(4, 0); +int __snprintf_chk(char *__restrict, size_t, int, size_t, + const char *__restrict, ...) + __printflike(5, 6); +int __vsnprintf_chk(char *__restrict, size_t, int, size_t, + const char *__restrict, __va_list) + __printflike(5, 0); +char *__gets_chk(char *, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + + +#define sprintf(str, ...) \ + __builtin___sprintf_chk(str, 0, __ssp_bos(str), __VA_ARGS__) + +#define vsprintf(str, fmt, ap) \ + __builtin___vsprintf_chk(str, 0, __ssp_bos(str), fmt, ap) + +#define snprintf(str, len, ...) \ + __builtin___snprintf_chk(str, len, 0, __ssp_bos(str), __VA_ARGS__) + +#define vsnprintf(str, len, fmt, ap) \ + __builtin___vsnprintf_chk(str, len, 0, __ssp_bos(str), fmt, ap) + +#define gets(str) \ + __gets_chk(str, __ssp_bos(str)) + +__ssp_decl(char *, fgets, (char *__restrict __buf, int __len, FILE *__fp)) +{ + if (__len > 0) + __ssp_check(__buf, (size_t)__len, __ssp_bos); + return __ssp_real_fgets(__buf, __len, __fp); +} + +#if __GNU_VISIBLE +__ssp_decl(char *, fgets_unlocked, (char *__restrict __buf, int __len, FILE *__fp)) +{ + if (__len > 0) + __ssp_check(__buf, (size_t)__len, __ssp_bos); + return __ssp_real_fgets_unlocked(__buf, __len, __fp); +} +#endif /* __GNU_VISIBLE */ + +__ssp_decl(size_t, fread, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __fp)) +{ + __ssp_check(__ptr, __size * __n, __ssp_bos0); + return __ssp_real_fread(__ptr, __size, __n, __fp); +} + +#if __MISC_VISIBLE +__ssp_decl(size_t, fread_unlocked, (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __fp)) +{ + __ssp_check(__ptr, __size * __n, __ssp_bos0); + return __ssp_real_fread_unlocked(__ptr, __size, __n, __fp); +} +#endif /* __MISC_VISIBLE */ + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ + +#endif /* _SSP_STDIO_H_ */ diff --git a/newlib/libc/include/ssp/stdlib.h b/newlib/libc/include/ssp/stdlib.h new file mode 100644 index 000000000..d5edb6d09 --- /dev/null +++ b/newlib/libc/include/ssp/stdlib.h @@ -0,0 +1,30 @@ +#ifndef _SSP_STDLIB_H_ +#define _SSP_STDLIB_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +__ssp_decl(size_t, mbstowcs, (wchar_t *__buf, const char *__src, size_t __n)) +{ + if (__buf != NULL) + __ssp_check(__buf, __n * sizeof(wchar_t), __ssp_bos); + return __ssp_real_mbstowcs (__buf, __src, __n); +} + +__ssp_redirect_raw(size_t, wcstombs, \ + (char *__buf, const wchar_t *__src, size_t __len), \ + (__buf, __src, __len), __buf != NULL, __ssp_bos); + +__ssp_decl(int, wctomb, (char *__buf, wchar_t __wc)) +{ + if (__buf != NULL) + __ssp_check(__buf, MB_CUR_MAX, __ssp_bos); + return __ssp_real_wctomb (__buf, __wc); +} + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STDLIB_H_ */ diff --git a/newlib/libc/include/ssp/string.h b/newlib/libc/include/ssp/string.h new file mode 100644 index 000000000..85c4512ac --- /dev/null +++ b/newlib/libc/include/ssp/string.h @@ -0,0 +1,115 @@ +/* $NetBSD: string.h,v 1.13 2014/11/29 13:23:48 pooka Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRING_H_ +#define _SSP_STRING_H_ + +#include +#include + +__BEGIN_DECLS +void *__memcpy_chk(void *, const void *, size_t, size_t); +void *__memmove_chk(void *, void *, size_t, size_t); +void *__mempcpy_chk(void *, const void *, size_t, size_t); +void *__memset_chk(void *, int, size_t, size_t); +char *__stpcpy_chk(char *, const char *, size_t); +char *__strcat_chk(char *, const char *, size_t); +char *__strcpy_chk(char *, const char *, size_t); +char *__strncat_chk(char *, const char *, size_t, size_t); +char *__strncpy_chk(char *, const char *, size_t, size_t); +__END_DECLS + +#if __SSP_FORTIFY_LEVEL > 0 + +#define __ssp_bos_check3(fun, dst, src, len) \ + ((__ssp_bos0(dst) != (size_t)-1) ? \ + __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)) : \ + __ ## fun ## _ichk(dst, src, len)) + +#define __ssp_bos_check2(fun, dst, src) \ + ((__ssp_bos0(dst) != (size_t)-1) ? \ + __builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)) : \ + __ ## fun ## _ichk(dst, src)) + +#define __ssp_bos_icheck3_restrict(fun, type1, type2) \ +__ssp_inline type1 __ ## fun ## _ichk(type1 __restrict, type2 __restrict, size_t); \ +__ssp_inline type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src, size_t len) { \ + return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \ +} + +#define __ssp_bos_icheck3(fun, type1, type2) \ +__ssp_inline type1 __ ## fun ## _ichk(type1, type2, size_t); \ +__ssp_inline type1 \ +__ ## fun ## _ichk(type1 dst, type2 src, size_t len) { \ + return __builtin___ ## fun ## _chk(dst, src, len, __ssp_bos0(dst)); \ +} + +#define __ssp_bos_icheck2_restrict(fun, type1, type2) \ +__ssp_inline type1 __ ## fun ## _ichk(type1, type2); \ +__ssp_inline type1 \ +__ ## fun ## _ichk(type1 __restrict dst, type2 __restrict src) { \ + return __builtin___ ## fun ## _chk(dst, src, __ssp_bos0(dst)); \ +} + +__BEGIN_DECLS +__ssp_bos_icheck3_restrict(memcpy, void *, const void *) +__ssp_bos_icheck3(memmove, void *, const void *) +__ssp_bos_icheck3_restrict(mempcpy, void *, const void *) +__ssp_bos_icheck3(memset, void *, int) +__ssp_bos_icheck2_restrict(stpcpy, char *, const char *) +#if __GNUC_PREREQ__(4,8) || defined(__clang__) +__ssp_bos_icheck3_restrict(stpncpy, char *, const char *) +#endif +__ssp_bos_icheck2_restrict(strcpy, char *, const char *) +__ssp_bos_icheck2_restrict(strcat, char *, const char *) +__ssp_bos_icheck3_restrict(strncpy, char *, const char *) +__ssp_bos_icheck3_restrict(strncat, char *, const char *) +__END_DECLS + +#define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) +#define memmove(dst, src, len) __ssp_bos_check3(memmove, dst, src, len) +#if __GNU_VISIBLE +#define mempcpy(dst, src, len) __ssp_bos_check3(mempcpy, dst, src, len) +#endif +#define memset(dst, val, len) __ssp_bos_check3(memset, dst, val, len) +#if __POSIX_VISIBLE >= 200809 +#define stpcpy(dst, src) __ssp_bos_check2(stpcpy, dst, src) +#if __GNUC_PREREQ__(4,8) || defined(__clang__) +#define stpncpy(dst, src, len) __ssp_bos_check3(stpncpy, dst, src, len) +#endif +#endif +#define strcpy(dst, src) __ssp_bos_check2(strcpy, dst, src) +#define strcat(dst, src) __ssp_bos_check2(strcat, dst, src) +#define strncpy(dst, src, len) __ssp_bos_check3(strncpy, dst, src, len) +#define strncat(dst, src, len) __ssp_bos_check3(strncat, dst, src, len) + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRING_H_ */ diff --git a/newlib/libc/include/ssp/strings.h b/newlib/libc/include/ssp/strings.h new file mode 100644 index 000000000..13adba175 --- /dev/null +++ b/newlib/libc/include/ssp/strings.h @@ -0,0 +1,55 @@ +/* $NetBSD: strings.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */ + +/*- + * Copyright (c) 2007 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_STRINGS_H_ +#define _SSP_STRINGS_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 +#define bcopy(src, dst, len) \ + ((__ssp_bos0(dst) != (size_t)-1) ? \ + __builtin___memmove_chk(dst, src, len, __ssp_bos0(dst)) : \ + __memmove_ichk(dst, src, len)) +#define bzero(dst, len) \ + ((__ssp_bos0(dst) != (size_t)-1) ? \ + __builtin___memset_chk(dst, 0, len, __ssp_bos0(dst)) : \ + __memset_ichk(dst, 0, len)) +#endif + +#if __BSD_VISIBLE +__ssp_redirect0(void, explicit_bzero, (void *__buf, size_t __len), \ + (__buf, __len)); +#endif + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_STRINGS_H_ */ diff --git a/newlib/libc/include/ssp/unistd.h b/newlib/libc/include/ssp/unistd.h new file mode 100644 index 000000000..5ca6ace7a --- /dev/null +++ b/newlib/libc/include/ssp/unistd.h @@ -0,0 +1,93 @@ +/* $NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_UNISTD_H_ +#define _SSP_UNISTD_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 +__BEGIN_DECLS + +#if __POSIX_VISIBLE >= 199209 +__ssp_redirect(size_t, confstr, (int __name, char *__buf, size_t __len), \ + (__name, __buf, __len)); +#endif + +__ssp_redirect_raw(char *, getcwd, (char *__buf, size_t __len), + (__buf, __len), __buf != 0, __ssp_bos); + +#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) +__ssp_redirect(int, getdomainname, (char *__buf, size_t __len), \ + (__buf, __len)); +#endif + +__ssp_decl(int, getgroups, (int __n, gid_t __buf[])) +{ + __ssp_check(__buf, __n * sizeof(gid_t), __ssp_bos); + return __ssp_real_getgroups (__n, __buf); +} + +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 +#if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) +__ssp_redirect(int, gethostname, (char *__buf, size_t __len), \ + (__buf, __len)); +#endif +#endif + +__ssp_redirect(int, getlogin_r, (char *__buf, size_t __len), \ + (__buf, __len)); + +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 +__ssp_redirect0(ssize_t, pread, (int __fd, void *__buf, size_t __len, off_t __off), \ + (__fd, __buf, __len, __off)); +#endif + +__ssp_redirect0(_READ_WRITE_RETURN_TYPE, read, \ + (int __fd, void *__buf, size_t __len), (__fd, __buf, __len)); + +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4 +__ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \ + char *__restrict __buf, size_t __len), (__path, __buf, __len)); +#endif + +#if __ATFILE_VISIBLE +__ssp_redirect(ssize_t, readlinkat, \ + (int __dirfd1, const char *__restrict __path, char *__restrict __buf, size_t __len), \ + (__dirfd1, __path, __buf, __len)); +#endif + +__ssp_redirect(int, ttyname_r, (int __fd, char *__buf, size_t __len), \ + (__fd, __buf, __len)); + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_UNISTD_H_ */ diff --git a/newlib/libc/include/ssp/wchar.h b/newlib/libc/include/ssp/wchar.h new file mode 100644 index 000000000..d748fa2cf --- /dev/null +++ b/newlib/libc/include/ssp/wchar.h @@ -0,0 +1,97 @@ +#ifndef _SSP_WCHAR_H_ +#define _SSP_WCHAR_H_ + +#include +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +/* wide character variant, __wlen is number of wchar_t */ +#define __ssp_redirect_wc(rtype, fun, args, call, cond, bos) \ +__ssp_decl(rtype, fun, args) \ +{ \ + if (cond) \ + __ssp_check(__buf, __wlen * sizeof(wchar_t), bos); \ + return __ssp_real_(fun) call; \ +} + +#define __ssp_bos_wicheck3(fun) \ +__ssp_redirect_wc(wchar_t *, fun, \ + (wchar_t *__buf, const wchar_t *__src, size_t __wlen), \ + (__buf, __src, __wlen), 1, __ssp_bos0) + +#define __ssp_bos_wicheck3_restrict(fun) \ +__ssp_redirect_wc(wchar_t *, fun, \ + (wchar_t *__restrict __buf, const wchar_t *__restrict __src, size_t __wlen), \ + (__buf, __src, __wlen), 1, __ssp_bos0) + +#define __ssp_bos_wicheck2_restrict(fun) \ +__ssp_decl(wchar_t *, fun, (wchar_t *__restrict __buf, const wchar_t *__restrict __src)) \ +{ \ + __ssp_check(__buf, (wcslen(__src) + 1) * sizeof(wchar_t), __ssp_bos0); \ + return __ssp_real_(fun) (__buf, __src); \ +} + +__BEGIN_DECLS +#if __POSIX_VISIBLE >= 200809 +__ssp_bos_wicheck2_restrict(wcpcpy) +__ssp_bos_wicheck3_restrict(wcpncpy) +#endif +__ssp_bos_wicheck2_restrict(wcscpy) +__ssp_bos_wicheck2_restrict(wcscat) +__ssp_bos_wicheck3_restrict(wcsncpy) +__ssp_bos_wicheck3_restrict(wcsncat) +__ssp_bos_wicheck3_restrict(wmemcpy) +__ssp_bos_wicheck3(wmemmove) +#if __GNU_VISIBLE +__ssp_bos_wicheck3_restrict(wmempcpy) +#endif +__ssp_redirect_wc(wchar_t *, wmemset, \ + (wchar_t *__buf, wchar_t __src, size_t __wlen), \ + (__buf, __src, __wlen), 1, __ssp_bos0) + +__ssp_decl(size_t, wcrtomb, (char *__buf, wchar_t __src, mbstate_t *__ps)) +{ + if (__buf != NULL && __src != L'\0') + __ssp_check(__buf, sizeof(wchar_t), __ssp_bos); + return __ssp_real_wcrtomb (__buf, __src, __ps); +} + +__ssp_redirect_wc(size_t, mbsrtowcs, \ + (wchar_t *__buf, const char **__src, size_t __wlen, mbstate_t *__ps), \ + (__buf, __src, __wlen, __ps), __buf != NULL, __ssp_bos) + +__ssp_redirect_raw(size_t, wcsrtombs, \ + (char *__buf, const wchar_t **__src, size_t __len, mbstate_t *__ps), \ + (__buf, __src, __len, __ps), __buf != NULL, __ssp_bos) + +#if __POSIX_VISIBLE >= 200809 +__ssp_redirect_wc(size_t, mbsnrtowcs, \ + (wchar_t *__buf, const char **__src, size_t __nms, size_t __wlen, mbstate_t *__ps), \ + (__buf, __src, __nms, __wlen, __ps), __buf != NULL, __ssp_bos) + +__ssp_redirect_raw(size_t, wcsnrtombs, \ + (char *__buf, const wchar_t **__src, size_t __nwc, size_t __len, mbstate_t *__ps), \ + (__buf, __src, __nwc, __len, __ps), __buf != NULL, __ssp_bos) +#endif + +__ssp_decl(wchar_t *, fgetws, (wchar_t *__restrict __buf, int __wlen, __FILE *__restrict __fp)) +{ + if (__wlen > 0) + __ssp_check(__buf, (size_t)__wlen * sizeof(wchar_t) , __ssp_bos); + return __ssp_real_fgetws(__buf, __wlen, __fp); +} + +#if __GNU_VISIBLE +__ssp_decl(wchar_t *, fgetws_unlocked, (wchar_t *__buf, int __wlen, __FILE *__fp)) +{ + if (__wlen > 0) + __ssp_check(__buf, (size_t)__wlen * sizeof(wchar_t) , __ssp_bos); + return __ssp_real_fgetws_unlocked(__buf, __wlen, __fp); +} +#endif /* __GNU_VISIBLE */ + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_WCHAR_H_ */ diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 5d8cb1092..f8d60766a 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -178,155 +178,155 @@ typedef _fpos64_t fpos64_t; #endif #if __POSIX_VISIBLE -char * _EXFUN(ctermid, (char *)); +char * ctermid (char *); #endif #if __XSI_VISIBLE && __XSI_VISIBLE < 600 -char * _EXFUN(cuserid, (char *)); +char * cuserid (char *); #endif -FILE * _EXFUN(tmpfile, (void)); -char * _EXFUN(tmpnam, (char *)); +FILE * tmpfile (void); +char * tmpnam (char *); #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -char * _EXFUN(tempnam, (const char *, const char *)); +char * tempnam (const char *, const char *) __malloc_like __result_use_check; #endif -int _EXFUN(fclose, (FILE *)); -int _EXFUN(fflush, (FILE *)); -FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); -void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); -int _EXFUN(setvbuf, (FILE *__restrict, char *__restrict, int, size_t)); -int _EXFUN(fprintf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fscanf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(printf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(scanf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(sscanf, (const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vprintf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(vsprintf, (char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(fgetc, (FILE *)); -char * _EXFUN(fgets, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputc, (int, FILE *)); -int _EXFUN(fputs, (const char *__restrict, FILE *__restrict)); -int _EXFUN(getc, (FILE *)); -int _EXFUN(getchar, (void)); -char * _EXFUN(gets, (char *)); -int _EXFUN(putc, (int, FILE *)); -int _EXFUN(putchar, (int)); -int _EXFUN(puts, (const char *)); -int _EXFUN(ungetc, (int, FILE *)); -size_t _EXFUN(fread, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); +int fclose (FILE *); +int fflush (FILE *); +FILE * freopen (const char *__restrict, const char *__restrict, FILE *__restrict); +void setbuf (FILE *__restrict, char *__restrict); +int setvbuf (FILE *__restrict, char *__restrict, int, size_t); +int fprintf (FILE *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int fscanf (FILE *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +int printf (const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 1, 2))); +int scanf (const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 1, 2))); +int sscanf (const char *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +int vfprintf (FILE *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int vprintf (const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 1, 0))); +int vsprintf (char *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int fgetc (FILE *); +char * fgets (char *__restrict, int, FILE *__restrict); +int fputc (int, FILE *); +int fputs (const char *__restrict, FILE *__restrict); +int getc (FILE *); +int getchar (void); +char * gets (char *); +int putc (int, FILE *); +int putchar (int); +int puts (const char *); +int ungetc (int, FILE *); +size_t fread (void *__restrict, size_t _size, size_t _n, FILE *__restrict); +size_t fwrite (const void *__restrict , size_t _size, size_t _n, FILE *); #ifdef _COMPILING_NEWLIB -int _EXFUN(fgetpos, (FILE *, _fpos_t *)); +int fgetpos (FILE *, _fpos_t *); #else -int _EXFUN(fgetpos, (FILE *__restrict, fpos_t *__restrict)); +int fgetpos (FILE *__restrict, fpos_t *__restrict); #endif -int _EXFUN(fseek, (FILE *, long, int)); +int fseek (FILE *, long, int); #ifdef _COMPILING_NEWLIB -int _EXFUN(fsetpos, (FILE *, const _fpos_t *)); +int fsetpos (FILE *, const _fpos_t *); #else -int _EXFUN(fsetpos, (FILE *, const fpos_t *)); +int fsetpos (FILE *, const fpos_t *); #endif -long _EXFUN(ftell, ( FILE *)); -void _EXFUN(rewind, (FILE *)); -void _EXFUN(clearerr, (FILE *)); -int _EXFUN(feof, (FILE *)); -int _EXFUN(ferror, (FILE *)); -void _EXFUN(perror, (const char *)); +long ftell ( FILE *); +void rewind (FILE *); +void clearerr (FILE *); +int feof (FILE *); +int ferror (FILE *); +void perror (const char *); #ifndef _REENT_ONLY -FILE * _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type)); -int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(remove, (const char *)); -int _EXFUN(rename, (const char *, const char *)); +FILE * fopen (const char *__restrict _name, const char *__restrict _type); +int sprintf (char *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int remove (const char *); +int rename (const char *, const char *); #ifdef _COMPILING_NEWLIB -int _EXFUN(_rename, (const char *, const char *)); +int _rename (const char *, const char *); #endif #endif #if __LARGEFILE_VISIBLE || __POSIX_VISIBLE >= 200112 #ifdef _COMPILING_NEWLIB -int _EXFUN(fseeko, (FILE *, _off_t, int)); -_off_t _EXFUN(ftello, ( FILE *)); +int fseeko (FILE *, _off_t, int); +_off_t ftello (FILE *); #else -int _EXFUN(fseeko, (FILE *, off_t, int)); -off_t _EXFUN(ftello, ( FILE *)); +int fseeko (FILE *, off_t, int); +off_t ftello (FILE *); #endif #endif #if __GNU_VISIBLE -int _EXFUN(fcloseall, (_VOID)); +int fcloseall (void); #endif #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)))); +int snprintf (char *__restrict, size_t, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int vsnprintf (char *__restrict, size_t, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int vfscanf (FILE *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 2, 0))); +int vscanf (const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 1, 0))); +int 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)))); +int asprintf (char **__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int 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 *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); +int asiprintf (char **, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +char * asniprintf (char *, size_t *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +char * asnprintf (char *__restrict, size_t *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); #ifndef diprintf -int _EXFUN(diprintf, (int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); +int diprintf (int, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); #endif -int _EXFUN(fiprintf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fiscanf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(iprintf, (const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(iscanf, (const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(siprintf, (char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(siscanf, (const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(sniprintf, (char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(vasiprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vdiprintf, (int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiscanf, (FILE *, const char *, __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(vsiprintf, (char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vsiscanf, (const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); +int fiprintf (FILE *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int fiscanf (FILE *, const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +int iprintf (const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 1, 2))); +int iscanf (const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 1, 2))); +int siprintf (char *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int siscanf (const char *, const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +int sniprintf (char *, size_t, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int vasiprintf (char **, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +char * vasniprintf (char *, size_t *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +char * vasnprintf (char *, size_t *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int vdiprintf (int, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int vfiprintf (FILE *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int vfiscanf (FILE *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 2, 0))); +int viprintf (const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 1, 0))); +int viscanf (const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 1, 0))); +int vsiprintf (char *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int vsiscanf (const char *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 2, 0))); +int vsniprintf (char *, size_t, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); #endif /* __MISC_VISIBLE */ #endif /* !_REENT_ONLY */ @@ -336,32 +336,32 @@ int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) #if __POSIX_VISIBLE #ifndef _REENT_ONLY -FILE * _EXFUN(fdopen, (int, const char *)); +FILE * fdopen (int, const char *); #endif -int _EXFUN(fileno, (FILE *)); +int fileno (FILE *); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE >= 199209 -int _EXFUN(pclose, (FILE *)); -FILE * _EXFUN(popen, (const char *, const char *)); +int pclose (FILE *); +FILE * popen (const char *, const char *); #endif #if __BSD_VISIBLE -void _EXFUN(setbuffer, (FILE *, char *, int)); -int _EXFUN(setlinebuf, (FILE *)); +void setbuffer (FILE *, char *, int); +int setlinebuf (FILE *); #endif #if __MISC_VISIBLE || (__XSI_VISIBLE && __POSIX_VISIBLE < 200112) -int _EXFUN(getw, (FILE *)); -int _EXFUN(putw, (int, FILE *)); +int getw (FILE *); +int putw (int, FILE *); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE -int _EXFUN(getc_unlocked, (FILE *)); -int _EXFUN(getchar_unlocked, (void)); -void _EXFUN(flockfile, (FILE *)); -int _EXFUN(ftrylockfile, (FILE *)); -void _EXFUN(funlockfile, (FILE *)); -int _EXFUN(putc_unlocked, (int, FILE *)); -int _EXFUN(putchar_unlocked, (int)); +int getc_unlocked (FILE *); +int getchar_unlocked (void); +void flockfile (FILE *); +int ftrylockfile (FILE *); +void funlockfile (FILE *); +int putc_unlocked (int, FILE *); +int putchar_unlocked (int); #endif /* @@ -371,199 +371,202 @@ int _EXFUN(putchar_unlocked, (int)); #if __POSIX_VISIBLE >= 200809 # ifndef _REENT_ONLY # ifndef dprintf -int _EXFUN(dprintf, (int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); +int dprintf (int, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); # endif -FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); +FILE * fmemopen (void *__restrict, size_t, const char *__restrict); /* getdelim - see __getdelim for now */ /* getline - see __getline for now */ -FILE * _EXFUN(open_memstream, (char **, size_t *)); -int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); +FILE * open_memstream (char **, size_t *); +int 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 *)); +int renameat (int, const char *, int, const char *); +# ifdef __CYGWIN__ +int renameat2 (int, const char *, int, const char *, unsigned int); +# endif #endif /* * Recursive versions of the above. */ -int _EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -char * _EXFUN(_asnprintf_r, (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_asprintf_r, (struct _reent *, char **__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_dprintf_r, (struct _reent *, int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fclose_r, (struct _reent *, FILE *)); -int _EXFUN(_fcloseall_r, (struct _reent *)); -FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); -int _EXFUN(_fflush_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_unlocked_r, (struct _reent *, FILE *)); -char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); -char * _EXFUN(_fgets_unlocked_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); +int _asiprintf_r (struct _reent *, char **, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 4, 5))); +char * _asnprintf_r (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 4, 5))); +int _asprintf_r (struct _reent *, char **__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _diprintf_r (struct _reent *, int, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _dprintf_r (struct _reent *, int, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _fclose_r (struct _reent *, FILE *); +int _fcloseall_r (struct _reent *); +FILE * _fdopen_r (struct _reent *, int, const char *); +int _fflush_r (struct _reent *, FILE *); +int _fgetc_r (struct _reent *, FILE *); +int _fgetc_unlocked_r (struct _reent *, FILE *); +char * _fgets_r (struct _reent *, char *__restrict, int, FILE *__restrict); +char * _fgets_unlocked_r (struct _reent *, char *__restrict, int, FILE *__restrict); #ifdef _COMPILING_NEWLIB -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); +int _fgetpos_r (struct _reent *, FILE *__restrict, _fpos_t *__restrict); +int _fsetpos_r (struct _reent *, FILE *, const _fpos_t *); #else -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const fpos_t *)); +int _fgetpos_r (struct _reent *, FILE *, fpos_t *); +int _fsetpos_r (struct _reent *, FILE *, const fpos_t *); #endif -int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *__restrict, size_t, const char *__restrict)); -FILE * _EXFUN(_fopen_r, (struct _reent *, const char *__restrict, const char *__restrict)); -FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); -int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fputs_unlocked_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fread_unlocked_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); -int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); -long _EXFUN(_ftell_r, (struct _reent *, FILE *)); -_off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); -void _EXFUN(_rewind_r, (struct _reent *, FILE *)); -size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fwrite_unlocked_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_getc_r, (struct _reent *, FILE *)); -int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); -int _EXFUN(_getchar_r, (struct _reent *)); -int _EXFUN(_getchar_unlocked_r, (struct _reent *)); -char * _EXFUN(_gets_r, (struct _reent *, char *)); -int _EXFUN(_iprintf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_iscanf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -FILE * _EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *)); -void _EXFUN(_perror_r, (struct _reent *, const char *)); -int _EXFUN(_printf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_putc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putchar_unlocked_r, (struct _reent *, int)); -int _EXFUN(_putchar_r, (struct _reent *, int)); -int _EXFUN(_puts_r, (struct _reent *, const char *)); -int _EXFUN(_remove_r, (struct _reent *, const char *)); -int _EXFUN(_rename_r, (struct _reent *, - const char *_old, const char *_new)); -int _EXFUN(_scanf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_siscanf_r, (struct _reent *, const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_snprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_sprintf_r, (struct _reent *, char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_sscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -char * _EXFUN(_tempnam_r, (struct _reent *, const char *, const char *)); -FILE * _EXFUN(_tmpfile_r, (struct _reent *)); -char * _EXFUN(_tmpnam_r, (struct _reent *, char *)); -int _EXFUN(_ungetc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_vasiprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(_vasniprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -char * _EXFUN(_vasnprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vasprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vfprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vprintf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_vscanf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsnprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsprintf_r, (struct _reent *, char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); +int _fiprintf_r (struct _reent *, FILE *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _fiscanf_r (struct _reent *, FILE *, const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 3, 4))); +FILE * _fmemopen_r (struct _reent *, void *__restrict, size_t, const char *__restrict); +FILE * _fopen_r (struct _reent *, const char *__restrict, const char *__restrict); +FILE * _freopen_r (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict); +int _fprintf_r (struct _reent *, FILE *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _fpurge_r (struct _reent *, FILE *); +int _fputc_r (struct _reent *, int, FILE *); +int _fputc_unlocked_r (struct _reent *, int, FILE *); +int _fputs_r (struct _reent *, const char *__restrict, FILE *__restrict); +int _fputs_unlocked_r (struct _reent *, const char *__restrict, FILE *__restrict); +size_t _fread_r (struct _reent *, void *__restrict, size_t _size, size_t _n, FILE *__restrict); +size_t _fread_unlocked_r (struct _reent *, void *__restrict, size_t _size, size_t _n, FILE *__restrict); +int _fscanf_r (struct _reent *, FILE *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 3, 4))); +int _fseek_r (struct _reent *, FILE *, long, int); +int _fseeko_r (struct _reent *, FILE *, _off_t, int); +long _ftell_r (struct _reent *, FILE *); +_off_t _ftello_r (struct _reent *, FILE *); +void _rewind_r (struct _reent *, FILE *); +size_t _fwrite_r (struct _reent *, const void *__restrict, size_t _size, size_t _n, FILE *__restrict); +size_t _fwrite_unlocked_r (struct _reent *, const void *__restrict, size_t _size, size_t _n, FILE *__restrict); +int _getc_r (struct _reent *, FILE *); +int _getc_unlocked_r (struct _reent *, FILE *); +int _getchar_r (struct _reent *); +int _getchar_unlocked_r (struct _reent *); +char * _gets_r (struct _reent *, char *); +int _iprintf_r (struct _reent *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int _iscanf_r (struct _reent *, const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +FILE * _open_memstream_r (struct _reent *, char **, size_t *); +void _perror_r (struct _reent *, const char *); +int _printf_r (struct _reent *, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 2, 3))); +int _putc_r (struct _reent *, int, FILE *); +int _putc_unlocked_r (struct _reent *, int, FILE *); +int _putchar_unlocked_r (struct _reent *, int); +int _putchar_r (struct _reent *, int); +int _puts_r (struct _reent *, const char *); +int _remove_r (struct _reent *, const char *); +int _rename_r (struct _reent *, + const char *_old, const char *_new); +int _scanf_r (struct _reent *, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 2, 3))); +int _siprintf_r (struct _reent *, char *, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _siscanf_r (struct _reent *, const char *, const char *, ...) + _ATTRIBUTE ((__format__ (__scanf__, 3, 4))); +int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) + _ATTRIBUTE ((__format__ (__printf__, 4, 5))); +int _snprintf_r (struct _reent *, char *__restrict, size_t, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 4, 5))); +int _sprintf_r (struct _reent *, char *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__printf__, 3, 4))); +int _sscanf_r (struct _reent *, const char *__restrict, const char *__restrict, ...) + _ATTRIBUTE ((__format__ (__scanf__, 3, 4))); +char * _tempnam_r (struct _reent *, const char *, const char *); +FILE * _tmpfile_r (struct _reent *); +char * _tmpnam_r (struct _reent *, char *); +int _ungetc_r (struct _reent *, int, FILE *); +int _vasiprintf_r (struct _reent *, char **, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 4, 0))); +char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 4, 0))); +int _vasprintf_r (struct _reent *, char **, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vdiprintf_r (struct _reent *, int, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vdprintf_r (struct _reent *, int, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vfiprintf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vfiscanf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 3, 0))); +int _vfprintf_r (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vfscanf_r (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 3, 0))); +int _viprintf_r (struct _reent *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int _viscanf_r (struct _reent *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 2, 0))); +int _vprintf_r (struct _reent *, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 2, 0))); +int _vscanf_r (struct _reent *, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 2, 0))); +int _vsiprintf_r (struct _reent *, char *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vsiscanf_r (struct _reent *, const char *, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 3, 0))); +int _vsniprintf_r (struct _reent *, char *, size_t, const char *, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 4, 0))); +int _vsnprintf_r (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 4, 0))); +int _vsprintf_r (struct _reent *, char *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _vsscanf_r (struct _reent *, const char *__restrict, const char *__restrict, __VALIST) + _ATTRIBUTE ((__format__ (__scanf__, 3, 0))); /* Other extensions. */ -int _EXFUN(fpurge, (FILE *)); -ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); -ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); +int fpurge (FILE *); +ssize_t __getdelim (char **, size_t *, int, FILE *); +ssize_t __getline (char **, size_t *, FILE *); #if __MISC_VISIBLE -void _EXFUN(clearerr_unlocked, (FILE *)); -int _EXFUN(feof_unlocked, (FILE *)); -int _EXFUN(ferror_unlocked, (FILE *)); -int _EXFUN(fileno_unlocked, (FILE *)); -int _EXFUN(fflush_unlocked, (FILE *)); -int _EXFUN(fgetc_unlocked, (FILE *)); -int _EXFUN(fputc_unlocked, (int, FILE *)); -size_t _EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); +void clearerr_unlocked (FILE *); +int feof_unlocked (FILE *); +int ferror_unlocked (FILE *); +int fileno_unlocked (FILE *); +int fflush_unlocked (FILE *); +int fgetc_unlocked (FILE *); +int fputc_unlocked (int, FILE *); +size_t fread_unlocked (void *__restrict, size_t _size, size_t _n, FILE *__restrict); +size_t fwrite_unlocked (const void *__restrict , size_t _size, size_t _n, FILE *); #endif #if __GNU_VISIBLE -char * _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict)); +char * fgets_unlocked (char *__restrict, int, FILE *__restrict); +int fputs_unlocked (const char *__restrict, FILE *__restrict); #endif #ifdef __LARGE64_FILES #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) -FILE * _EXFUN(fdopen64, (int, const char *)); -FILE * _EXFUN(fopen64, (const char *, const char *)); -FILE * _EXFUN(freopen64, (_CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(ftello64, (FILE *)); -_off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int)); -int _EXFUN(fgetpos64, (FILE *, _fpos64_t *)); -int _EXFUN(fsetpos64, (FILE *, const _fpos64_t *)); -FILE * _EXFUN(tmpfile64, (void)); +FILE * fdopen64 (int, const char *); +FILE * fopen64 (const char *, const char *); +FILE * freopen64 (const char *, const char *, FILE *); +_off64_t ftello64 (FILE *); +_off64_t fseeko64 (FILE *, _off64_t, int); +int fgetpos64 (FILE *, _fpos64_t *); +int fsetpos64 (FILE *, const _fpos64_t *); +FILE * tmpfile64 (void); -FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *)); -FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *)); -FILE * _EXFUN(_freopen64_r, (struct _reent *, _CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *)); -_off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int)); -int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *)); -int _EXFUN(_fsetpos64_r, (struct _reent *, FILE *, const _fpos64_t *)); -FILE * _EXFUN(_tmpfile64_r, (struct _reent *)); +FILE * _fdopen64_r (struct _reent *, int, const char *); +FILE * _fopen64_r (struct _reent *,const char *, const char *); +FILE * _freopen64_r (struct _reent *, const char *, const char *, FILE *); +_off64_t _ftello64_r (struct _reent *, FILE *); +_off64_t _fseeko64_r (struct _reent *, FILE *, _off64_t, int); +int _fgetpos64_r (struct _reent *, FILE *, _fpos64_t *); +int _fsetpos64_r (struct _reent *, FILE *, const _fpos64_t *); +FILE * _tmpfile64_r (struct _reent *); #endif /* !__CYGWIN__ */ #endif /* __LARGE64_FILES */ @@ -571,8 +574,8 @@ FILE * _EXFUN(_tmpfile64_r, (struct _reent *)); * Routines internal to the implementation. */ -int _EXFUN(__srget_r, (struct _reent *, FILE *)); -int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *)); +int __srget_r (struct _reent *, FILE *); +int __swbuf_r (struct _reent *, int, FILE *); /* * Stdio function-access interface. @@ -580,35 +583,35 @@ int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *)); #if __BSD_VISIBLE # ifdef __LARGE64_FILES -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, +FILE *funopen (const void *__cookie, + int (*__readfn)(void *__c, char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, + int (*__writefn)(void *__c, const char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, + _fpos64_t (*__seekfn)(void *__c, _fpos64_t __off, int __whence), + int (*__closefn)(void *__c)); +FILE *_funopen_r (struct _reent *, const void *__cookie, + int (*__readfn)(void *__c, char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, + int (*__writefn)(void *__c, const char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); + _fpos64_t (*__seekfn)(void *__c, _fpos64_t __off, int __whence), + int (*__closefn)(void *__c)); # else -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, +FILE *funopen (const void *__cookie, + int (*__readfn)(void *__cookie, char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, + int (*__writefn)(void *__cookie, const char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, + fpos_t (*__seekfn)(void *__cookie, fpos_t __off, int __whence), + int (*__closefn)(void *__cookie)); +FILE *_funopen_r (struct _reent *, const void *__cookie, + int (*__readfn)(void *__cookie, char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, + int (*__writefn)(void *__cookie, const char *__buf, _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); + fpos_t (*__seekfn)(void *__cookie, fpos_t __off, int __whence), + int (*__closefn)(void *__cookie)); # endif /* !__LARGE64_FILES */ # define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \ @@ -637,10 +640,10 @@ typedef struct cookie_seek_function_t *seek; cookie_close_function_t *close; } cookie_io_functions_t; -FILE *_EXFUN(fopencookie,(void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); -FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); +FILE *fopencookie (void *__cookie, + const char *__mode, cookie_io_functions_t __functions); +FILE *_fopencookie_r (struct _reent *, void *__cookie, + const char *__mode, cookie_io_functions_t __functions); #endif /* __GNU_VISIBLE */ #ifndef __CUSTOM_FILE_IO__ @@ -759,12 +762,12 @@ _putchar_unlocked(int _c) #define getchar() _getchar_unlocked() #define putchar(_c) _putchar_unlocked(_c) #endif /* __SINGLE_THREAD__ */ -#endif /* __cplusplus */ #if __MISC_VISIBLE || __POSIX_VISIBLE #define getchar_unlocked() _getchar_unlocked() #define putchar_unlocked(_c) _putchar_unlocked(_c) #endif +#endif /* __cplusplus */ #if __MISC_VISIBLE /* fast always-buffered version, true iff error */ @@ -793,4 +796,8 @@ _putchar_unlocked(int _c) _END_STD_C +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _STDIO_H_ */ diff --git a/newlib/libc/include/stdio_ext.h b/newlib/libc/include/stdio_ext.h index 029ab0253..231262d47 100644 --- a/newlib/libc/include/stdio_ext.h +++ b/newlib/libc/include/stdio_ext.h @@ -19,8 +19,8 @@ _BEGIN_STD_C -void _EXFUN(__fpurge,(FILE *)); -int _EXFUN(__fsetlocking,(FILE *, int)); +void __fpurge (FILE *); +int __fsetlocking (FILE *, int); /* TODO: @@ -52,13 +52,13 @@ __fpending (FILE *__fp) { return __fp->_p - __fp->_bf._base; } #else -size_t _EXFUN(__fbufsize,(FILE *)); -int _EXFUN(__freading,(FILE *)); -int _EXFUN(__fwriting,(FILE *)); -int _EXFUN(__freadable,(FILE *)); -int _EXFUN(__fwritable,(FILE *)); -int _EXFUN(__flbf,(FILE *)); -size_t _EXFUN(__fpending,(FILE *)); +size_t __fbufsize (FILE *); +int __freading (FILE *); +int __fwriting (FILE *); +int __freadable (FILE *); +int __fwritable (FILE *); +int __flbf (FILE *); +size_t __fpending (FILE *); #ifndef __cplusplus diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 968367f22..9773d3672 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -54,7 +54,7 @@ typedef struct #ifndef __compar_fn_t_defined #define __compar_fn_t_defined -typedef int (*__compar_fn_t) (const _PTR, const _PTR); +typedef int (*__compar_fn_t) (const void *, const void *); #endif #define EXIT_FAILURE 1 @@ -62,102 +62,102 @@ typedef int (*__compar_fn_t) (const _PTR, const _PTR); #define RAND_MAX __RAND_MAX -int _EXFUN(__locale_mb_cur_max,(_VOID)); +int __locale_mb_cur_max (void); #define MB_CUR_MAX __locale_mb_cur_max() -_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__))); -int _EXFUN(abs,(int)); +void abort (void) _ATTRIBUTE ((__noreturn__)); +int abs (int); #if __BSD_VISIBLE -__uint32_t _EXFUN(arc4random, (void)); -__uint32_t _EXFUN(arc4random_uniform, (__uint32_t)); -void _EXFUN(arc4random_buf, (void *, size_t)); +__uint32_t arc4random (void); +__uint32_t arc4random_uniform (__uint32_t); +void arc4random_buf (void *, size_t); #endif -int _EXFUN(atexit,(_VOID (*__func)(_VOID))); -double _EXFUN(atof,(const char *__nptr)); +int atexit (void (*__func)(void)); +double atof (const char *__nptr); #if __MISC_VISIBLE -float _EXFUN(atoff,(const char *__nptr)); +float atoff (const char *__nptr); #endif -int _EXFUN(atoi,(const char *__nptr)); -int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); -long _EXFUN(atol,(const char *__nptr)); -long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); -_PTR _EXFUN(bsearch,(const _PTR __key, - const _PTR __base, +int atoi (const char *__nptr); +int _atoi_r (struct _reent *, const char *__nptr); +long atol (const char *__nptr); +long _atol_r (struct _reent *, const char *__nptr); +void * bsearch (const void *__key, + const void *__base, size_t __nmemb, size_t __size, - __compar_fn_t _compar)); -_PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); -div_t _EXFUN(div,(int __numer, int __denom)); -_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__))); -_VOID _EXFUN_NOTHROW(free,(_PTR)); -char * _EXFUN(getenv,(const char *__string)); -char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); -char * _EXFUN(_findenv,(_CONST char *, int *)); -char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); + __compar_fn_t _compar); +void *calloc(size_t, size_t) __malloc_like __result_use_check + __alloc_size2(1, 2) _NOTHROW; +div_t div (int __numer, int __denom); +void exit (int __status) _ATTRIBUTE ((__noreturn__)); +void free (void *) _NOTHROW; +char * getenv (const char *__string); +char * _getenv_r (struct _reent *, const char *__string); +char * _findenv (const char *, int *); +char * _findenv_r (struct _reent *, const char *, int *); #if __POSIX_VISIBLE >= 200809 extern char *suboptarg; /* getsubopt(3) external variable */ -int _EXFUN(getsubopt,(char **, char * const *, char **)); +int getsubopt (char **, char * const *, char **); #endif -long _EXFUN(labs,(long)); -ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); -_PTR _EXFUN_NOTHROW(malloc,(size_t __size)); -int _EXFUN(mblen,(const char *, size_t)); -int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); -int _EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t)); -int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); -int _EXFUN(wctomb,(char *, wchar_t)); -int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); -size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t)); -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 *)); +long labs (long); +ldiv_t ldiv (long __numer, long __denom); +void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1) _NOTHROW; +int mblen (const char *, size_t); +int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *); +int mbtowc (wchar_t *__restrict, const char *__restrict, size_t); +int _mbtowc_r (struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *); +int wctomb (char *, wchar_t); +int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *); +size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t); +size_t _mbstowcs_r (struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *); +size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t); +size_t _wcstombs_r (struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *); #ifndef _REENT_ONLY #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 -char * _EXFUN(mkdtemp,(char *)); +char * mkdtemp (char *); #endif #if __GNU_VISIBLE -int _EXFUN(mkostemp,(char *, int)); -int _EXFUN(mkostemps,(char *, int, int)); +int mkostemp (char *, int); +int mkostemps (char *, int, int); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 4 -int _EXFUN(mkstemp,(char *)); +int mkstemp (char *); #endif #if __MISC_VISIBLE -int _EXFUN(mkstemps,(char *, int)); +int 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")))); +char * 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)); -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")))); -_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)); +char * _mkdtemp_r (struct _reent *, char *); +int _mkostemp_r (struct _reent *, char *, int); +int _mkostemps_r (struct _reent *, char *, int, int); +int _mkstemp_r (struct _reent *, char *); +int _mkstemps_r (struct _reent *, char *, int); +char * _mktemp_r (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))); +void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t _compar); +int rand (void); +void *realloc(void *, size_t) __result_use_check __alloc_size(2) _NOTHROW; #if __BSD_VISIBLE -void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2) - __alloc_size(3); -_PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); +void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size2(2, 3); +void *reallocf(void *, size_t) __result_use_check __alloc_size(2); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 -char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path)); +char * realpath (const char *__restrict path, char *__restrict resolved_path); #endif #if __BSD_VISIBLE -int _EXFUN(rpmatch, (const char *response)); +int rpmatch (const char *response); #endif #if __XSI_VISIBLE -_VOID _EXFUN(setkey, (const char *__key)); +void setkey (const char *__key); #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)); +void srand (unsigned __seed); +double strtod (const char *__restrict __n, char **__restrict __end_PTR); +double _strtod_r (struct _reent *,const char *__restrict __n, char **__restrict __end_PTR); #if __ISO_C_VISIBLE >= 1999 -float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); +float strtof (const char *__restrict __n, char **__restrict __end_PTR); #endif #if __MISC_VISIBLE /* the following strtodf interface is deprecated...use strtof instead */ @@ -165,10 +165,10 @@ float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); # define strtodf strtof # endif #endif -long _EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -long _EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); +long strtol (const char *__restrict __n, char **__restrict __end_PTR, int __base); +long _strtol_r (struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base); +unsigned long strtoul (const char *__restrict __n, char **__restrict __end_PTR, int __base); +unsigned long _strtoul_r (struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base); #if __GNU_VISIBLE double strtod_l (const char *__restrict, char **__restrict, locale_t); @@ -185,130 +185,131 @@ unsigned long long strtoull_l (const char *__restrict, char **__restrict, int, locale_t __loc); #endif -int _EXFUN(system,(const char *__string)); +int system (const char *__string); #if __SVID_VISIBLE || __XSI_VISIBLE >= 4 -long _EXFUN(a64l,(const char *__input)); -char * _EXFUN(l64a,(long __input)); -char * _EXFUN(_l64a_r,(struct _reent *,long __input)); +long a64l (const char *__input); +char * l64a (long __input); +char * _l64a_r (struct _reent *,long __input); #endif #if __MISC_VISIBLE -int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); +int on_exit (void (*__func)(int, void *),void *__arg); #endif #if __ISO_C_VISIBLE >= 1999 -_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__))); +void _Exit (int __status) _ATTRIBUTE ((__noreturn__)); #endif #if __SVID_VISIBLE || __XSI_VISIBLE -int _EXFUN(putenv,(char *__string)); +int putenv (char *__string); #endif -int _EXFUN(_putenv_r,(struct _reent *, char *__string)); -_PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t)); +int _putenv_r (struct _reent *, char *__string); +void * _reallocf_r (struct _reent *, void *, size_t); #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 -int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); +int setenv (const char *__string, const char *__value, int __overwrite); #endif -int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); +int _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 *)); -char * _EXFUN(fcvtf,(float,int,int *,int *)); -char * _EXFUN(ecvt,(double,int,int *,int *)); -char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(ecvtf,(float,int,int *,int *)); +char * gcvt (double,int,char *); +char * gcvtf (float,int,char *); +char * fcvt (double,int,int *,int *); +char * fcvtf (float,int,int *,int *); +char * ecvt (double,int,int *,int *); +char * ecvtbuf (double, int, int*, int*, char *); +char * fcvtbuf (double, int, int*, int*, char *); +char * ecvtf (float,int,int *,int *); #endif -char * _EXFUN(__itoa,(int, char *, int)); -char * _EXFUN(__utoa,(unsigned, char *, int)); +char * __itoa (int, char *, int); +char * __utoa (unsigned, char *, int); #if __MISC_VISIBLE -char * _EXFUN(itoa,(int, char *, int)); -char * _EXFUN(utoa,(unsigned, char *, int)); +char * itoa (int, char *, int); +char * utoa (unsigned, char *, int); #endif #if __POSIX_VISIBLE -int _EXFUN(rand_r,(unsigned *__seed)); +int 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])); -double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3])); -long _EXFUN(jrand48,(unsigned short [3])); -long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(lcong48,(unsigned short [7])); -_VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7])); -long _EXFUN(lrand48,(_VOID)); -long _EXFUN(_lrand48_r,(struct _reent *)); -long _EXFUN(mrand48,(_VOID)); -long _EXFUN(_mrand48_r,(struct _reent *)); -long _EXFUN(nrand48,(unsigned short [3])); -long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3])); +double drand48 (void); +double _drand48_r (struct _reent *); +double erand48 (unsigned short [3]); +double _erand48_r (struct _reent *, unsigned short [3]); +long jrand48 (unsigned short [3]); +long _jrand48_r (struct _reent *, unsigned short [3]); +void lcong48 (unsigned short [7]); +void _lcong48_r (struct _reent *, unsigned short [7]); +long lrand48 (void); +long _lrand48_r (struct _reent *); +long mrand48 (void); +long _mrand48_r (struct _reent *); +long nrand48 (unsigned short [3]); +long _nrand48_r (struct _reent *, unsigned short [3]); unsigned short * - _EXFUN(seed48,(unsigned short [3])); + seed48 (unsigned short [3]); unsigned short * - _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(srand48,(long)); -_VOID _EXFUN(_srand48_r,(struct _reent *, long)); + _seed48_r (struct _reent *, unsigned short [3]); +void srand48 (long); +void _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)); +char * initstate (unsigned, char *, size_t); +long random (void); +char * setstate (char *); +void srandom (unsigned); #endif #if __ISO_C_VISIBLE >= 1999 -long long _EXFUN(atoll,(const char *__nptr)); +long long atoll (const char *__nptr); #endif -long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); +long long _atoll_r (struct _reent *, const char *__nptr); #if __ISO_C_VISIBLE >= 1999 -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)); +long long llabs (long long); +lldiv_t lldiv (long long __numer, long long __denom); +long long strtoll (const char *__restrict __n, char **__restrict __end_PTR, int __base); #endif -long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); +long long _strtoll_r (struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base); #if __ISO_C_VISIBLE >= 1999 -unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); +unsigned long long strtoull (const char *__restrict __n, char **__restrict __end_PTR, int __base); #endif -unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); +unsigned long long _strtoull_r (struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base); #ifndef __CYGWIN__ #if __MISC_VISIBLE -_VOID _EXFUN(cfree,(_PTR)); +void cfree (void *); #endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 -int _EXFUN(unsetenv,(const char *__string)); +int unsetenv (const char *__string); #endif -int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); +int _unsetenv_r (struct _reent *, const char *__string); #endif /* !__CYGWIN__ */ #if __POSIX_VISIBLE >= 200112 -int _EXFUN(__nonnull (1) posix_memalign,(void **, size_t, size_t)); +int posix_memalign (void **, size_t, size_t) __nonnull((1)) + __result_use_check; #endif -char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); +char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**); #ifndef __CYGWIN__ -_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t)); -_PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t)); -_VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR)); -_PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t)); -_VOID _EXFUN(_mstats_r,(struct _reent *, char *)); +void * _malloc_r (struct _reent *, size_t) _NOTHROW; +void * _calloc_r (struct _reent *, size_t, size_t) _NOTHROW; +void _free_r (struct _reent *, void *) _NOTHROW; +void * _realloc_r (struct _reent *, void *, size_t) _NOTHROW; +void _mstats_r (struct _reent *, char *); #endif -int _EXFUN(_system_r,(struct _reent *, const char *)); +int _system_r (struct _reent *, const char *); -_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); +void __eprintf (const char *, const char *, unsigned int, const char *); /* There are two common qsort_r variants. If you request _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)); +void qsort_r (void *__base, size_t __nmemb, size_t __size, int (*_compar)(const void *, const void *, void *), void *__thunk); #elif __BSD_VISIBLE # ifdef __GNUC__ -_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))) +void qsort_r (void *__base, size_t __nmemb, size_t __size, void *__thunk, int (*_compar)(void *, const void *, const void *)) __asm__ (__ASMNAME ("__bsd_qsort_r")); # else -_VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))); +void __bsd_qsort_r (void *__base, size_t __nmemb, size_t __size, void *__thunk, int (*_compar)(void *, const void *, const void *)); # define qsort_r __bsd_qsort_r # endif #endif @@ -326,7 +327,7 @@ extern long double strtold (const char *__restrict, char **__restrict); */ #if __ISO_C_VISIBLE >= 2011 void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) - __alloc_size(2); + __alloc_size(2) __result_use_check; int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); @@ -334,4 +335,8 @@ _Noreturn void _END_STD_C +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _STDLIB_H_ */ diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h index 7833aa156..04c4d1828 100644 --- a/newlib/libc/include/string.h +++ b/newlib/libc/include/string.h @@ -26,30 +26,30 @@ _BEGIN_STD_C -_PTR _EXFUN(memchr,(const _PTR, int, size_t)); -int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); -_PTR _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t)); -_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); -_PTR _EXFUN(memset,(_PTR, int, size_t)); -char *_EXFUN(strcat,(char *__restrict, const char *__restrict)); -char *_EXFUN(strchr,(const char *, int)); -int _EXFUN(strcmp,(const char *, const char *)); -int _EXFUN(strcoll,(const char *, const char *)); -char *_EXFUN(strcpy,(char *__restrict, const char *__restrict)); -size_t _EXFUN(strcspn,(const char *, const char *)); -char *_EXFUN(strerror,(int)); -size_t _EXFUN(strlen,(const char *)); -char *_EXFUN(strncat,(char *__restrict, const char *__restrict, size_t)); -int _EXFUN(strncmp,(const char *, const char *, size_t)); -char *_EXFUN(strncpy,(char *__restrict, const char *__restrict, size_t)); -char *_EXFUN(strpbrk,(const char *, const char *)); -char *_EXFUN(strrchr,(const char *, int)); -size_t _EXFUN(strspn,(const char *, const char *)); -char *_EXFUN(strstr,(const char *, const char *)); +void * memchr (const void *, int, size_t); +int memcmp (const void *, const void *, size_t); +void * memcpy (void *__restrict, const void *__restrict, size_t); +void * memmove (void *, const void *, size_t); +void * memset (void *, int, size_t); +char *strcat (char *__restrict, const char *__restrict); +char *strchr (const char *, int); +int strcmp (const char *, const char *); +int strcoll (const char *, const char *); +char *strcpy (char *__restrict, const char *__restrict); +size_t strcspn (const char *, const char *); +char *strerror (int); +size_t strlen (const char *); +char *strncat (char *__restrict, const char *__restrict, size_t); +int strncmp (const char *, const char *, size_t); +char *strncpy (char *__restrict, const char *__restrict, size_t); +char *strpbrk (const char *, const char *); +char *strrchr (const char *, int); +size_t strspn (const char *, const char *); +char *strstr (const char *, const char *); #ifndef _REENT_ONLY -char *_EXFUN(strtok,(char *__restrict, const char *__restrict)); +char *strtok (char *__restrict, const char *__restrict); #endif -size_t _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t)); +size_t strxfrm (char *__restrict, const char *__restrict, size_t); #if __POSIX_VISIBLE >= 200809 int strcoll_l (const char *, const char *, locale_t); @@ -57,86 +57,89 @@ char *strerror_l (int, locale_t); size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE -char *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict)); +char *strtok_r (char *__restrict, const char *__restrict, char **__restrict); #endif #if __BSD_VISIBLE -int _EXFUN(timingsafe_bcmp,(const void *, const void *, size_t)); -int _EXFUN(timingsafe_memcmp,(const void *, const void *, size_t)); +int timingsafe_bcmp (const void *, const void *, size_t); +int timingsafe_memcmp (const void *, const void *, size_t); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE -_PTR _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t)); +void * memccpy (void *__restrict, const void *__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)); -_PTR _EXFUN(memrchr,(const _PTR, int, size_t)); -_PTR _EXFUN(rawmemchr,(const _PTR, int)); +void * mempcpy (void *, const void *, size_t); +void * memmem (const void *, size_t, const void *, size_t); +void * memrchr (const void *, int, size_t); +void * rawmemchr (const void *, int); #endif #if __POSIX_VISIBLE >= 200809 -char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict)); -char *_EXFUN(stpncpy,(char *__restrict, const char *__restrict, size_t)); +char *stpcpy (char *__restrict, const char *__restrict); +char *stpncpy (char *__restrict, const char *__restrict, size_t); #endif #if __GNU_VISIBLE -char *_EXFUN(strcasestr,(const char *, const char *)); -char *_EXFUN(strchrnul,(const char *, int)); +char *strcasestr (const char *, const char *); +char *strchrnul (const char *, int); #endif #if __MISC_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4 -char *_EXFUN(strdup,(const char *)); +char *strdup (const char *) __malloc_like __result_use_check; #endif -char *_EXFUN(_strdup_r,(struct _reent *, const char *)); +char *_strdup_r (struct _reent *, const char *); #if __POSIX_VISIBLE >= 200809 -char *_EXFUN(strndup,(const char *, size_t)); +char *strndup (const char *, size_t) __malloc_like __result_use_check; #endif -char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); +char *_strndup_r (struct _reent *, const char *, size_t); /* There are two common strerror_r variants. If you request _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX version. POSIX requires that #undef strerror_r will still let you invoke the underlying function, but that requires gcc support. */ #if __GNU_VISIBLE -char *_EXFUN(strerror_r,(int, char *, size_t)); +char *strerror_r (int, char *, size_t); #elif __POSIX_VISIBLE >= 200112 # ifdef __GNUC__ -int _EXFUN(strerror_r,(int, char *, size_t)) +int strerror_r (int, char *, size_t) #ifdef __ASMNAME __asm__ (__ASMNAME ("__xpg_strerror_r")) #endif ; # else -int _EXFUN(__xpg_strerror_r,(int, char *, size_t)); +int __xpg_strerror_r (int, char *, size_t); # define strerror_r __xpg_strerror_r # endif #endif /* Reentrant version of strerror. */ -char * _EXFUN(_strerror_r, (struct _reent *, int, int, int *)); +char * _strerror_r (struct _reent *, int, int, int *); #if __BSD_VISIBLE -size_t _EXFUN(strlcat,(char *, const char *, size_t)); -size_t _EXFUN(strlcpy,(char *, const char *, size_t)); +size_t strlcat (char *, const char *, size_t); +size_t strlcpy (char *, const char *, size_t); #endif #if __POSIX_VISIBLE >= 200809 -size_t _EXFUN(strnlen,(const char *, size_t)); +size_t strnlen (const char *, size_t); #endif #if __BSD_VISIBLE -char *_EXFUN(strsep,(char **, const char *)); +char *strsep (char **, const char *); +#endif +#if __BSD_VISIBLE +char *strnstr(const char *, const char *, size_t) __pure; #endif #if __MISC_VISIBLE -char *_EXFUN(strlwr,(char *)); -char *_EXFUN(strupr,(char *)); +char *strlwr (char *); +char *strupr (char *); #endif #ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ -char *_EXFUN(strsignal, (int __signo)); +char *strsignal (int __signo); #endif #ifdef __CYGWIN__ -int _EXFUN(strtosigno, (const char *__name)); +int strtosigno (const char *__name); #endif #if __GNU_VISIBLE -int _EXFUN(strverscmp,(const char *, const char *)); +int strverscmp (const char *, const char *); #endif #if __GNU_VISIBLE && defined(__GNUC__) @@ -166,11 +169,15 @@ int _EXFUN(strverscmp,(const char *, const char *)); sure here. */ #if __GNU_VISIBLE && !defined(basename) # define basename basename -char *_EXFUN(__nonnull (1) basename,(const char *)) __asm__(__ASMNAME("__gnu_basename")); +char *__nonnull ((1)) basename (const char *) __asm__(__ASMNAME("__gnu_basename")); #endif #include _END_STD_C +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _STRING_H_ */ diff --git a/newlib/libc/include/strings.h b/newlib/libc/include/strings.h index 35fcdc092..7e2e557e7 100644 --- a/newlib/libc/include/strings.h +++ b/newlib/libc/include/strings.h @@ -50,7 +50,7 @@ void bzero(void *, size_t); /* LEGACY */ #if __BSD_VISIBLE void explicit_bzero(void *, size_t); #endif -#if __XSI_VISIBLE +#if __MISC_VISIBLE || __POSIX_VISIBLE < 200809 || __XSI_VISIBLE >= 700 int ffs(int) __pure2; #endif #if __BSD_VISIBLE @@ -73,4 +73,8 @@ int strncasecmp_l (const char *, const char *, size_t, locale_t); #endif __END_DECLS +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _STRINGS_H_ */ diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h index ede90c4bc..22fa10688 100644 --- a/newlib/libc/include/sys/_default_fcntl.h +++ b/newlib/libc/include/sys/_default_fcntl.h @@ -23,6 +23,19 @@ extern "C" { #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ #define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ +#if defined (__CYGWIN__) +#define _FBINARY 0x10000 +#define _FTEXT 0x20000 +#endif +#define _FNOINHERIT 0x40000 +#define _FDIRECT 0x80000 +#define _FNOFOLLOW 0x100000 +#define _FDIRECTORY 0x200000 +#define _FEXECSRCH 0x400000 +#if defined (__CYGWIN__) +#define _FTMPFILE 0x800000 +#define _FNOATIME 0x1000000 +#endif #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) @@ -43,26 +56,31 @@ extern "C" { /* O_NDELAY _FNBIO set in include/fcntl.h */ #define O_NONBLOCK _FNONBLOCK #define O_NOCTTY _FNOCTTY -/* For machines which care - */ -#if defined (__CYGWIN__) -#define _FBINARY 0x10000 -#define _FTEXT 0x20000 -#define _FNOINHERIT 0x40000 -#define _FDIRECT 0x80000 -#define _FNOFOLLOW 0x100000 -#define _FDIRECTORY 0x200000 -#define _FEXECSRCH 0x400000 +/* POSIX-1.2008 specific flags */ +#if __POSIX_VISIBLE >= 200809 +#define O_CLOEXEC _FNOINHERIT +#define O_NOFOLLOW _FNOFOLLOW +#define O_DIRECTORY _FDIRECTORY +#define O_EXEC _FEXECSRCH +#define O_SEARCH _FEXECSRCH +#endif + +#if __BSD_VISIBLE +#define O_DIRECT _FDIRECT +#endif + +#if defined (__CYGWIN__) #define O_BINARY _FBINARY #define O_TEXT _FTEXT -#define O_CLOEXEC _FNOINHERIT -#define O_DIRECT _FDIRECT -#define O_NOFOLLOW _FNOFOLLOW #define O_DSYNC _FSYNC #define O_RSYNC _FSYNC -#define O_DIRECTORY _FDIRECTORY -#define O_EXEC _FEXECSRCH -#define O_SEARCH _FEXECSRCH + +/* Linux-specific flags */ +#if __GNU_VISIBLE +#define O_TMPFILE _FTMPFILE +#define O_NOATIME _FNOATIME +#endif #endif #if __MISC_VISIBLE @@ -187,27 +205,27 @@ struct eflock { #include #include /* sigh. for the mode bits for open/creat */ -extern int open _PARAMS ((const char *, int, ...)); +extern int open (const char *, int, ...); #if __ATFILE_VISIBLE -extern int openat _PARAMS ((int, const char *, int, ...)); +extern int openat (int, const char *, int, ...); #endif -extern int creat _PARAMS ((const char *, mode_t)); -extern int fcntl _PARAMS ((int, int, ...)); +extern int creat (const char *, mode_t); +extern int fcntl (int, int, ...); #if __BSD_VISIBLE -extern int flock _PARAMS ((int, int)); +extern int flock (int, int); #endif #if __GNU_VISIBLE #include -extern int futimesat _PARAMS ((int, const char *, const struct timeval *)); +extern int futimesat (int, const char *, const struct timeval *); #endif /* Provide _ prototypes for functions provided by some versions of newlib. */ #ifdef _COMPILING_NEWLIB -extern int _open _PARAMS ((const char *, int, ...)); -extern int _fcntl _PARAMS ((int, int, ...)); +extern int _open (const char *, int, ...); +extern int _fcntl (int, int, ...); #ifdef __LARGE64_FILES -extern int _open64 _PARAMS ((const char *, int, ...)); +extern int _open64 (const char *, int, ...); #endif #endif diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h index 98b93ce71..fc10531d5 100644 --- a/newlib/libc/include/sys/_types.h +++ b/newlib/libc/include/sys/_types.h @@ -180,13 +180,23 @@ typedef _LOCK_RECURSIVE_T _flock_t; typedef void *_iconv_t; #endif +#ifndef __machine_clock_t_defined #define _CLOCK_T_ unsigned long /* clock() */ +#endif + typedef _CLOCK_T_ __clock_t; -#define _TIME_T_ long /* time() */ +#if defined(_USE_LONG_TIME_T) || __LONG_MAX__ > 0x7fffffffL +#define _TIME_T_ long +#else +#define _TIME_T_ __int_least64_t +#endif typedef _TIME_T_ __time_t; +#ifndef __machine_clockid_t_defined #define _CLOCKID_T_ unsigned long +#endif + typedef _CLOCKID_T_ __clockid_t; #define _TIMER_T_ unsigned long @@ -200,6 +210,7 @@ typedef __uint8_t __sa_family_t; typedef __uint32_t __socklen_t; #endif +typedef int __nl_item; typedef unsigned short __nlink_t; typedef long __suseconds_t; /* microseconds (signed) */ typedef unsigned long __useconds_t; /* microseconds (unsigned) */ diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index 9e58ee980..ccb47ea40 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -3,6 +3,8 @@ /* Written 2000 by Werner Almesberger */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * @@ -225,17 +227,6 @@ * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __alloc_align(x) -#define __alloc_size(x) -#define __section(x) -#define __weak_symbol -#else #define __weak_symbol __attribute__((__weak__)) #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) #define __dead2 @@ -259,15 +250,16 @@ #endif #if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__) #define __alloc_size(x) __attribute__((__alloc_size__(x))) +#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x))) #else #define __alloc_size(x) +#define __alloc_size2(n, x) #endif #if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else #define __alloc_align(x) #endif -#endif /* lint */ #if !__GNUC_PREREQ__(2, 95) #define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) @@ -277,7 +269,7 @@ * Keywords added in C11. */ -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L #if !__has_extension(c_alignas) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ @@ -314,7 +306,7 @@ #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) -#elif __GNUC_PREREQ__(4,6) +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ #elif defined(__COUNTER__) #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) @@ -385,7 +377,7 @@ #endif #if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) -#define __always_inline __attribute__((__always_inline__)) +#define __always_inline __inline__ __attribute__((__always_inline__)) #else #define __always_inline #endif @@ -397,7 +389,7 @@ #endif #if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) +#define __nonnull(x) __attribute__((__nonnull__ x)) #define __nonnull_all __attribute__((__nonnull__)) #else #define __nonnull(x) @@ -436,7 +428,7 @@ * software that is unaware of C99 keywords. */ #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 #define __restrict #else #define __restrict restrict @@ -652,7 +644,7 @@ */ #if __has_attribute(__argument_with_type_tag__) && \ - __has_attribute(__type_tag_for_datatype__) && !defined(lint) + __has_attribute(__type_tag_for_datatype__) #define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx))) #define __datatype_type_tag(kind, type) \ @@ -681,42 +673,44 @@ #endif /* Structure implements a lock. */ -#define __lockable __lock_annotate(__lockable__) +/* FIXME: Use __lockable__, etc. to avoid colliding with user namespace macros, + * once clang is fixed: https://bugs.llvm.org/show_bug.cgi?id=34319 */ +#define __lockable __lock_annotate(lockable) /* Function acquires an exclusive or shared lock. */ #define __locks_exclusive(...) \ - __lock_annotate(__exclusive_lock_function__(__VA_ARGS__)) + __lock_annotate(exclusive_lock_function(__VA_ARGS__)) #define __locks_shared(...) \ - __lock_annotate(__shared_lock_function__(__VA_ARGS__)) + __lock_annotate(shared_lock_function(__VA_ARGS__)) /* Function attempts to acquire an exclusive or shared lock. */ #define __trylocks_exclusive(...) \ - __lock_annotate(__exclusive_trylock_function__(__VA_ARGS__)) + __lock_annotate(exclusive_trylock_function(__VA_ARGS__)) #define __trylocks_shared(...) \ - __lock_annotate(__shared_trylock_function__(__VA_ARGS__)) + __lock_annotate(shared_trylock_function(__VA_ARGS__)) /* Function releases a lock. */ -#define __unlocks(...) __lock_annotate(__unlock_function__(__VA_ARGS__)) +#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__)) /* Function asserts that an exclusive or shared lock is held. */ #define __asserts_exclusive(...) \ - __lock_annotate(__assert_exclusive_lock__(__VA_ARGS__)) + __lock_annotate(assert_exclusive_lock(__VA_ARGS__)) #define __asserts_shared(...) \ - __lock_annotate(__assert_shared_lock__(__VA_ARGS__)) + __lock_annotate(assert_shared_lock(__VA_ARGS__)) /* Function requires that an exclusive or shared lock is or is not held. */ #define __requires_exclusive(...) \ - __lock_annotate(__exclusive_locks_required__(__VA_ARGS__)) + __lock_annotate(exclusive_locks_required(__VA_ARGS__)) #define __requires_shared(...) \ - __lock_annotate(__shared_locks_required__(__VA_ARGS__)) + __lock_annotate(shared_locks_required(__VA_ARGS__)) #define __requires_unlocked(...) \ - __lock_annotate(__locks_excluded__(__VA_ARGS__)) + __lock_annotate(locks_excluded(__VA_ARGS__)) /* Function should not be analyzed. */ -#define __no_lock_analysis __lock_annotate(__no_thread_safety_analysis__) +#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) /* Guard variables and structure members by lock. */ -#define __guarded_by(x) __lock_annotate(__guarded_by__(x)) -#define __pt_guarded_by(x) __lock_annotate(__pt_guarded_by__(x)) +#define __guarded_by(x) __lock_annotate(guarded_by(x)) +#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) #endif /* !_SYS_CDEFS_H_ */ diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 8dc0c5e9d..49b62ebf6 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -108,7 +108,7 @@ #define _POINTER_INT short #endif -#ifdef __v850 +#if defined(__v850) && !defined(__rtems__) #define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) #endif @@ -283,6 +283,12 @@ #endif #endif +#ifdef _WANT_USE_LONG_TIME_T +#ifndef _USE_LONG_TIME_T +#define _USE_LONG_TIME_T +#endif +#endif + /* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended charsets. The extended charsets add a few functions and a couple of tables of a few K each. */ diff --git a/newlib/libc/include/sys/errno.h b/newlib/libc/include/sys/errno.h index a72c37320..025b461d4 100644 --- a/newlib/libc/include/sys/errno.h +++ b/newlib/libc/include/sys/errno.h @@ -12,12 +12,12 @@ extern "C" { #ifndef _REENT_ONLY #define errno (*__errno()) -extern int *__errno _PARAMS ((void)); +extern int *__errno (void); #endif /* Please don't use these variables directly. Use strerror instead. */ -extern __IMPORT _CONST char * _CONST _sys_errlist[]; +extern __IMPORT const char * const _sys_errlist[]; extern __IMPORT int _sys_nerr; #ifdef __CYGWIN__ extern __IMPORT const char * const sys_errlist[]; diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index c9133af57..f28dd071b 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -100,6 +100,9 @@ extern "C" { * _SVID_SOURCE (deprecated by _DEFAULT_SOURCE) * _DEFAULT_SOURCE (or none of the above) * POSIX-1.2008 with BSD and SVr4 extensions + * + * _FORTIFY_SOURCE = 1 or 2 + * Object Size Checking function wrappers */ #ifdef _GNU_SOURCE @@ -233,9 +236,11 @@ extern "C" { * __GNU_VISIBLE * GNU extensions; enabled with _GNU_SOURCE. * + * __SSP_FORTIFY_LEVEL + * Object Size Checking; defined to 0 (off), 1, or 2. + * * 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 @@ -314,6 +319,17 @@ extern "C" { #define __XSI_VISIBLE 0 #endif +#if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \ + (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1) +# if _FORTIFY_SOURCE > 1 +# define __SSP_FORTIFY_LEVEL 2 +# else +# define __SSP_FORTIFY_LEVEL 1 +# endif +#else +# define __SSP_FORTIFY_LEVEL 0 +#endif + /* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */ #ifdef __rtems__ @@ -409,7 +425,7 @@ extern "C" { #endif #define _POSIX_ADVISORY_INFO 200809L -/* #define _POSIX_ASYNCHRONOUS_IO -1 */ +#define _POSIX_ASYNCHRONOUS_IO 200809L #define _POSIX_BARRIERS 200809L #define _POSIX_CHOWN_RESTRICTED 1 #define _POSIX_CLOCK_SELECTION 200809L @@ -448,7 +464,7 @@ extern "C" { #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L /* #define _POSIX_THREAD_SPORADIC_SERVER -1 */ #define _POSIX_THREADS 200809L -/* #define _POSIX_TIMEOUTS -1 */ +#define _POSIX_TIMEOUTS 200809L #define _POSIX_TIMERS 200809L /* #define _POSIX_TRACE -1 */ /* #define _POSIX_TRACE_EVENT_FILTER -1 */ diff --git a/newlib/libc/include/sys/iconvnls.h b/newlib/libc/include/sys/iconvnls.h index 09ea18316..d4ee0b7c9 100644 --- a/newlib/libc/include/sys/iconvnls.h +++ b/newlib/libc/include/sys/iconvnls.h @@ -44,34 +44,34 @@ #define ICONV_NLS_FROM 0 #define ICONV_NLS_TO 1 -_VOID -_EXFUN(_iconv_nls_get_state, (iconv_t cd, mbstate_t *ps, int direction)); +void +_iconv_nls_get_state (iconv_t cd, mbstate_t *ps, int direction); int -_EXFUN(_iconv_nls_set_state, (iconv_t cd, mbstate_t *ps, int direction)); +_iconv_nls_set_state (iconv_t cd, mbstate_t *ps, int direction); int -_EXFUN(_iconv_nls_is_stateful, (iconv_t cd, int direction)); +_iconv_nls_is_stateful (iconv_t cd, int direction); int -_EXFUN(_iconv_nls_get_mb_cur_max, (iconv_t cd, int direction)); +_iconv_nls_get_mb_cur_max (iconv_t cd, int direction); size_t -_EXFUN(_iconv_nls_conv, (struct _reent *rptr, iconv_t cd, - _CONST char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft)); +_iconv_nls_conv (struct _reent *rptr, iconv_t cd, + const char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft); -_CONST char * -_EXFUN(_iconv_nls_construct_filename, (struct _reent *rptr, _CONST char *file, - _CONST char *dir, _CONST char *ext)); +const char * +_iconv_nls_construct_filename (struct _reent *rptr, const char *file, + const char *dir, const char *ext); int -_EXFUN(_iconv_nls_open, (struct _reent *rptr, _CONST char *encoding, - iconv_t *towc, iconv_t *fromwc, int flag)); +_iconv_nls_open (struct _reent *rptr, const char *encoding, + iconv_t *towc, iconv_t *fromwc, int flag); char * -_EXFUN(_iconv_resolve_encoding_name, (struct _reent *rptr, _CONST char *ca)); +_iconv_resolve_encoding_name (struct _reent *rptr, const char *ca); #endif /* __SYS_ICONVNLS_H__ */ diff --git a/newlib/libc/include/sys/lock.h b/newlib/libc/include/sys/lock.h index 42f9c4cd9..528904957 100644 --- a/newlib/libc/include/sys/lock.h +++ b/newlib/libc/include/sys/lock.h @@ -13,16 +13,16 @@ typedef int _LOCK_RECURSIVE_T; #define __LOCK_INIT(class,lock) static int lock = 0; #define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0; -#define __lock_init(lock) (_CAST_VOID 0) -#define __lock_init_recursive(lock) (_CAST_VOID 0) -#define __lock_close(lock) (_CAST_VOID 0) -#define __lock_close_recursive(lock) (_CAST_VOID 0) -#define __lock_acquire(lock) (_CAST_VOID 0) -#define __lock_acquire_recursive(lock) (_CAST_VOID 0) -#define __lock_try_acquire(lock) (_CAST_VOID 0) -#define __lock_try_acquire_recursive(lock) (_CAST_VOID 0) -#define __lock_release(lock) (_CAST_VOID 0) -#define __lock_release_recursive(lock) (_CAST_VOID 0) +#define __lock_init(lock) ((void) 0) +#define __lock_init_recursive(lock) ((void) 0) +#define __lock_close(lock) ((void) 0) +#define __lock_close_recursive(lock) ((void) 0) +#define __lock_acquire(lock) ((void) 0) +#define __lock_acquire_recursive(lock) ((void) 0) +#define __lock_try_acquire(lock) ((void) 0) +#define __lock_try_acquire_recursive(lock) ((void) 0) +#define __lock_release(lock) ((void) 0) +#define __lock_release_recursive(lock) ((void) 0) #else diff --git a/newlib/libc/include/sys/queue.h b/newlib/libc/include/sys/queue.h index 491bdde82..6392b6220 100644 --- a/newlib/libc/include/sys/queue.h +++ b/newlib/libc/include/sys/queue.h @@ -93,6 +93,7 @@ * _NEXT + + + + * _PREV - + - + * _LAST - - + + + * _LAST_FAST - - - + * _FOREACH + + + + * _FOREACH_FROM + + + + * _FOREACH_SAFE + + + + @@ -820,6 +821,16 @@ struct { \ #define TAILQ_LAST(head, headname) \ (*(((struct headname *)((head)->tqh_last))->tqh_last)) +/* + * The FAST function is fast in that it causes no data access other + * then the access to the head. The standard LAST function above + * will cause a data access of both the element you want and + * the previous element. FAST is very useful for instances when + * you may want to prefetch the last data element. + */ +#define TAILQ_LAST_FAST(head, type, field) \ + (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next)) + #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_PREV(elm, headname, field) \ diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index c045ca549..6e55e1c1f 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -144,7 +144,7 @@ struct __sbuf { * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. */ -#ifdef _REENT_SMALL +#if defined(_REENT_SMALL) && !defined(_REENT_GLOBAL_STDIO_STREAMS) /* * struct __sFILE_fake is the start of a struct __sFILE, with only the * minimal fields allocated. In __sinit() we really allocate the 3 @@ -165,7 +165,7 @@ struct __sFILE_fake { /* Following is needed both in libc/stdio and libc/stdlib so we put it * here instead of libc/stdio/local.h where it was previously. */ -extern _VOID _EXFUN(__sinit,(struct _reent *)); +extern void __sinit (struct _reent *); # define _REENT_SMALL_CHECK_INIT(ptr) \ do \ @@ -174,9 +174,9 @@ extern _VOID _EXFUN(__sinit,(struct _reent *)); __sinit (ptr); \ } \ while (0) -#else +#else /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */ # define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */ -#endif +#endif /* _REENT_SMALL && !_REENT_GLOBAL_STDIO_STREAMS */ struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ @@ -192,15 +192,15 @@ struct __sFILE { #endif /* operations */ - _PTR _cookie; /* cookie passed to io functions */ + void * _cookie; /* cookie passed to io functions */ - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, + _READ_WRITE_RETURN_TYPE (*_read) (struct _reent *, void *, + char *, _READ_WRITE_BUFSIZE_TYPE); + _READ_WRITE_RETURN_TYPE (*_write) (struct _reent *, void *, const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); + _READ_WRITE_BUFSIZE_TYPE); + _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int); + int (*_close) (struct _reent *, void *); /* separate buffer for long sequences of ungetc() */ struct __sbuf _ub; /* ungetc buffer */ @@ -248,15 +248,15 @@ struct __sFILE64 { struct _reent *_data; /* operations */ - _PTR _cookie; /* cookie passed to io functions */ + void * _cookie; /* cookie passed to io functions */ - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, + _READ_WRITE_RETURN_TYPE (*_read) (struct _reent *, void *, + char *, _READ_WRITE_BUFSIZE_TYPE); + _READ_WRITE_RETURN_TYPE (*_write) (struct _reent *, void *, const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); + _READ_WRITE_BUFSIZE_TYPE); + _fpos_t (*_seek) (struct _reent *, void *, _fpos_t, int); + int (*_close) (struct _reent *, void *); /* separate buffer for long sequences of ungetc() */ struct __sbuf _ub; /* ungetc buffer */ @@ -275,7 +275,7 @@ struct __sFILE64 { int _flags2; /* for future use */ _off64_t _offset; /* current lseek offset */ - _fpos64_t _EXFNPTR(_seek64, (struct _reent *, _PTR, _fpos64_t, int)); + _fpos64_t (*_seek64) (struct _reent *, void *, _fpos64_t, int); #ifndef __SINGLE_THREAD__ _flock_t _lock; /* for thread-safety locking */ @@ -391,7 +391,7 @@ struct _reent struct _mprec *_mp; - void _EXFNPTR(__cleanup, (struct _reent *)); + void (*__cleanup) (struct _reent *); int _gamma_signgam; @@ -418,6 +418,43 @@ struct _reent char *_signal_buf; /* strsignal */ }; +#ifdef _REENT_GLOBAL_STDIO_STREAMS +extern __FILE __sf[3]; + +# define _REENT_INIT(var) \ + { 0, \ + &__sf[0], \ + &__sf[1], \ + &__sf[2], \ + 0, \ + _NULL, \ + 0, \ + 0, \ + _NULL, \ + _NULL, \ + _NULL, \ + 0, \ + 0, \ + _NULL, \ + _NULL, \ + _NULL, \ + _NULL, \ + _NULL, \ + _REENT_INIT_ATEXIT \ + {_NULL, 0, _NULL}, \ + _NULL, \ + _NULL, \ + _NULL \ + } + +#define _REENT_INIT_PTR_ZEROED(var) \ + { (var)->_stdin = &__sf[0]; \ + (var)->_stdout = &__sf[1]; \ + (var)->_stderr = &__sf[2]; \ + } + +#else /* _REENT_GLOBAL_STDIO_STREAMS */ + extern const struct __sFILE_fake __sf_fake_stdin; extern const struct __sFILE_fake __sf_fake_stdout; extern const struct __sFILE_fake __sf_fake_stderr; @@ -454,6 +491,8 @@ extern const struct __sFILE_fake __sf_fake_stderr; (var)->_stderr = (__FILE *)&__sf_fake_stderr; \ } +#endif /* _REENT_GLOBAL_STDIO_STREAMS */ + /* Only add assert() calls if we are specified to debug. */ #ifdef _REENT_CHECK_DEBUG #include @@ -584,7 +623,7 @@ struct _reent int __sdidinit; /* 1 means stdio has been init'd */ - void _EXFNPTR(__cleanup, (struct _reent *)); + void (*__cleanup) (struct _reent *); /* used by mprec routines */ struct _Bigint *_result; @@ -773,15 +812,15 @@ extern __FILE __sf[3]; #endif extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__; -extern struct _reent *_CONST _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__; +extern struct _reent *const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__; -void _reclaim_reent _PARAMS ((struct _reent *)); +void _reclaim_reent (struct _reent *); /* #define _REENT_ONLY define this to get only reentrant routines */ #if defined(__DYNAMIC_REENT__) && !defined(__SINGLE_THREAD__) #ifndef __getreent - struct _reent * _EXFUN(__getreent, (void)); + struct _reent * __getreent (void); #endif # define _REENT (__getreent()) #else /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */ diff --git a/newlib/libc/include/sys/resource.h b/newlib/libc/include/sys/resource.h index c35ac2a46..b99506bd8 100644 --- a/newlib/libc/include/sys/resource.h +++ b/newlib/libc/include/sys/resource.h @@ -11,7 +11,7 @@ struct rusage { struct timeval ru_stime; /* system time used */ }; -int _EXFUN(getrusage, (int, struct rusage*)); +int getrusage (int, struct rusage*); #endif diff --git a/newlib/libc/include/sys/select.h b/newlib/libc/include/sys/select.h index f5dc58688..1e5d895bb 100644 --- a/newlib/libc/include/sys/select.h +++ b/newlib/libc/include/sys/select.h @@ -1,14 +1,3 @@ -/* select.h - Copyright 1998, 1999, 2000, 2001, 2005, 2009 Red Hat, Inc. - - Written by Geoffrey Noer - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - #ifndef _SYS_SELECT_H #define _SYS_SELECT_H diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index ab35718ae..45cc0366c 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -161,36 +161,34 @@ typedef struct sigaltstack { #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ -int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset)); +int sigprocmask (int, const sigset_t *, sigset_t *); #endif #if __POSIX_VISIBLE >= 199506 -int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset)); +int pthread_sigmask (int, const sigset_t *, sigset_t *); #endif -#if defined(__CYGWIN__) || defined(__rtems__) #ifdef _COMPILING_NEWLIB -int _EXFUN(_kill, (pid_t, int)); +int _kill (pid_t, int); #endif /* _COMPILING_NEWLIB */ -#endif /* __CYGWIN__ || __rtems__ */ #if __POSIX_VISIBLE -int _EXFUN(kill, (pid_t, int)); +int kill (pid_t, int); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 -int _EXFUN(killpg, (pid_t, int)); +int killpg (pid_t, int); #endif #if __POSIX_VISIBLE -int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); -int _EXFUN(sigaddset, (sigset_t *, const int)); -int _EXFUN(sigdelset, (sigset_t *, const int)); -int _EXFUN(sigismember, (const sigset_t *, int)); -int _EXFUN(sigfillset, (sigset_t *)); -int _EXFUN(sigemptyset, (sigset_t *)); -int _EXFUN(sigpending, (sigset_t *)); -int _EXFUN(sigsuspend, (const sigset_t *)); -int _EXFUN(sigwait, (const sigset_t *set, int *sig)); +int sigaction (int, const struct sigaction *, struct sigaction *); +int sigaddset (sigset_t *, const int); +int sigdelset (sigset_t *, const int); +int sigismember (const sigset_t *, int); +int sigfillset (sigset_t *); +int sigemptyset (sigset_t *); +int sigpending (sigset_t *); +int sigsuspend (const sigset_t *); +int sigwait (const sigset_t *, int *); #if !defined(__CYGWIN__) && !defined(__rtems__) /* These depend upon the type of sigset_t, which right now @@ -211,21 +209,21 @@ int _EXFUN(sigwait, (const sigset_t *set, int *sig)); value. */ #if __XSI_VISIBLE && !defined(__INSIDE_CYGWIN__) # ifdef __GNUC__ -int _EXFUN(sigpause, (int)) __asm__ (__ASMNAME ("__xpg_sigpause")); +int sigpause (int) __asm__ (__ASMNAME ("__xpg_sigpause")); # else -int _EXFUN(__xpg_sigpause, (int)); +int __xpg_sigpause (int); # define sigpause __xpg_sigpause # endif #elif __BSD_VISIBLE -int _EXFUN(sigpause, (int)); +int sigpause (int); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 -int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict)); +int sigaltstack (const stack_t *__restrict, stack_t *__restrict); #endif #if __POSIX_VISIBLE >= 199506 -int _EXFUN(pthread_kill, (pthread_t thread, int sig)); +int pthread_kill (pthread_t, int); #endif #if __POSIX_VISIBLE >= 199309 @@ -233,12 +231,10 @@ int _EXFUN(pthread_kill, (pthread_t thread, int sig)); /* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 NOTE: P1003.1c/D10, p. 39 adds sigwait(). */ -int _EXFUN(sigwaitinfo, (const sigset_t *set, siginfo_t *info)); -int _EXFUN(sigtimedwait, - (const sigset_t *set, siginfo_t *info, const struct timespec *timeout) -); +int sigwaitinfo (const sigset_t *, siginfo_t *); +int sigtimedwait (const sigset_t *, siginfo_t *, const struct timespec *); /* 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 */ -int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value)); +int sigqueue (pid_t, int, const union sigval); #endif /* __POSIX_VISIBLE >= 199309 */ diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index 94a90c0dd..eee98db64 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -144,41 +144,41 @@ struct stat #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 )); -int _EXFUN(stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -mode_t _EXFUN(umask,( mode_t __mask )); +int chmod (const char *__path, mode_t __mode ); +int fchmod (int __fd, mode_t __mode); +int fstat (int __fd, struct stat *__sbuf ); +int mkdir (const char *_path, mode_t __mode ); +int mkfifo (const char *__path, mode_t __mode ); +int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); +mode_t umask (mode_t __mask ); #if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf )); -int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev )); +int lstat (const char *__restrict __path, struct stat *__restrict __buf ); +int mknod (const char *__path, mode_t __mode, dev_t __dev ); #endif #if __ATFILE_VISIBLE && !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchmodat, (int, const char *, mode_t, int)); -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)); -int _EXFUN(mknodat, (int, const char *, mode_t, dev_t)); -int _EXFUN(utimensat, (int, const char *, const struct timespec *, int)); +int fchmodat (int, const char *, mode_t, int); +int fstatat (int, const char *__restrict , struct stat *__restrict, int); +int mkdirat (int, const char *, mode_t); +int mkfifoat (int, const char *, mode_t); +int mknodat (int, const char *, mode_t, dev_t); +int utimensat (int, const char *, const struct timespec *, int); #endif #if __POSIX_VISIBLE >= 200809 && !defined(__INSIDE_CYGWIN__) -int _EXFUN(futimens, (int, const struct timespec *)); +int futimens (int, const struct timespec *); #endif /* Provide prototypes for most of the _ names that are provided in newlib for some compilers. */ #ifdef _COMPILING_NEWLIB -int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(_stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -int _EXFUN(_mkdir,( const char *_path, mode_t __mode )); +int _fstat (int __fd, struct stat *__sbuf ); +int _stat (const char *__restrict __path, struct stat *__restrict __sbuf ); +int _mkdir (const char *_path, mode_t __mode ); #ifdef __LARGE64_FILES struct stat64; -int _EXFUN(_stat64,( const char *__restrict __path, struct stat64 *__restrict __sbuf )); -int _EXFUN(_fstat64,( int __fd, struct stat64 *__sbuf )); +int _stat64 (const char *__restrict __path, struct stat64 *__restrict __sbuf ); +int _fstat64 (int __fd, struct stat64 *__sbuf ); #endif #endif diff --git a/newlib/libc/include/sys/stdio.h b/newlib/libc/include/sys/stdio.h index 0918fe157..91a274596 100644 --- a/newlib/libc/include/sys/stdio.h +++ b/newlib/libc/include/sys/stdio.h @@ -12,7 +12,7 @@ #ifndef __SINGLE_THREAD__ # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) #else -# define _flockfile(fp) (_CAST_VOID 0) +# define _flockfile(fp) ((void) 0) #endif #endif @@ -20,7 +20,7 @@ #ifndef __SINGLE_THREAD__ # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) #else -# define _funlockfile(fp) (_CAST_VOID 0) +# define _funlockfile(fp) ((void) 0) #endif #endif diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 5fdb6673b..ce2e667f7 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -268,30 +268,30 @@ struct itimerval { #include __BEGIN_DECLS -int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); +int 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(lutimes, (const char *, const struct timeval *)); -int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); +int adjtime (const struct timeval *, struct timeval *); +int futimes (int, const struct timeval *); +int lutimes (const char *, const struct timeval *); +int settimeofday (const struct timeval *, const struct timezone *); #endif #if __MISC_VISIBLE || __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 getitimer (int __which, struct itimerval *__value); +int setitimer (int __which, const struct itimerval *__restrict __value, + struct itimerval *__restrict __ovalue); #endif -int _EXFUN(gettimeofday, (struct timeval *__restrict __p, - void *__restrict __tz)); +int gettimeofday (struct timeval *__restrict __p, + void *__restrict __tz); #if __GNU_VISIBLE -int _EXFUN(futimesat, (int, const char *, const struct timeval [2])); +int futimesat (int, const char *, const struct timeval [2]); #endif #ifdef _COMPILING_NEWLIB -int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz)); +int _gettimeofday (struct timeval *__p, void *__tz); #endif __END_DECLS diff --git a/newlib/libc/include/sys/timeb.h b/newlib/libc/include/sys/timeb.h index 793b48143..ccf664974 100644 --- a/newlib/libc/include/sys/timeb.h +++ b/newlib/libc/include/sys/timeb.h @@ -31,7 +31,7 @@ struct timeb short dstflag; }; -extern int ftime _PARAMS ((struct timeb *)); +extern int ftime (struct timeb *); #ifdef __cplusplus } diff --git a/newlib/libc/include/sys/times.h b/newlib/libc/include/sys/times.h index b1f1dc699..05b254714 100644 --- a/newlib/libc/include/sys/times.h +++ b/newlib/libc/include/sys/times.h @@ -21,9 +21,9 @@ struct tms { clock_t tms_cstime; /* system time, children */ }; -clock_t _EXFUN(times,(struct tms *)); +clock_t times (struct tms *); #ifdef _COMPILING_NEWLIB -clock_t _EXFUN(_times,(struct tms *)); +clock_t _times (struct tms *); #endif #ifdef __cplusplus diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 75f8a51df..5386bd49d 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -15,214 +15,234 @@ extern "C" { extern char **environ; -void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((__noreturn__))); +void _exit (int __status) _ATTRIBUTE ((__noreturn__)); -int _EXFUN(access,(const char *__path, int __amode )); -unsigned _EXFUN(alarm, (unsigned __secs )); -int _EXFUN(chdir, (const char *__path )); -int _EXFUN(chmod, (const char *__path, mode_t __mode )); +int access (const char *__path, int __amode); +unsigned alarm (unsigned __secs); +int chdir (const char *__path); +int chmod (const char *__path, mode_t __mode); #if !defined(__INSIDE_CYGWIN__) -int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group )); +int chown (const char *__path, uid_t __owner, gid_t __group); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112) -int _EXFUN(chroot, (const char *__path )); +int chroot (const char *__path); #endif -int _EXFUN(close, (int __fildes )); +int close (int __fildes); #if __POSIX_VISIBLE >= 199209 -size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len)); +size_t confstr (int __name, char *__buf, size_t __len); #endif #if __XSI_VISIBLE -char * _EXFUN(crypt, (const char *__key, const char *__salt)); +char * crypt (const char *__key, const char *__salt); #endif #if __XSI_VISIBLE && __XSI_VISIBLE < 700 -char * _EXFUN(ctermid, (char *__s )); +char * ctermid (char *__s); #endif #if __XSI_VISIBLE && __XSI_VISIBLE < 600 -char * _EXFUN(cuserid, (char *__s )); +char * cuserid (char *__s); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -int _EXFUN(daemon, (int nochdir, int noclose)); +int daemon (int nochdir, int noclose); #endif -int _EXFUN(dup, (int __fildes )); -int _EXFUN(dup2, (int __fildes, int __fildes2 )); +int dup (int __fildes); +int dup2 (int __fildes, int __fildes2); #if __GNU_VISIBLE -int _EXFUN(dup3, (int __fildes, int __fildes2, int flags)); -int _EXFUN(eaccess, (const char *__path, int __mode)); +int dup3 (int __fildes, int __fildes2, int flags); +int eaccess (const char *__path, int __mode); #endif #if __XSI_VISIBLE -void _EXFUN(encrypt, (char *__block, int __edflag)); +void encrypt (char *__block, int __edflag); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -void _EXFUN(endusershell, (void)); +void endusershell (void); #endif #if __GNU_VISIBLE -int _EXFUN(euidaccess, (const char *__path, int __mode)); +int 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 *, ... )); +int execl (const char *__path, const char *, ...); +int execle (const char *__path, const char *, ...); +int execlp (const char *__file, const char *, ...); #if __MISC_VISIBLE -int _EXFUN(execlpe, (const char *__file, const char *, ... )); +int 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[] )); +int execv (const char *__path, char * const __argv[]); +int execve (const char *__path, char * const __argv[], char * const __envp[]); +int execvp (const char *__file, char * const __argv[]); #if __GNU_VISIBLE -int _EXFUN(execvpe, (const char *__file, char * const __argv[], char * const __envp[] )); +int execvpe (const char *__file, char * const __argv[], char * const __envp[]); #endif #if __ATFILE_VISIBLE -int _EXFUN(faccessat, (int __dirfd, const char *__path, int __mode, int __flags)); +int faccessat (int __dirfd, const char *__path, int __mode, int __flags); #endif -#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 -int _EXFUN(fchdir, (int __fildes)); +#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 +int fchdir (int __fildes); +#endif +#if __POSIX_VISIBLE >= 199309 +int fchmod (int __fildes, mode_t __mode); #endif -int _EXFUN(fchmod, (int __fildes, mode_t __mode )); #if !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group )); +#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 +int fchown (int __fildes, uid_t __owner, gid_t __group); +#endif #endif #if __ATFILE_VISIBLE -int _EXFUN(fchownat, (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags)); +int fchownat (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags); #endif #if __POSIX_VISIBLE >= 200809 -int _EXFUN(fexecve, (int __fd, char * const __argv[], char * const __envp[] )); +int fexecve (int __fd, char * const __argv[], char * const __envp[]); +#endif +pid_t fork (void); +long fpathconf (int __fd, int __name); +int fsync (int __fd); +#if __POSIX_VISIBLE >= 199309 +int fdatasync (int __fd); #endif -pid_t _EXFUN(fork, (void )); -long _EXFUN(fpathconf, (int __fd, int __name )); -int _EXFUN(fsync, (int __fd)); -int _EXFUN(fdatasync, (int __fd)); #if __GNU_VISIBLE -char * _EXFUN(get_current_dir_name, (void)); +char * get_current_dir_name (void); #endif -char * _EXFUN(getcwd, (char *__buf, size_t __size )); +char * getcwd (char *__buf, size_t __size); #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -int _EXFUN(getdomainname ,(char *__name, size_t __len)); +int getdomainname (char *__name, size_t __len); #endif #if __BSD_VISIBLE -int _EXFUN(getentropy, (void *, size_t)); +int getentropy (void *, size_t); #endif #if !defined(__INSIDE_CYGWIN__) -gid_t _EXFUN(getegid, (void )); -uid_t _EXFUN(geteuid, (void )); -gid_t _EXFUN(getgid, (void )); +gid_t getegid (void); +uid_t geteuid (void); +gid_t getgid (void); #endif -int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] )); +int getgroups (int __gidsetsize, gid_t __grouplist[]); #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 -long _EXFUN(gethostid, (void)); +long gethostid (void); #endif -char * _EXFUN(getlogin, (void )); +char * getlogin (void); #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) -int _EXFUN(getlogin_r, (char *name, size_t namesize) ); +int getlogin_r (char *name, size_t namesize) ; +#endif +#if __BSD_VISIBLE || (__XSI_VISIBLE && __POSIX_VISIBLE < 200112) +char * getpass (const char *__prompt); +int getpagesize (void); #endif -char * _EXFUN(getpass, (const char *__prompt)); -int _EXFUN(getpagesize, (void)); #if __BSD_VISIBLE -int _EXFUN(getpeereid, (int, uid_t *, gid_t *)); +int getpeereid (int, uid_t *, gid_t *); #endif -pid_t _EXFUN(getpgid, (pid_t)); -pid_t _EXFUN(getpgrp, (void )); -pid_t _EXFUN(getpid, (void )); -pid_t _EXFUN(getppid, (void )); #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4 -pid_t _EXFUN(getsid, (pid_t)); +pid_t getpgid (pid_t); +#endif +pid_t getpgrp (void); +pid_t getpid (void); +pid_t getppid (void); +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 4 +pid_t getsid (pid_t); #endif #if !defined(__INSIDE_CYGWIN__) -uid_t _EXFUN(getuid, (void )); +uid_t getuid (void); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -char * _EXFUN(getusershell, (void)); +char * getusershell (void); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809) -char * _EXFUN(getwd, (char *__buf )); +char * getwd (char *__buf); #endif #if __BSD_VISIBLE -int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser)); +int iruserok (unsigned long raddr, int superuser, const char *ruser, const char *luser); #endif -int _EXFUN(isatty, (int __fildes )); +int isatty (int __fildes); #if __BSD_VISIBLE -int _EXFUN(issetugid, (void)); +int issetugid (void); #endif #if !defined(__INSIDE_CYGWIN__) -int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group )); +#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 +int lchown (const char *__path, uid_t __owner, gid_t __group); #endif -int _EXFUN(link, (const char *__path1, const char *__path2 )); +#endif +int link (const char *__path1, const char *__path2); #if __ATFILE_VISIBLE -int _EXFUN(linkat, (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags )); +int linkat (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags); +#endif +#if __MISC_VISIBLE || __XSI_VISIBLE +int nice (int __nice_value); #endif -int _EXFUN(nice, (int __nice_value )); #if !defined(__INSIDE_CYGWIN__) -off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); +off_t lseek (int __fildes, off_t __offset, int __whence); #endif #if __MISC_VISIBLE || __XSI_VISIBLE >= 4 #define F_ULOCK 0 #define F_LOCK 1 #define F_TLOCK 2 #define F_TEST 3 -int _EXFUN(lockf, (int __fd, int __cmd, off_t __len)); +int lockf (int __fd, int __cmd, off_t __len); #endif -long _EXFUN(pathconf, (const char *__path, int __name )); -int _EXFUN(pause, (void )); +long pathconf (const char *__path, int __name); +int pause (void); #if __POSIX_VISIBLE >= 199506 -int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void))); +int pthread_atfork (void (*)(void), void (*)(void), void (*)(void)); #endif -int _EXFUN(pipe, (int __fildes[2] )); +int pipe (int __fildes[2]); #if __GNU_VISIBLE -int _EXFUN(pipe2, (int __fildes[2], int flags)); +int 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 __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 +ssize_t pread (int __fd, void *__buf, size_t __nbytes, off_t __offset); +ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, off_t __offset); +#endif +_READ_WRITE_RETURN_TYPE read (int __fd, void *__buf, size_t __nbyte); #if __BSD_VISIBLE -int _EXFUN(rresvport, (int *__alport)); -int _EXFUN(revoke, (char *__path)); +int rresvport (int *__alport); +int revoke (char *__path); #endif -int _EXFUN(rmdir, (const char *__path )); +int rmdir (const char *__path); #if __BSD_VISIBLE -int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser)); +int ruserok (const char *rhost, int superuser, const char *ruser, const char *luser); +#endif +#if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200112) +void * sbrk (ptrdiff_t __incr); #endif -void * _EXFUN(sbrk, (ptrdiff_t __incr)); #if !defined(__INSIDE_CYGWIN__) #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 -int _EXFUN(setegid, (gid_t __gid )); -int _EXFUN(seteuid, (uid_t __uid )); +int setegid (gid_t __gid); +int seteuid (uid_t __uid); #endif -int _EXFUN(setgid, (gid_t __gid )); +int setgid (gid_t __gid); #endif #if __BSD_VISIBLE -int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist )); +int setgroups (int ngroups, const gid_t *grouplist); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -int _EXFUN(sethostname, (const char *, size_t)); +int sethostname (const char *, size_t); +#endif +int setpgid (pid_t __pid, pid_t __pgid); +#if __SVID_VISIBLE || __XSI_VISIBLE >= 500 +int setpgrp (void); #endif -int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid )); -int _EXFUN(setpgrp, (void )); #if (__BSD_VISIBLE || __XSI_VISIBLE >= 4) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(setregid, (gid_t __rgid, gid_t __egid)); -int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid)); +int setregid (gid_t __rgid, gid_t __egid); +int setreuid (uid_t __ruid, uid_t __euid); #endif -pid_t _EXFUN(setsid, (void )); +pid_t setsid (void); #if !defined(__INSIDE_CYGWIN__) -int _EXFUN(setuid, (uid_t __uid )); +int setuid (uid_t __uid); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) -void _EXFUN(setusershell, (void)); +void setusershell (void); #endif -unsigned _EXFUN(sleep, (unsigned int __seconds )); +unsigned sleep (unsigned int __seconds); #if __XSI_VISIBLE -void _EXFUN(swab, (const void *__restrict, void *__restrict, ssize_t)); +void swab (const void *__restrict, void *__restrict, ssize_t); #endif -long _EXFUN(sysconf, (int __name )); -pid_t _EXFUN(tcgetpgrp, (int __fildes )); -int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); -char * _EXFUN(ttyname, (int __fildes )); -int _EXFUN(ttyname_r, (int, char *, size_t)); -int _EXFUN(unlink, (const char *__path )); +long sysconf (int __name); +pid_t tcgetpgrp (int __fildes); +int tcsetpgrp (int __fildes, pid_t __pgrp_id); +char * ttyname (int __fildes); +int ttyname_r (int, char *, size_t); +int unlink (const char *__path); #if __XSI_VISIBLE >= 500 && __POSIX_VISIBLE < 200809 || __BSD_VISIBLE -int _EXFUN(usleep, (useconds_t __useconds)); +int usleep (useconds_t __useconds); #endif #if __BSD_VISIBLE -int _EXFUN(vhangup, (void )); +int vhangup (void); #endif -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte )); +_READ_WRITE_RETURN_TYPE write (int __fd, const void *__buf, size_t __nbyte); #ifdef __CYGWIN__ # define __UNISTD_GETOPT__ @@ -236,69 +256,69 @@ extern int optreset; /* getopt(3) external variable */ #endif #if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE < 200809) -pid_t _EXFUN(vfork, (void )); +pid_t vfork (void); #endif #ifdef _COMPILING_NEWLIB /* Provide prototypes for most of the _ names that are provided in newlib for some compilers. */ -int _EXFUN(_close, (int __fildes )); -pid_t _EXFUN(_fork, (void )); -pid_t _EXFUN(_getpid, (void )); -int _EXFUN(_isatty, (int __fildes )); -int _EXFUN(_link, (const char *__path1, const char *__path2 )); -_off_t _EXFUN(_lseek, (int __fildes, _off_t __offset, int __whence )); +int _close (int __fildes); +pid_t _fork (void); +pid_t _getpid (void); +int _isatty (int __fildes); +int _link (const char *__path1, const char *__path2); +_off_t _lseek (int __fildes, _off_t __offset, int __whence); #ifdef __LARGE64_FILES -_off64_t _EXFUN(_lseek64, (int __filedes, _off64_t __offset, int __whence )); +_off64_t _lseek64 (int __filedes, _off64_t __offset, int __whence); #endif -_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte )); -void * _EXFUN(_sbrk, (ptrdiff_t __incr)); -int _EXFUN(_unlink, (const char *__path )); -_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte )); -int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); +_READ_WRITE_RETURN_TYPE _read (int __fd, void *__buf, size_t __nbyte); +void * _sbrk (ptrdiff_t __incr); +int _unlink (const char *__path); +_READ_WRITE_RETURN_TYPE _write (int __fd, const void *__buf, size_t __nbyte); +int _execve (const char *__path, char * const __argv[], char * const __envp[]); #endif #if !defined(__INSIDE_CYGWIN__) #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 -int _EXFUN(ftruncate, (int __fd, off_t __length)); +int ftruncate (int __fd, off_t __length); #endif #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 -int _EXFUN(truncate, (const char *, off_t __length)); +int truncate (const char *, off_t __length); #endif #endif #if __BSD_VISIBLE || __POSIX_VISIBLE < 200112 -int _EXFUN(getdtablesize, (void)); +int getdtablesize (void); #endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500 -useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); +useconds_t ualarm (useconds_t __useconds, useconds_t __interval); #endif #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 #if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) /* winsock[2].h defines as __stdcall, and with int as 2nd arg */ - int _EXFUN(gethostname, (char *__name, size_t __len)); + int gethostname (char *__name, size_t __len); #endif #endif #if __MISC_VISIBLE -int _EXFUN(setdtablesize, (int)); +int setdtablesize (int); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 500 -void _EXFUN(sync, (void)); +void 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)); +ssize_t readlink (const char *__restrict __path, + char *__restrict __buf, size_t __buflen); +int symlink (const char *__name1, const char *__name2); #endif #if __ATFILE_VISIBLE -ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__restrict __path, - char *__restrict __buf, size_t __buflen)); -int _EXFUN(symlinkat, (const char *, int, const char *)); -int _EXFUN(unlinkat, (int, const char *, int)); +ssize_t readlinkat (int __dirfd1, const char *__restrict __path, + char *__restrict __buf, size_t __buflen); +int symlinkat (const char *, int, const char *); +int unlinkat (int, const char *, int); #endif #define F_OK 0 @@ -562,9 +582,18 @@ int _EXFUN(unlinkat, (int, const char *, int)); #define _CS_POSIX_V7_THREADS_LDFLAGS 19 #define _CS_V7_ENV 20 #define _CS_V6_ENV _CS_V7_ENV +#define _CS_LFS_CFLAGS 21 +#define _CS_LFS_LDFLAGS 22 +#define _CS_LFS_LIBS 23 +#define _CS_LFS_LINTFLAGS 24 #endif #ifdef __cplusplus } #endif + +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _SYS_UNISTD_H */ diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index 8806b98c7..a2efcc15e 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -53,19 +53,19 @@ struct tm #endif }; -clock_t _EXFUN(clock, (void)); -double _EXFUN(difftime, (time_t _time2, time_t _time1)); -time_t _EXFUN(mktime, (struct tm *_timeptr)); -time_t _EXFUN(time, (time_t *_timer)); +clock_t clock (void); +double difftime (time_t _time2, time_t _time1); +time_t mktime (struct tm *_timeptr); +time_t time (time_t *_timer); #ifndef _REENT_ONLY -char *_EXFUN(asctime, (const struct tm *_tblock)); -char *_EXFUN(ctime, (const time_t *_time)); -struct tm *_EXFUN(gmtime, (const time_t *_timer)); -struct tm *_EXFUN(localtime,(const time_t *_timer)); +char *asctime (const struct tm *_tblock); +char *ctime (const time_t *_time); +struct tm *gmtime (const time_t *_timer); +struct tm *localtime (const time_t *_timer); #endif -size_t _EXFUN(strftime, (char *__restrict _s, +size_t strftime (char *__restrict _s, size_t _maxsize, const char *__restrict _fmt, - const struct tm *__restrict _t)); + const struct tm *__restrict _t); #if __POSIX_VISIBLE >= 200809 extern size_t strftime_l (char *__restrict _s, size_t _maxsize, @@ -73,13 +73,13 @@ extern size_t strftime_l (char *__restrict _s, size_t _maxsize, const struct tm *__restrict _t, locale_t _l); #endif -char *_EXFUN(asctime_r, (const struct tm *__restrict, - char *__restrict)); -char *_EXFUN(ctime_r, (const time_t *, char *)); -struct tm *_EXFUN(gmtime_r, (const time_t *__restrict, - struct tm *__restrict)); -struct tm *_EXFUN(localtime_r, (const time_t *__restrict, - struct tm *__restrict)); +char *asctime_r (const struct tm *__restrict, + char *__restrict); +char *ctime_r (const time_t *, char *); +struct tm *gmtime_r (const time_t *__restrict, + struct tm *__restrict); +struct tm *localtime_r (const time_t *__restrict, + struct tm *__restrict); _END_STD_C @@ -88,9 +88,9 @@ extern "C" { #endif #if __XSI_VISIBLE -char *_EXFUN(strptime, (const char *__restrict, +char *strptime (const char *__restrict, const char *__restrict, - struct tm *__restrict)); + struct tm *__restrict); #endif #if __GNU_VISIBLE char *strptime_l (const char *__restrict, const char *__restrict, @@ -98,9 +98,9 @@ char *strptime_l (const char *__restrict, const char *__restrict, #endif #if __POSIX_VISIBLE -_VOID _EXFUN(tzset, (_VOID)); +void tzset (void); #endif -_VOID _EXFUN(_tzset_r, (struct _reent *)); +void _tzset_r (struct _reent *); typedef struct __tzrule_struct { @@ -120,7 +120,7 @@ typedef struct __tzinfo_struct __tzrule_type __tzrule[2]; } __tzinfo_type; -__tzinfo_type *_EXFUN (__gettzinfo, (_VOID)); +__tzinfo_type *__gettzinfo (void); /* getdate functions */ @@ -128,9 +128,9 @@ __tzinfo_type *_EXFUN (__gettzinfo, (_VOID)); #if __XSI_VISIBLE >= 4 #ifndef _REENT_ONLY #define getdate_err (*__getdate_err()) -int *_EXFUN(__getdate_err,(_VOID)); +int *__getdate_err (void); -struct tm * _EXFUN(getdate, (const char *)); +struct tm * getdate (const char *); /* getdate_err is set to one of the following values to indicate the error. 1 the DATEMSK environment variable is null or undefined, 2 the template file cannot be opened for reading, @@ -145,7 +145,7 @@ struct tm * _EXFUN(getdate, (const char *)); #if __GNU_VISIBLE /* getdate_r returns the error code as above */ -int _EXFUN(getdate_r, (const char *, struct tm *)); +int getdate_r (const char *, struct tm *); #endif /* __GNU_VISIBLE */ #endif /* HAVE_GETDATE */ @@ -183,33 +183,31 @@ extern "C" { /* Clocks, P1003.1b-1993, p. 263 */ -int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp)); -int _EXFUN(clock_gettime, (clockid_t clock_id, struct timespec *tp)); -int _EXFUN(clock_getres, (clockid_t clock_id, struct timespec *res)); +int clock_settime (clockid_t clock_id, const struct timespec *tp); +int clock_gettime (clockid_t clock_id, struct timespec *tp); +int clock_getres (clockid_t clock_id, struct timespec *res); /* Create a Per-Process Timer, P1003.1b-1993, p. 264 */ -int _EXFUN(timer_create, - (clockid_t clock_id, +int timer_create (clockid_t clock_id, struct sigevent *__restrict evp, - timer_t *__restrict timerid)); + timer_t *__restrict timerid); /* Delete a Per_process Timer, P1003.1b-1993, p. 266 */ -int _EXFUN(timer_delete, (timer_t timerid)); +int timer_delete (timer_t timerid); /* Per-Process Timers, P1003.1b-1993, p. 267 */ -int _EXFUN(timer_settime, - (timer_t timerid, int flags, +int timer_settime (timer_t timerid, int flags, const struct itimerspec *__restrict value, - struct itimerspec *__restrict ovalue)); -int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value)); -int _EXFUN(timer_getoverrun, (timer_t timerid)); + struct itimerspec *__restrict ovalue); +int timer_gettime (timer_t timerid, struct itimerspec *value); +int timer_getoverrun (timer_t timerid); /* High Resolution Sleep, P1003.1b-1993, p. 269 */ -int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp)); +int nanosleep (const struct timespec *rqtp, struct timespec *rmtp); #ifdef __cplusplus } @@ -222,9 +220,8 @@ int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp)); extern "C" { #endif -int _EXFUN(clock_nanosleep, - (clockid_t clock_id, int flags, const struct timespec *rqtp, - struct timespec *rmtp)); +int clock_nanosleep (clockid_t clock_id, int flags, + const struct timespec *rqtp, struct timespec *rmtp); #ifdef __cplusplus } @@ -297,7 +294,7 @@ extern "C" { /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */ -int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id)); +int clock_getcpuclockid (pid_t pid, clockid_t *clock_id); #endif /* _POSIX_CPUTIME */ @@ -305,8 +302,8 @@ int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id)); /* CPU-time Clock Attribute Access, P1003.4b/D8, p. 56 */ -int _EXFUN(clock_setenable_attr, (clockid_t clock_id, int attr)); -int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr)); +int clock_setenable_attr (clockid_t clock_id, int attr); +int clock_getenable_attr (clockid_t clock_id, int *attr); #endif /* _POSIX_CPUTIME or _POSIX_THREAD_CPUTIME */ diff --git a/newlib/libc/include/unctrl.h b/newlib/libc/include/unctrl.h index 004075232..010812ff3 100644 --- a/newlib/libc/include/unctrl.h +++ b/newlib/libc/include/unctrl.h @@ -40,7 +40,7 @@ #define unctrl(c) __unctrl[(c) & 0xff] #define unctrllen(ch) __unctrllen[(ch) & 0xff] -extern __IMPORT _CONST char * _CONST __unctrl[256]; /* Control strings. */ -extern __IMPORT _CONST char __unctrllen[256]; /* Control strings length. */ +extern __IMPORT const char * const __unctrl[256]; /* Control strings. */ +extern __IMPORT const char __unctrllen[256]; /* Control strings length. */ #endif /* _UNCTRL_H_ */ diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h index 25ee9a880..9f2441c4f 100644 --- a/newlib/libc/include/wchar.h +++ b/newlib/libc/include/wchar.h @@ -86,90 +86,90 @@ struct tm; typedef _mbstate_t mbstate_t; #endif /* _MBSTATE_T */ -wint_t _EXFUN(btowc, (int)); -int _EXFUN(wctob, (wint_t)); -size_t _EXFUN(mbrlen, (const char *__restrict, size_t, mbstate_t *__restrict)); -size_t _EXFUN(mbrtowc, (wchar_t *__restrict, const char *__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbrtowc_r, (struct _reent *, wchar_t * , const char * , - size_t, mbstate_t *)); -int _EXFUN(mbsinit, (const mbstate_t *)); +wint_t btowc (int); +int wctob (wint_t); +size_t mbrlen (const char *__restrict, size_t, mbstate_t *__restrict); +size_t mbrtowc (wchar_t *__restrict, const char *__restrict, size_t, + mbstate_t *__restrict); +size_t _mbrtowc_r (struct _reent *, wchar_t * , const char * , + size_t, mbstate_t *); +int mbsinit (const mbstate_t *); #if __POSIX_VISIBLE >= 200809 -size_t _EXFUN(mbsnrtowcs, (wchar_t *__restrict, const char **__restrict, - size_t, size_t, mbstate_t *__restrict)); +size_t mbsnrtowcs (wchar_t *__restrict, const char **__restrict, + size_t, size_t, mbstate_t *__restrict); #endif -size_t _EXFUN(_mbsnrtowcs_r, (struct _reent *, wchar_t * , const char ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(mbsrtowcs, (wchar_t *__restrict, const char **__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); -size_t _EXFUN(wcrtomb, (char *__restrict, wchar_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); +size_t _mbsnrtowcs_r (struct _reent *, wchar_t * , const char ** , + size_t, size_t, mbstate_t *); +size_t mbsrtowcs (wchar_t *__restrict, const char **__restrict, size_t, + mbstate_t *__restrict); +size_t _mbsrtowcs_r (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *); +size_t wcrtomb (char *__restrict, wchar_t, mbstate_t *__restrict); +size_t _wcrtomb_r (struct _reent *, char * , wchar_t, mbstate_t *); #if __POSIX_VISIBLE >= 200809 -size_t _EXFUN(wcsnrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, size_t, mbstate_t *__restrict)); +size_t wcsnrtombs (char *__restrict, const wchar_t **__restrict, + size_t, size_t, mbstate_t *__restrict); #endif -size_t _EXFUN(_wcsnrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(wcsrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcsrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, mbstate_t *)); +size_t _wcsnrtombs_r (struct _reent *, char * , const wchar_t ** , + size_t, size_t, mbstate_t *); +size_t wcsrtombs (char *__restrict, const wchar_t **__restrict, + size_t, mbstate_t *__restrict); +size_t _wcsrtombs_r (struct _reent *, char * , const wchar_t ** , + size_t, mbstate_t *); #if __POSIX_VISIBLE >= 200809 -int _EXFUN(wcscasecmp, (const wchar_t *, const wchar_t *)); +int wcscasecmp (const wchar_t *, const wchar_t *); #endif -wchar_t *_EXFUN(wcscat, (wchar_t *__restrict, const wchar_t *__restrict)); -wchar_t *_EXFUN(wcschr, (const wchar_t *, wchar_t)); -int _EXFUN(wcscmp, (const wchar_t *, const wchar_t *)); -int _EXFUN(wcscoll, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscpy, (wchar_t *__restrict, const wchar_t *__restrict)); +wchar_t *wcscat (wchar_t *__restrict, const wchar_t *__restrict); +wchar_t *wcschr (const wchar_t *, wchar_t); +int wcscmp (const wchar_t *, const wchar_t *); +int wcscoll (const wchar_t *, const wchar_t *); +wchar_t *wcscpy (wchar_t *__restrict, const wchar_t *__restrict); #if __POSIX_VISIBLE >= 200809 -wchar_t *_EXFUN(wcpcpy, (wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcsdup, (const wchar_t *)); +wchar_t *wcpcpy (wchar_t *__restrict, + const wchar_t *__restrict); +wchar_t *wcsdup (const wchar_t *) __malloc_like __result_use_check; #endif -wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * )); -size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *)); -size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, const struct tm *__restrict)); +wchar_t *_wcsdup_r (struct _reent *, const wchar_t * ); +size_t wcscspn (const wchar_t *, const wchar_t *); +size_t wcsftime (wchar_t *__restrict, size_t, + const wchar_t *__restrict, const struct tm *__restrict); #if __GNU_VISIBLE size_t wcsftime_l (wchar_t *__restrict, size_t, const wchar_t *__restrict, const struct tm *__restrict, locale_t); #endif -size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslen, (const wchar_t *)); +size_t wcslcat (wchar_t *, const wchar_t *, size_t); +size_t wcslcpy (wchar_t *, const wchar_t *, size_t); +size_t wcslen (const wchar_t *); #if __POSIX_VISIBLE >= 200809 -int _EXFUN(wcsncasecmp, (const wchar_t *, const wchar_t *, size_t)); +int wcsncasecmp (const wchar_t *, const wchar_t *, size_t); #endif -wchar_t *_EXFUN(wcsncat, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -int _EXFUN(wcsncmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); +wchar_t *wcsncat (wchar_t *__restrict, + const wchar_t *__restrict, size_t); +int wcsncmp (const wchar_t *, const wchar_t *, size_t); +wchar_t *wcsncpy (wchar_t *__restrict, + const wchar_t *__restrict, size_t); #if __POSIX_VISIBLE >= 200809 -wchar_t *_EXFUN(wcpncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -size_t _EXFUN(wcsnlen, (const wchar_t *, size_t)); +wchar_t *wcpncpy (wchar_t *__restrict, + const wchar_t *__restrict, size_t); +size_t wcsnlen (const wchar_t *, size_t); #endif -wchar_t *_EXFUN(wcspbrk, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t)); -size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsstr, (const wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcstok, (wchar_t *__restrict, const wchar_t *__restrict, - wchar_t **__restrict)); -double _EXFUN(wcstod, (const wchar_t *__restrict, wchar_t **__restrict)); -double _EXFUN(_wcstod_r, (struct _reent *, const wchar_t *, wchar_t **)); +wchar_t *wcspbrk (const wchar_t *, const wchar_t *); +wchar_t *wcsrchr (const wchar_t *, wchar_t); +size_t wcsspn (const wchar_t *, const wchar_t *); +wchar_t *wcsstr (const wchar_t *__restrict, + const wchar_t *__restrict); +wchar_t *wcstok (wchar_t *__restrict, const wchar_t *__restrict, + wchar_t **__restrict); +double wcstod (const wchar_t *__restrict, wchar_t **__restrict); +double _wcstod_r (struct _reent *, const wchar_t *, wchar_t **); #if __ISO_C_VISIBLE >= 1999 -float _EXFUN(wcstof, (const wchar_t *__restrict, wchar_t **__restrict)); +float wcstof (const wchar_t *__restrict, wchar_t **__restrict); #endif -float _EXFUN(_wcstof_r, (struct _reent *, const wchar_t *, wchar_t **)); +float _wcstof_r (struct _reent *, const wchar_t *, wchar_t **); #if __XSI_VISIBLE -int _EXFUN(wcswidth, (const wchar_t *, size_t)); +int wcswidth (const wchar_t *, size_t); #endif -size_t _EXFUN(wcsxfrm, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); +size_t wcsxfrm (wchar_t *__restrict, const wchar_t *__restrict, + size_t); #if __POSIX_VISIBLE >= 200809 extern int wcscasecmp_l (const wchar_t *, const wchar_t *, locale_t); extern int wcsncasecmp_l (const wchar_t *, const wchar_t *, size_t, locale_t); @@ -179,32 +179,36 @@ extern size_t wcsxfrm_l (wchar_t *__restrict, const wchar_t *__restrict, size_t, #endif #if __XSI_VISIBLE -int _EXFUN(wcwidth, (const wchar_t)); +int wcwidth (const wchar_t); #endif -wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t)); -int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemcpy, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); -wchar_t *_EXFUN(wmemmove, (wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemset, (wchar_t *, wchar_t, size_t)); +wchar_t *wmemchr (const wchar_t *, wchar_t, size_t); +int wmemcmp (const wchar_t *, const wchar_t *, size_t); +wchar_t *wmemcpy (wchar_t *__restrict, const wchar_t *__restrict, + size_t); +wchar_t *wmemmove (wchar_t *, const wchar_t *, size_t); +#if __GNU_VISIBLE +wchar_t *wmempcpy (wchar_t *__restrict, const wchar_t *__restrict, + size_t); +#endif +wchar_t *wmemset (wchar_t *, wchar_t, size_t); -long _EXFUN(wcstol, (const wchar_t *__restrict, wchar_t **__restrict, int)); +long wcstol (const wchar_t *__restrict, wchar_t **__restrict, int); #if __ISO_C_VISIBLE >= 1999 -long long _EXFUN(wcstoll, (const wchar_t *__restrict, wchar_t **__restrict, - int)); +long long wcstoll (const wchar_t *__restrict, wchar_t **__restrict, + int); #endif -unsigned long _EXFUN(wcstoul, (const wchar_t *__restrict, wchar_t **__restrict, - int)); +unsigned long wcstoul (const wchar_t *__restrict, wchar_t **__restrict, + int); #if __ISO_C_VISIBLE >= 1999 -unsigned long long _EXFUN(wcstoull, (const wchar_t *__restrict, - wchar_t **__restrict, int)); +unsigned long long wcstoull (const wchar_t *__restrict, + wchar_t **__restrict, int); #endif -long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); +long _wcstol_r (struct _reent *, const wchar_t *, wchar_t **, int); +long long _wcstoll_r (struct _reent *, const wchar_t *, wchar_t **, int); +unsigned long _wcstoul_r (struct _reent *, const wchar_t *, wchar_t **, int); +unsigned long long _wcstoull_r (struct _reent *, const wchar_t *, wchar_t **, int); #if __ISO_C_VISIBLE >= 1999 -long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); +long double wcstold (const wchar_t *, wchar_t **); #endif #if __GNU_VISIBLE @@ -220,53 +224,53 @@ float wcstof_l (const wchar_t *, wchar_t **, locale_t); long double wcstold_l (const wchar_t *, wchar_t **, locale_t); #endif -wint_t _EXFUN(fgetwc, (__FILE *)); -wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc, (wchar_t, __FILE *)); -int _EXFUN(fputws, (const wchar_t *__restrict, __FILE *__restrict)); +wint_t fgetwc (__FILE *); +wchar_t *fgetws (wchar_t *__restrict, int, __FILE *__restrict); +wint_t fputwc (wchar_t, __FILE *); +int fputws (const wchar_t *__restrict, __FILE *__restrict); #if __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE >= 500 -int _EXFUN (fwide, (__FILE *, int)); +int fwide (__FILE *, int); #endif -wint_t _EXFUN (getwc, (__FILE *)); -wint_t _EXFUN (getwchar, (void)); -wint_t _EXFUN(putwc, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar, (wchar_t)); -wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *)); +wint_t getwc (__FILE *); +wint_t getwchar (void); +wint_t putwc (wchar_t, __FILE *); +wint_t putwchar (wchar_t); +wint_t ungetwc (wint_t wc, __FILE *); -wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN(_fgetwc_unlocked_r, (struct _reent *, __FILE *)); -wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *)); -wchar_t *_EXFUN(_fgetws_unlocked_r, (struct _reent *, wchar_t *, int, __FILE *)); -wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_fputwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -int _EXFUN(_fputws_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN(_fputws_unlocked_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN (_fwide_r, (struct _reent *, __FILE *, int)); -wint_t _EXFUN (_getwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwc_unlocked_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwchar_r, (struct _reent *ptr)); -wint_t _EXFUN (_getwchar_unlocked_r, (struct _reent *ptr)); -wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t)); -wint_t _EXFUN(_putwchar_unlocked_r, (struct _reent *, wchar_t)); -wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *)); +wint_t _fgetwc_r (struct _reent *, __FILE *); +wint_t _fgetwc_unlocked_r (struct _reent *, __FILE *); +wchar_t *_fgetws_r (struct _reent *, wchar_t *, int, __FILE *); +wchar_t *_fgetws_unlocked_r (struct _reent *, wchar_t *, int, __FILE *); +wint_t _fputwc_r (struct _reent *, wchar_t, __FILE *); +wint_t _fputwc_unlocked_r (struct _reent *, wchar_t, __FILE *); +int _fputws_r (struct _reent *, const wchar_t *, __FILE *); +int _fputws_unlocked_r (struct _reent *, const wchar_t *, __FILE *); +int _fwide_r (struct _reent *, __FILE *, int); +wint_t _getwc_r (struct _reent *, __FILE *); +wint_t _getwc_unlocked_r (struct _reent *, __FILE *); +wint_t _getwchar_r (struct _reent *ptr); +wint_t _getwchar_unlocked_r (struct _reent *ptr); +wint_t _putwc_r (struct _reent *, wchar_t, __FILE *); +wint_t _putwc_unlocked_r (struct _reent *, wchar_t, __FILE *); +wint_t _putwchar_r (struct _reent *, wchar_t); +wint_t _putwchar_unlocked_r (struct _reent *, wchar_t); +wint_t _ungetwc_r (struct _reent *, wint_t wc, __FILE *); #if __GNU_VISIBLE -wint_t _EXFUN(fgetwc_unlocked, (__FILE *)); -wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *)); -int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict)); -wint_t _EXFUN(getwc_unlocked, (__FILE *)); -wint_t _EXFUN(getwchar_unlocked, (void)); -wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar_unlocked, (wchar_t)); +wint_t fgetwc_unlocked (__FILE *); +wchar_t *fgetws_unlocked (wchar_t *__restrict, int, __FILE *__restrict); +wint_t fputwc_unlocked (wchar_t, __FILE *); +int fputws_unlocked (const wchar_t *__restrict, __FILE *__restrict); +wint_t getwc_unlocked (__FILE *); +wint_t getwchar_unlocked (void); +wint_t putwc_unlocked (wchar_t, __FILE *); +wint_t putwchar_unlocked (wchar_t); #endif #if __POSIX_VISIBLE >= 200809 -__FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *)); +__FILE *open_wmemstream (wchar_t **, size_t *); #endif -__FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); +__FILE *_open_wmemstream_r (struct _reent *, wchar_t **, size_t *); #ifndef __VALIST #ifdef __GNUC__ @@ -277,42 +281,42 @@ __FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); #endif #if __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE >= 500 -int _EXFUN(fwprintf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwprintf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, __VALIST)); -int _EXFUN(vwprintf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wprintf, (const wchar_t *__restrict, ...)); +int fwprintf (__FILE *__restrict, const wchar_t *__restrict, ...); +int swprintf (wchar_t *__restrict, size_t, + const wchar_t *__restrict, ...); +int vfwprintf (__FILE *__restrict, const wchar_t *__restrict, + __VALIST); +int vswprintf (wchar_t *__restrict, size_t, + const wchar_t *__restrict, __VALIST); +int vwprintf (const wchar_t *__restrict, __VALIST); +int wprintf (const wchar_t *__restrict, ...); #endif -int _EXFUN(_fwprintf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, ...)); -int _EXFUN(_vfwprintf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, __VALIST)); -int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...)); +int _fwprintf_r (struct _reent *, __FILE *, const wchar_t *, ...); +int _swprintf_r (struct _reent *, wchar_t *, size_t, const wchar_t *, ...); +int _vfwprintf_r (struct _reent *, __FILE *, const wchar_t *, __VALIST); +int _vswprintf_r (struct _reent *, wchar_t *, size_t, const wchar_t *, __VALIST); +int _vwprintf_r (struct _reent *, const wchar_t *, __VALIST); +int _wprintf_r (struct _reent *, const wchar_t *, ...); #if __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE >= 500 -int _EXFUN(fwscanf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swscanf, (const wchar_t *__restrict, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwscanf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswscanf, (const wchar_t *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vwscanf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wscanf, (const wchar_t *__restrict, ...)); +int fwscanf (__FILE *__restrict, const wchar_t *__restrict, ...); +int swscanf (const wchar_t *__restrict, + const wchar_t *__restrict, ...); +int vfwscanf (__FILE *__restrict, const wchar_t *__restrict, + __VALIST); +int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, + __VALIST); +int vwscanf (const wchar_t *__restrict, __VALIST); +int wscanf (const wchar_t *__restrict, ...); #endif -int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...)); -int _EXFUN(_vfwscanf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, __VALIST)); -int _EXFUN(_vwscanf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); +int _fwscanf_r (struct _reent *, __FILE *, const wchar_t *, ...); +int _swscanf_r (struct _reent *, const wchar_t *, const wchar_t *, ...); +int _vfwscanf_r (struct _reent *, __FILE *, const wchar_t *, __VALIST); +int _vswscanf_r (struct _reent *, const wchar_t *, const wchar_t *, __VALIST); +int _vwscanf_r (struct _reent *, const wchar_t *, __VALIST); +int _wscanf_r (struct _reent *, const wchar_t *, ...); #define getwc(fp) fgetwc(fp) #define putwc(wc,fp) fputwc((wc), (fp)) @@ -328,4 +332,8 @@ int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); _END_STD_C +#if __SSP_FORTIFY_LEVEL > 0 +#include +#endif + #endif /* _WCHAR_H_ */ diff --git a/newlib/libc/include/wctype.h b/newlib/libc/include/wctype.h index 3d36d5a92..9b710900d 100644 --- a/newlib/libc/include/wctype.h +++ b/newlib/libc/include/wctype.h @@ -27,26 +27,26 @@ typedef int wctype_t; typedef int wctrans_t; #endif -int _EXFUN(iswalpha, (wint_t)); -int _EXFUN(iswalnum, (wint_t)); +int iswalpha (wint_t); +int iswalnum (wint_t); #if __ISO_C_VISIBLE >= 1999 -int _EXFUN(iswblank, (wint_t)); +int iswblank (wint_t); #endif -int _EXFUN(iswcntrl, (wint_t)); -int _EXFUN(iswctype, (wint_t, wctype_t)); -int _EXFUN(iswdigit, (wint_t)); -int _EXFUN(iswgraph, (wint_t)); -int _EXFUN(iswlower, (wint_t)); -int _EXFUN(iswprint, (wint_t)); -int _EXFUN(iswpunct, (wint_t)); -int _EXFUN(iswspace, (wint_t)); -int _EXFUN(iswupper, (wint_t)); -int _EXFUN(iswxdigit, (wint_t)); -wint_t _EXFUN(towctrans, (wint_t, wctrans_t)); -wint_t _EXFUN(towupper, (wint_t)); -wint_t _EXFUN(towlower, (wint_t)); -wctrans_t _EXFUN(wctrans, (const char *)); -wctype_t _EXFUN(wctype, (const char *)); +int iswcntrl (wint_t); +int iswctype (wint_t, wctype_t); +int iswdigit (wint_t); +int iswgraph (wint_t); +int iswlower (wint_t); +int iswprint (wint_t); +int iswpunct (wint_t); +int iswspace (wint_t); +int iswupper (wint_t); +int iswxdigit (wint_t); +wint_t towctrans (wint_t, wctrans_t); +wint_t towupper (wint_t); +wint_t towlower (wint_t); +wctrans_t wctrans (const char *); +wctype_t wctype (const char *); #if __POSIX_VISIBLE >= 200809 extern int iswalpha_l (wint_t, locale_t); diff --git a/newlib/libc/libc.in.xml b/newlib/libc/libc.in.xml index 972696189..bf5f8a05f 100644 --- a/newlib/libc/libc.in.xml +++ b/newlib/libc/libc.in.xml @@ -35,6 +35,7 @@ + diff --git a/newlib/libc/libc.texinfo b/newlib/libc/libc.texinfo index 995e95e5c..f8c820baf 100644 --- a/newlib/libc/libc.texinfo +++ b/newlib/libc/libc.texinfo @@ -171,6 +171,7 @@ into another language, under the above conditions for modified versions. @ifset ICONV * Iconv:: @end ifset +* Overflow Protection:: * Document Index:: @end menu diff --git a/newlib/libc/locale/Makefile.in b/newlib/libc/locale/Makefile.in index 07efc34ab..c939fa358 100644 --- a/newlib/libc/locale/Makefile.in +++ b/newlib/libc/locale/Makefile.in @@ -298,7 +298,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = \ duplocale.def \ freelocale.def \ @@ -633,8 +633,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/locale/duplocale.c b/newlib/libc/locale/duplocale.c index 9f6156cb4..d3e7d782e 100644 --- a/newlib/libc/locale/duplocale.c +++ b/newlib/libc/locale/duplocale.c @@ -8,7 +8,7 @@ INDEX INDEX _duplocale_r -ANSI_SYNOPSIS +SYNOPSIS #include locale_t duplocale(locale_t <[locobj]>); diff --git a/newlib/libc/locale/freelocale.c b/newlib/libc/locale/freelocale.c index dd3c0f95e..f5d55f5e2 100644 --- a/newlib/libc/locale/freelocale.c +++ b/newlib/libc/locale/freelocale.c @@ -8,7 +8,7 @@ INDEX INDEX _freelocale_r -ANSI_SYNOPSIS +SYNOPSIS #include locale_t freelocale(locale_t <[locobj]>); diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index b5402372c..4c343e462 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -11,7 +11,7 @@ INDEX INDEX _localeconv_r -ANSI_SYNOPSIS +SYNOPSIS #include char *setlocale(int <[category]>, const char *<[locale]>); lconv *localeconv(void); @@ -20,22 +20,6 @@ ANSI_SYNOPSIS int <[category]>, const char *<[locale]>); lconv *_localeconv_r(void *<[reent]>); -TRAD_SYNOPSIS - #include - char *setlocale(<[category]>, <[locale]>) - int <[category]>; - char *<[locale]>; - - lconv *localeconv(); - - char *_setlocale_r(<[reent]>, <[category]>, <[locale]>) - char *<[reent]>; - int <[category]>; - char *<[locale]>; - - lconv *_localeconv_r(<[reent]>); - char *<[reent]>; - DESCRIPTION <> is the facility defined by ANSI C to condition the execution environment for international collating and formatting @@ -90,15 +74,16 @@ Cygwin additionally supports locales from the file (<<"">> is also accepted; if given, the settings are read from the corresponding LC_* environment variables and $LANG according to POSIX rules.) -This implementation also supports the modifier <<"cjknarrow">>, which -affects how the functions <> and <> handle characters -from the "CJK Ambiguous Width" category of characters described at -http://www.unicode.org/reports/tr11/#Ambiguous. These characters have a width -of 1 for singlebyte charsets and a width of 2 for multibyte charsets -other than UTF-8. For UTF-8, their width depends on the language specifier: +This implementation also supports the modifiers <<"cjknarrow">> and +<<"cjkwide">>, which affect how the functions <> and <> +handle characters from the "CJK Ambiguous Width" category of characters +described at http://www.unicode.org/reports/tr11/#Ambiguous. +These characters have a width of 1 for singlebyte charsets and a width of 2 +for multibyte charsets other than UTF-8. +For UTF-8, their width depends on the language specifier: it is 2 for <<"zh">> (Chinese), <<"ja">> (Japanese), and <<"ko">> (Korean), -and 1 for everything else. Specifying <<"cjknarrow">> forces a width of 1, -independent of charset and language. +and 1 for everything else. Specifying <<"cjknarrow">> or <<"cjkwide">> +forces a width of 1 or 2, respectively, independent of charset and language. If you use <> as the <[locale]> argument, <> returns a pointer to the string representing the current locale. The acceptable @@ -305,10 +290,9 @@ static char *currentlocale (void); #endif /* _MB_CAPABLE */ char * -_DEFUN(_setlocale_r, (p, category, locale), - struct _reent *p _AND - int category _AND - _CONST char *locale) +_setlocale_r (struct _reent *p, + int category, + const char *locale) { #ifndef _MB_CAPABLE if (locale) @@ -479,7 +463,7 @@ currentlocale () extern void __set_ctype (struct __locale_t *, const char *charset); char * -__loadlocale (struct __locale_t *loc, int category, const char *new_locale) +__loadlocale (struct __locale_t *loc, int category, char *new_locale) { /* At this point a full-featured system would just load the locale specific data from the locale files. @@ -497,6 +481,7 @@ __loadlocale (struct __locale_t *loc, int category, const char *new_locale) wctomb_p l_wctomb; mbtowc_p l_mbtowc; int cjknarrow = 0; + int cjkwide = 0; /* Avoid doing everything twice if nothing has changed. @@ -521,7 +506,7 @@ __loadlocale (struct __locale_t *loc, int category, const char *new_locale) restart: if (!locale) - locale = (char *) new_locale; + locale = new_locale; else if (locale != tmp_locale) { locale = __set_locale_from_locale_alias (locale, tmp_locale); @@ -610,11 +595,13 @@ restart: if (c && c[0] == '@') { /* Modifier */ - /* Only one modifier is recognized right now. "cjknarrow" is used - to modify the behaviour of wcwidth() for East Asian languages. + /* Modifiers "cjknarrow" or "cjkwide" are recognized to modify the + behaviour of wcwidth() and wcswidth() for East Asian languages. For details see the comment at the end of this function. */ if (!strcmp (c + 1, "cjknarrow")) cjknarrow = 1; + else if (!strcmp (c + 1, "cjkwide")) + cjkwide = 1; } /* We only support this subset of charsets. */ switch (charset[0]) @@ -911,12 +898,15 @@ restart: single-byte charsets, and double width for multi-byte charsets other than UTF-8. For UTF-8, use double width for the East Asian languages ("ja", "ko", "zh"), and single width for everything else. - Single width can also be forced with the "@cjknarrow" modifier. */ - loc->cjk_lang = !cjknarrow && mbc_max > 1 - && (charset[0] != 'U' - || strncmp (locale, "ja", 2) == 0 - || strncmp (locale, "ko", 2) == 0 - || strncmp (locale, "zh", 2) == 0); + Single width can also be forced with the "@cjknarrow" modifier. + Double width can also be forced with the "@cjkwide" modifier. + */ + loc->cjk_lang = cjkwide || + (!cjknarrow && mbc_max > 1 + && (charset[0] != 'U' + || strncmp (locale, "ja", 2) == 0 + || strncmp (locale, "ko", 2) == 0 + || strncmp (locale, "zh", 2) == 0)); #ifdef __HAVE_LOCALE_INFO__ ret = __ctype_load_locale (loc, locale, (void *) l_wctomb, charset, mbc_max); @@ -982,7 +972,7 @@ __get_locale_env (struct _reent *p, int category) #endif /* _MB_CAPABLE */ int -_DEFUN_VOID (__locale_mb_cur_max) +__locale_mb_cur_max (void) { #ifdef __HAVE_LOCALE_INFO__ return __get_current_ctype_locale ()->mb_cur_max[0]; @@ -991,6 +981,7 @@ _DEFUN_VOID (__locale_mb_cur_max) #endif } +#ifdef __HAVE_LOCALE_INFO__ const char * __locale_ctype_ptr_l (struct __locale_t *locale) { @@ -1002,13 +993,13 @@ __locale_ctype_ptr (void) { return __get_current_locale ()->ctype_ptr; } +#endif /* __HAVE_LOCALE_INFO__ */ #ifndef _REENT_ONLY char * -_DEFUN (setlocale, (category, locale), - int category _AND - _CONST char *locale) +setlocale (int category, + const char *locale) { return _setlocale_r (_REENT, category, locale); } diff --git a/newlib/libc/locale/localeconv.c b/newlib/libc/locale/localeconv.c index 165f6f7c3..5f34a785f 100644 --- a/newlib/libc/locale/localeconv.c +++ b/newlib/libc/locale/localeconv.c @@ -51,8 +51,7 @@ __localeconv_l (struct __locale_t *locale) } struct lconv * -_DEFUN (_localeconv_r, (data), - struct _reent *data) +_localeconv_r (struct _reent *data) { /* Note that we always fall back to the global locale, even in case of specifying a reent. Otherwise a call to _localeconv_r would just @@ -62,7 +61,7 @@ _DEFUN (_localeconv_r, (data), #ifndef _REENT_ONLY struct lconv * -_DEFUN_VOID (localeconv) +localeconv (void) { return __localeconv_l (__get_current_locale ()); } diff --git a/newlib/libc/locale/newlocale.c b/newlib/libc/locale/newlocale.c index c8176256e..0789d5fd9 100644 --- a/newlib/libc/locale/newlocale.c +++ b/newlib/libc/locale/newlocale.c @@ -8,7 +8,7 @@ INDEX INDEX _newlocale_r -ANSI_SYNOPSIS +SYNOPSIS #include locale_t newlocale(int <[category_mask]>, const char *<[locale]>, locale_t <[locobj]>); @@ -147,7 +147,7 @@ _newlocale_r (struct _reent *p, int category_mask, const char *locale, tmp_locale.wctomb = base->wctomb; tmp_locale.mbtowc = base->mbtowc; tmp_locale.cjk_lang = base->cjk_lang; - tmp_locale.ctype_ptr - base->ctype_ptr; + tmp_locale.ctype_ptr = base->ctype_ptr; } #ifdef __HAVE_LOCALE_INFO__ /* Mark the values as "has still to be copied". We do this in diff --git a/newlib/libc/locale/setlocale.h b/newlib/libc/locale/setlocale.h index 85a38d586..a0c80843a 100644 --- a/newlib/libc/locale/setlocale.h +++ b/newlib/libc/locale/setlocale.h @@ -195,7 +195,7 @@ struct __locale_t }; #ifdef _MB_CAPABLE -extern char *__loadlocale (struct __locale_t *, int, const char *); +extern char *__loadlocale (struct __locale_t *, int, char *); extern const char *__get_locale_env(struct _reent *, int); #endif /* _MB_CAPABLE */ @@ -217,7 +217,11 @@ __get_global_locale () _ELIDABLE_INLINE struct __locale_t * __get_locale_r (struct _reent *r) { +#ifdef __HAVE_LOCALE_INFO__ return r->_locale; +#else + return __get_global_locale(); +#endif } /* In POSIX terms the current locale is the locale used by all functions @@ -227,7 +231,11 @@ __get_locale_r (struct _reent *r) _ELIDABLE_INLINE struct __locale_t * __get_current_locale (void) { +#ifdef __HAVE_LOCALE_INFO__ return _REENT->_locale ?: __get_global_locale (); +#else + return __get_global_locale(); +#endif } /* Only access fixed "C" locale using this function. Fake for !_MB_CAPABLE diff --git a/newlib/libc/locale/uselocale.c b/newlib/libc/locale/uselocale.c index 810590fc0..83ebcdd19 100644 --- a/newlib/libc/locale/uselocale.c +++ b/newlib/libc/locale/uselocale.c @@ -8,7 +8,7 @@ INDEX INDEX _uselocale_r -ANSI_SYNOPSIS +SYNOPSIS #include locale_t uselocale(locale_t <[locobj]>); diff --git a/newlib/libc/machine/a29k/configure b/newlib/libc/machine/a29k/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/a29k/configure +++ b/newlib/libc/machine/a29k/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/aarch64/configure b/newlib/libc/machine/aarch64/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/aarch64/configure +++ b/newlib/libc/machine/aarch64/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/aarch64/memcmp.S b/newlib/libc/machine/aarch64/memcmp.S index 1ffb79eb3..605d99365 100644 --- a/newlib/libc/machine/aarch64/memcmp.S +++ b/newlib/libc/machine/aarch64/memcmp.S @@ -1,3 +1,31 @@ +/* memcmp - compare memory + + Copyright (c) 2018 Linaro Limited + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Linaro nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + /* * Copyright (c) 2017 ARM Ltd * All rights reserved. @@ -35,6 +63,8 @@ * ARMv8-a, AArch64, unaligned accesses. */ +#define L(l) .L ## l + /* Parameters and result. */ #define src1 x0 #define src2 x1 @@ -44,9 +74,12 @@ /* Internal variables. */ #define data1 x3 #define data1w w3 -#define data2 x4 -#define data2w w4 -#define tmp1 x5 +#define data1h x4 +#define data2 x5 +#define data2w w5 +#define data2h x6 +#define tmp1 x7 +#define tmp2 x8 .macro def_fn f p2align=0 .text @@ -56,83 +89,106 @@ \f: .endm -/* Small inputs of less than 8 bytes are handled separately. This allows the - main code to be sped up using unaligned loads since there are now at least - 8 bytes to be compared. If the first 8 bytes are equal, align src1. - This ensures each iteration does at most one unaligned access even if both - src1 and src2 are unaligned, and mutually aligned inputs behave as if - aligned. After the main loop, process the last 8 bytes using unaligned - accesses. */ - def_fn memcmp p2align=6 subs limit, limit, 8 - b.lo .Lless8 + b.lo L(less8) - /* Limit >= 8, so check first 8 bytes using unaligned loads. */ ldr data1, [src1], 8 ldr data2, [src2], 8 - and tmp1, src1, 7 - add limit, limit, tmp1 cmp data1, data2 - bne .Lreturn + b.ne L(return) + + subs limit, limit, 8 + b.gt L(more16) + + ldr data1, [src1, limit] + ldr data2, [src2, limit] + b L(return) + +L(more16): + ldr data1, [src1], 8 + ldr data2, [src2], 8 + cmp data1, data2 + bne L(return) + + /* Jump directly to comparing the last 16 bytes for 32 byte (or less) + strings. */ + subs limit, limit, 16 + b.ls L(last_bytes) + + /* We overlap loads between 0-32 bytes at either side of SRC1 when we + try to align, so limit it only to strings larger than 128 bytes. */ + cmp limit, 96 + b.ls L(loop16) /* Align src1 and adjust src2 with bytes not yet done. */ + and tmp1, src1, 15 + add limit, limit, tmp1 sub src1, src1, tmp1 sub src2, src2, tmp1 - subs limit, limit, 8 - b.ls .Llast_bytes - - /* Loop performing 8 bytes per iteration using aligned src1. - Limit is pre-decremented by 8 and must be larger than zero. - Exit if <= 8 bytes left to do or if the data is not equal. */ + /* Loop performing 16 bytes per iteration using aligned src1. + Limit is pre-decremented by 16 and must be larger than zero. + Exit if <= 16 bytes left to do or if the data is not equal. */ .p2align 4 -.Lloop8: - ldr data1, [src1], 8 - ldr data2, [src2], 8 - subs limit, limit, 8 - ccmp data1, data2, 0, hi /* NZCV = 0b0000. */ - b.eq .Lloop8 +L(loop16): + ldp data1, data1h, [src1], 16 + ldp data2, data2h, [src2], 16 + subs limit, limit, 16 + ccmp data1, data2, 0, hi + ccmp data1h, data2h, 0, eq + b.eq L(loop16) cmp data1, data2 - bne .Lreturn + bne L(return) + mov data1, data1h + mov data2, data2h + cmp data1, data2 + bne L(return) - /* Compare last 1-8 bytes using unaligned access. */ -.Llast_bytes: - ldr data1, [src1, limit] - ldr data2, [src2, limit] + /* Compare last 1-16 bytes using unaligned access. */ +L(last_bytes): + add src1, src1, limit + add src2, src2, limit + ldp data1, data1h, [src1] + ldp data2, data2h, [src2] + cmp data1, data2 + bne L(return) + mov data1, data1h + mov data2, data2h + cmp data1, data2 /* Compare data bytes and set return value to 0, -1 or 1. */ -.Lreturn: +L(return): #ifndef __AARCH64EB__ rev data1, data1 rev data2, data2 #endif cmp data1, data2 -.Lret_eq: +L(ret_eq): cset result, ne cneg result, result, lo - ret + ret .p2align 4 /* Compare up to 8 bytes. Limit is [-8..-1]. */ -.Lless8: +L(less8): adds limit, limit, 4 - b.lo .Lless4 + b.lo L(less4) ldr data1w, [src1], 4 ldr data2w, [src2], 4 cmp data1w, data2w - b.ne .Lreturn + b.ne L(return) sub limit, limit, 4 -.Lless4: +L(less4): adds limit, limit, 4 - beq .Lret_eq -.Lbyte_loop: + beq L(ret_eq) +L(byte_loop): ldrb data1w, [src1], 1 ldrb data2w, [src2], 1 subs limit, limit, 1 ccmp data1w, data2w, 0, ne /* NZCV = 0b0000. */ - b.eq .Lbyte_loop + b.eq L(byte_loop) sub result, data1w, data2w ret diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S index 799e7b787..103e3f8bb 100644 --- a/newlib/libc/machine/aarch64/memset.S +++ b/newlib/libc/machine/aarch64/memset.S @@ -142,10 +142,10 @@ L(set_long): b.eq L(try_zva) L(no_zva): sub count, dstend, dst /* Count is 16 too large. */ - add dst, dst, 16 + sub dst, dst, 16 /* Dst is biased by -32. */ sub count, count, 64 + 16 /* Adjust count and bias for loop. */ -1: stp q0, q0, [dst], 64 - stp q0, q0, [dst, -32] +1: stp q0, q0, [dst, 32] + stp q0, q0, [dst, 64]! L(tail64): subs count, count, 64 b.hi 1b @@ -233,6 +233,7 @@ L(zva_other): subs count, count, zva_len b.hs 3b 4: add count, count, zva_len + sub dst, dst, 32 /* Bias dst for tail loop. */ b L(tail64) .size memset, . - memset diff --git a/newlib/libc/machine/aarch64/strcmp.S b/newlib/libc/machine/aarch64/strcmp.S index 85baca920..e2bef2d49 100644 --- a/newlib/libc/machine/aarch64/strcmp.S +++ b/newlib/libc/machine/aarch64/strcmp.S @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013, Linaro Limited +/* Copyright (c) 2012-2018, Linaro Limited All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,6 +41,8 @@ \f: .endm +#define L(label) .L ## label + #define REP8_01 0x0101010101010101 #define REP8_7f 0x7f7f7f7f7f7f7f7f #define REP8_80 0x8080808080808080 @@ -69,24 +71,25 @@ def_fn strcmp p2align=6 eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7 - b.ne .Lmisaligned8 + b.ne L(misaligned8) ands tmp1, src1, #7 - b.ne .Lmutual_align + b.ne L(mutual_align) /* NUL detection works on the principle that (X - 1) & (~X) & 0x80 (=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and can be done in parallel across the entire word. */ -.Lloop_aligned: +L(loop_aligned): ldr data1, [src1], #8 ldr data2, [src2], #8 -.Lstart_realigned: +L(start_realigned): sub tmp1, data1, zeroones orr tmp2, data1, #REP8_7f eor diff, data1, data2 /* Non-zero if differences found. */ bic has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ orr syndrome, diff, has_nul - cbz syndrome, .Lloop_aligned + cbz syndrome, L(loop_aligned) /* End of performance-critical section -- one 64B cache line. */ +L(end): #ifndef __AARCH64EB__ rev syndrome, syndrome rev data1, data1 @@ -137,7 +140,7 @@ def_fn strcmp p2align=6 ret #endif -.Lmutual_align: +L(mutual_align): /* Sources are mutually aligned, but are not currently at an alignment boundary. Round down the addresses and then mask off the bytes that preceed the start point. */ @@ -157,15 +160,41 @@ def_fn strcmp p2align=6 #endif orr data1, data1, tmp2 orr data2, data2, tmp2 - b .Lstart_realigned + b L(start_realigned) -.Lmisaligned8: - /* We can do better than this. */ +L(misaligned8): + /* Align SRC1 to 8 bytes and then compare 8 bytes at a time, always + checking to make sure that we don't access beyond page boundary in + SRC2. */ + tst src1, #7 + b.eq L(loop_misaligned) +L(do_misaligned): ldrb data1w, [src1], #1 ldrb data2w, [src2], #1 cmp data1w, #1 ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ - b.eq .Lmisaligned8 + b.ne L(done) + tst src1, #7 + b.ne L(do_misaligned) + +L(loop_misaligned): + /* Test if we are within the last dword of the end of a 4K page. If + yes then jump back to the misaligned loop to copy a byte at a time. */ + and tmp1, src2, #0xff8 + eor tmp1, tmp1, #0xff8 + cbz tmp1, L(do_misaligned) + ldr data1, [src1], #8 + ldr data2, [src2], #8 + + sub tmp1, data1, zeroones + orr tmp2, data1, #REP8_7f + eor diff, data1, data2 /* Non-zero if differences found. */ + bic has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ + orr syndrome, diff, has_nul + cbz syndrome, L(loop_misaligned) + b L(end) + +L(done): sub result, data1, data2 ret .size strcmp, .-strcmp diff --git a/newlib/libc/machine/aarch64/strncmp.S b/newlib/libc/machine/aarch64/strncmp.S index 0b90dd8a6..ffdabc260 100644 --- a/newlib/libc/machine/aarch64/strncmp.S +++ b/newlib/libc/machine/aarch64/strncmp.S @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, Linaro Limited +/* Copyright (c) 2013, 2018, Linaro Limited All rights reserved. Redistribution and use in source and binary forms, with or without @@ -67,6 +67,7 @@ #define limit_wd x13 #define mask x14 #define endloop x15 +#define count mask .text .p2align 6 @@ -78,9 +79,9 @@ def_fn strncmp eor tmp1, src1, src2 mov zeroones, #REP8_01 tst tmp1, #7 + and count, src1, #7 b.ne .Lmisaligned8 - ands tmp1, src1, #7 - b.ne .Lmutual_align + cbnz count, .Lmutual_align /* Calculate the number of full and partial words -1. */ sub limit_wd, limit, #1 /* limit != 0, so no underflow. */ lsr limit_wd, limit_wd, #3 /* Convert to Dwords. */ @@ -185,44 +186,105 @@ def_fn strncmp bic src1, src1, #7 bic src2, src2, #7 ldr data1, [src1], #8 - neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */ + neg tmp3, count, lsl #3 /* 64 - bits(bytes beyond align). */ ldr data2, [src2], #8 mov tmp2, #~0 sub limit_wd, limit, #1 /* limit != 0, so no underflow. */ #ifdef __AARCH64EB__ /* Big-endian. Early bytes are at MSB. */ - lsl tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */ + lsl tmp2, tmp2, tmp3 /* Shift (count & 63). */ #else /* Little-endian. Early bytes are at LSB. */ - lsr tmp2, tmp2, tmp3 /* Shift (tmp1 & 63). */ + lsr tmp2, tmp2, tmp3 /* Shift (count & 63). */ #endif and tmp3, limit_wd, #7 lsr limit_wd, limit_wd, #3 /* Adjust the limit. Only low 3 bits used, so overflow irrelevant. */ - add limit, limit, tmp1 - add tmp3, tmp3, tmp1 + add limit, limit, count + add tmp3, tmp3, count orr data1, data1, tmp2 orr data2, data2, tmp2 add limit_wd, limit_wd, tmp3, lsr #3 b .Lstart_realigned -.Lret0: - mov result, #0 - ret - .p2align 6 + /* Don't bother with dwords for up to 16 bytes. */ .Lmisaligned8: - sub limit, limit, #1 -1: + cmp limit, #16 + b.hs .Ltry_misaligned_words + +.Lbyte_loop: /* Perhaps we can do better than this. */ ldrb data1w, [src1], #1 ldrb data2w, [src2], #1 subs limit, limit, #1 - ccmp data1w, #1, #0, cs /* NZCV = 0b0000. */ + ccmp data1w, #1, #0, hi /* NZCV = 0b0000. */ ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ - b.eq 1b + b.eq .Lbyte_loop +.Ldone: sub result, data1, data2 ret - .size strncmp, . - strncmp + /* Align the SRC1 to a dword by doing a bytewise compare and then do + the dword loop. */ +.Ltry_misaligned_words: + lsr limit_wd, limit, #3 + cbz count, .Ldo_misaligned + neg count, count + and count, count, #7 + sub limit, limit, count + lsr limit_wd, limit, #3 + +.Lpage_end_loop: + ldrb data1w, [src1], #1 + ldrb data2w, [src2], #1 + cmp data1w, #1 + ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */ + b.ne .Ldone + subs count, count, #1 + b.hi .Lpage_end_loop + +.Ldo_misaligned: + /* Prepare ourselves for the next page crossing. Unlike the aligned + loop, we fetch 1 less dword because we risk crossing bounds on + SRC2. */ + mov count, #8 + subs limit_wd, limit_wd, #1 + b.lo .Ldone_loop +.Lloop_misaligned: + and tmp2, src2, #0xff8 + eor tmp2, tmp2, #0xff8 + cbz tmp2, .Lpage_end_loop + + ldr data1, [src1], #8 + ldr data2, [src2], #8 + sub tmp1, data1, zeroones + orr tmp2, data1, #REP8_7f + eor diff, data1, data2 /* Non-zero if differences found. */ + bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ + ccmp diff, #0, #0, eq + b.ne .Lnot_limit + subs limit_wd, limit_wd, #1 + b.pl .Lloop_misaligned + +.Ldone_loop: + /* We found a difference or a NULL before the limit was reached. */ + and limit, limit, #7 + cbz limit, .Lnot_limit + /* Read the last word. */ + sub src1, src1, 8 + sub src2, src2, 8 + ldr data1, [src1, limit] + ldr data2, [src2, limit] + sub tmp1, data1, zeroones + orr tmp2, data1, #REP8_7f + eor diff, data1, data2 /* Non-zero if differences found. */ + bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */ + ccmp diff, #0, #0, eq + b.ne .Lnot_limit + +.Lret0: + mov result, #0 + ret + .size strncmp, . - strncmp #endif diff --git a/newlib/libc/machine/arc/configure b/newlib/libc/machine/arc/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/arc/configure +++ b/newlib/libc/machine/arc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/arm/configure b/newlib/libc/machine/arm/configure index b3691a884..4b9ac6739 100755 --- a/newlib/libc/machine/arm/configure +++ b/newlib/libc/machine/arm/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -690,6 +690,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1240,7 +1241,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1310,7 +1311,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1326,6 +1327,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1401,7 +1403,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1456,7 +1458,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2490,6 +2492,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2528,7 +2542,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3336,8 +3350,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3397,6 +3409,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4010,7 +4028,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4067,7 +4085,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/bfin/configure b/newlib/libc/machine/bfin/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/bfin/configure +++ b/newlib/libc/machine/bfin/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/configure b/newlib/libc/machine/configure index c72010b6d..be295f6fd 100755 --- a/newlib/libc/machine/configure +++ b/newlib/libc/machine/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -764,6 +764,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode enable_shared @@ -822,6 +823,7 @@ mt nds32 necv70 nios2 +nvptx or1k powerpc rl78 @@ -1380,7 +1382,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1450,7 +1452,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1466,6 +1468,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1561,7 +1564,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1839,7 +1842,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2873,6 +2876,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2911,7 +2926,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3719,8 +3734,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3780,6 +3793,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -11483,7 +11502,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11485 "configure" +#line 11505 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11589,7 +11608,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11591 "configure" +#line 11611 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11907,6 +11926,8 @@ subdirs="$subdirs a29k" necv70) subdirs="$subdirs necv70" ;; nios2) subdirs="$subdirs nios2" + ;; + nvptx) subdirs="$subdirs nvptx" ;; or1k) subdirs="$subdirs or1k" ;; @@ -12566,7 +12587,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12623,7 +12644,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/configure.in b/newlib/libc/machine/configure.in index bca12129d..8ebe68bdb 100644 --- a/newlib/libc/machine/configure.in +++ b/newlib/libc/machine/configure.in @@ -61,6 +61,7 @@ if test -n "${machine_dir}"; then nds32) AC_CONFIG_SUBDIRS(nds32) ;; necv70) AC_CONFIG_SUBDIRS(necv70) ;; nios2) AC_CONFIG_SUBDIRS(nios2) ;; + nvptx) AC_CONFIG_SUBDIRS(nvptx) ;; or1k) AC_CONFIG_SUBDIRS(or1k) ;; powerpc) AC_CONFIG_SUBDIRS(powerpc) ;; rl78) AC_CONFIG_SUBDIRS(rl78) ;; diff --git a/newlib/libc/machine/cr16/configure b/newlib/libc/machine/cr16/configure index d3b535d2d..6a6ad6044 100644 --- a/newlib/libc/machine/cr16/configure +++ b/newlib/libc/machine/cr16/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/cris/configure b/newlib/libc/machine/cris/configure index 74996222e..017a4d5e7 100755 --- a/newlib/libc/machine/cris/configure +++ b/newlib/libc/machine/cris/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/cris/memcpy.c b/newlib/libc/machine/cris/memcpy.c index c7a1af957..c314edeb6 100644 --- a/newlib/libc/machine/cris/memcpy.c +++ b/newlib/libc/machine/cris/memcpy.c @@ -31,6 +31,7 @@ than what we describe. An assembly file should be used instead. */ #include +#include "../../string/local.h" /* Break even between movem and move16 is really at 38.7 * 2, but modulo 44, so up to the next multiple of 44, we use ordinary code. */ @@ -40,6 +41,7 @@ __asm__ (".syntax no_register_prefix"); void * +__inhibit_loop_to_libcall memcpy(void *__restrict pdst, const void *__restrict psrc, size_t pn) { /* Now we want the parameters put in special registers. diff --git a/newlib/libc/machine/cris/sys/errno.h b/newlib/libc/machine/cris/sys/errno.h index 310388943..3d573015d 100644 --- a/newlib/libc/machine/cris/sys/errno.h +++ b/newlib/libc/machine/cris/sys/errno.h @@ -16,12 +16,12 @@ extern "C" { #ifndef _REENT_ONLY #define errno (*__errno()) -extern int *__errno _PARAMS ((void)); +extern int *__errno (void); #endif /* Please don't use these variables directly. Use strerror instead. */ -extern _CONST char * _CONST _sys_errlist[]; +extern const char * const _sys_errlist[]; extern int _sys_nerr; #define __errno_r(ptr) ((ptr)->_errno) diff --git a/newlib/libc/machine/cris/sys/fcntl.h b/newlib/libc/machine/cris/sys/fcntl.h index 6017a190f..7630a9874 100644 --- a/newlib/libc/machine/cris/sys/fcntl.h +++ b/newlib/libc/machine/cris/sys/fcntl.h @@ -143,17 +143,17 @@ struct eflock { #include #include /* sigh. for the mode bits for open/creat */ -extern int open _PARAMS ((const char *, int, ...)); -extern int creat _PARAMS ((const char *, mode_t)); -extern int fcntl _PARAMS ((int, int, ...)); +extern int open (const char *, int, ...); +extern int creat (const char *, mode_t); +extern int fcntl (int, int, ...); /* Provide _ prototypes for functions provided by some versions of newlib. */ #ifdef _COMPILING_NEWLIB -extern int _open _PARAMS ((const char *, int, ...)); -extern int _fcntl _PARAMS ((int, int, ...)); +extern int _open (const char *, int, ...); +extern int _fcntl (int, int, ...); #ifdef __LARGE64_FILES -extern int _open64 _PARAMS ((const char *, int, ...)); +extern int _open64 (const char *, int, ...); #endif #endif diff --git a/newlib/libc/machine/crx/configure b/newlib/libc/machine/crx/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/crx/configure +++ b/newlib/libc/machine/crx/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/d10v/configure b/newlib/libc/machine/d10v/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/d10v/configure +++ b/newlib/libc/machine/d10v/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/d30v/configure b/newlib/libc/machine/d30v/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/d30v/configure +++ b/newlib/libc/machine/d30v/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/epiphany/configure b/newlib/libc/machine/epiphany/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/epiphany/configure +++ b/newlib/libc/machine/epiphany/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/epiphany/setjmp.S b/newlib/libc/machine/epiphany/setjmp.S index 2986bb47a..b981ee51e 100644 --- a/newlib/libc/machine/epiphany/setjmp.S +++ b/newlib/libc/machine/epiphany/setjmp.S @@ -45,6 +45,8 @@ _setjmp: mov r0,#0 rts .size _setjmp, .-_setjmp + .global setjmp + .set setjmp, _setjmp .global _longjmp _longjmp: @@ -63,3 +65,5 @@ _longjmp: movne r0,r1 jr lr .size _longjmp, .-_longjmp + .global longjmp + .set longjmp, _longjmp diff --git a/newlib/libc/machine/fr30/configure b/newlib/libc/machine/fr30/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/fr30/configure +++ b/newlib/libc/machine/fr30/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/frv/configure b/newlib/libc/machine/frv/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/frv/configure +++ b/newlib/libc/machine/frv/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/ft32/configure b/newlib/libc/machine/ft32/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/ft32/configure +++ b/newlib/libc/machine/ft32/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/h8300/configure b/newlib/libc/machine/h8300/configure index 248592edb..d19497d9d 100755 --- a/newlib/libc/machine/h8300/configure +++ b/newlib/libc/machine/h8300/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/h8500/configure b/newlib/libc/machine/h8500/configure index 6c55d0d5a..e475ddd1f 100755 --- a/newlib/libc/machine/h8500/configure +++ b/newlib/libc/machine/h8500/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/hppa/configure b/newlib/libc/machine/hppa/configure index 6f0bd2500..2b8a77c57 100755 --- a/newlib/libc/machine/hppa/configure +++ b/newlib/libc/machine/hppa/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/i386/Makefile.in b/newlib/libc/machine/i386/Makefile.in index fb5808064..5ab7c00b6 100644 --- a/newlib/libc/machine/i386/Makefile.in +++ b/newlib/libc/machine/i386/Makefile.in @@ -273,7 +273,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host all: all-am @@ -588,8 +588,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/machine/i386/configure b/newlib/libc/machine/i386/configure index 4ee4707f6..76c10c78f 100755 --- a/newlib/libc/machine/i386/configure +++ b/newlib/libc/machine/i386/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -567,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -762,6 +762,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode enable_shared @@ -1324,7 +1325,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1394,7 +1395,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1410,6 +1411,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1505,7 +1507,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1783,7 +1785,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2817,6 +2819,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2855,7 +2869,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3663,8 +3677,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3724,6 +3736,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -11427,7 +11445,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11430 "configure" +#line 11448 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11533,7 +11551,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11536 "configure" +#line 11554 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12393,7 +12411,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12450,7 +12468,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/i960/configure b/newlib/libc/machine/i960/configure index bb878bacf..a2e46c224 100755 --- a/newlib/libc/machine/i960/configure +++ b/newlib/libc/machine/i960/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/iq2000/configure b/newlib/libc/machine/iq2000/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/iq2000/configure +++ b/newlib/libc/machine/iq2000/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/lm32/configure b/newlib/libc/machine/lm32/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/lm32/configure +++ b/newlib/libc/machine/lm32/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/m32c/configure b/newlib/libc/machine/m32c/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/m32c/configure +++ b/newlib/libc/machine/m32c/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/m32r/configure b/newlib/libc/machine/m32r/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/m32r/configure +++ b/newlib/libc/machine/m32r/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/m68hc11/configure b/newlib/libc/machine/m68hc11/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/m68hc11/configure +++ b/newlib/libc/machine/m68hc11/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/m68k/configure b/newlib/libc/machine/m68k/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/m68k/configure +++ b/newlib/libc/machine/m68k/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/m88k/configure b/newlib/libc/machine/m88k/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/m88k/configure +++ b/newlib/libc/machine/m88k/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/mep/configure b/newlib/libc/machine/mep/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/mep/configure +++ b/newlib/libc/machine/mep/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/microblaze/abort.c b/newlib/libc/machine/microblaze/abort.c index b2c5a00b2..1af7b368f 100644 --- a/newlib/libc/machine/microblaze/abort.c +++ b/newlib/libc/machine/microblaze/abort.c @@ -15,14 +15,10 @@ FUNCTION INDEX abort -ANSI_SYNOPSIS +SYNOPSIS #include void abort(void); -TRAD_SYNOPSIS - #include - void abort(); - DESCRIPTION Use <> to signal that your program has detected a condition it cannot deal with. Normally, <> ends your program's execution. @@ -50,8 +46,8 @@ Supporting OS subroutines required: <<_exit>> and optionally, <>. #include #include -_VOID -_DEFUN_VOID (abort) +void +abort (void) { #ifdef ABORT_MESSAGE write (2, "Abort called\n", sizeof ("Abort called\n")-1); diff --git a/newlib/libc/machine/microblaze/configure b/newlib/libc/machine/microblaze/configure index f80e155f3..7ac546442 100644 --- a/newlib/libc/machine/microblaze/configure +++ b/newlib/libc/machine/microblaze/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/microblaze/strcmp.c b/newlib/libc/machine/microblaze/strcmp.c index 2f0337412..434195e2c 100644 --- a/newlib/libc/machine/microblaze/strcmp.c +++ b/newlib/libc/machine/microblaze/strcmp.c @@ -34,16 +34,10 @@ FUNCTION INDEX strcmp -ANSI_SYNOPSIS +SYNOPSIS #include int strcmp(const char *<[a]>, const char *<[b]>); -TRAD_SYNOPSIS - #include - int strcmp(<[a]>, <[b]>) - char *<[a]>; - char *<[b]>; - DESCRIPTION <> compares the string at <[a]> to the string at <[b]>. @@ -87,9 +81,8 @@ QUICKREF #endif int -_DEFUN (strcmp, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strcmp (const char *s1, + const char *s2) { #ifndef HAVE_HW_PCMP diff --git a/newlib/libc/machine/microblaze/strcpy.c b/newlib/libc/machine/microblaze/strcpy.c index 0819ee511..62072fa28 100644 --- a/newlib/libc/machine/microblaze/strcpy.c +++ b/newlib/libc/machine/microblaze/strcpy.c @@ -34,16 +34,10 @@ FUNCTION INDEX strcpy -ANSI_SYNOPSIS +SYNOPSIS #include char *strcpy(char *restrict <[dst]>, const char *restrict <[src]>); -TRAD_SYNOPSIS - #include - char *strcpy(<[dst]>, <[src]>) - char *<[dst]>; - char *<[src]>; - DESCRIPTION <> copies the string pointed to by <[src]> (including the terminating null character) to the array @@ -87,9 +81,8 @@ QUICKREF #endif char* -_DEFUN (strcpy, (dst0, src0), - char *__restrict dst0 _AND - _CONST char *__restrict src0) +strcpy (char *__restrict dst0, + const char *__restrict src0) { #ifndef HAVE_HW_PCMP @@ -103,9 +96,9 @@ _DEFUN (strcpy, (dst0, src0), return s; #else char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If SRC or DEST is unaligned, then copy bytes. */ if (!UNALIGNED (src, dst)) diff --git a/newlib/libc/machine/microblaze/strlen.c b/newlib/libc/machine/microblaze/strlen.c index 51387cd9c..acb4464bc 100644 --- a/newlib/libc/machine/microblaze/strlen.c +++ b/newlib/libc/machine/microblaze/strlen.c @@ -34,15 +34,10 @@ FUNCTION INDEX strlen -ANSI_SYNOPSIS +SYNOPSIS #include size_t strlen(const char *<[str]>); -TRAD_SYNOPSIS - #include - size_t strlen(<[str]>) - char *<[src]>; - DESCRIPTION The <> function works out the length of the string starting at <<*<[str]>>> by counting chararacters until it @@ -83,21 +78,20 @@ QUICKREF #endif size_t -_DEFUN (strlen, (str), - _CONST char *str) +strlen (const char *str) { #ifndef HAVE_HW_PCMP #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) - _CONST char *start = str; + const char *start = str; while (*str) str++; return str - start; #else - _CONST char *start = str; + const char *start = str; unsigned long *aligned_addr; if (!UNALIGNED (str)) diff --git a/newlib/libc/machine/mips/configure b/newlib/libc/machine/mips/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/mips/configure +++ b/newlib/libc/machine/mips/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/mn10200/configure b/newlib/libc/machine/mn10200/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/mn10200/configure +++ b/newlib/libc/machine/mn10200/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/mn10300/configure b/newlib/libc/machine/mn10300/configure index 6f0bd2500..2b8a77c57 100755 --- a/newlib/libc/machine/mn10300/configure +++ b/newlib/libc/machine/mn10300/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/moxie/configure b/newlib/libc/machine/moxie/configure index d3b535d2d..6a6ad6044 100644 --- a/newlib/libc/machine/moxie/configure +++ b/newlib/libc/machine/moxie/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/msp430/configure b/newlib/libc/machine/msp430/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/msp430/configure +++ b/newlib/libc/machine/msp430/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/mt/configure b/newlib/libc/machine/mt/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/mt/configure +++ b/newlib/libc/machine/mt/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/nds32/abort.c b/newlib/libc/machine/nds32/abort.c index 724562a84..5fa0b6e7f 100644 --- a/newlib/libc/machine/nds32/abort.c +++ b/newlib/libc/machine/nds32/abort.c @@ -5,14 +5,10 @@ FUNCTION INDEX abort -ANSI_SYNOPSIS +SYNOPSIS #include void abort(void); -TRAD_SYNOPSIS - #include - void abort(); - DESCRIPTION Use <> to signal that your program has detected a condition it cannot deal with. Normally, <> ends your program's execution. @@ -32,8 +28,8 @@ Supporting OS subroutines required: <<_exit>>. #include -_VOID -_DEFUN_VOID (abort) +void +abort (void) { while (1) { diff --git a/newlib/libc/machine/nds32/configure b/newlib/libc/machine/nds32/configure index b990b39db..fb3b7a9ea 100755 --- a/newlib/libc/machine/nds32/configure +++ b/newlib/libc/machine/nds32/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -698,6 +698,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1253,7 +1254,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1323,7 +1324,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1339,6 +1340,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1421,7 +1423,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1476,7 +1478,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2510,6 +2512,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2548,7 +2562,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3356,8 +3370,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3417,6 +3429,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -5069,7 +5087,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5126,7 +5144,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/necv70/configure b/newlib/libc/machine/necv70/configure index 4c1042031..a45a4592f 100755 --- a/newlib/libc/machine/necv70/configure +++ b/newlib/libc/machine/necv70/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/nios2/configure b/newlib/libc/machine/nios2/configure index 9fdf98864..762b15336 100755 --- a/newlib/libc/machine/nios2/configure +++ b/newlib/libc/machine/nios2/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/nvptx/Makefile.am b/newlib/libc/machine/nvptx/Makefile.am new file mode 100644 index 000000000..66664d3c2 --- /dev/null +++ b/newlib/libc/machine/nvptx/Makefile.am @@ -0,0 +1,17 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +AM_CCASFLAGS = $(INCLUDES) + +noinst_LIBRARIES = lib.a + +lib_a_SOURCES = calloc.c callocr.c malloc.c mallocr.c realloc.c reallocr.c \ + free.c write.c assert.c puts.c putchar.c printf.c abort.c \ + exit.c misc.c +lib_a_CFLAGS = $(AM_CFLAGS) + +ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libc/machine/nvptx/Makefile.in b/newlib/libc/machine/nvptx/Makefile.in new file mode 100644 index 000000000..75256b352 --- /dev/null +++ b/newlib/libc/machine/nvptx/Makefile.in @@ -0,0 +1,531 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/../../../../mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +lib_a_AR = $(AR) $(ARFLAGS) +lib_a_LIBADD = +am_lib_a_OBJECTS = lib_a-calloc.$(OBJEXT) lib_a-callocr.$(OBJEXT) \ + lib_a-malloc.$(OBJEXT) lib_a-mallocr.$(OBJEXT) \ + lib_a-realloc.$(OBJEXT) lib_a-reallocr.$(OBJEXT) \ + lib_a-free.$(OBJEXT) lib_a-write.$(OBJEXT) \ + lib_a-assert.$(OBJEXT) lib_a-puts.$(OBJEXT) \ + lib_a-putchar.$(OBJEXT) lib_a-printf.$(OBJEXT) \ + lib_a-abort.$(OBJEXT) lib_a-exit.$(OBJEXT) \ + lib_a-misc.$(OBJEXT) +lib_a_OBJECTS = $(am_lib_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(lib_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +NO_INCLUDE_LIST = @NO_INCLUDE_LIST@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +READELF = @READELF@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +aext = @aext@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libm_machine_dir = @libm_machine_dir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lpfx = @lpfx@ +machine_dir = @machine_dir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +newlib_basedir = @newlib_basedir@ +oext = @oext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sys_dir = @sys_dir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = cygnus +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) +AM_CCASFLAGS = $(INCLUDES) +noinst_LIBRARIES = lib.a +lib_a_SOURCES = calloc.c callocr.c malloc.c mallocr.c realloc.c reallocr.c \ + free.c write.c assert.c puts.c putchar.c printf.c abort.c \ + exit.c misc.c + +lib_a_CFLAGS = $(AM_CFLAGS) +ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --cygnus Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) + -rm -f lib.a + $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` + +lib_a-calloc.o: calloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-calloc.o `test -f 'calloc.c' || echo '$(srcdir)/'`calloc.c + +lib_a-calloc.obj: calloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-calloc.obj `if test -f 'calloc.c'; then $(CYGPATH_W) 'calloc.c'; else $(CYGPATH_W) '$(srcdir)/calloc.c'; fi` + +lib_a-callocr.o: callocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-callocr.o `test -f 'callocr.c' || echo '$(srcdir)/'`callocr.c + +lib_a-callocr.obj: callocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-callocr.obj `if test -f 'callocr.c'; then $(CYGPATH_W) 'callocr.c'; else $(CYGPATH_W) '$(srcdir)/callocr.c'; fi` + +lib_a-malloc.o: malloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-malloc.o `test -f 'malloc.c' || echo '$(srcdir)/'`malloc.c + +lib_a-malloc.obj: malloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-malloc.obj `if test -f 'malloc.c'; then $(CYGPATH_W) 'malloc.c'; else $(CYGPATH_W) '$(srcdir)/malloc.c'; fi` + +lib_a-mallocr.o: mallocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mallocr.o `test -f 'mallocr.c' || echo '$(srcdir)/'`mallocr.c + +lib_a-mallocr.obj: mallocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mallocr.obj `if test -f 'mallocr.c'; then $(CYGPATH_W) 'mallocr.c'; else $(CYGPATH_W) '$(srcdir)/mallocr.c'; fi` + +lib_a-realloc.o: realloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-realloc.o `test -f 'realloc.c' || echo '$(srcdir)/'`realloc.c + +lib_a-realloc.obj: realloc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-realloc.obj `if test -f 'realloc.c'; then $(CYGPATH_W) 'realloc.c'; else $(CYGPATH_W) '$(srcdir)/realloc.c'; fi` + +lib_a-reallocr.o: reallocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-reallocr.o `test -f 'reallocr.c' || echo '$(srcdir)/'`reallocr.c + +lib_a-reallocr.obj: reallocr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-reallocr.obj `if test -f 'reallocr.c'; then $(CYGPATH_W) 'reallocr.c'; else $(CYGPATH_W) '$(srcdir)/reallocr.c'; fi` + +lib_a-free.o: free.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-free.o `test -f 'free.c' || echo '$(srcdir)/'`free.c + +lib_a-free.obj: free.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-free.obj `if test -f 'free.c'; then $(CYGPATH_W) 'free.c'; else $(CYGPATH_W) '$(srcdir)/free.c'; fi` + +lib_a-write.o: write.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-write.o `test -f 'write.c' || echo '$(srcdir)/'`write.c + +lib_a-write.obj: write.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-write.obj `if test -f 'write.c'; then $(CYGPATH_W) 'write.c'; else $(CYGPATH_W) '$(srcdir)/write.c'; fi` + +lib_a-assert.o: assert.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-assert.o `test -f 'assert.c' || echo '$(srcdir)/'`assert.c + +lib_a-assert.obj: assert.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-assert.obj `if test -f 'assert.c'; then $(CYGPATH_W) 'assert.c'; else $(CYGPATH_W) '$(srcdir)/assert.c'; fi` + +lib_a-puts.o: puts.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-puts.o `test -f 'puts.c' || echo '$(srcdir)/'`puts.c + +lib_a-puts.obj: puts.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-puts.obj `if test -f 'puts.c'; then $(CYGPATH_W) 'puts.c'; else $(CYGPATH_W) '$(srcdir)/puts.c'; fi` + +lib_a-putchar.o: putchar.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putchar.o `test -f 'putchar.c' || echo '$(srcdir)/'`putchar.c + +lib_a-putchar.obj: putchar.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putchar.obj `if test -f 'putchar.c'; then $(CYGPATH_W) 'putchar.c'; else $(CYGPATH_W) '$(srcdir)/putchar.c'; fi` + +lib_a-printf.o: printf.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.o `test -f 'printf.c' || echo '$(srcdir)/'`printf.c + +lib_a-printf.obj: printf.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-printf.obj `if test -f 'printf.c'; then $(CYGPATH_W) 'printf.c'; else $(CYGPATH_W) '$(srcdir)/printf.c'; fi` + +lib_a-abort.o: abort.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-abort.o `test -f 'abort.c' || echo '$(srcdir)/'`abort.c + +lib_a-abort.obj: abort.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-abort.obj `if test -f 'abort.c'; then $(CYGPATH_W) 'abort.c'; else $(CYGPATH_W) '$(srcdir)/abort.c'; fi` + +lib_a-exit.o: exit.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-exit.o `test -f 'exit.c' || echo '$(srcdir)/'`exit.c + +lib_a-exit.obj: exit.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-exit.obj `if test -f 'exit.c'; then $(CYGPATH_W) 'exit.c'; else $(CYGPATH_W) '$(srcdir)/exit.c'; fi` + +lib_a-misc.o: misc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-misc.o `test -f 'misc.c' || echo '$(srcdir)/'`misc.c + +lib_a-misc.obj: misc.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-misc.obj `if test -f 'misc.c'; then $(CYGPATH_W) 'misc.c'; else $(CYGPATH_W) '$(srcdir)/misc.c'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-am: +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-noinstLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-tags dvi dvi-am \ + html html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/machine/nvptx/abort.c b/newlib/libc/machine/nvptx/abort.c new file mode 100644 index 000000000..f0ce15484 --- /dev/null +++ b/newlib/libc/machine/nvptx/abort.c @@ -0,0 +1,23 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +void __attribute__((noreturn)) +abort (void) +{ + for (;;) + __builtin_trap (); +} diff --git a/newlib/libc/machine/nvptx/aclocal.m4 b/newlib/libc/machine/nvptx/aclocal.m4 new file mode 100644 index 000000000..18dab02aa --- /dev/null +++ b/newlib/libc/machine/nvptx/aclocal.m4 @@ -0,0 +1,1012 @@ +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.6], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.6])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([../../../acinclude.m4]) diff --git a/newlib/libc/machine/nvptx/assert.c b/newlib/libc/machine/nvptx/assert.c new file mode 100644 index 000000000..19c809c57 --- /dev/null +++ b/newlib/libc/machine/nvptx/assert.c @@ -0,0 +1,40 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2016-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include + +#ifndef HAVE_ASSERT_FUNC +/* func can be NULL, in which case no function information is given. */ +void +__assert_func (const char *file, + int line, + const char *func, + const char *failedexpr) +{ + abort(); + /* NOTREACHED */ +} +#endif /* HAVE_ASSERT_FUNC */ + +void +__assert (const char *file, + int line, + const char *failedexpr) +{ + __assert_func (file, line, NULL, failedexpr); + /* NOTREACHED */ +} diff --git a/newlib/libc/machine/nvptx/calloc.c b/newlib/libc/machine/nvptx/calloc.c new file mode 100644 index 000000000..e83a32d49 --- /dev/null +++ b/newlib/libc/machine/nvptx/calloc.c @@ -0,0 +1,26 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include + +void * +calloc (size_t size, size_t len) +{ + void *p = malloc (size * len); + if (!p) + return p; + return memset (p, 0, len); +} diff --git a/newlib/libc/machine/nvptx/callocr.c b/newlib/libc/machine/nvptx/callocr.c new file mode 100644 index 000000000..fa10f532e --- /dev/null +++ b/newlib/libc/machine/nvptx/callocr.c @@ -0,0 +1,22 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +void * +_calloc_r (struct _reent *ptr, size_t size, size_t len) +{ + return calloc (size, len); +} diff --git a/newlib/libc/machine/nvptx/configure b/newlib/libc/machine/nvptx/configure new file mode 100644 index 000000000..6a6ad6044 --- /dev/null +++ b/newlib/libc/machine/nvptx/configure @@ -0,0 +1,4766 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='newlib' +PACKAGE_TARNAME='newlib' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="Makefile.am" +ac_subst_vars='LTLIBOBJS +LIBOBJS +sys_dir +machine_dir +libm_machine_dir +lpfx +aext +oext +OBJEXT +USE_LIBTOOL_FALSE +USE_LIBTOOL_TRUE +ELIX_LEVEL_4_FALSE +ELIX_LEVEL_4_TRUE +ELIX_LEVEL_3_FALSE +ELIX_LEVEL_3_TRUE +ELIX_LEVEL_2_FALSE +ELIX_LEVEL_2_TRUE +ELIX_LEVEL_1_FALSE +ELIX_LEVEL_1_TRUE +ELIX_LEVEL_0_FALSE +ELIX_LEVEL_0_TRUE +LDFLAGS +NO_INCLUDE_LIST +NEWLIB_CFLAGS +CCASFLAGS +CCAS +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +READELF +RANLIB +AR +AS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +newlib_basedir +MAY_SUPPLY_SYSCALLS_FALSE +MAY_SUPPLY_SYSCALLS_TRUE +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_multilib +enable_target_optspace +enable_malloc_debugging +enable_newlib_multithread +enable_newlib_iconv +enable_newlib_elix_level +enable_newlib_io_float +enable_newlib_supplied_syscalls +enable_newlib_fno_builtin +enable_dependency_tracking +enable_maintainer_mode +' + ac_precious_vars='build_alias +host_alias +target_alias +CCAS +CCASFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/newlib] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of newlib 3.0.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-multilib build many library versions (default) + --enable-target-optspace optimize for space + --enable-malloc-debugging indicate malloc debugging requested + --enable-newlib-multithread enable support for multiple threads + --enable-newlib-iconv enable iconv library support + --enable-newlib-elix-level supply desired elix library level (1-4) + --disable-newlib-io-float disable printf/scanf family float support + --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + +Some influential environment variables: + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +newlib configure 3.0.0 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by newlib $as_me 3.0.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in ../../../.. "$srcdir"/../../../..; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in ../../../.. \"$srcdir\"/../../../.." "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +# Check whether --enable-multilib was given. +if test "${enable_multilib+set}" = set; then : + enableval=$enable_multilib; case "${enableval}" in + yes) multilib=yes ;; + no) multilib=no ;; + *) as_fn_error $? "bad value ${enableval} for multilib option" "$LINENO" 5 ;; + esac +else + multilib=yes +fi + +# Check whether --enable-target-optspace was given. +if test "${enable_target_optspace+set}" = set; then : + enableval=$enable_target_optspace; case "${enableval}" in + yes) target_optspace=yes ;; + no) target_optspace=no ;; + *) as_fn_error $? "bad value ${enableval} for target-optspace option" "$LINENO" 5 ;; + esac +else + target_optspace= +fi + +# Check whether --enable-malloc-debugging was given. +if test "${enable_malloc_debugging+set}" = set; then : + enableval=$enable_malloc_debugging; case "${enableval}" in + yes) malloc_debugging=yes ;; + no) malloc_debugging=no ;; + *) as_fn_error $? "bad value ${enableval} for malloc-debugging option" "$LINENO" 5 ;; + esac +else + malloc_debugging= +fi + +# Check whether --enable-newlib-multithread was given. +if test "${enable_newlib_multithread+set}" = set; then : + enableval=$enable_newlib_multithread; case "${enableval}" in + yes) newlib_multithread=yes ;; + no) newlib_multithread=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-multithread option" "$LINENO" 5 ;; + esac +else + newlib_multithread=yes +fi + +# Check whether --enable-newlib-iconv was given. +if test "${enable_newlib_iconv+set}" = set; then : + enableval=$enable_newlib_iconv; if test "${newlib_iconv+set}" != set; then + case "${enableval}" in + yes) newlib_iconv=yes ;; + no) newlib_iconv=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-iconv option" "$LINENO" 5 ;; + esac + fi +else + newlib_iconv=${newlib_iconv} +fi + +# Check whether --enable-newlib-elix-level was given. +if test "${enable_newlib_elix_level+set}" = set; then : + enableval=$enable_newlib_elix_level; case "${enableval}" in + 0) newlib_elix_level=0 ;; + 1) newlib_elix_level=1 ;; + 2) newlib_elix_level=2 ;; + 3) newlib_elix_level=3 ;; + 4) newlib_elix_level=4 ;; + *) as_fn_error $? "bad value ${enableval} for newlib-elix-level option" "$LINENO" 5 ;; + esac +else + newlib_elix_level=0 +fi + +# Check whether --enable-newlib-io-float was given. +if test "${enable_newlib_io_float+set}" = set; then : + enableval=$enable_newlib_io_float; case "${enableval}" in + yes) newlib_io_float=yes ;; + no) newlib_io_float=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-io-float option" "$LINENO" 5 ;; + esac +else + newlib_io_float=yes +fi + +# Check whether --enable-newlib-supplied-syscalls was given. +if test "${enable_newlib_supplied_syscalls+set}" = set; then : + enableval=$enable_newlib_supplied_syscalls; case "${enableval}" in + yes) newlib_may_supply_syscalls=yes ;; + no) newlib_may_supply_syscalls=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-supplied-syscalls option" "$LINENO" 5 ;; + esac +else + newlib_may_supply_syscalls=yes +fi + + if test x${newlib_may_supply_syscalls} = xyes; then + MAY_SUPPLY_SYSCALLS_TRUE= + MAY_SUPPLY_SYSCALLS_FALSE='#' +else + MAY_SUPPLY_SYSCALLS_TRUE='#' + MAY_SUPPLY_SYSCALLS_FALSE= +fi + + +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + + +test -z "${with_target_subdir}" && with_target_subdir=. + +if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then + newlib_basedir="${srcdir}/${with_multisrctop}../../../.." + else + newlib_basedir="${srcdir}/${with_multisrctop}../../.." + fi +else + newlib_basedir="${srcdir}/../../.." +fi + + + + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='newlib' + VERSION='3.0.0' + + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# FIXME: We temporarily define our own version of AC_PROG_CC. This is +# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +# are probably using a cross compiler, which will not be able to fully +# link an executable. This should really be fixed in autoconf +# itself. + + + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -z "$CC" && as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using GNU C" >&5 +$as_echo_n "checking whether we are using GNU C... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_c_compiler_gnu=yes +else + ac_cv_c_compiler_gnu=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } + +if test $ac_cv_c_compiler_gnu = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. +set dummy ${ac_tool_prefix}readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$READELF"; then + ac_cv_prog_READELF="$READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_READELF="${ac_tool_prefix}readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +READELF=$ac_cv_prog_READELF +if test -n "$READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_READELF"; then + ac_ct_READELF=$READELF + # Extract the first word of "readelf", so it can be a program name with args. +set dummy readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_READELF"; then + ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_READELF="readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_READELF=$ac_cv_prog_ac_ct_READELF +if test -n "$ac_ct_READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +$as_echo "$ac_ct_READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_READELF" = x; then + READELF=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + READELF=$ac_ct_READELF + fi +else + READELF="$ac_cv_prog_READELF" +fi + + + + +# Hack to ensure that INSTALL won't be set to "../" with autoconf 2.13. */ +ac_given_INSTALL=$INSTALL + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + + +# We need AC_EXEEXT to keep automake happy in cygnus mode. However, +# at least currently, we never actually build a program, so we never +# need to use $(EXEEXT). Moreover, the test for EXEEXT normally +# fails, because we are probably configuring with a cross compiler +# which can't create executables. So we include AC_EXEEXT to keep +# automake happy, but we don't execute it, since we don't care about +# the result. +if false; then + + dummy_var=1 +fi + +. ${newlib_basedir}/configure.host + +NEWLIB_CFLAGS=${newlib_cflags} + + +NO_INCLUDE_LIST=${noinclude} + + +LDFLAGS=${ldflags} + + + if test x${newlib_elix_level} = x0; then + ELIX_LEVEL_0_TRUE= + ELIX_LEVEL_0_FALSE='#' +else + ELIX_LEVEL_0_TRUE='#' + ELIX_LEVEL_0_FALSE= +fi + + if test x${newlib_elix_level} = x1; then + ELIX_LEVEL_1_TRUE= + ELIX_LEVEL_1_FALSE='#' +else + ELIX_LEVEL_1_TRUE='#' + ELIX_LEVEL_1_FALSE= +fi + + if test x${newlib_elix_level} = x2; then + ELIX_LEVEL_2_TRUE= + ELIX_LEVEL_2_FALSE='#' +else + ELIX_LEVEL_2_TRUE='#' + ELIX_LEVEL_2_FALSE= +fi + + if test x${newlib_elix_level} = x3; then + ELIX_LEVEL_3_TRUE= + ELIX_LEVEL_3_FALSE='#' +else + ELIX_LEVEL_3_TRUE='#' + ELIX_LEVEL_3_FALSE= +fi + + if test x${newlib_elix_level} = x4; then + ELIX_LEVEL_4_TRUE= + ELIX_LEVEL_4_FALSE='#' +else + ELIX_LEVEL_4_TRUE='#' + ELIX_LEVEL_4_FALSE= +fi + + + if test x${use_libtool} = xyes; then + USE_LIBTOOL_TRUE= + USE_LIBTOOL_FALSE='#' +else + USE_LIBTOOL_TRUE='#' + USE_LIBTOOL_FALSE= +fi + + +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + +# Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we +# use oext, which is set in configure.host based on the target platform. +OBJEXT=${oext} + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAY_SUPPLY_SYSCALLS_TRUE}" && test -z "${MAY_SUPPLY_SYSCALLS_FALSE}"; then + as_fn_error $? "conditional \"MAY_SUPPLY_SYSCALLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_0_TRUE}" && test -z "${ELIX_LEVEL_0_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_0\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_1_TRUE}" && test -z "${ELIX_LEVEL_1_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_1\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_2_TRUE}" && test -z "${ELIX_LEVEL_2_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_3_TRUE}" && test -z "${ELIX_LEVEL_3_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_3\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ELIX_LEVEL_4_TRUE}" && test -z "${ELIX_LEVEL_4_FALSE}"; then + as_fn_error $? "conditional \"ELIX_LEVEL_4\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LIBTOOL_TRUE}" && test -z "${USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by newlib $as_me 3.0.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +newlib config.status 3.0.0 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/newlib/libc/machine/nvptx/configure.in b/newlib/libc/machine/nvptx/configure.in new file mode 100644 index 000000000..f31b655de --- /dev/null +++ b/newlib/libc/machine/nvptx/configure.in @@ -0,0 +1,14 @@ +dnl This is the newlib/libc/machine/nvptx configure.in file. +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT([newlib],[NEWLIB_VERSION]) +AC_CONFIG_SRCDIR([Makefile.am]) + +dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake. +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/newlib/libc/machine/nvptx/exit.c b/newlib/libc/machine/nvptx/exit.c new file mode 100644 index 000000000..de82bf384 --- /dev/null +++ b/newlib/libc/machine/nvptx/exit.c @@ -0,0 +1,32 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +/* Sadly, PTX doesn't support weak declarations, only weak + definitions. Weakly define it here in case we're not using crt0 + (for instance in offloading). You probably shouldn't be calling + 'exit' in an offloaded region anyway, but that'd be a runtime + error, not a link error. */ +int *__attribute((weak)) __exitval_ptr; + +void __attribute__((noreturn)) +exit (int status) +{ + if (__exitval_ptr) + *__exitval_ptr = status; + for (;;) + asm ("exit;" ::: "memory"); +} diff --git a/newlib/libc/machine/nvptx/free.c b/newlib/libc/machine/nvptx/free.c new file mode 100644 index 000000000..7d329cee8 --- /dev/null +++ b/newlib/libc/machine/nvptx/free.c @@ -0,0 +1,26 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2016-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +/* The CUDA-provided free. */ +void sys_free (void *) __asm__ ("free"); + +/* The user-visible free (renamed by compiler). */ +void free (void *ptr) +{ + if (ptr) + sys_free ((long long *)ptr - 1); +} diff --git a/newlib/libc/machine/nvptx/malloc.c b/newlib/libc/machine/nvptx/malloc.c new file mode 100644 index 000000000..37ab75a1b --- /dev/null +++ b/newlib/libc/machine/nvptx/malloc.c @@ -0,0 +1,29 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2016-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +/* The CUDA-provided malloc. */ +void *sys_malloc (size_t) __asm__ ("malloc"); + +/* The user-visible malloc (renamed by compiler). */ +void *malloc (size_t size) +{ + long long *ptr = sys_malloc (size + sizeof (long long)); + if (ptr) + *(size_t *)ptr++ = size; + + return ptr; +} diff --git a/newlib/libc/machine/nvptx/mallocr.c b/newlib/libc/machine/nvptx/mallocr.c new file mode 100644 index 000000000..bef89de02 --- /dev/null +++ b/newlib/libc/machine/nvptx/mallocr.c @@ -0,0 +1,26 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +void *_malloc_r (struct _reent *r, size_t n) +{ + return malloc (n); +} + +void _free_r (struct _reent *r, void *p) +{ + free (p); +} diff --git a/newlib/libc/machine/nvptx/misc.c b/newlib/libc/machine/nvptx/misc.c new file mode 100644 index 000000000..ed1bc3478 --- /dev/null +++ b/newlib/libc/machine/nvptx/misc.c @@ -0,0 +1,34 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#undef errno +extern int errno; + +int +close(int fd) { + return -1; +} + +off_t +lseek(int fd, off_t offset, int whence) { + return 0; +} + +int +read(int fd, void *buf, size_t count) { + return 0; +} diff --git a/newlib/libc/machine/nvptx/printf.c b/newlib/libc/machine/nvptx/printf.c new file mode 100644 index 000000000..d3f12bde5 --- /dev/null +++ b/newlib/libc/machine/nvptx/printf.c @@ -0,0 +1,30 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2015-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +extern int vprintf (const char *, va_list); + +int +printf (const char *fmt, ...) +{ + va_list args; + int res; + + va_start (args, fmt); + res = vprintf (fmt, args); + va_end (args); + return res; +} diff --git a/newlib/libc/machine/nvptx/putchar.c b/newlib/libc/machine/nvptx/putchar.c new file mode 100644 index 000000000..cb7537f17 --- /dev/null +++ b/newlib/libc/machine/nvptx/putchar.c @@ -0,0 +1,31 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2015-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +extern int vprintf (const char *, va_list); + +int +putchar (int c) +{ + unsigned valist[1]; + + c = (unsigned char)c; + valist[0] = c; + int ret = vprintf ("%c", valist); + if (ret < 0) + c = -1; + return c; +} diff --git a/newlib/libc/machine/nvptx/puts.c b/newlib/libc/machine/nvptx/puts.c new file mode 100644 index 000000000..ce4d17f68 --- /dev/null +++ b/newlib/libc/machine/nvptx/puts.c @@ -0,0 +1,27 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2015-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +extern int vprintf (const char *, va_list); + +int +puts (const char *str) +{ + void *valist[1]; + + valist[0] = str; + return vprintf ("%s\n", valist); +} diff --git a/newlib/libc/machine/nvptx/realloc.c b/newlib/libc/machine/nvptx/realloc.c new file mode 100644 index 000000000..1cb84df5d --- /dev/null +++ b/newlib/libc/machine/nvptx/realloc.c @@ -0,0 +1,32 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2016-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +void * +realloc (void *old_ptr, size_t new_size) +{ + void *new_ptr = malloc (new_size); + + if (old_ptr && new_ptr) + { + size_t old_size = *(size_t *)((long long *)old_ptr - 1); + size_t copy_size = old_size > new_size ? new_size : old_size; + __builtin_memcpy (new_ptr, old_ptr, copy_size); + free (old_ptr); + } + + return new_ptr; +} diff --git a/newlib/libc/machine/nvptx/reallocr.c b/newlib/libc/machine/nvptx/reallocr.c new file mode 100644 index 000000000..e942f069c --- /dev/null +++ b/newlib/libc/machine/nvptx/reallocr.c @@ -0,0 +1,21 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include + +void *_realloc_r (struct _reent *r, void *p, size_t n) _NOTHROW +{ + return realloc (p, n); +} diff --git a/newlib/libc/machine/nvptx/write.c b/newlib/libc/machine/nvptx/write.c new file mode 100644 index 000000000..0544dd05e --- /dev/null +++ b/newlib/libc/machine/nvptx/write.c @@ -0,0 +1,33 @@ +/* + * Support file for nvptx in newlib. + * Copyright (c) 2014-2018 Mentor Graphics. + * + * The authors hereby grant permission to use, copy, modify, distribute, + * and license this software and its documentation for any purpose, provided + * that existing copyright notices are retained in all copies and that this + * notice is included verbatim in any distributions. No written agreement, + * license, or royalty fee is required for any of the authorized uses. + * Modifications to this software may be copyrighted by their authors + * and need not follow the licensing terms described here, provided that + * the new terms are clearly indicated on the first page of each file where + * they apply. + */ + +#include +#include +#include +#include + +_READ_WRITE_RETURN_TYPE write (int fd, const void *buf, size_t count) +{ + size_t i; + char *b = (char *)buf; + if (fd != 1 && fd != 2) + { + errno = EBADF; + return -1; + } + for (i = 0; i < count; i++) + printf ("%c", b[i]); + return count; +} diff --git a/newlib/libc/machine/or1k/configure b/newlib/libc/machine/or1k/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/or1k/configure +++ b/newlib/libc/machine/or1k/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/powerpc/atosfix16.c b/newlib/libc/machine/powerpc/atosfix16.c index 501c0f1cb..b069d71d1 100644 --- a/newlib/libc/machine/powerpc/atosfix16.c +++ b/newlib/libc/machine/powerpc/atosfix16.c @@ -15,7 +15,7 @@ INDEX INDEX _atosfix64_r -ANSI_SYNOPSIS +SYNOPSIS #include __int16_t atosfix16(const char *<[s]>); __int32_t atosfix32(const char *<[s]>); @@ -25,29 +25,6 @@ ANSI_SYNOPSIS __int32_t _atosfix32_r(struct __reent *, const char *<[s]>); __int64_t _atosfix32_r(struct __reent *, const char *<[s]>); -TRAD_SYNOPSIS - #include - __int16_t atosfix16(<[s]>) - const char *<[s]>; - - __int32_t atosfix32(<[s]>) - const char *<[s]>; - - __int64_t atosfix64(<[s]>) - const char *<[s]>; - - __int16_t _atosfix16_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - - __int32_t _atosfix32_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - - __int64_t _atosfix64_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - DESCRIPTION <> converts the initial portion of a string to a sign + 15-bit fraction fixed point value. @@ -85,17 +62,15 @@ PORTABILITY #include <_ansi.h> __int16_t -_DEFUN (_atosfix16_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atosfix16_r (struct _reent *reent, + const char *s) { return _strtosfix16_r (reent, s, NULL); } #ifndef _REENT_ONLY __int16_t -_DEFUN (atosfix16, (s), - _CONST char *s) +atosfix16 (const char *s) { return strtosfix16 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/atosfix32.c b/newlib/libc/machine/powerpc/atosfix32.c index dbcac7e2f..e1915b25a 100644 --- a/newlib/libc/machine/powerpc/atosfix32.c +++ b/newlib/libc/machine/powerpc/atosfix32.c @@ -8,17 +8,15 @@ #include <_ansi.h> __int32_t -_DEFUN (_atosfix32_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atosfix32_r (struct _reent *reent, + const char *s) { return _strtosfix32_r (reent, s, NULL); } #ifndef _REENT_ONLY __int32_t -_DEFUN (atosfix32, (s), - _CONST char *s) +atosfix32 (const char *s) { return strtosfix32 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/atosfix64.c b/newlib/libc/machine/powerpc/atosfix64.c index 109baf7b6..5340b1ee2 100644 --- a/newlib/libc/machine/powerpc/atosfix64.c +++ b/newlib/libc/machine/powerpc/atosfix64.c @@ -8,17 +8,15 @@ #include <_ansi.h> __int64_t -_DEFUN (_atosfix64_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atosfix64_r (struct _reent *reent, + const char *s) { return _strtosfix64_r (reent, s, NULL); } #ifndef _REENT_ONLY __int64_t -_DEFUN (atosfix64, (s), - _CONST char *s) +atosfix64 (const char *s) { return strtosfix64 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/atoufix16.c b/newlib/libc/machine/powerpc/atoufix16.c index 53db13764..4cc833862 100644 --- a/newlib/libc/machine/powerpc/atoufix16.c +++ b/newlib/libc/machine/powerpc/atoufix16.c @@ -15,7 +15,7 @@ INDEX INDEX _atoufix64_r -ANSI_SYNOPSIS +SYNOPSIS #include __uint16_t atoufix16(const char *<[s]>); __uint32_t atoufix32(const char *<[s]>); @@ -25,29 +25,6 @@ ANSI_SYNOPSIS __uint32_t _atoufix32_r(struct __reent *, const char *<[s]>); __uint64_t _atoufix32_r(struct __reent *, const char *<[s]>); -TRAD_SYNOPSIS - #include - __uint16_t atoufix16(<[s]>) - const char *<[s]>; - - __uint32_t atoufix32(<[s]>) - const char *<[s]>; - - __uint64_t atoufix64(<[s]>) - const char *<[s]>; - - __uint16_t _atoufix16_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - - __uint32_t _atoufix32_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - - __uint64_t _atoufix64_r(, <[s]>) - struct _reent *<[reent]>; - const char *<[s]>; - DESCRIPTION <> converts the initial portion of a string to a 16-bit fraction unsigned fixed point value. @@ -85,17 +62,15 @@ PORTABILITY #include <_ansi.h> __uint16_t -_DEFUN (_atoufix16_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atoufix16_r (struct _reent *reent, + const char *s) { return _strtoufix16_r (reent, s, NULL); } #ifndef _REENT_ONLY __uint16_t -_DEFUN (atoufix16, (s), - _CONST char *s) +atoufix16 (const char *s) { return strtoufix16 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/atoufix32.c b/newlib/libc/machine/powerpc/atoufix32.c index ee29ac586..aa2333af6 100644 --- a/newlib/libc/machine/powerpc/atoufix32.c +++ b/newlib/libc/machine/powerpc/atoufix32.c @@ -8,17 +8,15 @@ #include <_ansi.h> __uint32_t -_DEFUN (_atoufix32_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atoufix32_r (struct _reent *reent, + const char *s) { return _strtoufix32_r (reent, s, NULL); } #ifndef _REENT_ONLY __uint32_t -_DEFUN (atoufix32, (s), - _CONST char *s) +atoufix32 (const char *s) { return strtoufix32 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/atoufix64.c b/newlib/libc/machine/powerpc/atoufix64.c index e5eefc423..cf9517e95 100644 --- a/newlib/libc/machine/powerpc/atoufix64.c +++ b/newlib/libc/machine/powerpc/atoufix64.c @@ -8,17 +8,15 @@ #include <_ansi.h> __uint64_t -_DEFUN (_atoufix64_r, (reent, s), - struct _reent *reent _AND - _CONST char *s) +_atoufix64_r (struct _reent *reent, + const char *s) { return _strtoufix64_r (reent, s, NULL); } #ifndef _REENT_ONLY __uint64_t -_DEFUN (atoufix64, (s), - _CONST char *s) +atoufix64 (const char *s) { return strtoufix64 (s, NULL); } diff --git a/newlib/libc/machine/powerpc/configure b/newlib/libc/machine/powerpc/configure index feafc8bec..1e98a3107 100755 --- a/newlib/libc/machine/powerpc/configure +++ b/newlib/libc/machine/powerpc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -690,6 +690,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1240,7 +1241,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1310,7 +1311,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1326,6 +1327,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1401,7 +1403,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1456,7 +1458,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2490,6 +2492,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2528,7 +2542,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3336,8 +3350,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3397,6 +3409,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4019,7 +4037,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4076,7 +4094,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/powerpc/machine/malloc.h b/newlib/libc/machine/powerpc/machine/malloc.h index 945a9651a..32fbb268b 100644 --- a/newlib/libc/machine/powerpc/machine/malloc.h +++ b/newlib/libc/machine/powerpc/machine/malloc.h @@ -3,14 +3,14 @@ # if defined(__ALTIVEC__) -_PTR _EXFUN(vec_calloc,(size_t __nmemb, size_t __size)); -_PTR _EXFUN(_vec_calloc_r,(struct _reent *, size_t __nmemb, size_t __size)); -_VOID _EXFUN(vec_free,(_PTR)); +void *vec_calloc (size_t __nmemb, size_t __size); +void *_vec_calloc_r (struct _reent *, size_t __nmemb, size_t __size); +void vec_free (void *); #define _vec_freer _freer -_PTR _EXFUN(vec_malloc,(size_t __size)); +void *vec_malloc (size_t __size); #define _vec_mallocr _memalign_r -_PTR _EXFUN(vec_realloc,(_PTR __r, size_t __size)); -_PTR _EXFUN(_vec_realloc_r,(struct _reent *, _PTR __r, size_t __size)); +void *vec_realloc (void *__r, size_t __size); +void *_vec_realloc_r (struct _reent *, void *__r, size_t __size); # endif /* __ALTIVEC__ */ diff --git a/newlib/libc/machine/powerpc/machine/stdlib.h b/newlib/libc/machine/powerpc/machine/stdlib.h index 1cf18371a..2db801092 100644 --- a/newlib/libc/machine/powerpc/machine/stdlib.h +++ b/newlib/libc/machine/powerpc/machine/stdlib.h @@ -5,14 +5,14 @@ # if defined(__ALTIVEC__) -_PTR _EXFUN(vec_calloc,(size_t __nmemb, size_t __size)); -_PTR _EXFUN(_vec_calloc_r,(struct _reent *, size_t __nmemb, size_t __size)); -_VOID _EXFUN(vec_free,(_PTR)); +void *vec_calloc (size_t __nmemb, size_t __size); +void *_vec_calloc_r (struct _reent *, size_t __nmemb, size_t __size); +void vec_free (void *); #define _vec_freer _freer -_PTR _EXFUN(vec_malloc,(size_t __size)); +void *vec_malloc (size_t __size); #define _vec_mallocr _memalign_r -_PTR _EXFUN(vec_realloc,(_PTR __r, size_t __size)); -_PTR _EXFUN(_vec_realloc_r,(struct _reent *, _PTR __r, size_t __size)); +void *vec_realloc (void *__r, size_t __size); +void *_vec_realloc_r (struct _reent *, void *__r, size_t __size); # endif /* __ALTIVEC__ */ @@ -24,39 +24,39 @@ _PTR _EXFUN(_vec_realloc_r,(struct _reent *, _PTR __r, size_t __size)); #ifdef __cplusplus extern "C" { #endif -__int16_t _EXFUN(atosfix16,(const char *__str)); -__int16_t _EXFUN(_atosfix16_r,(struct _reent *, const char *__str)); -__int32_t _EXFUN(atosfix32,(const char *__str)); -__int32_t _EXFUN(_atosfix32_r,(struct _reent *, const char *__str)); -__int64_t _EXFUN(atosfix64,(const char *__str)); -__int64_t _EXFUN(_atosfix64_r,(struct _reent *, const char *__str)); +__int16_t atosfix16 (const char *__str); +__int16_t _atosfix16_r (struct _reent *, const char *__str); +__int32_t atosfix32 (const char *__str); +__int32_t _atosfix32_r (struct _reent *, const char *__str); +__int64_t atosfix64 (const char *__str); +__int64_t _atosfix64_r (struct _reent *, const char *__str); -__uint16_t _EXFUN(atoufix16,(const char *__str)); -__uint16_t _EXFUN(_atoufix16_r,(struct _reent *, const char *__str)); -__uint32_t _EXFUN(atoufix32,(const char *__str)); -__uint32_t _EXFUN(_atoufix32_r,(struct _reent *, const char *__str)); -__uint64_t _EXFUN(atoufix64,(const char *__str)); -__uint64_t _EXFUN(_atoufix64_r,(struct _reent *, const char *__str)); +__uint16_t atoufix16 (const char *__str); +__uint16_t _atoufix16_r (struct _reent *, const char *__str); +__uint32_t atoufix32 (const char *__str); +__uint32_t _atoufix32_r (struct _reent *, const char *__str); +__uint64_t atoufix64 (const char *__str); +__uint64_t _atoufix64_r (struct _reent *, const char *__str); -__int16_t _EXFUN(strtosfix16,(const char *__str, char **__endptr)); -__int16_t _EXFUN(_strtosfix16_r,(struct _reent *, const char *__str, - char **__endptr)); -__int32_t _EXFUN(strtosfix32,(const char *__str, char **__endptr)); -__int32_t _EXFUN(_strtosfix32_r,(struct _reent *, const char *__str, - char **__endptr)); -__int64_t _EXFUN(strtosfix64,(const char *__str, char **__endptr)); -__int64_t _EXFUN(_strtosfix64_r,(struct _reent *, const char *__str, - char **__endptr)); +__int16_t strtosfix16 (const char *__str, char **__endptr); +__int16_t _strtosfix16_r (struct _reent *, const char *__str, + char **__endptr); +__int32_t strtosfix32 (const char *__str, char **__endptr); +__int32_t _strtosfix32_r (struct _reent *, const char *__str, + char **__endptr); +__int64_t strtosfix64 (const char *__str, char **__endptr); +__int64_t _strtosfix64_r (struct _reent *, const char *__str, + char **__endptr); -__uint16_t _EXFUN(strtoufix16,(const char *__str, char **__endptr)); -__uint16_t _EXFUN(_strtoufix16_r,(struct _reent *, const char *__str, - char **__endptr)); -__uint32_t _EXFUN(strtoufix32,(const char *__str, char **__endptr)); -__uint32_t _EXFUN(_strtoufix32_r,(struct _reent *, const char *__str, - char **__endptr)); -__uint64_t _EXFUN(strtoufix64,(const char *__str, char **__endptr)); -__uint64_t _EXFUN(_strtoufix64_r,(struct _reent *, const char *__str, - char **__endptr)); +__uint16_t strtoufix16 (const char *__str, char **__endptr); +__uint16_t _strtoufix16_r (struct _reent *, const char *__str, + char **__endptr); +__uint32_t strtoufix32 (const char *__str, char **__endptr); +__uint32_t _strtoufix32_r (struct _reent *, const char *__str, + char **__endptr); +__uint64_t strtoufix64 (const char *__str, char **__endptr); +__uint64_t _strtoufix64_r (struct _reent *, const char *__str, + char **__endptr); #ifdef __cplusplus } #endif diff --git a/newlib/libc/machine/powerpc/strtosfix16.c b/newlib/libc/machine/powerpc/strtosfix16.c index d3cfe0781..3fba45409 100644 --- a/newlib/libc/machine/powerpc/strtosfix16.c +++ b/newlib/libc/machine/powerpc/strtosfix16.c @@ -15,7 +15,7 @@ INDEX INDEX _strtosfix64_r -ANSI_SYNOPSIS +SYNOPSIS #include __int16 strtosfix16 (const char *<[s]>, char **<[ptr]>); @@ -32,35 +32,6 @@ ANSI_SYNOPSIS __int64 _strtosfix64_r (void *<[reent]>, const char *<[s]>, char **<[ptr]>); -TRAD_SYNOPSIS - #include - __int16 strtosfix16 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __int32 strtosfix32 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __int64 strtosfix64 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __int16 _strtosfix16_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - - __int32 _strtosfix32_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - - __int64 _strtosfix64_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to a fixed-point sign + 15-bits fraction representation. The function @@ -121,9 +92,8 @@ PORTABILITY * Ignores `locale' stuff. */ __int16_t -_DEFUN (_strtosfix16_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtosfix16_r (struct _reent *rptr, + const char *nptr, char **endptr) { union double_union dbl; @@ -198,8 +168,7 @@ _DEFUN (_strtosfix16_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __int16_t -_DEFUN (strtosfix16, (s, ptr, base), - _CONST char *s _AND +strtosfix16 (const char *s, char **ptr) { return _strtosfix16_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/strtosfix32.c b/newlib/libc/machine/powerpc/strtosfix32.c index 2e22c1458..b21de9ea1 100644 --- a/newlib/libc/machine/powerpc/strtosfix32.c +++ b/newlib/libc/machine/powerpc/strtosfix32.c @@ -13,9 +13,8 @@ * Ignores `locale' stuff. */ __int32_t -_DEFUN (_strtosfix32_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtosfix32_r (struct _reent *rptr, + const char *nptr, char **endptr) { union double_union dbl; @@ -92,8 +91,7 @@ _DEFUN (_strtosfix32_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __int32_t -_DEFUN (strtosfix32, (s, ptr, base), - _CONST char *s _AND +strtosfix32 (const char *s, char **ptr) { return _strtosfix32_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/strtosfix64.c b/newlib/libc/machine/powerpc/strtosfix64.c index 3006632a4..16032128f 100644 --- a/newlib/libc/machine/powerpc/strtosfix64.c +++ b/newlib/libc/machine/powerpc/strtosfix64.c @@ -13,9 +13,8 @@ * Ignores `locale' stuff. */ __int64_t -_DEFUN (_strtosfix64_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtosfix64_r (struct _reent *rptr, + const char *nptr, char **endptr) { union long_double_union ldbl; @@ -105,8 +104,7 @@ _DEFUN (_strtosfix64_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __int64_t -_DEFUN (strtosfix64, (s, ptr, base), - _CONST char *s _AND +strtosfix64 (const char *s, char **ptr) { return _strtosfix64_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/strtoufix16.c b/newlib/libc/machine/powerpc/strtoufix16.c index d90255c0e..9b16268bb 100644 --- a/newlib/libc/machine/powerpc/strtoufix16.c +++ b/newlib/libc/machine/powerpc/strtoufix16.c @@ -15,7 +15,7 @@ INDEX INDEX _strtoufix64_r -ANSI_SYNOPSIS +SYNOPSIS #include __uint16_t strtoufix16 (const char *<[s]>, char **<[ptr]>); @@ -32,35 +32,6 @@ ANSI_SYNOPSIS __uint64_t _strtoufix64_r (void *<[reent]>, const char *<[s]>, char **<[ptr]>); -TRAD_SYNOPSIS - #include - __uint16_t strtoufix16 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __uint32_t strtoufix32 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __uint64_t strtoufix64 (<[s]>, <[ptr]>) - char *<[s]>; - char **<[ptr]>; - - __uint16_t _strtoufix16_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - - __uint32_t _strtoufix32_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - - __uint64_t _strtoufix64_r (<[reent]>, <[s]>, <[ptr]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to a fixed-point 16-bits fraction representation. The function @@ -120,9 +91,8 @@ PORTABILITY * Ignores `locale' stuff. */ __uint16_t -_DEFUN (_strtoufix16_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtoufix16_r (struct _reent *rptr, + const char *nptr, char **endptr) { union double_union dbl; @@ -189,8 +159,7 @@ _DEFUN (_strtoufix16_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __uint16_t -_DEFUN (strtoufix16, (s, ptr, base), - _CONST char *s _AND +strtoufix16 (const char *s, char **ptr) { return _strtoufix16_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/strtoufix32.c b/newlib/libc/machine/powerpc/strtoufix32.c index 6a8e0812f..7d03f8c9b 100644 --- a/newlib/libc/machine/powerpc/strtoufix32.c +++ b/newlib/libc/machine/powerpc/strtoufix32.c @@ -13,9 +13,8 @@ * Ignores `locale' stuff. */ __uint32_t -_DEFUN (_strtoufix32_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtoufix32_r (struct _reent *rptr, + const char *nptr, char **endptr) { union double_union dbl; @@ -89,8 +88,7 @@ _DEFUN (_strtoufix32_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __uint32_t -_DEFUN (strtoufix32, (s, ptr, base), - _CONST char *s _AND +strtoufix32 (const char *s, char **ptr) { return _strtoufix32_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/strtoufix64.c b/newlib/libc/machine/powerpc/strtoufix64.c index 539f953a4..a2f0484b3 100644 --- a/newlib/libc/machine/powerpc/strtoufix64.c +++ b/newlib/libc/machine/powerpc/strtoufix64.c @@ -13,9 +13,8 @@ * Ignores `locale' stuff. */ __uint64_t -_DEFUN (_strtoufix64_r, (rptr, nptr, endptr), - struct _reent *rptr _AND - _CONST char *nptr _AND +_strtoufix64_r (struct _reent *rptr, + const char *nptr, char **endptr) { union long_double_union ldbl; @@ -104,8 +103,7 @@ _DEFUN (_strtoufix64_r, (rptr, nptr, endptr), #ifndef _REENT_ONLY __uint64_t -_DEFUN (strtoufix64, (s, ptr, base), - _CONST char *s _AND +strtoufix64 (const char *s, char **ptr) { return _strtoufix64_r (_REENT, s, ptr); diff --git a/newlib/libc/machine/powerpc/ufix64toa.c b/newlib/libc/machine/powerpc/ufix64toa.c index 450e0a352..c829b9b33 100644 --- a/newlib/libc/machine/powerpc/ufix64toa.c +++ b/newlib/libc/machine/powerpc/ufix64toa.c @@ -15,8 +15,8 @@ #include #include "fix64.h" -extern char *_simdldtoa_r _PARAMS((struct _reent *, LONG_DOUBLE_UNION *, int, - int, int *, int *, char **)); +extern char *_simdldtoa_r (struct _reent *, LONG_DOUBLE_UNION *, int, + int, int *, int *, char **); /* * Convert an unsigned fixed-point 64-bit value to string. @@ -25,13 +25,12 @@ extern char *_simdldtoa_r _PARAMS((struct _reent *, LONG_DOUBLE_UNION *, int, */ char * -_DEFUN (_ufix64toa_r, (rptr, value, mode, ndigits, decpt, sign, rve), - struct _reent *rptr _AND - __uint64_t value _AND - int mode _AND - int ndigits _AND - int *decpt _AND - int *sign _AND +_ufix64toa_r (struct _reent *rptr, + __uint64_t value, + int mode, + int ndigits, + int *decpt, + int *sign, char **rve) { union long_double_union ldbl; diff --git a/newlib/libc/machine/powerpc/vec_calloc.c b/newlib/libc/machine/powerpc/vec_calloc.c index 5efe91049..7a90d571c 100644 --- a/newlib/libc/machine/powerpc/vec_calloc.c +++ b/newlib/libc/machine/powerpc/vec_calloc.c @@ -8,22 +8,10 @@ INDEX INDEX _vec_calloc_r -ANSI_SYNOPSIS +SYNOPSIS #include void *vec_calloc(size_t <[n]>, size_t <[s]>); void *vec_calloc_r(void *<[reent]>, size_t , <[s]>); - -TRAD_SYNOPSIS - #include - char *vec_calloc(<[n]>, <[s]>) - size_t <[n]>, <[s]>; - - char *_vec_calloc_r(<[reent]>, <[n]>, <[s]>) - char *<[reent]>; - size_t <[n]>; - size_t <[s]>; - - DESCRIPTION Use <> to request a block of memory sufficient to hold an @@ -55,9 +43,8 @@ Supporting OS subroutines required: <>, <>, <>, #ifndef _REENT_ONLY -_PTR -_DEFUN (vec_calloc, (n, size), - size_t n _AND +void * +vec_calloc (size_t n, size_t size) { return _vec_calloc_r (_REENT, n, size); diff --git a/newlib/libc/machine/powerpc/vec_free.c b/newlib/libc/machine/powerpc/vec_free.c index b55c52dde..c893e5ab4 100644 --- a/newlib/libc/machine/powerpc/vec_free.c +++ b/newlib/libc/machine/powerpc/vec_free.c @@ -6,8 +6,7 @@ #ifndef _REENT_ONLY void -_DEFUN (vec_free, (aptr), - _PTR aptr) +vec_free (void *aptr) { _free_r (_REENT, aptr); } diff --git a/newlib/libc/machine/powerpc/vec_malloc.c b/newlib/libc/machine/powerpc/vec_malloc.c index 6bcad59b6..b62fe0762 100644 --- a/newlib/libc/machine/powerpc/vec_malloc.c +++ b/newlib/libc/machine/powerpc/vec_malloc.c @@ -15,7 +15,7 @@ INDEX INDEX _vec_free_r -ANSI_SYNOPSIS +SYNOPSIS #include void *vec_malloc(size_t <[nbytes]>); void *vec_realloc(void *<[aptr]>, size_t <[nbytes]>); @@ -27,32 +27,6 @@ ANSI_SYNOPSIS void *<[aptr]>, size_t <[nbytes]>); void _vec_free_r(void *<[reent]>, void *<[aptr]>); - -TRAD_SYNOPSIS - #include - char *vec_malloc(<[nbytes]>) - size_t <[nbytes]>; - - char *vec_realloc(<[aptr]>, <[nbytes]>) - char *<[aptr]>; - size_t <[nbytes]>; - - void vec_free(<[aptr]>) - char *<[aptr]>; - - char *_vec_malloc_r(<[reent]>,<[nbytes]>) - char *<[reent]>; - size_t <[nbytes]>; - - char *_vec_realloc_r(<[reent]>, <[aptr]>, <[nbytes]>) - char *<[reent]>; - char *<[aptr]>; - size_t <[nbytes]>; - - void _vec_free_r(<[reent]>, <[aptr]>) - char *<[reent]>; - char *<[aptr]>; - DESCRIPTION These functions manage a pool of system memory that is 16-byte aligned.. @@ -121,9 +95,8 @@ Supporting OS subroutines required: <>. */ #ifndef _REENT_ONLY -_PTR -_DEFUN (vec_malloc, (nbytes), - size_t nbytes) /* get a block */ +void * +vec_malloc (size_t nbytes) /* get a block */ { return _memalign_r (_REENT, 16, nbytes); } diff --git a/newlib/libc/machine/powerpc/vec_realloc.c b/newlib/libc/machine/powerpc/vec_realloc.c index e192e399d..db6f32060 100644 --- a/newlib/libc/machine/powerpc/vec_realloc.c +++ b/newlib/libc/machine/powerpc/vec_realloc.c @@ -6,9 +6,8 @@ #ifndef _REENT_ONLY -_PTR -_DEFUN (vec_realloc, (ap, nbytes), - _PTR ap _AND +void * +vec_realloc (void *ap, size_t nbytes) { return _vec_realloc_r (_REENT, ap, nbytes); diff --git a/newlib/libc/machine/powerpc/vfprintf.c b/newlib/libc/machine/powerpc/vfprintf.c index d264e2673..1244f39f1 100644 --- a/newlib/libc/machine/powerpc/vfprintf.c +++ b/newlib/libc/machine/powerpc/vfprintf.c @@ -11,7 +11,7 @@ INDEX INDEX vsnprintf -ANSI_SYNOPSIS +SYNOPSIS #include #include int vprintf(const char *<[fmt]>, va_list <[list]>); @@ -28,53 +28,6 @@ ANSI_SYNOPSIS int _vsnprintf_r(void *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int vprintf( <[fmt]>, <[list]>) - char *<[fmt]>; - va_list <[list]>; - - int vfprintf(<[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsprintf(<[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int vsnprintf(<[str]>, <[size]>, <[fmt]>, <[list]>) - char *<[str]>; - size_t <[size]>; - char *<[fmt]>; - va_list <[list]>; - - int _vprintf_r(<[reent]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfprintf_r(<[reent]>, <[fp]>, <[fmt]>, <[list]>) - char *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsnprintf_r(<[reent]>, <[str]>, <[size]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[str]>; - size_t <[size]>; - char *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, <> and <> are (respectively) variants of <>, <>, <> and <>. They differ @@ -167,11 +120,7 @@ static char *rcsid = "$Id$"; #include #endif -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #include "fvwrite.h" @@ -270,16 +219,16 @@ __sbprintf_r(rptr, fp, fmt, ap) #define DEFPREC 6 #ifdef _NO_LONGDBL -static char *cvt _PARAMS((struct _reent *, double, int, int, char *, int *, int, int *)); +static char *cvt (struct _reent *, double, int, int, char *, int *, int, int *); #else -static char *cvt _PARAMS((struct _reent *, _LONG_DOUBLE, int, int, char *, int *, int, int *)); -extern int _ldcheck _PARAMS((_LONG_DOUBLE *)); +static char *cvt (struct _reent *, _LONG_DOUBLE, int, int, char *, int *, int, int *); +extern int _ldcheck (_LONG_DOUBLE *); #endif -static int exponent _PARAMS((char *, int, int)); +static int exponent (char *, int, int); #ifdef __SPE__ -static char *cvt_ufix64 _PARAMS((struct _reent *, unsigned long long, int, int *, int *)); +static char *cvt_ufix64 (struct _reent *, unsigned long long, int, int *, int *); #endif /* __SPE__ */ #else /* no FLOATING_POINT */ @@ -318,9 +267,8 @@ static char *cvt_ufix64 _PARAMS((struct _reent *, unsigned long long, int, int #define FIXEDPOINT 0x400 /* fixed-point */ int -_DEFUN (VFPRINTF, (fp, fmt0, ap), - FILE * fp _AND - _CONST char *fmt0 _AND +VFPRINTF (FILE * fp, + const char *fmt0, va_list ap) { CHECK_INIT (_REENT, fp); @@ -328,10 +276,9 @@ _DEFUN (VFPRINTF, (fp, fmt0, ap), } int -_DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap), - struct _reent *data _AND - FILE * fp _AND - _CONST char *fmt0 _AND +_VFPRINTF_R (struct _reent *data, + FILE * fp, + const char *fmt0, va_list ap) { register char *fmt; /* format string */ @@ -397,9 +344,9 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap), * below longer. */ #define PADSIZE 16 /* pad chunk size */ - static _CONST char blanks[PADSIZE] = + static const char blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static _CONST char zeroes[PADSIZE] = + static const char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; /* @@ -1294,11 +1241,11 @@ error: #ifdef FLOATING_POINT #ifdef _NO_LONGDBL -extern char *_dtoa_r _PARAMS((struct _reent *, double, int, - int, int *, int *, char **)); +extern char *_dtoa_r (struct _reent *, double, int, + int, int *, int *, char **); #else -extern char *_ldtoa_r _PARAMS((struct _reent *, _LONG_DOUBLE, int, - int, int *, int *, char **)); +extern char *_ldtoa_r (struct _reent *, _LONG_DOUBLE, int, + int, int *, int *, char **); #undef word0 #define word0(x) ldword0(x) #endif @@ -1405,8 +1352,8 @@ exponent(p0, exp, fmtch) #endif /* FLOATING_POINT */ #ifdef __SPE__ -extern char *_ufix64toa_r _PARAMS((struct _reent *, unsigned long long, int, - int, int *, int *, char **)); +extern char *_ufix64toa_r (struct _reent *, unsigned long long, int, + int, int *, int *, char **); static char * cvt_ufix64 (data, value, ndigits, decpt, length) struct _reent *data; diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index 1520ceab8..111fe5f9e 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -9,7 +9,7 @@ INDEX INDEX vsscanf -ANSI_SYNOPSIS +SYNOPSIS #include #include int vscanf(const char *restrict <[fmt]>, va_list <[list]>); @@ -23,40 +23,6 @@ ANSI_SYNOPSIS int _vsscanf_r(void *<[reent]>, const char *restrict <[str]>, const char *restrict <[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int vscanf( <[fmt]>, <[ist]>) - char *<[fmt]>; - va_list <[list]>; - - int vfscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsscanf( <[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _vscanf_r( <[reent]>, <[fmt]>, <[ist]>) - char *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>) - char *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, and <> are (respectively) variants of <>, <>, and <>. They differ only in @@ -111,11 +77,7 @@ Supporting OS subroutines required: #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef NO_FLOATING_POINT @@ -216,9 +178,8 @@ typedef union #ifndef _REENT_ONLY int -_DEFUN (vfscanf, (fp, fmt, ap), - register FILE *__restrict fp _AND - _CONST char *__restrict fmt _AND +vfscanf (register FILE *__restrict fp, + const char *__restrict fmt, va_list ap) { CHECK_INIT(_REENT, fp); @@ -228,7 +189,7 @@ _DEFUN (vfscanf, (fp, fmt, ap), int __svfscanf (fp, fmt0, ap) register FILE *fp; - char _CONST *fmt0; + char const *fmt0; va_list ap; { return __svfscanf_r (_REENT, fp, fmt0, ap); @@ -237,10 +198,9 @@ __svfscanf (fp, fmt0, ap) #endif /* !_REENT_ONLY */ int -_DEFUN (_vfscanf_r, (data, fp, fmt, ap), - struct _reent *data _AND - register FILE *__restrict fp _AND - _CONST char *__restrict fmt _AND +_vfscanf_r (struct _reent *data, + register FILE *__restrict fp, + const char *__restrict fmt, va_list ap) { return __svfscanf_r (data, fp, fmt, ap); @@ -251,7 +211,7 @@ int __svfscanf_r (rptr, fp, fmt0, ap) struct _reent *rptr; register FILE *fp; - char _CONST *fmt0; + char const *fmt0; va_list ap; { register u_char *fmt = (u_char *) fmt0; @@ -296,7 +256,7 @@ __svfscanf_r (rptr, fp, fmt0, ap) #endif /* `basefix' is used to avoid `if' tests in the integer scanner */ - static _CONST short basefix[17] = + static const short basefix[17] = {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; nassigned = 0; @@ -946,7 +906,7 @@ __svfscanf_r (rptr, fp, fmt0, ap) if (flags & NDIGITS) { if (p > buf) - _CAST_VOID ungetc (*(u_char *)-- p, fp); + (void) ungetc (*(u_char *)-- p, fp); goto match_failure; } c = ((u_char *) p)[-1]; @@ -962,7 +922,7 @@ __svfscanf_r (rptr, fp, fmt0, ap) *p = 0; res = (*ccfn) (rptr, buf, (char **) NULL, base); if ((flags & POINTER) && !(flags & VECTOR)) - *(va_arg (ap, _PTR *)) = (_PTR) (unsigned _POINTER_INT) res; + *(va_arg (ap, void **)) = (void *) (unsigned _POINTER_INT) res; else if (flags & SHORT) { if (!(flags & VECTOR)) @@ -1146,11 +1106,11 @@ __svfscanf_r (rptr, fp, fmt0, ap) --nread; if (c != 'e' && c != 'E') { - _CAST_VOID ungetc (c, fp); /* sign */ + (void) ungetc (c, fp); /* sign */ c = *(u_char *)-- p; --nread; } - _CAST_VOID ungetc (c, fp); + (void) ungetc (c, fp); } if ((flags & SUPPRESS) == 0) { diff --git a/newlib/libc/machine/riscv/configure b/newlib/libc/machine/riscv/configure index 2cf2d3a18..0b9d601de 100755 --- a/newlib/libc/machine/riscv/configure +++ b/newlib/libc/machine/riscv/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/riscv/ffs.c b/newlib/libc/machine/riscv/ffs.c index 652207722..2f2176e68 100644 --- a/newlib/libc/machine/riscv/ffs.c +++ b/newlib/libc/machine/riscv/ffs.c @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/ieeefp.c b/newlib/libc/machine/riscv/ieeefp.c index 5288877a6..9094cc651 100644 --- a/newlib/libc/machine/riscv/ieeefp.c +++ b/newlib/libc/machine/riscv/ieeefp.c @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/include/fenv.h b/newlib/libc/machine/riscv/include/fenv.h index 4709c02cb..4795cc925 100644 --- a/newlib/libc/machine/riscv/include/fenv.h +++ b/newlib/libc/machine/riscv/include/fenv.h @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/memcpy.c b/newlib/libc/machine/riscv/memcpy.c index 1b352b46e..a0ab78a0a 100644 --- a/newlib/libc/machine/riscv/memcpy.c +++ b/newlib/libc/machine/riscv/memcpy.c @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at @@ -11,10 +11,12 @@ #include #include +#include "../../string/local.h" #define unlikely(X) __builtin_expect (!!(X), 0) void * +__inhibit_loop_to_libcall memcpy(void *__restrict aa, const void *__restrict bb, size_t n) { #define BODY(a, b, t) { \ diff --git a/newlib/libc/machine/riscv/memset.S b/newlib/libc/machine/riscv/memset.S index 96bdddf68..337ed5365 100644 --- a/newlib/libc/machine/riscv/memset.S +++ b/newlib/libc/machine/riscv/memset.S @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/setjmp.S b/newlib/libc/machine/riscv/setjmp.S index b8cb3837f..eef242e02 100644 --- a/newlib/libc/machine/riscv/setjmp.S +++ b/newlib/libc/machine/riscv/setjmp.S @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/strcmp.S b/newlib/libc/machine/riscv/strcmp.S index 2d655ed8e..71c08537e 100644 --- a/newlib/libc/machine/riscv/strcmp.S +++ b/newlib/libc/machine/riscv/strcmp.S @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/strcpy.c b/newlib/libc/machine/riscv/strcpy.c index 905a9b8df..6d802fa8e 100644 --- a/newlib/libc/machine/riscv/strcpy.c +++ b/newlib/libc/machine/riscv/strcpy.c @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/strlen.c b/newlib/libc/machine/riscv/strlen.c index 466fb1f44..3b0406699 100644 --- a/newlib/libc/machine/riscv/strlen.c +++ b/newlib/libc/machine/riscv/strlen.c @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/sys/asm.h b/newlib/libc/machine/riscv/sys/asm.h index 5deec6bcd..8c8aeb3ae 100644 --- a/newlib/libc/machine/riscv/sys/asm.h +++ b/newlib/libc/machine/riscv/sys/asm.h @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/sys/fenv.h b/newlib/libc/machine/riscv/sys/fenv.h index 840165d58..1c4342571 100644 --- a/newlib/libc/machine/riscv/sys/fenv.h +++ b/newlib/libc/machine/riscv/sys/fenv.h @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/riscv/sys/string.h b/newlib/libc/machine/riscv/sys/string.h index d8ae6f5a7..beebe31f7 100644 --- a/newlib/libc/machine/riscv/sys/string.h +++ b/newlib/libc/machine/riscv/sys/string.h @@ -2,7 +2,7 @@ This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions - of the BSD License. This program is distributed in the hope that + of the FreeBSD License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of this license is available at diff --git a/newlib/libc/machine/rl78/configure b/newlib/libc/machine/rl78/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/rl78/configure +++ b/newlib/libc/machine/rl78/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/rx/configure b/newlib/libc/machine/rx/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/rx/configure +++ b/newlib/libc/machine/rx/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/sh/configure b/newlib/libc/machine/sh/configure index 32a819735..fccf05913 100755 --- a/newlib/libc/machine/sh/configure +++ b/newlib/libc/machine/sh/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -557,8 +557,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -702,6 +702,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1258,7 +1259,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1328,7 +1329,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1344,6 +1345,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1427,7 +1429,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1519,7 +1521,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2555,6 +2557,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2593,7 +2607,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3401,8 +3415,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3462,6 +3474,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -5376,7 +5394,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5433,7 +5451,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/sparc/configure b/newlib/libc/machine/sparc/configure index 20417c236..b36fb2643 100755 --- a/newlib/libc/machine/sparc/configure +++ b/newlib/libc/machine/sparc/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/spu/assert.c b/newlib/libc/machine/spu/assert.c index f1dd33047..90e94eb5d 100644 --- a/newlib/libc/machine/spu/assert.c +++ b/newlib/libc/machine/spu/assert.c @@ -10,10 +10,9 @@ /* func can be NULL, in which case no function information is given. */ void -_DEFUN (__assert_func, (file, line, func, failedexpr), - const char *file _AND - int line _AND - const char *func _AND +__assert_func (const char *file, + int line, + const char *func, const char *failedexpr) { fprintf(stderr, @@ -31,9 +30,8 @@ _DEFUN (__assert_func, (file, line, func, failedexpr), } void -_DEFUN (__assert, (file, line, failedexpr), - const char *file _AND - int line _AND +__assert (const char *file, + int line, const char *failedexpr) { __assert_func (file, line, NULL, failedexpr); diff --git a/newlib/libc/machine/spu/c99ppe.h b/newlib/libc/machine/spu/c99ppe.h index b0ccf2dc0..ccd2d257c 100644 --- a/newlib/libc/machine/spu/c99ppe.h +++ b/newlib/libc/machine/spu/c99ppe.h @@ -99,8 +99,8 @@ struct spe_reg128{ unsigned int slot[4]; }; -void _EXFUN(__sinit,(struct _reent *)); -FILE *_EXFUN(__sfp,(struct _reent *)); +void __sinit (struct _reent *); +FILE *__sfp (struct _reent *); #define __sfp_free(fp) ( (fp)->_fp = 0 ) #define CHECK_INIT(ptr) \ diff --git a/newlib/libc/machine/spu/clearerr.c b/newlib/libc/machine/spu/clearerr.c index b4034f8ff..27f726a64 100644 --- a/newlib/libc/machine/spu/clearerr.c +++ b/newlib/libc/machine/spu/clearerr.c @@ -36,9 +36,8 @@ Author: Joel Schopp #ifndef _REENT_ONLY -_VOID -_DEFUN (clearerr, (fp), - FILE * fp) +void +clearerr (FILE * fp) { int ret; diff --git a/newlib/libc/machine/spu/configure b/newlib/libc/machine/spu/configure index 0c094c57b..86a29dabb 100644 --- a/newlib/libc/machine/spu/configure +++ b/newlib/libc/machine/spu/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -691,6 +691,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1241,7 +1242,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1311,7 +1312,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1327,6 +1328,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1402,7 +1404,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1457,7 +1459,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2491,6 +2493,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2529,7 +2543,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3337,8 +3351,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3398,6 +3410,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4041,7 +4059,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4098,7 +4116,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/spu/creat.c b/newlib/libc/machine/spu/creat.c index 3cd714306..5b8c603f5 100644 --- a/newlib/libc/machine/spu/creat.c +++ b/newlib/libc/machine/spu/creat.c @@ -7,8 +7,7 @@ #include int -_DEFUN(creat, (path, mode), - const char *path _AND +creat (const char *path, mode_t mode) { return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode); diff --git a/newlib/libc/machine/spu/fclose.c b/newlib/libc/machine/spu/fclose.c index 4e1b8253b..6a3e5073f 100644 --- a/newlib/libc/machine/spu/fclose.c +++ b/newlib/libc/machine/spu/fclose.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (fclose, (fp), - FILE * fp) +fclose (FILE * fp) { int ret; diff --git a/newlib/libc/machine/spu/fdopen.c b/newlib/libc/machine/spu/fdopen.c index a795db8b5..6244e50df 100644 --- a/newlib/libc/machine/spu/fdopen.c +++ b/newlib/libc/machine/spu/fdopen.c @@ -34,9 +34,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef _REENT_ONLY /* Just a stub for now. */ FILE * -_DEFUN (fdopen, (fd, mode), - int fd _AND - _CONST char *mode) +fdopen (int fd, + const char *mode) { errno = ENOSYS; return NULL; diff --git a/newlib/libc/machine/spu/feof.c b/newlib/libc/machine/spu/feof.c index 25e3a8f82..8e874148f 100644 --- a/newlib/libc/machine/spu/feof.c +++ b/newlib/libc/machine/spu/feof.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (feof, (fp), - FILE * fp) +feof (FILE * fp) { int result; diff --git a/newlib/libc/machine/spu/ferror.c b/newlib/libc/machine/spu/ferror.c index ac747eff4..be7970fb6 100644 --- a/newlib/libc/machine/spu/ferror.c +++ b/newlib/libc/machine/spu/ferror.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (ferror, (fp), - FILE * fp) +ferror (FILE * fp) { int result; diff --git a/newlib/libc/machine/spu/fflush.c b/newlib/libc/machine/spu/fflush.c index 7037f4990..6b45ac4a1 100644 --- a/newlib/libc/machine/spu/fflush.c +++ b/newlib/libc/machine/spu/fflush.c @@ -36,8 +36,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (fflush, (fp), - FILE * fp) +fflush (FILE * fp) { int result; diff --git a/newlib/libc/machine/spu/fgetc.c b/newlib/libc/machine/spu/fgetc.c index 815203228..8e191cfcb 100644 --- a/newlib/libc/machine/spu/fgetc.c +++ b/newlib/libc/machine/spu/fgetc.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (fgetc, (fp), - FILE * fp) +fgetc (FILE * fp) { int result; diff --git a/newlib/libc/machine/spu/fgetpos.c b/newlib/libc/machine/spu/fgetpos.c index 694400e48..68d41ac0e 100644 --- a/newlib/libc/machine/spu/fgetpos.c +++ b/newlib/libc/machine/spu/fgetpos.c @@ -44,8 +44,7 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (fgetpos, (fp, pos), - FILE *__restrict fp _AND +fgetpos (FILE *__restrict fp, _fpos_t *__restrict pos) { c99_fgetpos_t arg; diff --git a/newlib/libc/machine/spu/fgets.c b/newlib/libc/machine/spu/fgets.c index 2b0ca417e..cde29da34 100644 --- a/newlib/libc/machine/spu/fgets.c +++ b/newlib/libc/machine/spu/fgets.c @@ -46,9 +46,8 @@ typedef struct #ifndef _REENT_ONLY char * -_DEFUN (fgets, (buf, n, fp), - char *__restrict buf _AND - int n _AND +fgets (char *__restrict buf, + int n, FILE *__restrict fp) { c99_fgets_t args; diff --git a/newlib/libc/machine/spu/fileno.c b/newlib/libc/machine/spu/fileno.c index 867a6b8f3..cbf9e50c4 100644 --- a/newlib/libc/machine/spu/fileno.c +++ b/newlib/libc/machine/spu/fileno.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY int -_DEFUN (fileno, (fp), - FILE *fp) +fileno (FILE *fp) { int ret; diff --git a/newlib/libc/machine/spu/fopen.c b/newlib/libc/machine/spu/fopen.c index 821d7c201..13ecdad1e 100644 --- a/newlib/libc/machine/spu/fopen.c +++ b/newlib/libc/machine/spu/fopen.c @@ -37,17 +37,16 @@ Author: Joel Schopp typedef struct { - _CONST char* file; + const char* file; unsigned int pad0[ 3 ]; - _CONST char* mode; + const char* mode; unsigned int pad1[ 3 ]; } c99_fopen_t; #ifndef _REENT_ONLY FILE * -_DEFUN (fopen, (file, mode), - _CONST char *__restrict file _AND - _CONST char *__restrict mode) +fopen (const char *__restrict file, + const char *__restrict mode) { int ret; c99_fopen_t args; diff --git a/newlib/libc/machine/spu/fputs.c b/newlib/libc/machine/spu/fputs.c index 9ed796894..898418606 100644 --- a/newlib/libc/machine/spu/fputs.c +++ b/newlib/libc/machine/spu/fputs.c @@ -37,7 +37,7 @@ Author: Joel Schopp typedef struct { - _CONST char* s; + const char* s; unsigned int pad0[ 3 ]; int fp; unsigned int pad1[ 3 ]; @@ -46,8 +46,7 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (fputs, (s, fp), - char _CONST *__restrict s _AND +fputs (char const *__restrict s, FILE *__restrict fp) { c99_fputs_t args; diff --git a/newlib/libc/machine/spu/fread.c b/newlib/libc/machine/spu/fread.c index eb3966c19..12b6bb782 100644 --- a/newlib/libc/machine/spu/fread.c +++ b/newlib/libc/machine/spu/fread.c @@ -49,10 +49,9 @@ typedef struct #ifndef _REENT_ONLY size_t -_DEFUN (fread, (buf, size, count, fp), - _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +fread (void *__restrict buf, + size_t size, + size_t count, FILE *__restrict fp) { c99_fread_t args; diff --git a/newlib/libc/machine/spu/freopen.c b/newlib/libc/machine/spu/freopen.c index 53dd2bc1d..8babcfe27 100644 --- a/newlib/libc/machine/spu/freopen.c +++ b/newlib/libc/machine/spu/freopen.c @@ -37,9 +37,9 @@ Author: Joel Schopp typedef struct { - _CONST char *file; + const char *file; unsigned int pad0[ 3 ]; - _CONST char *mode; + const char *mode; unsigned int pad1[ 3 ]; int fp; } c99_freopen_t; @@ -47,9 +47,8 @@ typedef struct #ifndef _REENT_ONLY FILE * -_DEFUN (freopen, (file, mode, fp), - const char *__restrict file _AND - const char *__restrict mode _AND +freopen (const char *__restrict file, + const char *__restrict mode, FILE *__restrict fp) { int ret; diff --git a/newlib/libc/machine/spu/fseek.c b/newlib/libc/machine/spu/fseek.c index dc7453325..df33ed85c 100644 --- a/newlib/libc/machine/spu/fseek.c +++ b/newlib/libc/machine/spu/fseek.c @@ -47,9 +47,8 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (fseek, (fp, offset, whence), - register FILE *fp _AND - long offset _AND +fseek (register FILE *fp, + long offset, int whence) { c99_fseek_t args; diff --git a/newlib/libc/machine/spu/fsetpos.c b/newlib/libc/machine/spu/fsetpos.c index 3bd0dde3d..87daa4c18 100644 --- a/newlib/libc/machine/spu/fsetpos.c +++ b/newlib/libc/machine/spu/fsetpos.c @@ -39,15 +39,14 @@ typedef struct { int fp; unsigned int pad0[ 3 ]; - _CONST _fpos_t *pos; + const _fpos_t *pos; } c99_fsetpos_t; #ifndef _REENT_ONLY int -_DEFUN (fsetpos, (iop, pos), - FILE * iop _AND - _CONST _fpos_t * pos) +fsetpos (FILE * iop, + const _fpos_t * pos) { c99_fsetpos_t args; diff --git a/newlib/libc/machine/spu/ftell.c b/newlib/libc/machine/spu/ftell.c index 4782e5ea3..8e56983e5 100644 --- a/newlib/libc/machine/spu/ftell.c +++ b/newlib/libc/machine/spu/ftell.c @@ -38,8 +38,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY long -_DEFUN (ftell, (fp), - FILE * fp) +ftell (FILE * fp) { long ret; diff --git a/newlib/libc/machine/spu/fwrite.c b/newlib/libc/machine/spu/fwrite.c index 58aab9f0a..84572af1d 100644 --- a/newlib/libc/machine/spu/fwrite.c +++ b/newlib/libc/machine/spu/fwrite.c @@ -39,7 +39,7 @@ Author: Joel Schopp typedef struct { - _CONST char* buf; + const char* buf; unsigned int pad0[ 3 ]; size_t size; unsigned int pad1[ 3 ]; @@ -49,10 +49,9 @@ typedef struct } c99_fwrite_t; size_t -_DEFUN (fwrite, (buf, size, count, fp), - _CONST _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +fwrite (const void *__restrict buf, + size_t size, + size_t count, FILE * fp) { c99_fwrite_t args; diff --git a/newlib/libc/machine/spu/impure.c b/newlib/libc/machine/spu/impure.c index 5fbe0e5f5..f9c86efdc 100644 --- a/newlib/libc/machine/spu/impure.c +++ b/newlib/libc/machine/spu/impure.c @@ -11,4 +11,4 @@ struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT(_impure_data); struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &_impure_data; -struct _reent *_CONST __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &_impure_data; +struct _reent *const __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &_impure_data; diff --git a/newlib/libc/machine/spu/memcpy.c b/newlib/libc/machine/spu/memcpy.c index dbbce8cee..0483cd23d 100644 --- a/newlib/libc/machine/spu/memcpy.c +++ b/newlib/libc/machine/spu/memcpy.c @@ -33,6 +33,7 @@ #include #include #include +#include "../../string/local.h" /* Copy n bytes from memory area src to memory area dest. * The memory areas may not overlap. The memcpy subroutine @@ -42,7 +43,9 @@ * either with prior knowledge of the alignment or special * casing specific optimal alignments. */ -void * memcpy(void * __restrict__ dest, const void * __restrict__ src, size_t n) +void * +__inhibit_loop_to_libcall +memcpy(void * __restrict__ dest, const void * __restrict__ src, size_t n) { int adjust, delta; unsigned int soffset1, doffset1, doffset2; diff --git a/newlib/libc/machine/spu/memcpy_ea.c b/newlib/libc/machine/spu/memcpy_ea.c index 6dfea7abb..ae67f86b1 100644 --- a/newlib/libc/machine/spu/memcpy_ea.c +++ b/newlib/libc/machine/spu/memcpy_ea.c @@ -34,10 +34,12 @@ POSSIBILITY OF SUCH DAMAGE. #include "ea_internal.h" #include #include +#include "../../string/local.h" COMPAT_EA_ALIAS (memcpy_ea); __ea void * +__inhibit_loop_to_libcall memcpy_ea (__ea void *dest, __ea const void *src, size_ea_t n) { __ea void *curr_dest = dest; diff --git a/newlib/libc/machine/spu/memset_ea.c b/newlib/libc/machine/spu/memset_ea.c index a18baf206..1d6027382 100644 --- a/newlib/libc/machine/spu/memset_ea.c +++ b/newlib/libc/machine/spu/memset_ea.c @@ -34,10 +34,12 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "ea_internal.h" #include +#include "../../string/local.h" COMPAT_EA_ALIAS (memset_ea); __ea void * +__inhibit_loop_to_libcall memset_ea (__ea void *dest, int c, size_ea_t n) { __ea void *curr_dest = dest; diff --git a/newlib/libc/machine/spu/perror.c b/newlib/libc/machine/spu/perror.c index 028f44a37..eae1419a1 100644 --- a/newlib/libc/machine/spu/perror.c +++ b/newlib/libc/machine/spu/perror.c @@ -7,15 +7,14 @@ typedef struct { - _CONST char* str; + const char* str; unsigned int pad0[ 3 ]; int arg_errno; unsigned int pad1[ 3 ]; } c99_perror_t; void -_DEFUN (perror, (s), - _CONST char *s) +perror (const char *s) { c99_perror_t arg; diff --git a/newlib/libc/machine/spu/puts.c b/newlib/libc/machine/spu/puts.c index 06f4b87b6..27bd2bd52 100644 --- a/newlib/libc/machine/spu/puts.c +++ b/newlib/libc/machine/spu/puts.c @@ -5,8 +5,7 @@ #ifndef _REENT_ONLY int -_DEFUN (puts, (s), - char _CONST * s) +puts (char const * s) { CHECK_STD_INIT(_REENT); diff --git a/newlib/libc/machine/spu/remove.c b/newlib/libc/machine/spu/remove.c index 930a98036..1a379dedc 100644 --- a/newlib/libc/machine/spu/remove.c +++ b/newlib/libc/machine/spu/remove.c @@ -36,7 +36,7 @@ Author: Joel Schopp int remove (filename) - _CONST char *filename; + const char *filename; { /* The return value gets written over buf diff --git a/newlib/libc/machine/spu/rename.c b/newlib/libc/machine/spu/rename.c index bf58fbdc4..e60355de7 100644 --- a/newlib/libc/machine/spu/rename.c +++ b/newlib/libc/machine/spu/rename.c @@ -37,16 +37,16 @@ Author: Joel Schopp typedef struct { - _CONST char *old; + const char *old; unsigned int pad0[ 3 ]; - _CONST char *new; + const char *new; unsigned int pad1[ 3 ]; } c99_rename_t; int rename (old, new) - _CONST char *old; - _CONST char *new; + const char *old; + const char *new; { c99_rename_t args; args.old = old; diff --git a/newlib/libc/machine/spu/rewind.c b/newlib/libc/machine/spu/rewind.c index 8d1a0a90f..e075fc7ee 100644 --- a/newlib/libc/machine/spu/rewind.c +++ b/newlib/libc/machine/spu/rewind.c @@ -37,8 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY void -_DEFUN (rewind, (fp), - FILE * fp) +rewind (FILE * fp) { int ret; diff --git a/newlib/libc/machine/spu/setbuf.c b/newlib/libc/machine/spu/setbuf.c index 84430fc73..427d5dc8d 100644 --- a/newlib/libc/machine/spu/setbuf.c +++ b/newlib/libc/machine/spu/setbuf.c @@ -46,8 +46,7 @@ typedef struct #ifndef _REENT_ONLY void -_DEFUN (setbuf, (fp, buf), - FILE *__restrict fp _AND +setbuf (FILE *__restrict fp, char *__restrict buf) { c99_setbuf_t args; diff --git a/newlib/libc/machine/spu/setvbuf.c b/newlib/libc/machine/spu/setvbuf.c index 32da292f9..91c1cf3bf 100644 --- a/newlib/libc/machine/spu/setvbuf.c +++ b/newlib/libc/machine/spu/setvbuf.c @@ -50,10 +50,9 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (setvbuf, (fp, buf, mode, size), - FILE * fp _AND - char *buf _AND - int mode _AND +setvbuf (FILE * fp, + char *buf, + int mode, size_t size) { c99_setvbuf_t args; diff --git a/newlib/libc/machine/spu/stdio.c b/newlib/libc/machine/spu/stdio.c index 997ccb7a0..2a308b8aa 100644 --- a/newlib/libc/machine/spu/stdio.c +++ b/newlib/libc/machine/spu/stdio.c @@ -39,8 +39,7 @@ Author: Kazunori Asayama static FILE __fp[SPE_FOPEN_MAX]; FILE * -_DEFUN (__sfp, (d), - struct _reent *d) +__sfp (struct _reent *d) { int i; for (i = 0; i < SPE_FOPEN_MAX; i++) { @@ -52,9 +51,8 @@ _DEFUN (__sfp, (d), return NULL; } -static _VOID -_DEFUN (__cleanup, (s), - struct _reent *s) +static void +__cleanup (struct _reent *s) { int i; for (i = 0; i < SPE_FOPEN_MAX; i++) { @@ -64,9 +62,8 @@ _DEFUN (__cleanup, (s), } } -_VOID -_DEFUN (__sinit, (s), - struct _reent *s) +void +__sinit (struct _reent *s) { s->__cleanup = __cleanup; s->__sdidinit = 1; @@ -81,8 +78,8 @@ _DEFUN (__sinit, (s), s->_stderr->_fp = SPE_STDERR; } -_VOID -_DEFUN_VOID (__check_init) +void +__check_init (void) { CHECK_INIT(_REENT); } diff --git a/newlib/libc/machine/spu/sys/dirent.h b/newlib/libc/machine/spu/sys/dirent.h index 60da65a62..00ed41429 100644 --- a/newlib/libc/machine/spu/sys/dirent.h +++ b/newlib/libc/machine/spu/sys/dirent.h @@ -51,14 +51,6 @@ typedef struct { struct dirent dirent; } DIR; -DIR *opendir(const char *); -int closedir(DIR *); -struct dirent *readdir (DIR *); -int readdir_r (DIR *__restrict, struct dirent *__restrict, - struct dirent **__restrict); -void rewinddir(DIR *); -void seekdir(DIR *dir, off_t offset); -off_t telldir(DIR *dir); #ifdef __cplusplus } #endif diff --git a/newlib/libc/machine/spu/sys/errno.h b/newlib/libc/machine/spu/sys/errno.h index 85aafcfd5..ef087bd68 100644 --- a/newlib/libc/machine/spu/sys/errno.h +++ b/newlib/libc/machine/spu/sys/errno.h @@ -32,7 +32,7 @@ extern struct _reent _impure_data; /* Please don't use these variables directly. Use strerror instead. */ -extern _CONST char * _CONST _sys_errlist[]; +extern const char * const _sys_errlist[]; extern int _sys_nerr; #define __errno_r(ptr) ((ptr)->_errno) diff --git a/newlib/libc/machine/spu/tmpfile.c b/newlib/libc/machine/spu/tmpfile.c index c66f78388..e926cbc48 100644 --- a/newlib/libc/machine/spu/tmpfile.c +++ b/newlib/libc/machine/spu/tmpfile.c @@ -37,7 +37,7 @@ Author: Joel Schopp #ifndef _REENT_ONLY FILE * -_DEFUN_VOID (tmpfile) +tmpfile (void) { int ret; FILE* fp; diff --git a/newlib/libc/machine/spu/tmpnam.c b/newlib/libc/machine/spu/tmpnam.c index 5cbf2793b..898a1a70f 100644 --- a/newlib/libc/machine/spu/tmpnam.c +++ b/newlib/libc/machine/spu/tmpnam.c @@ -35,8 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" char * -_DEFUN (tmpnam, (s), - char *s) +tmpnam (char *s) { /* The return value gets written over buf */ diff --git a/newlib/libc/machine/spu/vfprintf.c b/newlib/libc/machine/spu/vfprintf.c index 128d0b3eb..deda41571 100644 --- a/newlib/libc/machine/spu/vfprintf.c +++ b/newlib/libc/machine/spu/vfprintf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vfprintf vfiprintf @@ -57,9 +53,8 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vfprintf, (fp, fmt0, ap), - FILE *__restrict fp _AND - _CONST char *__restrict fmt0 _AND +vfprintf (FILE *__restrict fp, + const char *__restrict fmt0, va_list ap) { c99_vfprintf_t args; diff --git a/newlib/libc/machine/spu/vfscanf.c b/newlib/libc/machine/spu/vfscanf.c index 0f728969f..9e093ba28 100644 --- a/newlib/libc/machine/spu/vfscanf.c +++ b/newlib/libc/machine/spu/vfscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vfscanf vfiscanf @@ -57,9 +53,8 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vfscanf, (fp, fmt, ap), - FILE *__restrict fp _AND - _CONST char *__restrict fmt _AND +vfscanf (FILE *__restrict fp, + const char *__restrict fmt, va_list ap) { c99_vfscanf_t args; diff --git a/newlib/libc/machine/spu/vprintf.c b/newlib/libc/machine/spu/vprintf.c index 32b86d8f2..de98c0a33 100644 --- a/newlib/libc/machine/spu/vprintf.c +++ b/newlib/libc/machine/spu/vprintf.c @@ -3,11 +3,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vprintf viprintf @@ -15,7 +11,7 @@ typedef struct { - _CONST char* fmt; + const char* fmt; unsigned int pad0[ 3 ]; va_list ap; } c99_vprintf_t; @@ -23,8 +19,7 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vprintf, (fmt, ap), - _CONST char *fmt _AND +vprintf (const char *fmt, va_list ap) { c99_vprintf_t args; diff --git a/newlib/libc/machine/spu/vscanf.c b/newlib/libc/machine/spu/vscanf.c index 4f68bfefd..e2d324ed7 100644 --- a/newlib/libc/machine/spu/vscanf.c +++ b/newlib/libc/machine/spu/vscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vscanf viscanf @@ -55,8 +51,7 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vscanf, (fmt, ap), - _CONST char *fmt _AND +vscanf (const char *fmt, va_list ap) { c99_vscanf_t args; diff --git a/newlib/libc/machine/spu/vsnprintf.c b/newlib/libc/machine/spu/vsnprintf.c index cf4f5e709..298165f5a 100644 --- a/newlib/libc/machine/spu/vsnprintf.c +++ b/newlib/libc/machine/spu/vsnprintf.c @@ -3,11 +3,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsnprintf vsniprintf @@ -19,7 +15,7 @@ typedef struct unsigned int pad0[ 3 ]; size_t size; unsigned int pad1[ 3 ]; - _CONST char* fmt; + const char* fmt; unsigned int pad2[ 3 ]; va_list ap; } c99_vsnprintf_t; @@ -27,10 +23,9 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vsnprintf, (str, size, fmt, ap), - char *__restrict str _AND - size_t size _AND - _CONST char *__restrict fmt _AND +vsnprintf (char *__restrict str, + size_t size, + const char *__restrict fmt, va_list ap) { c99_vsnprintf_t args; diff --git a/newlib/libc/machine/spu/vsprintf.c b/newlib/libc/machine/spu/vsprintf.c index 0719d38f5..8317a6636 100644 --- a/newlib/libc/machine/spu/vsprintf.c +++ b/newlib/libc/machine/spu/vsprintf.c @@ -4,11 +4,7 @@ #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsprintf vsiprintf @@ -26,9 +22,8 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vsprintf, (str, fmt, ap), - char *__restrict str _AND - _CONST char *__restrict fmt _AND +vsprintf (char *__restrict str, + const char *__restrict fmt, va_list ap) { c99_vsprintf_t args; diff --git a/newlib/libc/machine/spu/vsscanf.c b/newlib/libc/machine/spu/vsscanf.c index 2f7380ff4..ed6421422 100644 --- a/newlib/libc/machine/spu/vsscanf.c +++ b/newlib/libc/machine/spu/vsscanf.c @@ -35,11 +35,7 @@ Author: Joel Schopp #include "c99ppe.h" -#ifdef _HAVE_STDC #include -#else -#include -#endif #ifdef INTEGER_ONLY # define vsscanf vsiscanf @@ -47,9 +43,9 @@ Author: Joel Schopp typedef struct { - _CONST char *str; + const char *str; unsigned int pad0[ 3 ]; - _CONST char *fmt; + const char *fmt; unsigned int pad1[ 3 ]; va_list ap; } c99_vsscanf_t; @@ -57,9 +53,8 @@ typedef struct #ifndef _REENT_ONLY int -_DEFUN (vsscanf, (str, fmt, ap), - _CONST char *__restrict str _AND - _CONST char *__restrict fmt _AND +vsscanf (const char *__restrict str, + const char *__restrict fmt, va_list ap) { c99_vsscanf_t args; diff --git a/newlib/libc/machine/tic4x/configure b/newlib/libc/machine/tic4x/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/tic4x/configure +++ b/newlib/libc/machine/tic4x/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/tic6x/configure b/newlib/libc/machine/tic6x/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/tic6x/configure +++ b/newlib/libc/machine/tic6x/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/tic80/configure b/newlib/libc/machine/tic80/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/tic80/configure +++ b/newlib/libc/machine/tic80/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/v850/configure b/newlib/libc/machine/v850/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/v850/configure +++ b/newlib/libc/machine/v850/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/visium/configure b/newlib/libc/machine/visium/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/visium/configure +++ b/newlib/libc/machine/visium/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/visium/memcpy.c b/newlib/libc/machine/visium/memcpy.c index c5110064d..e64403135 100644 --- a/newlib/libc/machine/visium/memcpy.c +++ b/newlib/libc/machine/visium/memcpy.c @@ -31,6 +31,7 @@ #include #include "memcpy.h" +#include "../../string/local.h" #define INST_BARRIER __asm__ __volatile__ ("":::"memory"); @@ -422,6 +423,7 @@ do { \ static inline void +__inhibit_loop_to_libcall __int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) { int value = n; @@ -562,6 +564,7 @@ __int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) } static inline void +__inhibit_loop_to_libcall __shrt_int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) { int value = n; @@ -703,6 +706,7 @@ __shrt_int_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) static inline void +__inhibit_loop_to_libcall __byte_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) { int value = n; @@ -846,6 +850,7 @@ __byte_memcpy (void *__restrict s1, const void *__restrict s2, size_t n) /* Exposed interface. */ void * +__inhibit_loop_to_libcall memcpy (void *__restrict s1, const void *__restrict s2, size_t n) { void *result = s1; diff --git a/newlib/libc/machine/visium/memset.c b/newlib/libc/machine/visium/memset.c index bad64a96d..5c3906aa6 100644 --- a/newlib/libc/machine/visium/memset.c +++ b/newlib/libc/machine/visium/memset.c @@ -31,6 +31,7 @@ #include #include "memset.h" +#include "../../string/local.h" #define SET_32_OBJECTS(out) \ do { \ @@ -228,8 +229,8 @@ do { \ out += 1; \ } while(0) - static inline void +__inhibit_loop_to_libcall __int_memset (void *__restrict s1, int val, size_t n) { int value = n; @@ -369,6 +370,7 @@ __int_memset (void *__restrict s1, int val, size_t n) } static inline void +__inhibit_loop_to_libcall __short_int_memset (void *__restrict s1, int val, size_t n) { int value = n; @@ -508,6 +510,7 @@ __short_int_memset (void *__restrict s1, int val, size_t n) } static inline void +__inhibit_loop_to_libcall __byte_memset (void *__restrict s1, int val, size_t n) { int value = n; @@ -650,6 +653,7 @@ __byte_memset (void *__restrict s1, int val, size_t n) /* Exposed interface. */ void * +__inhibit_loop_to_libcall memset (void *s, int c, size_t n) { void *result = s; diff --git a/newlib/libc/machine/w65/configure b/newlib/libc/machine/w65/configure index 6c55d0d5a..e475ddd1f 100755 --- a/newlib/libc/machine/w65/configure +++ b/newlib/libc/machine/w65/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/x86_64/configure b/newlib/libc/machine/x86_64/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/x86_64/configure +++ b/newlib/libc/machine/x86_64/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/xc16x/configure b/newlib/libc/machine/xc16x/configure index 4cd1db78a..083cd071c 100644 --- a/newlib/libc/machine/xc16x/configure +++ b/newlib/libc/machine/xc16x/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/xscale/configure b/newlib/libc/machine/xscale/configure index d3b535d2d..6a6ad6044 100755 --- a/newlib/libc/machine/xscale/configure +++ b/newlib/libc/machine/xscale/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/xscale/memcpy.c b/newlib/libc/machine/xscale/memcpy.c index 7de967fb9..20758e159 100644 --- a/newlib/libc/machine/xscale/memcpy.c +++ b/newlib/libc/machine/xscale/memcpy.c @@ -6,8 +6,10 @@ #include #include "xscale.h" +#include "../../string/local.h" void * +__inhibit_loop_to_libcall memcpy (void *__restrict dst0, const void *__restrict src0, size_t len) { int dummy; diff --git a/newlib/libc/machine/xscale/memset.c b/newlib/libc/machine/xscale/memset.c index 4ff8d01e0..8fab2a7d1 100644 --- a/newlib/libc/machine/xscale/memset.c +++ b/newlib/libc/machine/xscale/memset.c @@ -6,8 +6,10 @@ #include #include "xscale.h" +#include "../../string/local.h" void * +__inhibit_loop_to_libcall memset (void *dst, int c, size_t len) { int dummy; diff --git a/newlib/libc/machine/xscale/strlen.c b/newlib/libc/machine/xscale/strlen.c index a8bc0851d..70c9a3b44 100644 --- a/newlib/libc/machine/xscale/strlen.c +++ b/newlib/libc/machine/xscale/strlen.c @@ -10,7 +10,7 @@ size_t strlen (const char *str) { - _CONST char *start = str; + const char *start = str; /* Skip unaligned part. */ if ((long)str & 3) diff --git a/newlib/libc/machine/xstormy16/configure b/newlib/libc/machine/xstormy16/configure index 4cd1db78a..083cd071c 100755 --- a/newlib/libc/machine/xstormy16/configure +++ b/newlib/libc/machine/xstormy16/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/machine/xstormy16/mallocr.c b/newlib/libc/machine/xstormy16/mallocr.c index 23e02f74c..07be53039 100644 --- a/newlib/libc/machine/xstormy16/mallocr.c +++ b/newlib/libc/machine/xstormy16/mallocr.c @@ -1,7 +1,7 @@ #include #ifdef DEFINE_MALLOC -_PTR +void * _malloc_r (struct _reent *r, size_t sz) { return malloc (sz); @@ -9,7 +9,7 @@ _malloc_r (struct _reent *r, size_t sz) #endif #ifdef DEFINE_CALLOC -_PTR +void * _calloc_r (struct _reent *r, size_t a, size_t b) { return calloc (a, b); @@ -18,15 +18,15 @@ _calloc_r (struct _reent *r, size_t a, size_t b) #ifdef DEFINE_FREE void -_free_r (struct _reent *r, _PTR x) +_free_r (struct _reent *r, void *x) { free (x); } #endif #ifdef DEFINE_REALLOC -_PTR -_realloc_r (struct _reent *r, _PTR x, size_t sz) +void * +_realloc_r (struct _reent *r, void *x, size_t sz) { return realloc (x, sz); } diff --git a/newlib/libc/machine/z8k/configure b/newlib/libc/machine/z8k/configure index 70a9593dd..5291def96 100755 --- a/newlib/libc/machine/z8k/configure +++ b/newlib/libc/machine/z8k/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for newlib 2.5.0. +# Generated by GNU Autoconf 2.68 for newlib 3.0.0. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='newlib' PACKAGE_TARNAME='newlib' -PACKAGE_VERSION='2.5.0' -PACKAGE_STRING='newlib 2.5.0' +PACKAGE_VERSION='3.0.0' +PACKAGE_STRING='newlib 3.0.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -689,6 +689,7 @@ enable_newlib_iconv enable_newlib_elix_level enable_newlib_io_float enable_newlib_supplied_syscalls +enable_newlib_fno_builtin enable_dependency_tracking enable_maintainer_mode ' @@ -1239,7 +1240,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures newlib 2.5.0 to adapt to many kinds of systems. +\`configure' configures newlib 3.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1309,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of newlib 2.5.0:";; + short | recursive ) echo "Configuration of newlib 3.0.0:";; esac cat <<\_ACEOF @@ -1325,6 +1326,7 @@ Optional Features: --enable-newlib-elix-level supply desired elix library level (1-4) --disable-newlib-io-float disable printf/scanf family float support --disable-newlib-supplied-syscalls disable newlib from supplying syscalls + --disable-newlib-fno-builtin disable -fno-builtin flag to allow compiler to use builtin library functions --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-maintainer-mode enable make rules and dependencies not useful @@ -1400,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -newlib configure 2.5.0 +newlib configure 3.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1455,7 +1457,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by newlib $as_me 2.5.0, which was +It was created by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2489,6 +2491,18 @@ else fi +# Check whether --enable-newlib-fno-builtin was given. +if test "${enable_newlib_fno_builtin+set}" = set; then : + enableval=$enable_newlib_fno_builtin; case "${enableval}" in + yes) newlib_fno_builtin=yes ;; + no) newlib_fno_builtin=no ;; + *) as_fn_error $? "bad value ${enableval} for newlib-fno-builtin option" "$LINENO" 5 ;; + esac +else + newlib_fno_builtin= +fi + + test -z "${with_target_subdir}" && with_target_subdir=. @@ -2527,7 +2541,7 @@ fi # Define the identity of the package. PACKAGE='newlib' - VERSION='2.5.0' + VERSION='3.0.0' # Some tools Automake needs. @@ -3335,8 +3349,6 @@ fi . ${newlib_basedir}/configure.host -newlib_cflags="${newlib_cflags} -fno-builtin" - NEWLIB_CFLAGS=${newlib_cflags} @@ -3396,6 +3408,12 @@ else fi +# Emit any target-specific warnings. +if test "x${newlib_msg_warn}" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ${newlib_msg_warn}" >&5 +$as_echo "$as_me: WARNING: ${newlib_msg_warn}" >&2;} +fi + # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we # use oext, which is set in configure.host based on the target platform. OBJEXT=${oext} @@ -4007,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by newlib $as_me 2.5.0, which was +This file was extended by newlib $as_me 3.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4064,7 +4082,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -newlib config.status 2.5.0 +newlib config.status 3.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/newlib/libc/misc/Makefile.in b/newlib/libc/misc/Makefile.in index e7925231c..803db8d23 100644 --- a/newlib/libc/misc/Makefile.in +++ b/newlib/libc/misc/Makefile.in @@ -278,7 +278,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = unctrl.def lock.def ffs.def CHAPTERS = misc.tex all: all-am @@ -571,8 +571,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/misc/__dprintf.c b/newlib/libc/misc/__dprintf.c index eba45eaaa..31454f4c2 100644 --- a/newlib/libc/misc/__dprintf.c +++ b/newlib/libc/misc/__dprintf.c @@ -20,10 +20,10 @@ static char *parse_number (); #endif -static long _EXFUN(get_number, (char *, long, int)); -static void _EXFUN(print_number, (int, int, long)); -static void _EXFUN(write_char, (char c)); -static void _EXFUN(write_string, (_CONST char *s)); +static long get_number (char *, long, int); +static void print_number (int, int, long); +static void write_char (char c); +static void write_string (const char *s); /* Non-zero for big-endian systems. */ static int big_endian_p; @@ -177,9 +177,8 @@ parse_number (s, p) /* Fetch the number at S of SIZE bytes. */ static long -_DEFUN(get_number, (s, size, unsigned_p), - char *s _AND - long size _AND +get_number (char *s, + long size, int unsigned_p) { long x; @@ -220,9 +219,8 @@ _DEFUN(get_number, (s, size, unsigned_p), /* Print X in base BASE. */ static void -_DEFUN(print_number, (base, unsigned_p, n), - int base _AND - int unsigned_p _AND +print_number (int base, + int unsigned_p, long n) { static char chars[16] = "0123456789abcdef"; @@ -254,8 +252,7 @@ _DEFUN(print_number, (base, unsigned_p, n), stdio is working. */ static void -_DEFUN(write_char, (c), - char c) +write_char (char c) { _write_r (_REENT, CONSOLE_FD, &c, 1); } @@ -265,8 +262,7 @@ _DEFUN(write_char, (c), stdio is working. */ static void -_DEFUN(write_string, (s), - _CONST char *s) +write_string (const char *s) { _write_r (_REENT, CONSOLE_FD, s, strlen (s)); } diff --git a/newlib/libc/misc/ffs.c b/newlib/libc/misc/ffs.c index ba5700920..068f25481 100644 --- a/newlib/libc/misc/ffs.c +++ b/newlib/libc/misc/ffs.c @@ -5,14 +5,10 @@ FUNCTION INDEX ffs -ANSI_SYNOPSIS +SYNOPSIS #include int ffs(int <[word]>); -TRAD_SYNOPSIS - #include - int ffs(<[word]>); - DESCRIPTION <> returns the first bit set in a word. diff --git a/newlib/libc/misc/fini.c b/newlib/libc/misc/fini.c index ab4203bf8..56eed6cb3 100644 --- a/newlib/libc/misc/fini.c +++ b/newlib/libc/misc/fini.c @@ -17,7 +17,9 @@ extern void (*__fini_array_start []) (void) __attribute__((weak)); extern void (*__fini_array_end []) (void) __attribute__((weak)); +#ifdef HAVE_INIT_FINI extern void _fini (void); +#endif /* Run all the cleanup routines. */ void @@ -30,6 +32,8 @@ __libc_fini_array (void) for (i = count; i > 0; i--) __fini_array_start[i-1] (); +#ifdef HAVE_INIT_FINI _fini (); +#endif } #endif diff --git a/newlib/libc/misc/init.c b/newlib/libc/misc/init.c index c85d6020f..95f1a7422 100644 --- a/newlib/libc/misc/init.c +++ b/newlib/libc/misc/init.c @@ -21,7 +21,9 @@ extern void (*__preinit_array_end []) (void) __attribute__((weak)); extern void (*__init_array_start []) (void) __attribute__((weak)); extern void (*__init_array_end []) (void) __attribute__((weak)); +#ifdef HAVE_INIT_FINI extern void _init (void); +#endif /* Iterate over all the init routines. */ void @@ -34,7 +36,9 @@ __libc_init_array (void) for (i = 0; i < count; i++) __preinit_array_start[i] (); +#ifdef HAVE_INIT_FINI _init (); +#endif count = __init_array_end - __init_array_start; for (i = 0; i < count; i++) diff --git a/newlib/libc/misc/lock.c b/newlib/libc/misc/lock.c index a76317668..545511e78 100644 --- a/newlib/libc/misc/lock.c +++ b/newlib/libc/misc/lock.c @@ -42,7 +42,7 @@ INDEX INDEX __retarget_lock_release_recursive -ANSI_SYNOPSIS +SYNOPSIS #include struct __lock __lock___sinit_recursive_mutex; struct __lock __lock___sfp_recursive_mutex; diff --git a/newlib/libc/misc/unctrl.c b/newlib/libc/misc/unctrl.c index fa0b90ff1..8bca2a2a5 100644 --- a/newlib/libc/misc/unctrl.c +++ b/newlib/libc/misc/unctrl.c @@ -7,16 +7,11 @@ INDEX INDEX unctrllen -ANSI_SYNOPSIS +SYNOPSIS #include char *unctrl(int <[c]>); int unctrllen(int <[c]>); -TRAD_SYNOPSIS - #include - char *unctrl(<[c]>); - int unctrllen(<[c]>); - DESCRIPTION <> is a macro which returns the printable representation of <[c]> as a string. @@ -74,7 +69,7 @@ No supporting OS subroutines are required. static char sccsid[] = "@(#)unctrl.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -_CONST char * _CONST __unctrl[256] = { +const char * const __unctrl[256] = { "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", "^H", "^I", "^J", "^K", "^L", "^M", "^N", "^O", "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", @@ -110,7 +105,7 @@ _CONST char * _CONST __unctrl[256] = { "0xf8", "0xf9", "0xfa", "0xfb", "0xfc", "0xfd", "0xfe", "0xff", }; -_CONST char __unctrllen[256] = { +const char __unctrllen[256] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, diff --git a/newlib/libc/posix/Makefile.am b/newlib/libc/posix/Makefile.am index 481849cb3..6cdee1df0 100644 --- a/newlib/libc/posix/Makefile.am +++ b/newlib/libc/posix/Makefile.am @@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) GENERAL_SOURCES = \ - closedir.c collate.c collcmp.c creat.c \ + closedir.c collate.c collcmp.c creat.c dirfd.c \ fnmatch.c glob.c _isatty.c isatty.c \ opendir.c readdir.c readdir_r.c \ regcomp.c regerror.c regexec.c regfree.c \ diff --git a/newlib/libc/posix/Makefile.in b/newlib/libc/posix/Makefile.in index 360f2ca87..6dff00b8e 100644 --- a/newlib/libc/posix/Makefile.in +++ b/newlib/libc/posix/Makefile.in @@ -74,14 +74,14 @@ lib_a_AR = $(AR) $(ARFLAGS) lib_a_LIBADD = am__objects_1 = lib_a-closedir.$(OBJEXT) lib_a-collate.$(OBJEXT) \ lib_a-collcmp.$(OBJEXT) lib_a-creat.$(OBJEXT) \ - lib_a-fnmatch.$(OBJEXT) lib_a-glob.$(OBJEXT) \ - lib_a-_isatty.$(OBJEXT) lib_a-isatty.$(OBJEXT) \ - lib_a-opendir.$(OBJEXT) lib_a-readdir.$(OBJEXT) \ - lib_a-readdir_r.$(OBJEXT) lib_a-regcomp.$(OBJEXT) \ - lib_a-regerror.$(OBJEXT) lib_a-regexec.$(OBJEXT) \ - lib_a-regfree.$(OBJEXT) lib_a-rewinddir.$(OBJEXT) \ - lib_a-sleep.$(OBJEXT) lib_a-usleep.$(OBJEXT) \ - lib_a-telldir.$(OBJEXT) + lib_a-dirfd.$(OBJEXT) lib_a-fnmatch.$(OBJEXT) \ + lib_a-glob.$(OBJEXT) lib_a-_isatty.$(OBJEXT) \ + lib_a-isatty.$(OBJEXT) lib_a-opendir.$(OBJEXT) \ + lib_a-readdir.$(OBJEXT) lib_a-readdir_r.$(OBJEXT) \ + lib_a-regcomp.$(OBJEXT) lib_a-regerror.$(OBJEXT) \ + lib_a-regexec.$(OBJEXT) lib_a-regfree.$(OBJEXT) \ + lib_a-rewinddir.$(OBJEXT) lib_a-sleep.$(OBJEXT) \ + lib_a-usleep.$(OBJEXT) lib_a-telldir.$(OBJEXT) am__objects_2 = lib_a-scandir.$(OBJEXT) lib_a-seekdir.$(OBJEXT) am__objects_3 = lib_a-execl.$(OBJEXT) lib_a-execle.$(OBJEXT) \ lib_a-execlp.$(OBJEXT) lib_a-execv.$(OBJEXT) \ @@ -100,8 +100,8 @@ am__objects_4 = lib_a-popen.$(OBJEXT) lib_a-posix_spawn.$(OBJEXT) lib_a_OBJECTS = $(am_lib_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) libposix_la_LIBADD = -am__objects_6 = closedir.lo collate.lo collcmp.lo creat.lo fnmatch.lo \ - glob.lo _isatty.lo isatty.lo opendir.lo readdir.lo \ +am__objects_6 = closedir.lo collate.lo collcmp.lo creat.lo dirfd.lo \ + fnmatch.lo glob.lo _isatty.lo isatty.lo opendir.lo readdir.lo \ readdir_r.lo regcomp.lo regerror.lo regexec.lo regfree.lo \ rewinddir.lo sleep.lo usleep.lo telldir.lo am__objects_7 = scandir.lo seekdir.lo @@ -290,7 +290,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = cygnus INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) GENERAL_SOURCES = \ - closedir.c collate.c collcmp.c creat.c \ + closedir.c collate.c collcmp.c creat.c dirfd.c \ fnmatch.c glob.c _isatty.c isatty.c \ opendir.c readdir.c readdir_r.c \ regcomp.c regerror.c regexec.c regfree.c \ @@ -328,7 +328,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = \ popen.def \ posix_spawn.def @@ -428,6 +428,12 @@ lib_a-creat.o: creat.c lib_a-creat.obj: creat.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creat.obj `if test -f 'creat.c'; then $(CYGPATH_W) 'creat.c'; else $(CYGPATH_W) '$(srcdir)/creat.c'; fi` +lib_a-dirfd.o: dirfd.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dirfd.o `test -f 'dirfd.c' || echo '$(srcdir)/'`dirfd.c + +lib_a-dirfd.obj: dirfd.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dirfd.obj `if test -f 'dirfd.c'; then $(CYGPATH_W) 'dirfd.c'; else $(CYGPATH_W) '$(srcdir)/dirfd.c'; fi` + lib_a-fnmatch.o: fnmatch.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fnmatch.o `test -f 'fnmatch.c' || echo '$(srcdir)/'`fnmatch.c @@ -775,8 +781,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/posix/_isatty.c b/newlib/libc/posix/_isatty.c index 7d6ccae7c..c4dcc1f9c 100644 --- a/newlib/libc/posix/_isatty.c +++ b/newlib/libc/posix/_isatty.c @@ -6,7 +6,7 @@ #include int -_DEFUN(_isatty, (fd), int fd) +_isatty (int fd) { struct stat buf; diff --git a/newlib/libc/posix/closedir.c b/newlib/libc/posix/closedir.c index 7801da043..032636d09 100644 --- a/newlib/libc/posix/closedir.c +++ b/newlib/libc/posix/closedir.c @@ -49,8 +49,7 @@ extern void _cleanupdir (DIR *dirp); * close a directory. */ int -_DEFUN(closedir, (dirp), - register DIR *dirp) +closedir (register DIR *dirp) { int rc; diff --git a/newlib/libc/posix/creat.c b/newlib/libc/posix/creat.c index b8a4f9a14..fab807375 100644 --- a/newlib/libc/posix/creat.c +++ b/newlib/libc/posix/creat.c @@ -5,8 +5,7 @@ #include int -_DEFUN(creat, (path, mode), - const char *path _AND +creat (const char *path, mode_t mode) { return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode); diff --git a/newlib/libc/posix/dirfd.c b/newlib/libc/posix/dirfd.c new file mode 100644 index 000000000..439dfa2f6 --- /dev/null +++ b/newlib/libc/posix/dirfd.c @@ -0,0 +1,38 @@ +#ifndef HAVE_OPENDIR + +/*- + * Copyright (c) 2018 embedded brains GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +int +dirfd(DIR *dirp) +{ + + return (__dirfd(dirp)); +} + +#endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/execl.c b/newlib/libc/posix/execl.c index ebb97fb9b..c3b4e55bd 100644 --- a/newlib/libc/posix/execl.c +++ b/newlib/libc/posix/execl.c @@ -13,40 +13,27 @@ 'environ'. */ static char ***p_environ = &environ; -#ifdef _HAVE_STDC #include int -_DEFUN(execl, (path, arg0, ...), - _CONST char *path _AND - _CONST char *arg0 _DOTS) +execl (const char *path, + const char *arg0, ...) -#else - -#include - -int -_DEFUN(execl, (path, arg0, va_alist), - _CONST char *path _AND - _CONST char *arg0 _AND - va_dcl) - -#endif { int i; va_list args; - _CONST char *argv[256]; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); va_end (args); - return _execve (path, (char * _CONST *) argv, *p_environ); + return _execve (path, (char * const *) argv, *p_environ); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execle.c b/newlib/libc/posix/execle.c index 2b22036a1..34f0ea373 100644 --- a/newlib/libc/posix/execle.c +++ b/newlib/libc/posix/execle.c @@ -8,43 +8,30 @@ #include <_ansi.h> #include -#ifdef _HAVE_STDC #include int -_DEFUN(execle, (path, arg0, ...), - _CONST char *path _AND - _CONST char *arg0 _DOTS) +execle (const char *path, + const char *arg0, ...) -#else - -#include - -int -_DEFUN(execle, (path, arg0, va_alist), - _CONST char *path _AND - _CONST char *arg0 _AND - va_dcl) - -#endif { int i; va_list args; - _CONST char * _CONST *envp; - _CONST char *argv[256]; + const char * const *envp; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); - envp = va_arg (args, _CONST char * _CONST *); + envp = va_arg (args, const char * const *); va_end (args); - return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp); + return _execve (path, (char * const *) argv, (char * const *) envp); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execlp.c b/newlib/libc/posix/execlp.c index 6212da629..b845c88c5 100644 --- a/newlib/libc/posix/execlp.c +++ b/newlib/libc/posix/execlp.c @@ -8,41 +8,28 @@ #include <_ansi.h> #include -#ifdef _HAVE_STDC #include int -_DEFUN(execlp, (path, arg0, ...), - _CONST char *path _AND - _CONST char *arg0 _DOTS) +execlp (const char *path, + const char *arg0, ...) -#else - -#include - -int -_DEFUN(execlp, (path, arg0, va_alist), - _CONST char *path _AND - _CONST char *arg0 _AND - va_dcl) - -#endif { int i; va_list args; - _CONST char *argv[256]; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); va_end (args); - return execvp (path, (char * _CONST *) argv); + return execvp (path, (char * const *) argv); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execv.c b/newlib/libc/posix/execv.c index 8793e2ec4..6a1052c26 100644 --- a/newlib/libc/posix/execv.c +++ b/newlib/libc/posix/execv.c @@ -14,11 +14,10 @@ static char ***p_environ = &environ; int -_DEFUN (execv, (path, argv), - const char *path _AND +execv (const char *path, char * const argv[]) { - return _execve (path, (char * _CONST *) argv, *p_environ); + return _execve (path, (char * const *) argv, *p_environ); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execve.c b/newlib/libc/posix/execve.c index d1355133a..99c145426 100644 --- a/newlib/libc/posix/execve.c +++ b/newlib/libc/posix/execve.c @@ -10,9 +10,8 @@ int -_DEFUN(execve, (path, argv, envp), - const char *path _AND - char * const argv[] _AND +execve (const char *path, + char * const argv[], char * const envp[]) { return _execve (path, argv, envp); diff --git a/newlib/libc/posix/execvp.c b/newlib/libc/posix/execvp.c index 64310f661..be7e71cea 100644 --- a/newlib/libc/posix/execvp.c +++ b/newlib/libc/posix/execvp.c @@ -21,9 +21,8 @@ */ static char * -_DEFUN (strccpy, (s1, s2, c), - char *s1 _AND - char *s2 _AND +strccpy (char *s1, + char *s2, char c) { char *dest = s1; @@ -36,9 +35,8 @@ _DEFUN (strccpy, (s1, s2, c), } int -_DEFUN (execvp, (file, argv), - _CONST char *file _AND - char * _CONST argv[]) +execvp (const char *file, + char * const argv[]) { char *path = getenv ("PATH"); char buf[MAXNAMLEN]; diff --git a/newlib/libc/posix/isatty.c b/newlib/libc/posix/isatty.c index afd5ec85e..8a6740a55 100644 --- a/newlib/libc/posix/isatty.c +++ b/newlib/libc/posix/isatty.c @@ -4,7 +4,7 @@ #include int -_DEFUN(isatty, (fd), int fd) +isatty (int fd) { return _isatty (fd); } diff --git a/newlib/libc/posix/opendir.c b/newlib/libc/posix/opendir.c index ca764e156..2cf1ba541 100644 --- a/newlib/libc/posix/opendir.c +++ b/newlib/libc/posix/opendir.c @@ -43,24 +43,12 @@ static char sccsid[] = "@(#)opendir.c 5.11 (Berkeley) 2/23/91"; #include #include -/* - * open a directory. - */ -DIR * -_DEFUN(opendir, (name), - const char *name) +static DIR * +_opendir_common(int fd) { - register DIR *dirp; - register int fd; - int rc = 0; + DIR *dirp; - if ((fd = open(name, 0)) == -1) - return NULL; -#ifdef HAVE_FCNTL - rc = fcntl(fd, F_SETFD, 1); -#endif - if (rc == -1 || - (dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { + if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { close (fd); return NULL; } @@ -93,4 +81,23 @@ _DEFUN(opendir, (name), return dirp; } +DIR * +opendir(const char *name) +{ + int fd; + + if ((fd = open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) == -1) + return (NULL); + return (_opendir_common(fd)); +} + +DIR * +fdopendir(int fd) +{ + + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + return (NULL); + return (_opendir_common(fd)); +} + #endif /* ! HAVE_OPENDIR */ diff --git a/newlib/libc/posix/popen.c b/newlib/libc/posix/popen.c index faf72b6e3..04aca4c9f 100644 --- a/newlib/libc/posix/popen.c +++ b/newlib/libc/posix/popen.c @@ -41,7 +41,7 @@ INDEX INDEX pclose -ANSI_SYNOPSIS +SYNOPSIS #include FILE *popen(const char *<[s]>, const char *<[mode]>); @@ -109,8 +109,7 @@ static struct pid { } *pidlist; FILE * -_DEFUN(popen, (program, type), - const char *program _AND +popen (const char *program, const char *type) { struct pid *cur; @@ -197,8 +196,7 @@ _DEFUN(popen, (program, type), * if already `pclosed', or waitpid returns an error. */ int -_DEFUN(pclose, (iop), - FILE *iop) +pclose (FILE *iop) { register struct pid *cur, *last; int pstat; diff --git a/newlib/libc/posix/posix_spawn.c b/newlib/libc/posix/posix_spawn.c index e5655e29a..19c5cd0fe 100644 --- a/newlib/libc/posix/posix_spawn.c +++ b/newlib/libc/posix/posix_spawn.c @@ -33,7 +33,7 @@ INDEX INDEX posix_spawnp -ANSI_SYNOPSIS +SYNOPSIS #include int posix_spawn(pid_t *<[pid]>, const char *<[path]>, @@ -147,7 +147,7 @@ typedef struct __posix_spawn_file_actions_entry { */ static int -process_spawnattr(_CONST posix_spawnattr_t sa) +process_spawnattr(const posix_spawnattr_t sa) { struct sigaction sigact = { .sa_flags = 0, .sa_handler = SIG_DFL }; int i; @@ -240,7 +240,7 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae) } static int -process_file_actions(_CONST posix_spawn_file_actions_t fa) +process_file_actions(const posix_spawn_file_actions_t fa) { posix_spawn_file_actions_entry_t *fae; int error; @@ -255,10 +255,10 @@ process_file_actions(_CONST posix_spawn_file_actions_t fa) } static int -do_posix_spawn(pid_t *pid, _CONST char *path, - _CONST posix_spawn_file_actions_t *fa, - _CONST posix_spawnattr_t *sa, - char * _CONST argv[], char * _CONST envp[], int use_env_path) +do_posix_spawn(pid_t *pid, const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], char * const envp[], int use_env_path) { pid_t p; volatile int error = 0; @@ -294,25 +294,23 @@ do_posix_spawn(pid_t *pid, _CONST char *path, } int -_DEFUN(posix_spawn, (pid, path, fa, sa, argv, envp), - pid_t *pid _AND - _CONST char *path _AND - _CONST posix_spawn_file_actions_t *fa _AND - _CONST posix_spawnattr_t *sa _AND - char * _CONST argv[] _AND - char * _CONST envp[]) +posix_spawn (pid_t *pid, + const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], + char * const envp[]) { return do_posix_spawn(pid, path, fa, sa, argv, envp, 0); } int -_DEFUN(posix_spawnp, (pid, path, fa, sa, argv, envp), - pid_t *pid _AND - _CONST char *path _AND - _CONST posix_spawn_file_actions_t *fa _AND - _CONST posix_spawnattr_t *sa _AND - char * _CONST argv[] _AND - char * _CONST envp[]) +posix_spawnp (pid_t *pid, + const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], + char * const envp[]) { return do_posix_spawn(pid, path, fa, sa, argv, envp, 1); } @@ -322,8 +320,7 @@ _DEFUN(posix_spawnp, (pid, path, fa, sa, argv, envp), */ int -_DEFUN(posix_spawn_file_actions_init, (ret), - posix_spawn_file_actions_t *ret) +posix_spawn_file_actions_init (posix_spawn_file_actions_t *ret) { posix_spawn_file_actions_t fa; @@ -337,8 +334,7 @@ _DEFUN(posix_spawn_file_actions_init, (ret), } int -_DEFUN(posix_spawn_file_actions_destroy, (fa), - posix_spawn_file_actions_t *fa) +posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *fa) { posix_spawn_file_actions_entry_t *fae; @@ -357,11 +353,10 @@ _DEFUN(posix_spawn_file_actions_destroy, (fa), } int -_DEFUN(posix_spawn_file_actions_addopen, (fa, fildes, path, oflag, mode), - posix_spawn_file_actions_t * __restrict fa _AND - int fildes _AND - _CONST char * __restrict path _AND - int oflag _AND +posix_spawn_file_actions_addopen (posix_spawn_file_actions_t * __restrict fa, + int fildes, + const char * __restrict path, + int oflag, mode_t mode) { posix_spawn_file_actions_entry_t *fae; @@ -392,9 +387,8 @@ _DEFUN(posix_spawn_file_actions_addopen, (fa, fildes, path, oflag, mode), } int -_DEFUN(posix_spawn_file_actions_adddup2, (fa, fildes, newfildes), - posix_spawn_file_actions_t *fa _AND - int fildes _AND +posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *fa, + int fildes, int newfildes) { posix_spawn_file_actions_entry_t *fae; @@ -417,8 +411,7 @@ _DEFUN(posix_spawn_file_actions_adddup2, (fa, fildes, newfildes), } int -_DEFUN(posix_spawn_file_actions_addclose, (fa, fildes), - posix_spawn_file_actions_t *fa _AND +posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *fa, int fildes) { posix_spawn_file_actions_entry_t *fae; @@ -444,8 +437,7 @@ _DEFUN(posix_spawn_file_actions_addclose, (fa, fildes), */ int -_DEFUN(posix_spawnattr_init, (ret), - posix_spawnattr_t *ret) +posix_spawnattr_init (posix_spawnattr_t *ret) { posix_spawnattr_t sa; @@ -459,16 +451,14 @@ _DEFUN(posix_spawnattr_init, (ret), } int -_DEFUN(posix_spawnattr_destroy, (sa), - posix_spawnattr_t *sa) +posix_spawnattr_destroy (posix_spawnattr_t *sa) { free(*sa); return (0); } int -_DEFUN(posix_spawnattr_getflags, (sa, flags), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getflags (const posix_spawnattr_t * __restrict sa, short * __restrict flags) { *flags = (*sa)->sa_flags; @@ -476,8 +466,7 @@ _DEFUN(posix_spawnattr_getflags, (sa, flags), } int -_DEFUN(posix_spawnattr_getpgroup, (sa, pgroup), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getpgroup (const posix_spawnattr_t * __restrict sa, pid_t * __restrict pgroup) { *pgroup = (*sa)->sa_pgroup; @@ -485,8 +474,7 @@ _DEFUN(posix_spawnattr_getpgroup, (sa, pgroup), } int -_DEFUN(posix_spawnattr_getschedparam, (sa, schedparam), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getschedparam (const posix_spawnattr_t * __restrict sa, struct sched_param * __restrict schedparam) { *schedparam = (*sa)->sa_schedparam; @@ -494,8 +482,7 @@ _DEFUN(posix_spawnattr_getschedparam, (sa, schedparam), } int -_DEFUN(posix_spawnattr_getschedpolicy, (sa, schedpolicy), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getschedpolicy (const posix_spawnattr_t * __restrict sa, int * __restrict schedpolicy) { *schedpolicy = (*sa)->sa_schedpolicy; @@ -503,8 +490,7 @@ _DEFUN(posix_spawnattr_getschedpolicy, (sa, schedpolicy), } int -_DEFUN(posix_spawnattr_getsigdefault, (sa, sigdefault), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getsigdefault (const posix_spawnattr_t * __restrict sa, sigset_t * __restrict sigdefault) { *sigdefault = (*sa)->sa_sigdefault; @@ -512,8 +498,7 @@ _DEFUN(posix_spawnattr_getsigdefault, (sa, sigdefault), } int -_DEFUN(posix_spawnattr_getsigmask, (sa, sigmask), - _CONST posix_spawnattr_t * __restrict sa _AND +posix_spawnattr_getsigmask (const posix_spawnattr_t * __restrict sa, sigset_t * __restrict sigmask) { *sigmask = (*sa)->sa_sigmask; @@ -521,8 +506,7 @@ _DEFUN(posix_spawnattr_getsigmask, (sa, sigmask), } int -_DEFUN(posix_spawnattr_setflags, (sa, flags), - posix_spawnattr_t *sa _AND +posix_spawnattr_setflags (posix_spawnattr_t *sa, short flags) { (*sa)->sa_flags = flags; @@ -530,8 +514,7 @@ _DEFUN(posix_spawnattr_setflags, (sa, flags), } int -_DEFUN(posix_spawnattr_setpgroup, (sa, pgroup), - posix_spawnattr_t *sa _AND +posix_spawnattr_setpgroup (posix_spawnattr_t *sa, pid_t pgroup) { (*sa)->sa_pgroup = pgroup; @@ -539,17 +522,15 @@ _DEFUN(posix_spawnattr_setpgroup, (sa, pgroup), } int -_DEFUN(posix_spawnattr_setschedparam, (sa, schedparam), - posix_spawnattr_t * __restrict sa _AND - _CONST struct sched_param * __restrict schedparam) +posix_spawnattr_setschedparam (posix_spawnattr_t * __restrict sa, + const struct sched_param * __restrict schedparam) { (*sa)->sa_schedparam = *schedparam; return (0); } int -_DEFUN(posix_spawnattr_setschedpolicy, (sa, schedpolicy), - posix_spawnattr_t *sa _AND +posix_spawnattr_setschedpolicy (posix_spawnattr_t *sa, int schedpolicy) { (*sa)->sa_schedpolicy = schedpolicy; @@ -557,18 +538,16 @@ _DEFUN(posix_spawnattr_setschedpolicy, (sa, schedpolicy), } int -_DEFUN(posix_spawnattr_setsigdefault, (sa, sigdefault), - posix_spawnattr_t * __restrict sa _AND - _CONST sigset_t * __restrict sigdefault) +posix_spawnattr_setsigdefault (posix_spawnattr_t * __restrict sa, + const sigset_t * __restrict sigdefault) { (*sa)->sa_sigdefault = *sigdefault; return (0); } int -_DEFUN(posix_spawnattr_setsigmask, (sa, sigmask), - posix_spawnattr_t * __restrict sa _AND - _CONST sigset_t * __restrict sigmask) +posix_spawnattr_setsigmask (posix_spawnattr_t * __restrict sa, + const sigset_t * __restrict sigmask) { (*sa)->sa_sigmask = *sigmask; return (0); diff --git a/newlib/libc/posix/readdir.c b/newlib/libc/posix/readdir.c index 3e620e328..40608f93c 100644 --- a/newlib/libc/posix/readdir.c +++ b/newlib/libc/posix/readdir.c @@ -45,8 +45,7 @@ extern int getdents (int fd, void *dp, int count); * get next entry in a directory. */ struct dirent * -_DEFUN(readdir, (dirp), - register DIR *dirp) +readdir (register DIR *dirp) { register struct dirent *dp; diff --git a/newlib/libc/posix/readdir_r.c b/newlib/libc/posix/readdir_r.c index d13775b87..8f4a98293 100644 --- a/newlib/libc/posix/readdir_r.c +++ b/newlib/libc/posix/readdir_r.c @@ -50,9 +50,8 @@ extern int getdents (int fd, void *dp, int count); * get next entry in a directory using supplied dirent structure. */ int -_DEFUN(readdir_r, (dirp, dp, dpp), - register DIR *__restrict dirp _AND - struct dirent *__restrict dp _AND +readdir_r (register DIR *__restrict dirp, + struct dirent *__restrict dp, struct dirent **__restrict dpp) { struct dirent *tmpdp; diff --git a/newlib/libc/posix/rewinddir.c b/newlib/libc/posix/rewinddir.c index f9ca9f7d4..930b79afc 100644 --- a/newlib/libc/posix/rewinddir.c +++ b/newlib/libc/posix/rewinddir.c @@ -42,8 +42,7 @@ static char sccsid[] = "@(#)rewinddir.c 5.1 (Berkeley) 5/25/90"; #include void -_DEFUN(rewinddir, (dirp), - DIR *dirp) +rewinddir (DIR *dirp) { #ifdef HAVE_DD_LOCK __lock_acquire_recursive(dirp->dd_lock); diff --git a/newlib/libc/posix/scandir.c b/newlib/libc/posix/scandir.c index 8cb8ff82d..d95cff378 100644 --- a/newlib/libc/posix/scandir.c +++ b/newlib/libc/posix/scandir.c @@ -68,10 +68,9 @@ static char sccsid[] = "@(#)scandir.c 5.10 (Berkeley) 2/23/91"; #endif int -_DEFUN(scandir, (dirname, namelist, select, dcomp), - const char *dirname _AND - struct dirent ***namelist _AND - int (*select) __P((const struct dirent *)) _AND +scandir (const char *dirname, + struct dirent ***namelist, + int (*select) __P((const struct dirent *)), int (*dcomp) __P((const struct dirent **, const struct dirent **))) { register struct dirent *d, *p, **names; @@ -169,8 +168,7 @@ cleanup: * Alphabetic order comparison routine for those who want it. */ int -_DEFUN(alphasort, (d1, d2), - const struct dirent **d1 _AND +alphasort (const struct dirent **d1, const struct dirent **d2) { return(strcmp((*d1)->d_name, (*d2)->d_name)); diff --git a/newlib/libc/posix/seekdir.c b/newlib/libc/posix/seekdir.c index 3965edabf..6ffeb1415 100644 --- a/newlib/libc/posix/seekdir.c +++ b/newlib/libc/posix/seekdir.c @@ -46,8 +46,7 @@ static char sccsid[] = "@(#)seekdir.c 5.7 (Berkeley) 6/1/90"; * _seekdir is in telldir.c so that it can share opaque data structures. */ void -_DEFUN(seekdir, (dirp, loc), - DIR *dirp _AND +seekdir (DIR *dirp, long loc) { #ifdef HAVE_DD_LOCK diff --git a/newlib/libc/posix/telldir.c b/newlib/libc/posix/telldir.c index 959e3b7bb..af86d8d4f 100644 --- a/newlib/libc/posix/telldir.c +++ b/newlib/libc/posix/telldir.c @@ -81,8 +81,7 @@ __LOCK_INIT(static, __dd_hash_mutex); #if !defined(_ELIX_LEVEL) || (_ELIX_LEVEL >= 2) long -_DEFUN(telldir, (dirp), - DIR *dirp) +telldir (DIR *dirp) { register int index; register struct ddloc *lp; @@ -119,8 +118,7 @@ _DEFUN(telldir, (dirp), * Only values returned by "telldir" should be passed to seekdir. */ void -_DEFUN(_seekdir, (dirp, loc), - register DIR *dirp _AND +_seekdir (register DIR *dirp, long loc) { register struct ddloc *lp; @@ -173,8 +171,7 @@ found: /* clean out any hash entries from a closed directory */ void -_DEFUN(_cleanupdir, (dirp), - register DIR *dirp) +_cleanupdir (register DIR *dirp) { int i; diff --git a/newlib/libc/posix/wordexp.c b/newlib/libc/posix/wordexp.c index 3e90c3aee..dcda3d2f6 100644 --- a/newlib/libc/posix/wordexp.c +++ b/newlib/libc/posix/wordexp.c @@ -127,9 +127,9 @@ wordexp(const char *__restrict words, wordexp_t *__restrict pwordexp, int flags) if (flags & WRDE_SHOWERR) { - fprintf(stderr, tmp); + fputs(tmp, stderr); while(fgets(tmp, MAXLINELEN, f_err)) - fprintf(stderr, tmp); + fputs(tmp, stderr); } goto cleanup; diff --git a/newlib/libc/reent/Makefile.in b/newlib/libc/reent/Makefile.in index 62b8500d4..4b323f209 100644 --- a/newlib/libc/reent/Makefile.in +++ b/newlib/libc/reent/Makefile.in @@ -343,7 +343,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = \ closer.def \ reent.def \ @@ -776,8 +776,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/reent/closer.c b/newlib/libc/reent/closer.c index aeacebd6c..deb34b002 100644 --- a/newlib/libc/reent/closer.c +++ b/newlib/libc/reent/closer.c @@ -26,16 +26,10 @@ FUNCTION INDEX _close_r -ANSI_SYNOPSIS +SYNOPSIS #include int _close_r(struct _reent *<[ptr]>, int <[fd]>); -TRAD_SYNOPSIS - #include - int _close_r(<[ptr]>, <[fd]>) - struct _reent *<[ptr]>; - int <[fd]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds diff --git a/newlib/libc/reent/execr.c b/newlib/libc/reent/execr.c index d8026703a..59b61223e 100644 --- a/newlib/libc/reent/execr.c +++ b/newlib/libc/reent/execr.c @@ -33,19 +33,11 @@ FUNCTION INDEX _execve_r -ANSI_SYNOPSIS +SYNOPSIS #include int _execve_r(struct _reent *<[ptr]>, const char *<[name]>, char *const <[argv]>[], char *const <[env]>[]); -TRAD_SYNOPSIS - #include - int _execve_r(<[ptr]>, <[name]>, <[argv]>, <[env]>) - struct _reent *<[ptr]>; - char *<[name]>; - char *<[argv]>[]; - char *<[env]>[]; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -53,11 +45,10 @@ DESCRIPTION */ int -_DEFUN (_execve_r, (ptr, name, argv, env), - struct _reent *ptr _AND - _CONST char *name _AND - char *_CONST argv[] _AND - char *_CONST env[]) +_execve_r (struct _reent *ptr, + const char *name, + char *const argv[], + char *const env[]) { int ret; @@ -76,15 +67,10 @@ FUNCTION INDEX _fork_r -ANSI_SYNOPSIS +SYNOPSIS #include int _fork_r(struct _reent *<[ptr]>); -TRAD_SYNOPSIS - #include - int _fork_r(<[ptr]>) - struct _reent *<[ptr]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -94,8 +80,7 @@ DESCRIPTION #ifndef NO_FORK int -_DEFUN (_fork_r, (ptr), - struct _reent *ptr) +_fork_r (struct _reent *ptr) { int ret; @@ -115,16 +100,10 @@ FUNCTION INDEX _wait_r -ANSI_SYNOPSIS +SYNOPSIS #include int _wait_r(struct _reent *<[ptr]>, int *<[status]>); -TRAD_SYNOPSIS - #include - int _wait_r(<[ptr]>, <[status]>) - struct _reent *<[ptr]>; - int *<[status]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -132,8 +111,7 @@ DESCRIPTION */ int -_DEFUN (_wait_r, (ptr, status), - struct _reent *ptr _AND +_wait_r (struct _reent *ptr, int *status) { int ret; diff --git a/newlib/libc/reent/fcntlr.c b/newlib/libc/reent/fcntlr.c index d632d183f..cd19d226f 100644 --- a/newlib/libc/reent/fcntlr.c +++ b/newlib/libc/reent/fcntlr.c @@ -28,19 +28,11 @@ FUNCTION INDEX _fcntl_r -ANSI_SYNOPSIS +SYNOPSIS #include int _fcntl_r(struct _reent *<[ptr]>, int <[fd]>, int <[cmd]>, <[arg]>); -TRAD_SYNOPSIS - #include - int _fcntl_r(<[ptr]>, <[fd]>, <[cmd]>, <[arg]>) - struct _reent *<[ptr]>; - int <[fd]>; - int <[cmd]>; - int <[arg]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -48,10 +40,9 @@ DESCRIPTION */ int -_DEFUN (_fcntl_r, (ptr, fd, cmd, arg), - struct _reent *ptr _AND - int fd _AND - int cmd _AND +_fcntl_r (struct _reent *ptr, + int fd, + int cmd, int arg) { int ret; diff --git a/newlib/libc/reent/fstat64r.c b/newlib/libc/reent/fstat64r.c index 1c4589713..c546f5c1d 100644 --- a/newlib/libc/reent/fstat64r.c +++ b/newlib/libc/reent/fstat64r.c @@ -34,18 +34,11 @@ FUNCTION INDEX _fstat64_r -ANSI_SYNOPSIS +SYNOPSIS #include int _fstat64_r(struct _reent *<[ptr]>, int <[fd]>, struct stat64 *<[pstat]>); -TRAD_SYNOPSIS - #include - int _fstat64_r(<[ptr]>, <[fd]>, <[pstat]>) - struct _reent *<[ptr]>; - int <[fd]>; - struct stat *<[pstat]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -54,9 +47,8 @@ DESCRIPTION */ int -_DEFUN (_fstat64_r, (ptr, fd, pstat), - struct _reent *ptr _AND - int fd _AND +_fstat64_r (struct _reent *ptr, + int fd, struct stat64 *pstat) { int ret; diff --git a/newlib/libc/reent/fstatr.c b/newlib/libc/reent/fstatr.c index 7f5d559da..ec906c98d 100644 --- a/newlib/libc/reent/fstatr.c +++ b/newlib/libc/reent/fstatr.c @@ -32,18 +32,11 @@ FUNCTION INDEX _fstat_r -ANSI_SYNOPSIS +SYNOPSIS #include int _fstat_r(struct _reent *<[ptr]>, int <[fd]>, struct stat *<[pstat]>); -TRAD_SYNOPSIS - #include - int _fstat_r(<[ptr]>, <[fd]>, <[pstat]>) - struct _reent *<[ptr]>; - int <[fd]>; - struct stat *<[pstat]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds diff --git a/newlib/libc/reent/getreent.c b/newlib/libc/reent/getreent.c index 60ae6fbb7..5fa98e96b 100644 --- a/newlib/libc/reent/getreent.c +++ b/newlib/libc/reent/getreent.c @@ -1,5 +1,11 @@ /* default reentrant pointer when multithread enabled */ +#ifdef GETREENT_PROVIDED + +int _dummy_getreent; + +#else + #include <_ansi.h> #include @@ -8,7 +14,9 @@ #endif struct _reent * -_DEFUN_VOID(__getreent) +__getreent (void) { return _impure_ptr; } + +#endif diff --git a/newlib/libc/reent/gettimeofdayr.c b/newlib/libc/reent/gettimeofdayr.c index f5a49f73c..9b982a993 100644 --- a/newlib/libc/reent/gettimeofdayr.c +++ b/newlib/libc/reent/gettimeofdayr.c @@ -35,21 +35,13 @@ FUNCTION INDEX _gettimeofday_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int _gettimeofday_r(struct _reent *<[ptr]>, struct timeval *<[ptimeval]>, void *<[ptimezone]>); -TRAD_SYNOPSIS - #include - #include - int _gettimeofday_r(<[ptr]>, <[ptimeval]>, <[ptimezone]>) - struct _reent *<[ptr]>; - struct timeval *<[ptimeval]>; - void *<[ptimezone]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -60,9 +52,8 @@ DESCRIPTION */ int -_DEFUN (_gettimeofday_r, (ptr, ptimeval, ptimezone), - struct _reent *ptr _AND - struct timeval *ptimeval _AND +_gettimeofday_r (struct _reent *ptr, + struct timeval *ptimeval, void *ptimezone) { int ret; diff --git a/newlib/libc/reent/impure.c b/newlib/libc/reent/impure.c index f5918c88f..76f67459e 100644 --- a/newlib/libc/reent/impure.c +++ b/newlib/libc/reent/impure.c @@ -25,4 +25,4 @@ static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure extern struct _reent reent_data __attribute__ ((alias("impure_data"))); #endif struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data; -struct _reent *_CONST __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data; +struct _reent *const __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data; diff --git a/newlib/libc/reent/isattyr.c b/newlib/libc/reent/isattyr.c index 05d47d323..f21bf25b2 100644 --- a/newlib/libc/reent/isattyr.c +++ b/newlib/libc/reent/isattyr.c @@ -30,17 +30,11 @@ FUNCTION INDEX _isatty_r -ANSI_SYNOPSIS +SYNOPSIS #include int _isatty_r(struct _reent *<[ptr]>, int <[fd]>); -TRAD_SYNOPSIS - #include - int _isatty_r(<[ptr]>, <[fd]>) - struct _reent *<[ptr]>; - int <[fd]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds diff --git a/newlib/libc/reent/linkr.c b/newlib/libc/reent/linkr.c index ded636af7..b22da5f94 100644 --- a/newlib/libc/reent/linkr.c +++ b/newlib/libc/reent/linkr.c @@ -31,18 +31,11 @@ FUNCTION INDEX _link_r -ANSI_SYNOPSIS +SYNOPSIS #include int _link_r(struct _reent *<[ptr]>, const char *<[old]>, const char *<[new]>); -TRAD_SYNOPSIS - #include - int _link_r(<[ptr]>, <[old]>, <[new]>) - struct _reent *<[ptr]>; - char *<[old]>; - char *<[new]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -50,10 +43,9 @@ DESCRIPTION */ int -_DEFUN (_link_r, (ptr, old, new), - struct _reent *ptr _AND - _CONST char *old _AND - _CONST char *new) +_link_r (struct _reent *ptr, + const char *old, + const char *new) { int ret; diff --git a/newlib/libc/reent/lseek64r.c b/newlib/libc/reent/lseek64r.c index 0207a1220..40769fb6d 100644 --- a/newlib/libc/reent/lseek64r.c +++ b/newlib/libc/reent/lseek64r.c @@ -28,19 +28,11 @@ FUNCTION INDEX _lseek64_r -ANSI_SYNOPSIS +SYNOPSIS #include off64_t _lseek64_r(struct _reent *<[ptr]>, int <[fd]>, off64_t <[pos]>, int <[whence]>); -TRAD_SYNOPSIS - #include - off64_t _lseek64_r(<[ptr]>, <[fd]>, <[pos]>, <[whence]>) - struct _reent *<[ptr]>; - int <[fd]>; - off64_t <[pos]>; - int <[whence]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -49,10 +41,9 @@ DESCRIPTION */ _off64_t -_DEFUN (_lseek64_r, (ptr, fd, pos, whence), - struct _reent *ptr _AND - int fd _AND - _off64_t pos _AND +_lseek64_r (struct _reent *ptr, + int fd, + _off64_t pos, int whence) { _off64_t ret; diff --git a/newlib/libc/reent/lseekr.c b/newlib/libc/reent/lseekr.c index fa00695a8..ac2daaab9 100644 --- a/newlib/libc/reent/lseekr.c +++ b/newlib/libc/reent/lseekr.c @@ -26,19 +26,11 @@ FUNCTION INDEX _lseek_r -ANSI_SYNOPSIS +SYNOPSIS #include off_t _lseek_r(struct _reent *<[ptr]>, int <[fd]>, off_t <[pos]>, int <[whence]>); -TRAD_SYNOPSIS - #include - off_t _lseek_r(<[ptr]>, <[fd]>, <[pos]>, <[whence]>) - struct _reent *<[ptr]>; - int <[fd]>; - off_t <[pos]>; - int <[whence]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -46,10 +38,9 @@ DESCRIPTION */ _off_t -_DEFUN (_lseek_r, (ptr, fd, pos, whence), - struct _reent *ptr _AND - int fd _AND - _off_t pos _AND +_lseek_r (struct _reent *ptr, + int fd, + _off_t pos, int whence) { _off_t ret; diff --git a/newlib/libc/reent/mkdirr.c b/newlib/libc/reent/mkdirr.c index fe36de11a..fd72df64c 100644 --- a/newlib/libc/reent/mkdirr.c +++ b/newlib/libc/reent/mkdirr.c @@ -26,18 +26,11 @@ FUNCTION INDEX _mkdir_r -ANSI_SYNOPSIS +SYNOPSIS #include int _mkdir_r(struct _reent *<[ptr]>, const char *<[path]>, int <[mode]>); -TRAD_SYNOPSIS - #include - int _mkdir_r(<[ptr]>, <[path]>, <[mode]>) - struct _reent *<[ptr]>; - char *<[path]>; - int <[mode]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -47,9 +40,8 @@ DESCRIPTION #include int -_DEFUN (_mkdir_r, (ptr, path, mode), - struct _reent *ptr _AND - _CONST char *path _AND +_mkdir_r (struct _reent *ptr, + const char *path, int mode) { int ret; diff --git a/newlib/libc/reent/open64r.c b/newlib/libc/reent/open64r.c index 30310d301..84bd67e34 100644 --- a/newlib/libc/reent/open64r.c +++ b/newlib/libc/reent/open64r.c @@ -29,19 +29,11 @@ FUNCTION INDEX _open64_r -ANSI_SYNOPSIS +SYNOPSIS #include int _open64_r(struct _reent *<[ptr]>, const char *<[file]>, int <[flags]>, int <[mode]>); -TRAD_SYNOPSIS - #include - int _open64_r(<[ptr]>, <[file]>, <[flags]>, <[mode]>) - struct _reent *<[ptr]>; - char *<[file]>; - int <[flags]>; - int <[mode]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -52,7 +44,7 @@ DESCRIPTION int _open64_r (ptr, file, flags, mode) struct _reent *ptr; - _CONST char *file; + const char *file; int flags; int mode; { diff --git a/newlib/libc/reent/openr.c b/newlib/libc/reent/openr.c index 35138c6de..c6a7db5de 100644 --- a/newlib/libc/reent/openr.c +++ b/newlib/libc/reent/openr.c @@ -27,19 +27,11 @@ FUNCTION INDEX _open_r -ANSI_SYNOPSIS +SYNOPSIS #include int _open_r(struct _reent *<[ptr]>, const char *<[file]>, int <[flags]>, int <[mode]>); -TRAD_SYNOPSIS - #include - int _open_r(<[ptr]>, <[file]>, <[flags]>, <[mode]>) - struct _reent *<[ptr]>; - char *<[file]>; - int <[flags]>; - int <[mode]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -47,10 +39,9 @@ DESCRIPTION */ int -_DEFUN (_open_r, (ptr, file, flags, mode), - struct _reent *ptr _AND - _CONST char *file _AND - int flags _AND +_open_r (struct _reent *ptr, + const char *file, + int flags, int mode) { int ret; diff --git a/newlib/libc/reent/readr.c b/newlib/libc/reent/readr.c index 38c1d9e39..7fccefd32 100644 --- a/newlib/libc/reent/readr.c +++ b/newlib/libc/reent/readr.c @@ -26,19 +26,11 @@ FUNCTION INDEX _read_r -ANSI_SYNOPSIS +SYNOPSIS #include _ssize_t _read_r(struct _reent *<[ptr]>, int <[fd]>, void *<[buf]>, size_t <[cnt]>); -TRAD_SYNOPSIS - #include - _ssize_t _read_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>) - struct _reent *<[ptr]>; - int <[fd]>; - char *<[buf]>; - size_t <[cnt]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -46,10 +38,9 @@ DESCRIPTION */ _ssize_t -_DEFUN (_read_r, (ptr, fd, buf, cnt), - struct _reent *ptr _AND - int fd _AND - _PTR buf _AND +_read_r (struct _reent *ptr, + int fd, + void *buf, size_t cnt) { _ssize_t ret; diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c index b6c2abf02..7c57e2019 100644 --- a/newlib/libc/reent/reent.c +++ b/newlib/libc/reent/reent.c @@ -30,8 +30,7 @@ int errno; /* Interim cleanup code */ void -_DEFUN (cleanup_glue, (ptr, glue), - struct _reent *ptr _AND +cleanup_glue (struct _reent *ptr, struct _glue *glue) { /* Have to reclaim these in reverse order: */ @@ -42,8 +41,7 @@ _DEFUN (cleanup_glue, (ptr, glue), } void -_DEFUN (_reclaim_reent, (ptr), - struct _reent *ptr) +_reclaim_reent (struct _reent *ptr) { if (ptr != _impure_ptr) { diff --git a/newlib/libc/reent/renamer.c b/newlib/libc/reent/renamer.c index d3951a28d..5420dc4a0 100644 --- a/newlib/libc/reent/renamer.c +++ b/newlib/libc/reent/renamer.c @@ -28,18 +28,11 @@ FUNCTION INDEX _rename_r -ANSI_SYNOPSIS +SYNOPSIS #include int _rename_r(struct _reent *<[ptr]>, const char *<[old]>, const char *<[new]>); -TRAD_SYNOPSIS - #include - int _rename_r(<[ptr]>, <[old]>, <[new]>) - struct _reent *<[ptr]>; - char *<[old]>; - char *<[new]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -47,10 +40,9 @@ DESCRIPTION */ int -_DEFUN (_rename_r, (ptr, old, new), - struct _reent *ptr _AND - _CONST char *old _AND - _CONST char *new) +_rename_r (struct _reent *ptr, + const char *old, + const char *new) { int ret = 0; diff --git a/newlib/libc/reent/sbrkr.c b/newlib/libc/reent/sbrkr.c index 44e42b57f..21c4bd913 100644 --- a/newlib/libc/reent/sbrkr.c +++ b/newlib/libc/reent/sbrkr.c @@ -30,16 +30,10 @@ FUNCTION INDEX _sbrk_r -ANSI_SYNOPSIS +SYNOPSIS #include void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>); -TRAD_SYNOPSIS - #include - void *_sbrk_r(<[ptr]>, <[incr]>) - struct _reent *<[ptr]>; - ptrdiff_t <[incr]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -47,8 +41,7 @@ DESCRIPTION */ void * -_DEFUN (_sbrk_r, (ptr, incr), - struct _reent *ptr _AND +_sbrk_r (struct _reent *ptr, ptrdiff_t incr) { char *ret; diff --git a/newlib/libc/reent/signalr.c b/newlib/libc/reent/signalr.c index 161d53091..345910e4b 100644 --- a/newlib/libc/reent/signalr.c +++ b/newlib/libc/reent/signalr.c @@ -32,17 +32,10 @@ FUNCTION INDEX _kill_r -ANSI_SYNOPSIS +SYNOPSIS #include int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>); -TRAD_SYNOPSIS - #include - int _kill_r(<[ptr]>, <[pid]>, <[sig]>) - struct _reent *<[ptr]>; - int <[pid]>; - int <[sig]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -50,9 +43,8 @@ DESCRIPTION */ int -_DEFUN (_kill_r, (ptr, pid, sig), - struct _reent *ptr _AND - int pid _AND +_kill_r (struct _reent *ptr, + int pid, int sig) { int ret; @@ -71,15 +63,10 @@ FUNCTION INDEX _getpid_r -ANSI_SYNOPSIS +SYNOPSIS #include int _getpid_r(struct _reent *<[ptr]>); -TRAD_SYNOPSIS - #include - int _getpid_r(<[ptr]>) - struct _reent *<[ptr]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -90,8 +77,7 @@ DESCRIPTION */ int -_DEFUN (_getpid_r, (ptr), - struct _reent *ptr) +_getpid_r (struct _reent *ptr) { int ret; ret = _getpid (); diff --git a/newlib/libc/reent/signgam.c b/newlib/libc/reent/signgam.c index bfb2dea51..b1017d861 100644 --- a/newlib/libc/reent/signgam.c +++ b/newlib/libc/reent/signgam.c @@ -8,7 +8,7 @@ #ifndef _REENT_ONLY int * -_DEFUN_VOID (__signgam) +__signgam (void) { return &_REENT_SIGNGAM(_REENT); } diff --git a/newlib/libc/reent/stat64r.c b/newlib/libc/reent/stat64r.c index 695b7f813..b64736ef2 100644 --- a/newlib/libc/reent/stat64r.c +++ b/newlib/libc/reent/stat64r.c @@ -33,18 +33,11 @@ FUNCTION INDEX _stat64_r -ANSI_SYNOPSIS +SYNOPSIS #include int _stat64_r(struct _reent *<[ptr]>, const char *<[file]>, struct stat64 *<[pstat]>); -TRAD_SYNOPSIS - #include - int _stat64_r(<[ptr]>, <[file]>, <[pstat]>) - struct _reent *<[ptr]>; - char *<[file]>; - struct stat64 *<[pstat]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -52,9 +45,8 @@ DESCRIPTION */ int -_DEFUN (_stat64_r, (ptr, file, pstat), - struct _reent *ptr _AND - _CONST char *file _AND +_stat64_r (struct _reent *ptr, + const char *file, struct stat64 *pstat) { int ret; diff --git a/newlib/libc/reent/statr.c b/newlib/libc/reent/statr.c index 9ad2bb209..9388e0246 100644 --- a/newlib/libc/reent/statr.c +++ b/newlib/libc/reent/statr.c @@ -33,18 +33,11 @@ FUNCTION INDEX _stat_r -ANSI_SYNOPSIS +SYNOPSIS #include int _stat_r(struct _reent *<[ptr]>, const char *<[file]>, struct stat *<[pstat]>); -TRAD_SYNOPSIS - #include - int _stat_r(<[ptr]>, <[file]>, <[pstat]>) - struct _reent *<[ptr]>; - char *<[file]>; - struct stat *<[pstat]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -52,9 +45,8 @@ DESCRIPTION */ int -_DEFUN (_stat_r, (ptr, file, pstat), - struct _reent *ptr _AND - _CONST char *file _AND +_stat_r (struct _reent *ptr, + const char *file, struct stat *pstat) { int ret; diff --git a/newlib/libc/reent/timesr.c b/newlib/libc/reent/timesr.c index 1881724ba..bb890035a 100644 --- a/newlib/libc/reent/timesr.c +++ b/newlib/libc/reent/timesr.c @@ -32,18 +32,11 @@ FUNCTION INDEX _times_r -ANSI_SYNOPSIS +SYNOPSIS #include #include clock_t _times_r(struct _reent *<[ptr]>, struct tms *<[ptms]>); -TRAD_SYNOPSIS - #include - #include - clock_t _times_r(<[ptr]>, <[ptms]>) - struct _reent *<[ptr]>; - struct tms *<[ptms]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -51,8 +44,7 @@ DESCRIPTION */ clock_t -_DEFUN (_times_r, (ptr, ptms), - struct _reent *ptr _AND +_times_r (struct _reent *ptr, struct tms *ptms) { clock_t ret; diff --git a/newlib/libc/reent/unlinkr.c b/newlib/libc/reent/unlinkr.c index 95b815f1b..41bac0194 100644 --- a/newlib/libc/reent/unlinkr.c +++ b/newlib/libc/reent/unlinkr.c @@ -27,16 +27,10 @@ FUNCTION INDEX _unlink_r -ANSI_SYNOPSIS +SYNOPSIS #include int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>); -TRAD_SYNOPSIS - #include - int _unlink_r(<[ptr]>, <[file]>) - struct _reent *<[ptr]>; - char *<[file]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -44,9 +38,8 @@ DESCRIPTION */ int -_DEFUN (_unlink_r, (ptr, file), - struct _reent *ptr _AND - _CONST char *file) +_unlink_r (struct _reent *ptr, + const char *file) { int ret; diff --git a/newlib/libc/reent/writer.c b/newlib/libc/reent/writer.c index 128f7f7ac..704aba18b 100644 --- a/newlib/libc/reent/writer.c +++ b/newlib/libc/reent/writer.c @@ -26,19 +26,11 @@ FUNCTION INDEX _write_r -ANSI_SYNOPSIS +SYNOPSIS #include _ssize_t _write_r(struct _reent *<[ptr]>, int <[fd]>, const void *<[buf]>, size_t <[cnt]>); -TRAD_SYNOPSIS - #include - _ssize_t _write_r(<[ptr]>, <[fd]>, <[buf]>, <[cnt]>) - struct _reent *<[ptr]>; - int <[fd]>; - char *<[buf]>; - size_t <[cnt]>; - DESCRIPTION This is a reentrant version of <>. It takes a pointer to the global data block, which holds @@ -46,10 +38,9 @@ DESCRIPTION */ _ssize_t -_DEFUN (_write_r, (ptr, fd, buf, cnt), - struct _reent *ptr _AND - int fd _AND - _CONST _PTR buf _AND +_write_r (struct _reent *ptr, + int fd, + const void *buf, size_t cnt) { _ssize_t ret; diff --git a/newlib/libc/search/Makefile.in b/newlib/libc/search/Makefile.in index dc748c2b8..54f33e122 100644 --- a/newlib/libc/search/Makefile.in +++ b/newlib/libc/search/Makefile.in @@ -328,7 +328,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) all: all-am .SUFFIXES: @@ -685,8 +685,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/search/bsearch.c b/newlib/libc/search/bsearch.c index d874e79ae..29b787425 100644 --- a/newlib/libc/search/bsearch.c +++ b/newlib/libc/search/bsearch.c @@ -20,20 +20,12 @@ FUNCTION INDEX bsearch -ANSI_SYNOPSIS +SYNOPSIS #include void *bsearch(const void *<[key]>, const void *<[base]>, size_t <[nmemb]>, size_t <[size]>, int (*<[compar]>)(const void *, const void *)); -TRAD_SYNOPSIS - #include - char *bsearch(<[key]>, <[base]>, <[nmemb]>, <[size]>, <[compar]>) - char *<[key]>; - char *<[base]>; - size_t <[nmemb]>, <[size]>; - int (*<[compar]>)(); - DESCRIPTION <> searches an array beginning at <[base]> for any element that matches <[key]>, using binary search. <[nmemb]> is the element @@ -63,15 +55,14 @@ No supporting OS subroutines are required. #include -_PTR -_DEFUN (bsearch, (key, base, nmemb, size, compar), - _CONST _PTR key _AND - _CONST _PTR base _AND - size_t nmemb _AND - size_t size _AND - int _EXFNPTR(compar, (const _PTR, const _PTR))) +void * +bsearch (const void *key, + const void *base, + size_t nmemb, + size_t size, + int (*compar) (const void *, const void *)) { - _PTR current; + void *current; size_t lower = 0; size_t upper = nmemb; size_t index; @@ -83,7 +74,7 @@ _DEFUN (bsearch, (key, base, nmemb, size, compar), while (lower < upper) { index = (lower + upper) / 2; - current = (_PTR) (((char *) base) + (index * size)); + current = (void *) (((char *) base) + (index * size)); result = compar (key, current); diff --git a/newlib/libc/search/hash.c b/newlib/libc/search/hash.c index 5fea88a82..e409618af 100644 --- a/newlib/libc/search/hash.c +++ b/newlib/libc/search/hash.c @@ -104,11 +104,10 @@ int hash_accesses, hash_collisions, hash_expansions, hash_overflows; /* OPEN/CLOSE */ extern DB * -_DEFUN(__hash_open, (file, flags, mode, info, dflags), - const char *file _AND - int flags _AND - int mode _AND - int dflags _AND +__hash_open (const char *file, + int flags, + int mode, + int dflags, const HASHINFO *info) /* Special directives for create */ { HTAB *hashp; @@ -194,6 +193,9 @@ _DEFUN(__hash_open, (file, flags, mode, info, dflags), RETURN_ERROR(EFTYPE, error1); if (hashp->hash(CHARKEY, sizeof(CHARKEY)) != hashp->H_CHARKEY) RETURN_ERROR(EFTYPE, error1); + /* Check bucket size isn't too big for target int. */ + if (hashp->BSIZE > INT_MAX) + RETURN_ERROR(EFTYPE, error1); /* * Figure out how many segments we need. Max_Bucket is the * maximum bucket number, so the number of buckets is @@ -344,7 +346,7 @@ init_hash(hashp, file, info) if (stat(file, &statbuf)) #endif return (NULL); - hashp->BSIZE = statbuf.st_blksize; + hashp->BSIZE = MIN(statbuf.st_blksize, MAX_BSIZE); hashp->BSHIFT = __log2(hashp->BSIZE); } diff --git a/newlib/libc/search/hash.h b/newlib/libc/search/hash.h index 6491814d6..1b094d613 100644 --- a/newlib/libc/search/hash.h +++ b/newlib/libc/search/hash.h @@ -40,6 +40,7 @@ #include #define __need_size_t #include +#include /* Check that newlib understands the byte order of its target system. */ #ifndef BYTE_ORDER @@ -82,28 +83,28 @@ typedef BUFHEAD **SEGMENT; /* Hash Table Information */ typedef struct hashhdr { /* Disk resident portion */ - int magic; /* Magic NO for hash tables */ - int version; /* Version ID */ + int32_t magic; /* Magic NO for hash tables */ + int32_t version; /* Version ID */ __uint32_t lorder; /* Byte Order */ - int bsize; /* Bucket/Page Size */ - int bshift; /* Bucket shift */ - int dsize; /* Directory Size */ - int ssize; /* Segment Size */ - int sshift; /* Segment shift */ - int ovfl_point; /* Where overflow pages are being + int32_t bsize; /* Bucket/Page Size */ + int32_t bshift; /* Bucket shift */ + int32_t dsize; /* Directory Size */ + int32_t ssize; /* Segment Size */ + int32_t sshift; /* Segment shift */ + int32_t ovfl_point; /* Where overflow pages are being * allocated */ - int last_freed; /* Last overflow page freed */ - int max_bucket; /* ID of Maximum bucket in use */ - int high_mask; /* Mask to modulo into entire table */ - int low_mask; /* Mask to modulo into lower half of + int32_t last_freed; /* Last overflow page freed */ + int32_t max_bucket; /* ID of Maximum bucket in use */ + int32_t high_mask; /* Mask to modulo into entire table */ + int32_t low_mask; /* Mask to modulo into lower half of * table */ - int ffactor; /* Fill factor */ - int nkeys; /* Number of keys in hash table */ - int hdrpages; /* Size of table header */ - int h_charkey; /* value of hash(CHARKEY) */ + int32_t ffactor; /* Fill factor */ + int32_t nkeys; /* Number of keys in hash table */ + int32_t hdrpages; /* Size of table header */ + int32_t h_charkey; /* value of hash(CHARKEY) */ #define NCACHED 32 /* number of bit maps and spare * points */ - int spares[NCACHED];/* spare pages for overflow */ + int32_t spares[NCACHED];/* spare pages for overflow */ __uint16_t bitmaps[NCACHED]; /* address of overflow page * bitmaps */ } HASHHDR; @@ -120,7 +121,7 @@ typedef struct htab { /* Memory resident data structure */ char *tmp_buf; /* Temporary Buffer for BIG data */ char *tmp_key; /* Temporary Buffer for BIG keys */ BUFHEAD *cpage; /* Current page */ - int cbucket; /* Current bucket */ + int32_t cbucket; /* Current bucket */ int cndx; /* Index of next item on cpage */ int error; /* Error Number -- for DBM * compatibility */ @@ -140,10 +141,18 @@ typedef struct htab { /* Memory resident data structure */ /* * Constants */ +#if INT_MAX == 32767 +#define MAX_BSIZE 4096 +#else #define MAX_BSIZE 65536 /* 2^16 */ +#endif #define MIN_BUFFERS 6 #define MINHDRSIZE 512 +#if INT_MAX == 32767 +#define DEF_BUFSIZE 4096 +#else #define DEF_BUFSIZE 65536 /* 64 K */ +#endif #define DEF_BUCKET_SIZE 4096 #define DEF_BUCKET_SHIFT 12 /* log2(BUCKET) */ #define DEF_SEGSIZE 256 diff --git a/newlib/libc/search/hash_buf.c b/newlib/libc/search/hash_buf.c index d50fc5720..81475e9f7 100644 --- a/newlib/libc/search/hash_buf.c +++ b/newlib/libc/search/hash_buf.c @@ -151,7 +151,7 @@ __get_buf(hashp, addr, prev_bp, newpage) return (NULL); if (!prev_bp) segp[segment_ndx] = - (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask); + (BUFHEAD *)((ptrdiff_t)bp | (intptr_t)is_disk_mask); } else { BUF_REMOVE(bp); MRU_INSERT(bp); diff --git a/newlib/libc/search/hcreate.c b/newlib/libc/search/hcreate.c index b7be1cd6f..7664353cc 100644 --- a/newlib/libc/search/hcreate.c +++ b/newlib/libc/search/hcreate.c @@ -57,20 +57,19 @@ __RCSID("$NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $"); static struct hsearch_data htab; int -_DEFUN(hcreate, (nel), size_t nel) +hcreate (size_t nel) { return hcreate_r (nel, &htab); } void -_DEFUN_VOID (hdestroy) +hdestroy (void) { hdestroy_r (&htab); } ENTRY * -_DEFUN(hsearch, (item, action), - ENTRY item _AND +hsearch (ENTRY item, ACTION action) { ENTRY *retval; diff --git a/newlib/libc/search/qsort.c b/newlib/libc/search/qsort.c index bf6285f5e..b53400aa8 100644 --- a/newlib/libc/search/qsort.c +++ b/newlib/libc/search/qsort.c @@ -5,19 +5,11 @@ FUNCTION INDEX qsort -ANSI_SYNOPSIS +SYNOPSIS #include void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>, int (*<[compar]>)(const void *, const void *) ); -TRAD_SYNOPSIS - #include - qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> ) - char *<[base]>; - size_t <[nmemb]>; - size_t <[size]>; - int (*<[compar]>)(); - DESCRIPTION <> sorts an array (beginning at <[base]>) of <[nmemb]> objects. <[size]> describes the size of each element of the array. @@ -85,8 +77,8 @@ typedef int cmp_t(const void *, const void *, void *); #else typedef int cmp_t(const void *, const void *); #endif -static inline char *med3 _PARAMS((char *, char *, char *, cmp_t *, void *)); -static inline void swapfunc _PARAMS((char *, char *, int, int)); +static inline char *med3 (char *, char *, char *, cmp_t *, void *); +static inline void swapfunc (char *, char *, int, int); #define min(a, b) (a) < (b) ? a : b @@ -108,10 +100,9 @@ static inline void swapfunc _PARAMS((char *, char *, int, int)); es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; static inline void -_DEFUN(swapfunc, (a, b, n, swaptype), - char *a _AND - char *b _AND - int n _AND +swapfunc (char *a, + char *b, + int n, int swaptype) { if(swaptype <= 1) @@ -139,11 +130,10 @@ _DEFUN(swapfunc, (a, b, n, swaptype), #endif static inline char * -_DEFUN(med3, (a, b, c, cmp, thunk), - char *a _AND - char *b _AND - char *c _AND - cmp_t *cmp _AND +med3 (char *a, + char *b, + char *c, + cmp_t *cmp, void *thunk #if !defined(I_AM_QSORT_R) && !defined(I_AM_GNU_QSORT_R) __unused @@ -155,29 +145,42 @@ __unused :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); } +/* + * Classical function call recursion wastes a lot of stack space. Each + * recursion level requires a full stack frame comprising all local variables + * and additional space as dictated by the processor calling convention. + * + * This implementation instead stores the variables that are unique for each + * recursion level in a parameter stack array, and uses iteration to emulate + * recursion. Function call recursion is not used until the array is full. + * + * To ensure the stack consumption isn't worsened by this design, the size of + * the parameter stack array is chosen to be similar to the stack frame + * excluding the array. Each function call recursion level can handle this + * number of iterative recursion levels. + */ +#define PARAMETER_STACK_LEVELS 8u + #if defined(I_AM_QSORT_R) void -_DEFUN(__bsd_qsort_r, (a, n, es, thunk, cmp), - void *a _AND - size_t n _AND - size_t es _AND - void *thunk _AND +__bsd_qsort_r (void *a, + size_t n, + size_t es, + void *thunk, cmp_t *cmp) #elif defined(I_AM_GNU_QSORT_R) void -_DEFUN(qsort_r, (a, n, es, cmp, thunk), - void *a _AND - size_t n _AND - size_t es _AND - cmp_t *cmp _AND +qsort_r (void *a, + size_t n, + size_t es, + cmp_t *cmp, void *thunk) #else #define thunk NULL void -_DEFUN(qsort, (a, n, es, cmp), - void *a _AND - size_t n _AND - size_t es _AND +qsort (void *a, + size_t n, + size_t es, cmp_t *cmp) #endif { @@ -185,16 +188,21 @@ _DEFUN(qsort, (a, n, es, cmp), size_t d, r; int cmp_result; int swaptype, swap_cnt; + size_t recursion_level = 0; + struct { void *a; size_t n; } parameter_stack[PARAMETER_STACK_LEVELS]; -loop: SWAPINIT(a, es); - swap_cnt = 0; + SWAPINIT(a, es); +loop: swap_cnt = 0; if (n < 7) { + /* Short arrays are insertion sorted. */ for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) for (pl = pm; pl > (char *) a && CMP(thunk, pl - es, pl) > 0; pl -= es) swap(pl, pl - es); - return; + goto pop; } + + /* Select a pivot element, move it to the left. */ pm = (char *) a + (n / 2) * es; if (n > 7) { pl = a; @@ -208,11 +216,17 @@ loop: SWAPINIT(a, es); pm = med3(pl, pm, pn, cmp, thunk); } swap(a, pm); - pa = pb = (char *) a + es; + /* + * Sort the array relative the pivot in four ranges as follows: + * { elems == pivot, elems < pivot, elems > pivot, elems == pivot } + */ + pa = pb = (char *) a + es; pc = pd = (char *) a + (n - 1) * es; for (;;) { + /* Scan left to right stopping at first element > pivot. */ while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) { + /* Move elements == pivot to the left (to pa) */ if (cmp_result == 0) { swap_cnt = 1; swap(pa, pb); @@ -220,7 +234,9 @@ loop: SWAPINIT(a, es); } pb += es; } + /* Scan right to left stopping at first element < pivot. */ while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) { + /* Move elements == pivot to the right (to pd) */ if (cmp_result == 0) { swap_cnt = 1; swap(pc, pd); @@ -230,6 +246,7 @@ loop: SWAPINIT(a, es); } if (pb > pc) break; + /* The scan has found two elements to swap with each other. */ swap(pb, pc); swap_cnt = 1; pb += es; @@ -240,27 +257,89 @@ loop: SWAPINIT(a, es); for (pl = pm; pl > (char *) a && CMP(thunk, pl - es, pl) > 0; pl -= es) swap(pl, pl - es); - return; + goto pop; } + /* + * Rearrange the array in three parts sorted like this: + * { elements < pivot, elements == pivot, elements > pivot } + */ pn = (char *) a + n * es; r = min(pa - (char *)a, pb - pa); vecswap(a, pb - r, r); r = min(pd - pc, pn - pd - es); vecswap(pb, pn - r, r); - if ((r = pb - pa) > es) + d = pb - pa; /* d = Size of left part. */ + r = pd - pc; /* r = Size of right part. */ + pn -= r; /* pn = Base of right part. */ + + /* + * Check which of the left and right parts are larger. + * Set (a, n) to (base, size) of the larger part. + * Set (pa, r) to (base, size) of the smaller part. + */ + if (r > d) { /* Right part is the larger part */ + pa = a; + a = pn; + n = r; + r = d; + } + else { /* Left part is the larger part, or both are equal. */ + pa = pn; + n = d; + } + + /* + * The left and right parts each need further sorting if they + * contain two elements or more. If both need sorting we use + * recursion to sort the smaller part and save the larger part + * to be sorted by iteration after the recursion. + * Using recursion only for the smaller part guarantees a + * recursion depth that is bounded to be less than (log2(n)). + */ + if (r > es) { /* Smaller part > 1 element. Both parts need sorting. */ + if (recursion_level < PARAMETER_STACK_LEVELS) { + /* + * The smaller part needs to be recursively sorted + * before the larger part is sorted. To avoid function + * call recursion the parameters for the larger part + * are pushed on the parameter_stack array. The smaller + * part is sorted using iteration and the larger part + * will be sorted when the parameter_stack is popped + * after the smaller part has been sorted. + */ + parameter_stack[recursion_level].a = a; + parameter_stack[recursion_level].n = n / es; + recursion_level++; + a = pa; + n = r / es; + goto loop; + } + else { + /* + * The parameter_stack array is full. The smaller part + * is sorted using function call recursion. The larger + * part will be sorted after the function call returns. + */ #if defined(I_AM_QSORT_R) - __bsd_qsort_r(a, r / es, es, thunk, cmp); + __bsd_qsort_r(pa, r / es, es, thunk, cmp); #elif defined(I_AM_GNU_QSORT_R) - qsort_r(a, r / es, es, cmp, thunk); + qsort_r(pa, r / es, es, cmp, thunk); #else - qsort(a, r / es, es, cmp); + qsort(pa, r / es, es, cmp); #endif - if ((r = pd - pc) > es) { - /* Iterate rather than recurse to save stack space */ - a = pn - r; - n = r / es; + } + } + if (n > es) { /* The larger part needs sorting. Iterate to sort. */ + n = n / es; + goto loop; + } + /* Both left and right parts are one element or less - level done. */ +pop: + if (recursion_level != 0) { + recursion_level--; + a = parameter_stack[recursion_level].a; + n = parameter_stack[recursion_level].n; goto loop; } -/* qsort(pn - r, r / es, es, cmp);*/ } diff --git a/newlib/libc/search/qsort_r.c b/newlib/libc/search/qsort_r.c index 9073061f0..c4b6fb7e2 100644 --- a/newlib/libc/search/qsort_r.c +++ b/newlib/libc/search/qsort_r.c @@ -5,7 +5,7 @@ FUNCTION INDEX qsort_r -ANSI_SYNOPSIS +SYNOPSIS #define _BSD_SOURCE #include void qsort_r(void *<[base]>, size_t <[nmemb]>, size_t <[size]>, @@ -18,15 +18,6 @@ ANSI_SYNOPSIS int (*<[compar]>)(const void *, const void *, void *), void *<[thunk]>); -TRAD_SYNOPSIS - #include - qsort_r(<[base]>, <[nmemb]>, <[size]>, <[compar]>, <[thumb]>) - char *<[base]>; - size_t <[nmemb]>; - size_t <[size]>; - int (*<[compar]>)(); - char *<[thumb]>; - DESCRIPTION <> sorts an array (beginning at <[base]>) of <[nmemb]> objects. <[size]> describes the size of each element of the array. diff --git a/newlib/libc/search/tdelete.c b/newlib/libc/search/tdelete.c index b607b5421..a595200db 100644 --- a/newlib/libc/search/tdelete.c +++ b/newlib/libc/search/tdelete.c @@ -26,9 +26,8 @@ __RCSID("$NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $"); /* delete node with given key */ void * -_DEFUN(tdelete, (vkey, vrootp, compar), - const void *__restrict vkey _AND /* key to be deleted */ - void **__restrict vrootp _AND /* address of the root of tree */ +tdelete (const void *__restrict vkey, /* key to be deleted */ + void **__restrict vrootp, /* address of the root of tree */ int (*compar)(const void *, const void *)) { node_t **rootp = (node_t **)vrootp; diff --git a/newlib/libc/search/tdestroy.c b/newlib/libc/search/tdestroy.c index 3e7327c4d..04c6b7052 100644 --- a/newlib/libc/search/tdestroy.c +++ b/newlib/libc/search/tdestroy.c @@ -40,8 +40,7 @@ trecurse(root, free_action) } void -_DEFUN(tdestroy, (vrootp, freefct), - void *vrootp _AND +tdestroy (void *vrootp, void (*freefct)(void *)) { node_t *root = (node_t *) vrootp; diff --git a/newlib/libc/search/tfind.c b/newlib/libc/search/tfind.c index 5d7c40c93..670f41fca 100644 --- a/newlib/libc/search/tfind.c +++ b/newlib/libc/search/tfind.c @@ -25,9 +25,8 @@ __RCSID("$NetBSD: tfind.c,v 1.2 1999/09/16 11:45:37 lukem Exp $"); /* find a node, or return 0 */ void * -_DEFUN(tfind, (vkey, vrootp, compar), - const void *vkey _AND /* key to be found */ - void **vrootp _AND /* address of the tree root */ +tfind (const void *vkey, /* key to be found */ + void **vrootp, /* address of the tree root */ int (*compar)(const void *, const void *)) { node_t **rootp = (node_t **)vrootp; diff --git a/newlib/libc/search/tsearch.c b/newlib/libc/search/tsearch.c index 5f41b407d..82d69447f 100644 --- a/newlib/libc/search/tsearch.c +++ b/newlib/libc/search/tsearch.c @@ -25,9 +25,8 @@ __RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $"); /* find or insert datum into search tree */ void * -_DEFUN(tsearch, (vkey, vrootp, compar), - const void *vkey _AND /* key to be located */ - void **vrootp _AND /* address of tree root */ +tsearch (const void *vkey, /* key to be located */ + void **vrootp, /* address of tree root */ int (*compar)(const void *, const void *)) { node_t *q; diff --git a/newlib/libc/search/twalk.c b/newlib/libc/search/twalk.c index 74ad5a615..02ef52242 100644 --- a/newlib/libc/search/twalk.c +++ b/newlib/libc/search/twalk.c @@ -49,8 +49,7 @@ trecurse(root, action, level) /* Walk the nodes of a tree */ void -_DEFUN(twalk, (vroot, action), - const void *vroot _AND /* Root of the tree to be walked */ +twalk (const void *vroot, /* Root of the tree to be walked */ void (*action)(const void *, VISIT, int)) { if (vroot != NULL && action != NULL) diff --git a/newlib/libc/signal/Makefile.in b/newlib/libc/signal/Makefile.in index ad5bddc0e..2f89f73d1 100644 --- a/newlib/libc/signal/Makefile.in +++ b/newlib/libc/signal/Makefile.in @@ -270,7 +270,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = psignal.def raise.def signal.def CHAPTERS = signal.tex all: all-am @@ -545,8 +545,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/signal/psignal.c b/newlib/libc/signal/psignal.c index 4638518da..f847ab2c8 100644 --- a/newlib/libc/signal/psignal.c +++ b/newlib/libc/signal/psignal.c @@ -6,16 +6,10 @@ FUNCTION INDEX psignal -ANSI_SYNOPSIS +SYNOPSIS #include void psignal(int <[signal]>, const char *<[prefix]>); -TRAD_SYNOPSIS - #include - void psignal(<[signal]>, <[prefix]>) - int <[signal]>; - const char *<[prefix]>; - DESCRIPTION Use <> to print (on standard error) a signal message corresponding to the value of the signal number <[signal]>. @@ -38,14 +32,37 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include +#include -_VOID -_DEFUN(psignal, (sig, s), - int sig _AND - _CONST char *s) -{ - if (s != NULL && *s != '\0') - fprintf (stderr, "%s: %s\n", s, strsignal (sig)); - else - fprintf (stderr, "%s\n", strsignal (sig)); +#define WRITE_STR(str) \ +{ \ + const char *p = (str); \ + size_t len = strlen (p); \ + while (len) \ + { \ + ssize_t len1 = write (fileno (stderr), p, len); \ + if (len1 < 0) \ + break; \ + len -= len1; \ + p += len1; \ + } \ +} + +void +psignal (int sig, + const char *s) +{ + fflush (stderr); + if (s != NULL && *s != '\0') + { + WRITE_STR (s); + WRITE_STR (": "); + } + WRITE_STR (strsignal (sig)); + +#ifdef __SCLE + WRITE_STR ((stderr->_flags & __SCLE) ? "\r\n" : "\n"); +#else + WRITE_STR ("\n"); +#endif } diff --git a/newlib/libc/signal/raise.c b/newlib/libc/signal/raise.c index bc47864e8..c678c6e2d 100644 --- a/newlib/libc/signal/raise.c +++ b/newlib/libc/signal/raise.c @@ -12,21 +12,12 @@ INDEX INDEX _raise_r -ANSI_SYNOPSIS +SYNOPSIS #include int raise(int <[sig]>); int _raise_r(void *<[reent]>, int <[sig]>); -TRAD_SYNOPSIS - #include - int raise(<[sig]>) - int <[sig]>; - - int _raise_r(<[reent]>, <[sig]>) - char *<[reent]>; - int <[sig]>; - DESCRIPTION Send the signal <[sig]> (one of the macros from `<>'). This interrupts your program's normal flow of execution, and allows a signal @@ -61,8 +52,7 @@ int _dummy_raise; #ifndef _REENT_ONLY int -_DEFUN (raise, (sig), - int sig) +raise (int sig) { return _raise_r (_REENT, sig); } @@ -70,8 +60,7 @@ _DEFUN (raise, (sig), #endif int -_DEFUN (_raise_r, (reent, sig), - struct _reent *reent _AND +_raise_r (struct _reent *reent, int sig) { return _kill_r (reent, _getpid_r (reent), sig); diff --git a/newlib/libc/signal/signal.c b/newlib/libc/signal/signal.c index 183004725..0110287d8 100644 --- a/newlib/libc/signal/signal.c +++ b/newlib/libc/signal/signal.c @@ -7,23 +7,12 @@ INDEX INDEX _signal_r -ANSI_SYNOPSIS +SYNOPSIS #include void (*signal(int <[sig]>, void(*<[func]>)(int))) (int); void (*_signal_r(void *<[reent]>, int <[sig]>, void(*<[func]>)(int))) (int); -TRAD_SYNOPSIS - #include - char ( * signal(<[sig]>, <[func]>) )() - int <[sig]>; - char ( * <[func]> )(); - - char ( * _signal_r(<[reent]>, <[sig]>, <[func]>) )() - char *<[reent]>; - int <[sig]>; - char ( * <[func]> )(); - DESCRIPTION <> provides a simple signal-handling implementation for embedded targets. @@ -100,8 +89,7 @@ int _dummy_simulated_signal; #include <_syslist.h> int -_DEFUN (_init_signal_r, (ptr), - struct _reent *ptr) +_init_signal_r (struct _reent *ptr) { int i; @@ -119,9 +107,8 @@ _DEFUN (_init_signal_r, (ptr), } _sig_func_ptr -_DEFUN (_signal_r, (ptr, sig, func), - struct _reent *ptr _AND - int sig _AND +_signal_r (struct _reent *ptr, + int sig, _sig_func_ptr func) { _sig_func_ptr old_func; @@ -142,8 +129,7 @@ _DEFUN (_signal_r, (ptr, sig, func), } int -_DEFUN (_raise_r, (ptr, sig), - struct _reent *ptr _AND +_raise_r (struct _reent *ptr, int sig) { _sig_func_ptr func; @@ -177,8 +163,7 @@ _DEFUN (_raise_r, (ptr, sig), } int -_DEFUN (__sigtramp_r, (ptr, sig), - struct _reent *ptr _AND +__sigtramp_r (struct _reent *ptr, int sig) { _sig_func_ptr func; @@ -209,28 +194,26 @@ _DEFUN (__sigtramp_r, (ptr, sig), #ifndef _REENT_ONLY int -_DEFUN (raise, (sig), - int sig) +raise (int sig) { return _raise_r (_REENT, sig); } _sig_func_ptr -_DEFUN (signal, (sig, func), - int sig _AND +signal (int sig, _sig_func_ptr func) { return _signal_r (_REENT, sig, func); } int -_DEFUN_VOID (_init_signal) +_init_signal (void) { return _init_signal_r (_REENT); } int -_DEFUN (__sigtramp, (sig), int sig) +__sigtramp (int sig) { return __sigtramp_r (_REENT, sig); } diff --git a/newlib/libc/ssp/Makefile.am b/newlib/libc/ssp/Makefile.am new file mode 100644 index 000000000..23754baf5 --- /dev/null +++ b/newlib/libc/ssp/Makefile.am @@ -0,0 +1,69 @@ +## Process this file with automake to generate Makefile.in + +AUTOMAKE_OPTIONS = cygnus + +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +GENERAL_SOURCES = \ + chk_fail.c \ + stack_protector.c + +STRING_SOURCES = \ + memcpy_chk.c \ + memmove_chk.c \ + mempcpy_chk.c \ + memset_chk.c \ + stpcpy_chk.c \ + stpncpy_chk.c \ + strcat_chk.c \ + strcpy_chk.c \ + strncat_chk.c \ + strncpy_chk.c + +STDIO_SOURCES = \ + gets_chk.c \ + snprintf_chk.c \ + sprintf_chk.c \ + vsnprintf_chk.c \ + vsprintf_chk.c + +## None of these functions are specified by EL/IX +if ELIX_LEVEL_1 +ELIX_SOURCES = +else +if ELIX_LEVEL_2 +ELIX_SOURCES = +else +if ELIX_LEVEL_3 +ELIX_SOURCES = +else +if ELIX_LEVEL_4 +ELIX_SOURCES = +else +if HAVE_STDIO_DIR +ELIX_SOURCES = $(GENERAL_SOURCES) $(STRING_SOURCES) $(STDIO_SOURCES) +else +ELIX_SOURCES = $(GENERAL_SOURCES) $(STRING_SOURCES) +endif +endif +endif +endif +endif + +libssp_la_LDFLAGS = -Xcompiler -nostdlib + +if USE_LIBTOOL +noinst_LTLIBRARIES = libssp.la +libssp_la_SOURCES = $(ELIX_SOURCES) +noinst_DATA = objectlist.awk.in +else +noinst_LIBRARIES = lib.a +lib_a_SOURCES = $(ELIX_SOURCES) +lib_a_CFLAGS = $(AM_CFLAGS) +noinst_DATA = +endif # USE_LIBTOOL + +CHEWOUT_FILES = +CHAPTERS = ssp.tex + +include $(srcdir)/../../Makefile.shared diff --git a/newlib/libc/ssp/Makefile.in b/newlib/libc/ssp/Makefile.in new file mode 100644 index 000000000..8de2d36c6 --- /dev/null +++ b/newlib/libc/ssp/Makefile.in @@ -0,0 +1,706 @@ +# Makefile.in generated by automake 1.11.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am +subdir = ssp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ + $(top_srcdir)/../../ltoptions.m4 \ + $(top_srcdir)/../../ltsugar.m4 \ + $(top_srcdir)/../../ltversion.m4 \ + $(top_srcdir)/../../lt~obsolete.m4 \ + $(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +lib_a_AR = $(AR) $(ARFLAGS) +lib_a_LIBADD = +am__objects_1 = lib_a-chk_fail.$(OBJEXT) \ + lib_a-stack_protector.$(OBJEXT) +am__objects_2 = lib_a-memcpy_chk.$(OBJEXT) lib_a-memmove_chk.$(OBJEXT) \ + lib_a-mempcpy_chk.$(OBJEXT) lib_a-memset_chk.$(OBJEXT) \ + lib_a-stpcpy_chk.$(OBJEXT) lib_a-stpncpy_chk.$(OBJEXT) \ + lib_a-strcat_chk.$(OBJEXT) lib_a-strcpy_chk.$(OBJEXT) \ + lib_a-strncat_chk.$(OBJEXT) lib_a-strncpy_chk.$(OBJEXT) +am__objects_3 = lib_a-gets_chk.$(OBJEXT) lib_a-snprintf_chk.$(OBJEXT) \ + lib_a-sprintf_chk.$(OBJEXT) lib_a-vsnprintf_chk.$(OBJEXT) \ + lib_a-vsprintf_chk.$(OBJEXT) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@am__objects_4 = $(am__objects_1) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@ $(am__objects_2) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@am__objects_4 = $(am__objects_1) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@ $(am__objects_2) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@ $(am__objects_3) +@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_4) +lib_a_OBJECTS = $(am_lib_a_OBJECTS) +LTLIBRARIES = $(noinst_LTLIBRARIES) +libssp_la_LIBADD = +am__objects_5 = chk_fail.lo stack_protector.lo +am__objects_6 = memcpy_chk.lo memmove_chk.lo mempcpy_chk.lo \ + memset_chk.lo stpcpy_chk.lo stpncpy_chk.lo strcat_chk.lo \ + strcpy_chk.lo strncat_chk.lo strncpy_chk.lo +am__objects_7 = gets_chk.lo snprintf_chk.lo sprintf_chk.lo \ + vsnprintf_chk.lo vsprintf_chk.lo +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@am__objects_8 = $(am__objects_5) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@ $(am__objects_6) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@am__objects_8 = $(am__objects_5) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@ $(am__objects_6) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@ $(am__objects_7) +@USE_LIBTOOL_TRUE@am_libssp_la_OBJECTS = $(am__objects_8) +libssp_la_OBJECTS = $(am_libssp_la_OBJECTS) +libssp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libssp_la_LDFLAGS) $(LDFLAGS) -o $@ +@USE_LIBTOOL_TRUE@am_libssp_la_rpath = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(lib_a_SOURCES) $(libssp_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(noinst_DATA) +ETAGS = etags +CTAGS = ctags +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CRT0 = @CRT0@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@ +LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@ +LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ +LIBC_POSIX_DEF = @LIBC_POSIX_DEF@ +LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ +LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ +LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@ +LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@ +LIBC_STDIO_DEF = @LIBC_STDIO_DEF@ +LIBC_STDIO_LIB = @LIBC_STDIO_LIB@ +LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ +LIBC_SYS_LIB = @LIBC_SYS_LIB@ +LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ +LIBC_XDR_DEF = @LIBC_XDR_DEF@ +LIBC_XDR_LIB = @LIBC_XDR_LIB@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NO_INCLUDE_LIST = @NO_INCLUDE_LIST@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +READELF = @READELF@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +aext = @aext@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +extra_dir = @extra_dir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libm_machine_dir = @libm_machine_dir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lpfx = @lpfx@ +machine_dir = @machine_dir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +newlib_basedir = @newlib_basedir@ +oext = @oext@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sys_dir = @sys_dir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = cygnus +INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) +GENERAL_SOURCES = \ + chk_fail.c \ + stack_protector.c + +STRING_SOURCES = \ + memcpy_chk.c \ + memmove_chk.c \ + mempcpy_chk.c \ + memset_chk.c \ + stpcpy_chk.c \ + stpncpy_chk.c \ + strcat_chk.c \ + strcpy_chk.c \ + strncat_chk.c \ + strncpy_chk.c + +STDIO_SOURCES = \ + gets_chk.c \ + snprintf_chk.c \ + sprintf_chk.c \ + vsnprintf_chk.c \ + vsprintf_chk.c + +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_FALSE@ELIX_SOURCES = $(GENERAL_SOURCES) $(STRING_SOURCES) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_FALSE@@HAVE_STDIO_DIR_TRUE@ELIX_SOURCES = $(GENERAL_SOURCES) $(STRING_SOURCES) $(STDIO_SOURCES) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@@ELIX_LEVEL_4_TRUE@ELIX_SOURCES = +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_SOURCES = +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_SOURCES = +@ELIX_LEVEL_1_TRUE@ELIX_SOURCES = +libssp_la_LDFLAGS = -Xcompiler -nostdlib +@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libssp.la +@USE_LIBTOOL_TRUE@libssp_la_SOURCES = $(ELIX_SOURCES) +@USE_LIBTOOL_FALSE@noinst_DATA = +@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in +@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a +@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(ELIX_SOURCES) +@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS) +CHEWOUT_FILES = +CHAPTERS = ssp.tex + +# +# documentation rules +# +SUFFIXES = .def .xml +CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str +DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py +DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) +DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) +all: all-am + +.SUFFIXES: +.SUFFIXES: .def .xml .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus ssp/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --cygnus ssp/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/../../Makefile.shared: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) + -rm -f lib.a + $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) + $(RANLIB) lib.a + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libssp.la: $(libssp_la_OBJECTS) $(libssp_la_DEPENDENCIES) $(EXTRA_libssp_la_DEPENDENCIES) + $(libssp_la_LINK) $(am_libssp_la_rpath) $(libssp_la_OBJECTS) $(libssp_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -c -o $@ $< + +lib_a-chk_fail.o: chk_fail.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-chk_fail.o `test -f 'chk_fail.c' || echo '$(srcdir)/'`chk_fail.c + +lib_a-chk_fail.obj: chk_fail.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-chk_fail.obj `if test -f 'chk_fail.c'; then $(CYGPATH_W) 'chk_fail.c'; else $(CYGPATH_W) '$(srcdir)/chk_fail.c'; fi` + +lib_a-stack_protector.o: stack_protector.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stack_protector.o `test -f 'stack_protector.c' || echo '$(srcdir)/'`stack_protector.c + +lib_a-stack_protector.obj: stack_protector.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stack_protector.obj `if test -f 'stack_protector.c'; then $(CYGPATH_W) 'stack_protector.c'; else $(CYGPATH_W) '$(srcdir)/stack_protector.c'; fi` + +lib_a-memcpy_chk.o: memcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy_chk.o `test -f 'memcpy_chk.c' || echo '$(srcdir)/'`memcpy_chk.c + +lib_a-memcpy_chk.obj: memcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy_chk.obj `if test -f 'memcpy_chk.c'; then $(CYGPATH_W) 'memcpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/memcpy_chk.c'; fi` + +lib_a-memmove_chk.o: memmove_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove_chk.o `test -f 'memmove_chk.c' || echo '$(srcdir)/'`memmove_chk.c + +lib_a-memmove_chk.obj: memmove_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove_chk.obj `if test -f 'memmove_chk.c'; then $(CYGPATH_W) 'memmove_chk.c'; else $(CYGPATH_W) '$(srcdir)/memmove_chk.c'; fi` + +lib_a-mempcpy_chk.o: mempcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mempcpy_chk.o `test -f 'mempcpy_chk.c' || echo '$(srcdir)/'`mempcpy_chk.c + +lib_a-mempcpy_chk.obj: mempcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mempcpy_chk.obj `if test -f 'mempcpy_chk.c'; then $(CYGPATH_W) 'mempcpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/mempcpy_chk.c'; fi` + +lib_a-memset_chk.o: memset_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset_chk.o `test -f 'memset_chk.c' || echo '$(srcdir)/'`memset_chk.c + +lib_a-memset_chk.obj: memset_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset_chk.obj `if test -f 'memset_chk.c'; then $(CYGPATH_W) 'memset_chk.c'; else $(CYGPATH_W) '$(srcdir)/memset_chk.c'; fi` + +lib_a-stpcpy_chk.o: stpcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpcpy_chk.o `test -f 'stpcpy_chk.c' || echo '$(srcdir)/'`stpcpy_chk.c + +lib_a-stpcpy_chk.obj: stpcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpcpy_chk.obj `if test -f 'stpcpy_chk.c'; then $(CYGPATH_W) 'stpcpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/stpcpy_chk.c'; fi` + +lib_a-stpncpy_chk.o: stpncpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpncpy_chk.o `test -f 'stpncpy_chk.c' || echo '$(srcdir)/'`stpncpy_chk.c + +lib_a-stpncpy_chk.obj: stpncpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpncpy_chk.obj `if test -f 'stpncpy_chk.c'; then $(CYGPATH_W) 'stpncpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/stpncpy_chk.c'; fi` + +lib_a-strcat_chk.o: strcat_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcat_chk.o `test -f 'strcat_chk.c' || echo '$(srcdir)/'`strcat_chk.c + +lib_a-strcat_chk.obj: strcat_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcat_chk.obj `if test -f 'strcat_chk.c'; then $(CYGPATH_W) 'strcat_chk.c'; else $(CYGPATH_W) '$(srcdir)/strcat_chk.c'; fi` + +lib_a-strcpy_chk.o: strcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcpy_chk.o `test -f 'strcpy_chk.c' || echo '$(srcdir)/'`strcpy_chk.c + +lib_a-strcpy_chk.obj: strcpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcpy_chk.obj `if test -f 'strcpy_chk.c'; then $(CYGPATH_W) 'strcpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/strcpy_chk.c'; fi` + +lib_a-strncat_chk.o: strncat_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncat_chk.o `test -f 'strncat_chk.c' || echo '$(srcdir)/'`strncat_chk.c + +lib_a-strncat_chk.obj: strncat_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncat_chk.obj `if test -f 'strncat_chk.c'; then $(CYGPATH_W) 'strncat_chk.c'; else $(CYGPATH_W) '$(srcdir)/strncat_chk.c'; fi` + +lib_a-strncpy_chk.o: strncpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncpy_chk.o `test -f 'strncpy_chk.c' || echo '$(srcdir)/'`strncpy_chk.c + +lib_a-strncpy_chk.obj: strncpy_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncpy_chk.obj `if test -f 'strncpy_chk.c'; then $(CYGPATH_W) 'strncpy_chk.c'; else $(CYGPATH_W) '$(srcdir)/strncpy_chk.c'; fi` + +lib_a-gets_chk.o: gets_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets_chk.o `test -f 'gets_chk.c' || echo '$(srcdir)/'`gets_chk.c + +lib_a-gets_chk.obj: gets_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets_chk.obj `if test -f 'gets_chk.c'; then $(CYGPATH_W) 'gets_chk.c'; else $(CYGPATH_W) '$(srcdir)/gets_chk.c'; fi` + +lib_a-snprintf_chk.o: snprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-snprintf_chk.o `test -f 'snprintf_chk.c' || echo '$(srcdir)/'`snprintf_chk.c + +lib_a-snprintf_chk.obj: snprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-snprintf_chk.obj `if test -f 'snprintf_chk.c'; then $(CYGPATH_W) 'snprintf_chk.c'; else $(CYGPATH_W) '$(srcdir)/snprintf_chk.c'; fi` + +lib_a-sprintf_chk.o: sprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sprintf_chk.o `test -f 'sprintf_chk.c' || echo '$(srcdir)/'`sprintf_chk.c + +lib_a-sprintf_chk.obj: sprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sprintf_chk.obj `if test -f 'sprintf_chk.c'; then $(CYGPATH_W) 'sprintf_chk.c'; else $(CYGPATH_W) '$(srcdir)/sprintf_chk.c'; fi` + +lib_a-vsnprintf_chk.o: vsnprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf_chk.o `test -f 'vsnprintf_chk.c' || echo '$(srcdir)/'`vsnprintf_chk.c + +lib_a-vsnprintf_chk.obj: vsnprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsnprintf_chk.obj `if test -f 'vsnprintf_chk.c'; then $(CYGPATH_W) 'vsnprintf_chk.c'; else $(CYGPATH_W) '$(srcdir)/vsnprintf_chk.c'; fi` + +lib_a-vsprintf_chk.o: vsprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsprintf_chk.o `test -f 'vsprintf_chk.c' || echo '$(srcdir)/'`vsprintf_chk.c + +lib_a-vsprintf_chk.obj: vsprintf_chk.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsprintf_chk.obj `if test -f 'vsprintf_chk.c'; then $(CYGPATH_W) 'vsprintf_chk.c'; else $(CYGPATH_W) '$(srcdir)/vsprintf_chk.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-am: +check: check-am +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + +objectlist.awk.in: $(noinst_LTLIBRARIES) + -rm -f objectlist.awk.in + for i in `ls *.lo` ; \ + do \ + echo $$i `pwd`/$$i >> objectlist.awk.in ; \ + done + +.c.def: + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def + +TARGETDOC ?= ../tmp.texi + +doc: $(CHEWOUT_FILES) + for chapter in $(CHAPTERS) ; \ + do \ + cat $(srcdir)/$$chapter >> $(TARGETDOC) ; \ + done + +.c.xml: + $(DOCBOOK_CHEW) < $< > $*.xml || ( rm $*.xml && false ) + @touch stmp-xml + +docbook: $(DOCBOOK_OUT_FILES) + for chapter in $(DOCBOOK_CHAPTERS) ; \ + do \ + ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/newlib/libc/ssp/chk_fail.c b/newlib/libc/ssp/chk_fail.c new file mode 100644 index 000000000..b1f8e42a6 --- /dev/null +++ b/newlib/libc/ssp/chk_fail.c @@ -0,0 +1,13 @@ +#include +#include +#include + +void +__attribute__((__noreturn__)) +__chk_fail(void) +{ + char msg[] = "*** buffer overflow detected ***: terminated\n"; + write (2, msg, strlen (msg)); + raise (SIGABRT); + _exit (127); +} diff --git a/newlib/libc/ssp/gets_chk.c b/newlib/libc/ssp/gets_chk.c new file mode 100644 index 000000000..b4f7015bc --- /dev/null +++ b/newlib/libc/ssp/gets_chk.c @@ -0,0 +1,78 @@ +/* $NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: gets_chk.c,v 1.7 2013/10/04 20:49:16 christos Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include +#include +#include +#include + +extern char *__gets(char *); +#undef gets +#ifdef __NEWLIB__ +#define __gets gets +#endif + +char * +__gets_chk(char * __restrict buf, size_t slen) +{ + char *abuf; + size_t len; + + if (slen >= (size_t)INT_MAX) + return __gets(buf); + + if ((abuf = malloc(slen + 1)) == NULL) + return __gets(buf); + + if (fgets(abuf, (int)(slen + 1), stdin) == NULL) { + free(abuf); + return NULL; + } + + len = strlen(abuf); + if (len > 0 && abuf[len - 1] == '\n') + --len; + + if (len >= slen) + __chk_fail(); + + (void)memcpy(buf, abuf, len); + + buf[len] = '\0'; + free(abuf); + return buf; +} diff --git a/newlib/libc/ssp/memcpy_chk.c b/newlib/libc/ssp/memcpy_chk.c new file mode 100644 index 000000000..63f536dc5 --- /dev/null +++ b/newlib/libc/ssp/memcpy_chk.c @@ -0,0 +1,54 @@ +/* $NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: memcpy_chk.c,v 1.7 2015/05/13 19:57:16 joerg Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef memcpy + +void *__memcpy_chk(void * __restrict, const void * __restrict, size_t, size_t); + +void * +__memcpy_chk(void * __restrict dst, const void * __restrict src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + + if (__ssp_overlap((const char *)src, (const char *)dst, len)) + __chk_fail(); + + return memcpy(dst, src, len); +} diff --git a/newlib/libc/ssp/memmove_chk.c b/newlib/libc/ssp/memmove_chk.c new file mode 100644 index 000000000..f8f03d778 --- /dev/null +++ b/newlib/libc/ssp/memmove_chk.c @@ -0,0 +1,50 @@ +/* $NetBSD: memmove_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: memmove_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef memmove + +void *__memmove_chk(void *, void *src, size_t, size_t); + +void * +__memmove_chk(void *dst, void *src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + return memmove(dst, src, len); +} diff --git a/newlib/libc/ssp/mempcpy_chk.c b/newlib/libc/ssp/mempcpy_chk.c new file mode 100644 index 000000000..fc2ccf894 --- /dev/null +++ b/newlib/libc/ssp/mempcpy_chk.c @@ -0,0 +1,21 @@ +#define _GNU_SOURCE +#include +#include +#include + +#undef mempcpy + +void *__mempcpy_chk(void * __restrict, const void * __restrict, size_t, size_t); + +void * +__mempcpy_chk(void * __restrict dst, const void * __restrict src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + + if (__ssp_overlap((const char *)src, (const char *)dst, len)) + __chk_fail(); + + return mempcpy(dst, src, len); +} diff --git a/newlib/libc/ssp/memset_chk.c b/newlib/libc/ssp/memset_chk.c new file mode 100644 index 000000000..0e303b9eb --- /dev/null +++ b/newlib/libc/ssp/memset_chk.c @@ -0,0 +1,49 @@ +/* $NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: memset_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef memset + +void *__memset_chk(void * __restrict, int, size_t, size_t); + +void * +__memset_chk(void * __restrict dst, int val, size_t len, size_t slen) +{ + if (len > slen) + __chk_fail(); + return memset(dst, val, len); +} diff --git a/newlib/libc/ssp/snprintf_chk.c b/newlib/libc/ssp/snprintf_chk.c new file mode 100644 index 000000000..cede5a4bd --- /dev/null +++ b/newlib/libc/ssp/snprintf_chk.c @@ -0,0 +1,59 @@ +/* $NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: snprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include +#include + +#undef vsnprintf + +/*ARGSUSED*/ +int +__snprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, + const char * __restrict fmt, ...) +{ + va_list ap; + int rv; + + if (len > slen) + __chk_fail(); + + va_start(ap, fmt); + rv = vsnprintf(buf, len, fmt, ap); + va_end(ap); + + return rv; +} diff --git a/newlib/libc/ssp/sprintf_chk.c b/newlib/libc/ssp/sprintf_chk.c new file mode 100644 index 000000000..1e924799b --- /dev/null +++ b/newlib/libc/ssp/sprintf_chk.c @@ -0,0 +1,63 @@ +/* $NetBSD: sprintf_chk.c,v 1.6 2009/02/05 05:40:36 lukem Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: sprintf_chk.c,v 1.6 2009/02/05 05:40:36 lukem Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include +#include +#include + +#undef vsnprintf +#undef vsprintf + +int +/*ARGSUSED*/ +__sprintf_chk(char * __restrict buf, int flags, size_t slen, + const char * __restrict fmt, ...) +{ + va_list ap; + int rv; + + va_start(ap, fmt); + if (slen > (size_t)INT_MAX) + rv = vsprintf(buf, fmt, ap); + else { + if ((rv = vsnprintf(buf, slen, fmt, ap)) >= 0 && (size_t)rv >= slen) + __chk_fail(); + } + va_end(ap); + + return rv; +} diff --git a/newlib/libc/ssp/ssp.tex b/newlib/libc/ssp/ssp.tex new file mode 100644 index 000000000..927035082 --- /dev/null +++ b/newlib/libc/ssp/ssp.tex @@ -0,0 +1,57 @@ +@node Overflow Protection +@chapter Overflow Protection + +@menu +* Stack Smashing Protection:: Checks enabled with -fstack-protector* +* Object Size Checking:: Checks enabled with _FORTIFY_SOURCE +@end menu + +@node Stack Smashing Protection +@section Stack Smashing Protection +Stack Smashing Protection is a compiler feature which emits extra code +to check for stack smashing attacks. It depends on a canary, which is +initialized with the process, and functions for process termination when +an overflow is detected. These are private entry points intended solely +for use by the compiler, and are used when any of the @code{-fstack-protector}, +@code{-fstack-protector-all}, @code{-fstack-protector-explicit}, or +@code{-fstack-protector-strong} compiler flags are enabled. + +@node Object Size Checking +@section Object Size Checking +Object Size Checking is a feature which wraps certain functions with checks +to prevent buffer overflows. These are enabled when compiling with +optimization (@code{-O1} and higher) and @code{_FORTIFY_SOURCE} defined +to 1, or for stricter checks, to 2. + +@cindex list of overflow protected functions +The following functions use object size checking to detect buffer overflows +when enabled: + +@example +@exdent @emph{String functions:} +bcopy memmove strcpy +bzero mempcpy strcat +explicit_bzero memset strncat +memcpy stpcpy strncpy + +@exdent @emph{Wide Character String functions:} +fgetws wcrtomb wcsrtombs +fgetws_unlocked wcscat wmemcpy +mbsnrtowcs wcscpy wmemmove +mbsrtowcs wcsncat wmempcpy +wcpcpy wcsncpy wmemset +wcpncpy wcsnrtombs + +@exdent @emph{Stdio functions:} +fgets fread_unlocked sprintf +fgets_unlocked gets vsnprintf +fread snprintf vsprintf + +@exdent @emph{Stdlib functions:} +mbstowcs wcstombs wctomb + +@exdent @emph{System functions:} +getcwd read ttyname_r +pread readlink + +@end example diff --git a/newlib/libc/ssp/stack_protector.c b/newlib/libc/ssp/stack_protector.c new file mode 100644 index 000000000..ee014b69d --- /dev/null +++ b/newlib/libc/ssp/stack_protector.c @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include + +uintptr_t __stack_chk_guard = 0; + +void +__attribute__((__constructor__)) +__stack_chk_init (void) +{ + if (__stack_chk_guard != 0) + return; + +#if defined(__CYGWIN__) || defined(__rtems__) + arc4random_buf(&__stack_chk_guard, sizeof(__stack_chk_guard)); +#else + /* If getentropy is not available, use the "terminator canary". */ + ((unsigned char *)&__stack_chk_guard)[0] = 0; + ((unsigned char *)&__stack_chk_guard)[1] = 0; + ((unsigned char *)&__stack_chk_guard)[2] = '\n'; + ((unsigned char *)&__stack_chk_guard)[3] = 255; +#endif +} + +void +__attribute__((__noreturn__)) +__stack_chk_fail (void) +{ + char msg[] = "*** stack smashing detected ***: terminated\n"; + write (2, msg, strlen (msg)); + raise (SIGABRT); + _exit (127); +} + +#ifdef __ELF__ +void +__attribute__((visibility ("hidden"))) +__stack_chk_fail_local (void) +{ + __stack_chk_fail(); +} +#endif diff --git a/newlib/libc/ssp/stpcpy_chk.c b/newlib/libc/ssp/stpcpy_chk.c new file mode 100644 index 000000000..ed1d74ad7 --- /dev/null +++ b/newlib/libc/ssp/stpcpy_chk.c @@ -0,0 +1,58 @@ +/* $NetBSD: stpcpy_chk.c,v 1.6 2015/05/09 15:42:21 christos Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: stpcpy_chk.c,v 1.6 2015/05/09 15:42:21 christos Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef memcpy + +#if !__GNUC_PREREQ__(4, 8) +char *__stpcpy_chk(char * __restrict, const char * __restrict, size_t); +#endif + +char * +__stpcpy_chk(char * __restrict dst, const char * __restrict src, size_t slen) +{ + size_t len = strlen(src); + + if (len >= slen) + __chk_fail(); + + if (__ssp_overlap(src, dst, len)) + __chk_fail(); + + (void)memcpy(dst, src, len + 1); + return dst + len; +} diff --git a/newlib/libc/ssp/stpncpy_chk.c b/newlib/libc/ssp/stpncpy_chk.c new file mode 100644 index 000000000..756626153 --- /dev/null +++ b/newlib/libc/ssp/stpncpy_chk.c @@ -0,0 +1,56 @@ +/* $NetBSD: stpncpy_chk.c,v 1.3 2015/05/09 15:42:21 christos Exp $ */ + +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: stpncpy_chk.c,v 1.3 2015/05/09 15:42:21 christos Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef stpncpy + +#if !__GNUC_PREREQ__(4, 8) +char *__stpncpy_chk(char * __restrict, const char * __restrict, size_t, size_t); +#endif + +char * +__stpncpy_chk(char * __restrict dst, const char * __restrict src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + + if (__ssp_overlap(src, dst, len)) + __chk_fail(); + + return stpncpy(dst, src, len); +} diff --git a/newlib/libc/ssp/strcat_chk.c b/newlib/libc/ssp/strcat_chk.c new file mode 100644 index 000000000..d57f9559b --- /dev/null +++ b/newlib/libc/ssp/strcat_chk.c @@ -0,0 +1,62 @@ +/* $NetBSD: strcat_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: strcat_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +char *__strcat_chk(char * __restrict, const char * __restrict, size_t); + +char * +__strcat_chk(char * __restrict dst, const char * __restrict src, size_t slen) +{ + char *d; + + for (d = dst; *d; d++) { + if (slen-- == 0) + __chk_fail(); + } + + while (*src) { + if (slen-- == 0) + __chk_fail(); + *d++ = *src++; + } + + if (slen-- == 0) + __chk_fail(); + + *d = '\0'; + return dst; +} diff --git a/newlib/libc/ssp/strcpy_chk.c b/newlib/libc/ssp/strcpy_chk.c new file mode 100644 index 000000000..cef160a62 --- /dev/null +++ b/newlib/libc/ssp/strcpy_chk.c @@ -0,0 +1,55 @@ +/* $NetBSD: strcpy_chk.c,v 1.8 2015/05/09 15:42:21 christos Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: strcpy_chk.c,v 1.8 2015/05/09 15:42:21 christos Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef memcpy + +char *__strcpy_chk(char * __restrict, const char * __restrict, size_t); + +char * +__strcpy_chk(char * __restrict dst, const char * __restrict src, size_t slen) +{ + size_t len = strlen(src) + 1; + + if (len > slen) + __chk_fail(); + + if (__ssp_overlap(src, dst, len)) + __chk_fail(); + + return memcpy(dst, src, len); +} diff --git a/newlib/libc/ssp/strncat_chk.c b/newlib/libc/ssp/strncat_chk.c new file mode 100644 index 000000000..5ce5a9ef6 --- /dev/null +++ b/newlib/libc/ssp/strncat_chk.c @@ -0,0 +1,73 @@ +/* $NetBSD: strncat_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: strncat_chk.c,v 1.5 2014/09/17 00:39:28 joerg Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include + +char *__strncat_chk(char * __restrict, const char * __restrict, size_t, + size_t); + +char * +__strncat_chk(char * __restrict dst, const char * __restrict src, size_t len, + size_t slen) +{ + char *d; + + if (len == 0) + return dst; + + if (len > slen) + __chk_fail(); + + for (d = dst; *d; d++) { + if (slen-- == 0) + __chk_fail(); + } + + do { + if ((*d = *src++) == '\0') + break; + if (slen-- == 0) + __chk_fail(); + d++; + } while (--len != 0); + + if (slen-- == 0) + __chk_fail(); + + *d = '\0'; + return dst; +} diff --git a/newlib/libc/ssp/strncpy_chk.c b/newlib/libc/ssp/strncpy_chk.c new file mode 100644 index 000000000..591157a25 --- /dev/null +++ b/newlib/libc/ssp/strncpy_chk.c @@ -0,0 +1,55 @@ +/* $NetBSD: strncpy_chk.c,v 1.6 2015/05/09 15:42:21 christos Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: strncpy_chk.c,v 1.6 2015/05/09 15:42:21 christos Exp $"); + +/*LINTLIBRARY*/ + +#include +#include + +#undef strncpy + +char *__strncpy_chk(char * __restrict, const char * __restrict, size_t, + size_t); + +char * +__strncpy_chk(char * __restrict dst, const char * __restrict src, size_t len, + size_t slen) +{ + if (len > slen) + __chk_fail(); + + if (__ssp_overlap(src, dst, len)) + __chk_fail(); + + return strncpy(dst, src, len); +} diff --git a/newlib/libc/ssp/vsnprintf_chk.c b/newlib/libc/ssp/vsnprintf_chk.c new file mode 100644 index 000000000..2b8802908 --- /dev/null +++ b/newlib/libc/ssp/vsnprintf_chk.c @@ -0,0 +1,51 @@ +/* $NetBSD: vsnprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: vsnprintf_chk.c,v 1.5 2008/04/28 20:23:00 martin Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include +#include + +#undef vsnprintf + +int +__vsnprintf_chk(char * __restrict buf, size_t len, int flags, size_t slen, + const char * __restrict fmt, va_list ap) +{ + if (len > slen) + __chk_fail(); + + return vsnprintf(buf, len, fmt, ap); +} diff --git a/newlib/libc/ssp/vsprintf_chk.c b/newlib/libc/ssp/vsprintf_chk.c new file mode 100644 index 000000000..fec8a18c7 --- /dev/null +++ b/newlib/libc/ssp/vsprintf_chk.c @@ -0,0 +1,60 @@ +/* $NetBSD: vsprintf_chk.c,v 1.6 2009/02/05 05:39:38 lukem Exp $ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +__RCSID("$NetBSD: vsprintf_chk.c,v 1.6 2009/02/05 05:39:38 lukem Exp $"); + +/*LINTLIBRARY*/ + +#include +#include +#include +#include +#include + +#undef vsprintf +#undef vsnprintf + +/*ARGSUSED*/ +int +__vsprintf_chk(char * __restrict buf, int flags, size_t slen, + const char * __restrict fmt, va_list ap) +{ + int rv; + + if (slen > (size_t)INT_MAX) + rv = vsprintf(buf, fmt, ap); + else { + if ((rv = vsnprintf(buf, slen, fmt, ap)) >= 0 && (size_t)rv >= slen) + __chk_fail(); + } + + return rv; +} diff --git a/newlib/libc/stdio/Makefile.in b/newlib/libc/stdio/Makefile.in index 061554d2d..aa22a0e3a 100644 --- a/newlib/libc/stdio/Makefile.in +++ b/newlib/libc/stdio/Makefile.in @@ -657,7 +657,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) @NEWLIB_NANO_FORMATTED_IO_FALSE@CHEWOUT_INT_FORMATTED_IO_FILES = \ @NEWLIB_NANO_FORMATTED_IO_FALSE@ diprintf.def \ @NEWLIB_NANO_FORMATTED_IO_FALSE@ siprintf.def \ @@ -1859,8 +1859,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/stdio/asiprintf.c b/newlib/libc/stdio/asiprintf.c index 0c363d5ea..ce6d0a972 100644 --- a/newlib/libc/stdio/asiprintf.c +++ b/newlib/libc/stdio/asiprintf.c @@ -25,10 +25,9 @@ #include "local.h" int -_DEFUN(_asiprintf_r, (ptr, strp, fmt), - struct _reent *ptr _AND - char **strp _AND - const char *fmt _DOTS) +_asiprintf_r (struct _reent *ptr, + char **strp, + const char *fmt, ...) { int ret; va_list ap; @@ -53,9 +52,8 @@ _DEFUN(_asiprintf_r, (ptr, strp, fmt), #ifndef _REENT_ONLY int -_DEFUN(asiprintf, (strp, fmt), - char **strp _AND - const char *fmt _DOTS) +asiprintf (char **strp, + const char *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/asniprintf.c b/newlib/libc/stdio/asniprintf.c index 16ccfde63..0bfe00d9b 100644 --- a/newlib/libc/stdio/asniprintf.c +++ b/newlib/libc/stdio/asniprintf.c @@ -14,11 +14,10 @@ #include "local.h" char * -_DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt), - struct _reent *ptr _AND - char *buf _AND - size_t *lenp _AND - const char *fmt _DOTS) +_asniprintf_r (struct _reent *ptr, + char *buf, + size_t *lenp, + const char *fmt, ...) { int ret; va_list ap; @@ -61,10 +60,9 @@ _DEFUN(_asniprintf_r, (ptr, buf, lenp, fmt), #ifndef _REENT_ONLY char * -_DEFUN(asniprintf, (buf, lenp, fmt), - char *buf _AND - size_t *lenp _AND - const char *fmt _DOTS) +asniprintf (char *buf, + size_t *lenp, + const char *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/asnprintf.c b/newlib/libc/stdio/asnprintf.c index 2e8d8aabb..f657f9ec9 100644 --- a/newlib/libc/stdio/asnprintf.c +++ b/newlib/libc/stdio/asnprintf.c @@ -14,11 +14,10 @@ #include "local.h" char * -_DEFUN(_asnprintf_r, (ptr, buf, lenp, fmt), - struct _reent *__restrict ptr _AND - char *buf _AND - size_t *lenp _AND - const char *__restrict fmt _DOTS) +_asnprintf_r (struct _reent *__restrict ptr, + char *buf, + size_t *lenp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -60,17 +59,16 @@ _DEFUN(_asnprintf_r, (ptr, buf, lenp, fmt), #ifdef _NANO_FORMATTED_IO char * -_EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...) - _ATTRIBUTE ((__alias__("_asnprintf_r")))); +_asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) + _ATTRIBUTE ((__alias__("_asnprintf_r"))); #endif #ifndef _REENT_ONLY char * -_DEFUN(asnprintf, (buf, lenp, fmt), - char *__restrict buf _AND - size_t *__restrict lenp _AND - const char *__restrict fmt _DOTS) +asnprintf (char *__restrict buf, + size_t *__restrict lenp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -113,7 +111,7 @@ _DEFUN(asnprintf, (buf, lenp, fmt), #ifdef _NANO_FORMATTED_IO char * -_EXFUN(asniprintf, (char *, size_t *, const char *, ...) - _ATTRIBUTE ((__alias__("asnprintf")))); +asniprintf (char *, size_t *, const char *, ...) + _ATTRIBUTE ((__alias__("asnprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/asprintf.c b/newlib/libc/stdio/asprintf.c index bf214f9af..25696c575 100644 --- a/newlib/libc/stdio/asprintf.c +++ b/newlib/libc/stdio/asprintf.c @@ -25,10 +25,9 @@ #include "local.h" int -_DEFUN(_asprintf_r, (ptr, strp, fmt), - struct _reent *ptr _AND - char **__restrict strp _AND - const char *__restrict fmt _DOTS) +_asprintf_r (struct _reent *ptr, + char **__restrict strp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -52,16 +51,15 @@ _DEFUN(_asprintf_r, (ptr, strp, fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...) - _ATTRIBUTE ((__alias__("_asprintf_r")))); +_asiprintf_r (struct _reent *, char **, const char *, ...) + _ATTRIBUTE ((__alias__("_asprintf_r"))); #endif #ifndef _REENT_ONLY int -_DEFUN(asprintf, (strp, fmt), - char **__restrict strp _AND - const char *__restrict fmt _DOTS) +asprintf (char **__restrict strp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -85,7 +83,7 @@ _DEFUN(asprintf, (strp, fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(asiprintf, (char **, const char *, ...) - _ATTRIBUTE ((__alias__("asprintf")))); +asiprintf (char **, const char *, ...) + _ATTRIBUTE ((__alias__("asprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/clearerr.c b/newlib/libc/stdio/clearerr.c index 9bf0837f5..be83d6dd9 100644 --- a/newlib/libc/stdio/clearerr.c +++ b/newlib/libc/stdio/clearerr.c @@ -24,7 +24,7 @@ INDEX INDEX clearerr_unlocked -ANSI_SYNOPSIS +SYNOPSIS #include void clearerr(FILE *<[fp]>); @@ -32,16 +32,6 @@ ANSI_SYNOPSIS #include void clearerr_unlocked(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - void clearerr(<[fp]>) - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - void clearerr_unlocked(<[fp]>) - FILE *<[fp]>; - DESCRIPTION The <> functions maintain an error indicator with each file pointer <[fp]>, to record whether any read or write errors have @@ -81,9 +71,8 @@ No supporting OS subroutines are required. #undef clearerr -_VOID -_DEFUN(clearerr, (fp), - FILE * fp) +void +clearerr (FILE * fp) { CHECK_INIT(_REENT, fp); _newlib_flockfile_start (fp); diff --git a/newlib/libc/stdio/clearerr_u.c b/newlib/libc/stdio/clearerr_u.c index 00c5e8efa..4952f777c 100644 --- a/newlib/libc/stdio/clearerr_u.c +++ b/newlib/libc/stdio/clearerr_u.c @@ -32,9 +32,8 @@ #undef clearerr_unlocked -_VOID -_DEFUN(clearerr_unlocked, (fp), - FILE * fp) +void +clearerr_unlocked (FILE * fp) { CHECK_INIT(_REENT, fp); __sclearerr (fp); diff --git a/newlib/libc/stdio/diprintf.c b/newlib/libc/stdio/diprintf.c index e0a5595e1..8ac58354a 100644 --- a/newlib/libc/stdio/diprintf.c +++ b/newlib/libc/stdio/diprintf.c @@ -16,7 +16,7 @@ INDEX INDEX _vdiprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int diprintf(int <[fd]>, const char *<[format]>, ...); @@ -49,10 +49,9 @@ Supporting OS subroutines required: <>, <>. #include int -_DEFUN(_diprintf_r, (ptr, fd, format), - struct _reent *ptr _AND - int fd _AND - const char *format _DOTS) +_diprintf_r (struct _reent *ptr, + int fd, + const char *format, ...) { va_list ap; int n; @@ -66,9 +65,8 @@ _DEFUN(_diprintf_r, (ptr, fd, format), #ifndef _REENT_ONLY int -_DEFUN(diprintf, (fd, format), - int fd _AND - const char *format _DOTS) +diprintf (int fd, + const char *format, ...) { va_list ap; int n; diff --git a/newlib/libc/stdio/dprintf.c b/newlib/libc/stdio/dprintf.c index 2925ceb31..ae9f86d18 100644 --- a/newlib/libc/stdio/dprintf.c +++ b/newlib/libc/stdio/dprintf.c @@ -16,7 +16,7 @@ INDEX INDEX _vdprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int dprintf(int <[fd]>, const char *restrict <[format]>, ...); @@ -53,10 +53,9 @@ Supporting OS subroutines required: <>, <>. #include "local.h" int -_DEFUN(_dprintf_r, (ptr, fd, format), - struct _reent *ptr _AND - int fd _AND - const char *__restrict format _DOTS) +_dprintf_r (struct _reent *ptr, + int fd, + const char *__restrict format, ...) { va_list ap; int n; @@ -69,16 +68,15 @@ _DEFUN(_dprintf_r, (ptr, fd, format), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...) - _ATTRIBUTE ((__alias__("_dprintf_r")))); +_diprintf_r (struct _reent *, int, const char *, ...) + _ATTRIBUTE ((__alias__("_dprintf_r"))); #endif #ifndef _REENT_ONLY int -_DEFUN(dprintf, (fd, format), - int fd _AND - const char *__restrict format _DOTS) +dprintf (int fd, + const char *__restrict format, ...) { va_list ap; int n; @@ -93,7 +91,7 @@ _DEFUN(dprintf, (fd, format), #ifdef _NANO_FORMATTED_IO int -_EXFUN(diprintf, (int, const char *, ...) - _ATTRIBUTE ((__alias__("dprintf")))); +diprintf (int, const char *, ...) + _ATTRIBUTE ((__alias__("dprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c index 0ce112306..1c36057a7 100644 --- a/newlib/libc/stdio/fclose.c +++ b/newlib/libc/stdio/fclose.c @@ -24,20 +24,11 @@ INDEX INDEX _fclose_r -ANSI_SYNOPSIS +SYNOPSIS #include int fclose(FILE *<[fp]>); int _fclose_r(struct _reent *<[reent]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int fclose(<[fp]>) - FILE *<[fp]>; - - int fclose(<[fp]>) - struct _reent *<[reent]> - FILE *<[fp]>; - DESCRIPTION If the file or stream identified by <[fp]> is open, <> closes it, after first ensuring that any pending data is written (by calling @@ -65,8 +56,7 @@ Required OS subroutines: <>, <>, <>, <>, #include "local.h" int -_DEFUN(_fclose_r, (rptr, fp), - struct _reent *rptr _AND +_fclose_r (struct _reent *rptr, register FILE * fp) { int r; @@ -130,8 +120,7 @@ _DEFUN(_fclose_r, (rptr, fp), #ifndef _REENT_ONLY int -_DEFUN(fclose, (fp), - register FILE * fp) +fclose (register FILE * fp) { return _fclose_r(_REENT, fp); } diff --git a/newlib/libc/stdio/fcloseall.c b/newlib/libc/stdio/fcloseall.c index 090f3f2c3..2e78b4b3c 100644 --- a/newlib/libc/stdio/fcloseall.c +++ b/newlib/libc/stdio/fcloseall.c @@ -24,18 +24,11 @@ INDEX INDEX _fcloseall_r -ANSI_SYNOPSIS +SYNOPSIS #include int fcloseall(void); int _fcloseall_r (struct _reent *<[ptr]>); -TRAD_SYNOPSIS - #include - int fcloseall() - - int _fcloseall_r (<[ptr]>) - struct _reent *<[ptr]>; - DESCRIPTION <> closes all files in the current reentrancy struct's domain. The function <<_fcloseall_r>> is the same function, except the reentrancy @@ -64,8 +57,7 @@ Required OS subroutines: <>, <>, <>, <>, #include "local.h" int -_DEFUN(_fcloseall_r, (ptr), - struct _reent *ptr) +_fcloseall_r (struct _reent *ptr) { return _fwalk_reent (ptr, _fclose_r); } @@ -73,7 +65,7 @@ _DEFUN(_fcloseall_r, (ptr), #ifndef _REENT_ONLY int -_DEFUN_VOID(fcloseall) +fcloseall (void) { return _fcloseall_r (_GLOBAL_REENT); } diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c index 77f599b65..854c0183d 100644 --- a/newlib/libc/stdio/fdopen.c +++ b/newlib/libc/stdio/fdopen.c @@ -24,23 +24,12 @@ INDEX INDEX _fdopen_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *fdopen(int <[fd]>, const char *<[mode]>); FILE *_fdopen_r(struct _reent *<[reent]>, int <[fd]>, const char *<[mode]>); -TRAD_SYNOPSIS - #include - FILE *fdopen(<[fd]>, <[mode]>) - int <[fd]>; - char *<[mode]>; - - FILE *_fdopen_r(<[reent]>, <[fd]>, <[mode]>) - struct _reent *<[reent]>; - int <[fd]>; - char *<[mode]>); - DESCRIPTION <> produces a file descriptor of type <>, from a descriptor for an already-open file (returned, for example, by the @@ -64,10 +53,9 @@ PORTABILITY #include <_syslist.h> FILE * -_DEFUN(_fdopen_r, (ptr, fd, mode), - struct _reent *ptr _AND - int fd _AND - _CONST char *mode) +_fdopen_r (struct _reent *ptr, + int fd, + const char *mode) { register FILE *fp; int flags, oflags; @@ -105,7 +93,7 @@ _DEFUN(_fdopen_r, (ptr, fd, mode), _fcntl_r (ptr, fd, F_SETFL, fdflags | O_APPEND); #endif fp->_file = fd; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; #undef _read #undef _write @@ -134,9 +122,8 @@ _DEFUN(_fdopen_r, (ptr, fd, mode), #ifndef _REENT_ONLY FILE * -_DEFUN(fdopen, (fd, mode), - int fd _AND - _CONST char *mode) +fdopen (int fd, + const char *mode) { return _fdopen_r (_REENT, fd, mode); } diff --git a/newlib/libc/stdio/feof.c b/newlib/libc/stdio/feof.c index 7aadd8209..879417936 100644 --- a/newlib/libc/stdio/feof.c +++ b/newlib/libc/stdio/feof.c @@ -24,7 +24,7 @@ INDEX INDEX feof_unlocked -ANSI_SYNOPSIS +SYNOPSIS #include int feof(FILE *<[fp]>); @@ -32,16 +32,6 @@ ANSI_SYNOPSIS #include int feof_unlocked(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int feof(<[fp]>) - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int feof_unlocked(<[fp]>) - FILE *<[fp]>; - DESCRIPTION <> tests whether or not the end of the file identified by <[fp]> has been reached. @@ -75,8 +65,7 @@ No supporting OS subroutines are required. #undef feof int -_DEFUN(feof, (fp), - FILE * fp) +feof (FILE * fp) { int result; CHECK_INIT(_REENT, fp); diff --git a/newlib/libc/stdio/feof_u.c b/newlib/libc/stdio/feof_u.c index 48fc4af47..e9238e113 100644 --- a/newlib/libc/stdio/feof_u.c +++ b/newlib/libc/stdio/feof_u.c @@ -32,8 +32,7 @@ #undef feof_unlocked int -_DEFUN(feof_unlocked, (fp), - FILE * fp) +feof_unlocked (FILE * fp) { CHECK_INIT(_REENT, fp); return __sfeof (fp); diff --git a/newlib/libc/stdio/ferror.c b/newlib/libc/stdio/ferror.c index f93063d71..3bff52045 100644 --- a/newlib/libc/stdio/ferror.c +++ b/newlib/libc/stdio/ferror.c @@ -24,7 +24,7 @@ INDEX INDEX ferror_unlocked -ANSI_SYNOPSIS +SYNOPSIS #include int ferror(FILE *<[fp]>); @@ -32,16 +32,6 @@ ANSI_SYNOPSIS #include int ferror_unlocked(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int ferror(<[fp]>) - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int ferror_unlocked(<[fp]>) - FILE *<[fp]>; - DESCRIPTION The <> functions maintain an error indicator with each file pointer <[fp]>, to record whether any read or write errors have @@ -84,8 +74,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef ferror int -_DEFUN(ferror, (fp), - FILE * fp) +ferror (FILE * fp) { int result; CHECK_INIT(_REENT, fp); diff --git a/newlib/libc/stdio/ferror_u.c b/newlib/libc/stdio/ferror_u.c index 9b9edba24..ae1e278fd 100644 --- a/newlib/libc/stdio/ferror_u.c +++ b/newlib/libc/stdio/ferror_u.c @@ -33,8 +33,7 @@ #undef ferror_unlocked int -_DEFUN(ferror_unlocked, (fp), - FILE * fp) +ferror_unlocked (FILE * fp) { CHECK_INIT(_REENT, fp); return __sferror (fp); diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c index a4e639e72..e958af9fc 100644 --- a/newlib/libc/stdio/fflush.c +++ b/newlib/libc/stdio/fflush.c @@ -28,7 +28,7 @@ INDEX INDEX _fflush_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include int fflush(FILE *<[fp]>); @@ -100,8 +100,7 @@ No supporting OS subroutines are required. /* Core function which does not lock file pointer. This gets called directly from __srefill. */ int -_DEFUN(__sflush_r, (ptr, fp), - struct _reent *ptr _AND +__sflush_r (struct _reent *ptr, register FILE * fp) { register unsigned char *p; @@ -239,8 +238,7 @@ _DEFUN(__sflush_r, (ptr, fp), and we don't want to move the underlying file pointer unless we're writing. */ int -_DEFUN(__sflushw_r, (ptr, fp), - struct _reent *ptr _AND +__sflushw_r (struct _reent *ptr, register FILE *fp) { return (fp->_flags & __SWR) ? __sflush_r (ptr, fp) : 0; @@ -250,8 +248,7 @@ _DEFUN(__sflushw_r, (ptr, fp), #endif /* __IMPL_UNLOCKED__ */ int -_DEFUN(_fflush_r, (ptr, fp), - struct _reent *ptr _AND +_fflush_r (struct _reent *ptr, register FILE * fp) { int ret; @@ -286,8 +283,7 @@ _DEFUN(_fflush_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(fflush, (fp), - register FILE * fp) +fflush (register FILE * fp) { if (fp == NULL) return _fwalk_reent (_GLOBAL_REENT, _fflush_r); diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c index 34447a2c8..7d0d4842c 100644 --- a/newlib/libc/stdio/fgetc.c +++ b/newlib/libc/stdio/fgetc.c @@ -28,7 +28,7 @@ INDEX INDEX _fgetc_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include int fgetc(FILE *<[fp]>); @@ -43,27 +43,6 @@ ANSI_SYNOPSIS #include int _fgetc_unlocked_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int fgetc(<[fp]>) - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int fgetc_unlocked(<[fp]>) - FILE *<[fp]>; - - #include - int _fgetc_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int _fgetc_unlocked_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION Use <> to get the next single character from the file or stream identified by <[fp]>. As a side effect, <> advances the file's @@ -106,8 +85,7 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" int -_DEFUN(_fgetc_r, (ptr, fp), - struct _reent * ptr _AND +_fgetc_r (struct _reent * ptr, FILE * fp) { int result; @@ -121,8 +99,7 @@ _DEFUN(_fgetc_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(fgetc, (fp), - FILE * fp) +fgetc (FILE * fp) { #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) int result; diff --git a/newlib/libc/stdio/fgetc_u.c b/newlib/libc/stdio/fgetc_u.c index 5bbd5a549..9a5719c29 100644 --- a/newlib/libc/stdio/fgetc_u.c +++ b/newlib/libc/stdio/fgetc_u.c @@ -29,8 +29,7 @@ #include "local.h" int -_DEFUN(_fgetc_unlocked_r, (ptr, fp), - struct _reent * ptr _AND +_fgetc_unlocked_r (struct _reent * ptr, FILE * fp) { CHECK_INIT(ptr, fp); @@ -40,8 +39,7 @@ _DEFUN(_fgetc_unlocked_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(fgetc_unlocked, (fp), - FILE * fp) +fgetc_unlocked (FILE * fp) { #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c index 20dd1082c..b4f681281 100644 --- a/newlib/libc/stdio/fgetpos.c +++ b/newlib/libc/stdio/fgetpos.c @@ -24,22 +24,11 @@ INDEX INDEX _fgetpos_r -ANSI_SYNOPSIS +SYNOPSIS #include int fgetpos(FILE *restrict <[fp]>, fpos_t *restrict <[pos]>); int _fgetpos_r(struct _reent *<[ptr]>, FILE *restrict <[fp]>, fpos_t *restrict <[pos]>); -TRAD_SYNOPSIS - #include - int fgetpos(<[fp]>, <[pos]>) - FILE *<[fp]>; - fpos_t *<[pos]>; - - int _fgetpos_r(<[ptr]>, <[fp]>, <[pos]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - fpos_t *<[pos]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -76,9 +65,8 @@ No supporting OS subroutines are required. #include int -_DEFUN(_fgetpos_r, (ptr, fp, pos), - struct _reent * ptr _AND - FILE *__restrict fp _AND +_fgetpos_r (struct _reent * ptr, + FILE *__restrict fp, _fpos_t *__restrict pos) { *pos = _ftell_r (ptr, fp); @@ -93,8 +81,7 @@ _DEFUN(_fgetpos_r, (ptr, fp, pos), #ifndef _REENT_ONLY int -_DEFUN(fgetpos, (fp, pos), - FILE *__restrict fp _AND +fgetpos (FILE *__restrict fp, _fpos_t *__restrict pos) { return _fgetpos_r (_REENT, fp, pos); diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c index f7c8a0300..7adfb2179 100644 --- a/newlib/libc/stdio/fgets.c +++ b/newlib/libc/stdio/fgets.c @@ -28,7 +28,7 @@ INDEX INDEX _fgets_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include char *fgets(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>); @@ -42,34 +42,6 @@ ANSI_SYNOPSIS #include char *_fgets_unlocked_r(struct _reent *<[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>); -TRAD_SYNOPSIS - #include - char *fgets(<[buf]>,<[n]>,<[fp]>) - char *<[buf]>; - int <[n]>; - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - char *fgets_unlocked(<[buf]>,<[n]>,<[fp]>) - char *<[buf]>; - int <[n]>; - FILE *<[fp]>; - - #include - char *_fgets_r(<[ptr]>, <[buf]>,<[n]>,<[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - int <[n]>; - FILE *<[fp]>; - - #include - char *_fgets_unlocked_r(<[ptr]>, <[buf]>,<[n]>,<[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - int <[n]>; - FILE *<[fp]>; - DESCRIPTION Reads at most <[n-1]> characters from <[fp]> until a newline is found. The characters including to the newline are stored @@ -122,10 +94,9 @@ Supporting OS subroutines required: <>, <>, <>, */ char * -_DEFUN(_fgets_r, (ptr, buf, n, fp), - struct _reent * ptr _AND - char *__restrict buf _AND - int n _AND +_fgets_r (struct _reent * ptr, + char *__restrict buf, + int n, FILE *__restrict fp) { size_t len; @@ -192,20 +163,20 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp), */ if (len > n) len = n; - t = (unsigned char *) memchr ((_PTR) p, '\n', len); + t = (unsigned char *) memchr ((void *) p, '\n', len); if (t != 0) { len = ++t - p; fp->_r -= len; fp->_p = t; - _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len); + (void) memcpy ((void *) s, (void *) p, len); s[len] = 0; _newlib_flockfile_exit (fp); return (buf); } fp->_r -= len; fp->_p += len; - _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len); + (void) memcpy ((void *) s, (void *) p, len); s += len; } while ((n -= len) != 0); @@ -217,9 +188,8 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp), #ifndef _REENT_ONLY char * -_DEFUN(fgets, (buf, n, fp), - char *__restrict buf _AND - int n _AND +fgets (char *__restrict buf, + int n, FILE *__restrict fp) { return _fgets_r (_REENT, buf, n, fp); diff --git a/newlib/libc/stdio/fgetwc.c b/newlib/libc/stdio/fgetwc.c index d6de4b6cb..522697e9b 100644 --- a/newlib/libc/stdio/fgetwc.c +++ b/newlib/libc/stdio/fgetwc.c @@ -45,7 +45,7 @@ INDEX INDEX _getwc_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include #include wint_t fgetwc(FILE *<[fp]>); @@ -80,53 +80,6 @@ ANSI_SYNOPSIS #include wint_t _getwc_unlocked_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - #include - wint_t fgetwc(<[fp]>) - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - #include - wint_t fgetwc_unlocked(<[fp]>) - FILE *<[fp]>; - - #include - #include - wint_t _fgetwc_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - #include - #include - wint_t _fgetwc_unlocked_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - #include - #include - wint_t getwc(<[fp]>) - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - #include - wint_t getwc_unlocked(<[fp]>) - FILE *<[fp]>; - - #include - #include - wint_t _getwc_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - #include - #include - wint_t _getwc_unlocked_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION Use <> to get the next wide character from the file or stream identified by <[fp]>. As a side effect, <> advances the file's @@ -172,8 +125,7 @@ PORTABILITY #include "local.h" wint_t -_DEFUN(__fgetwc, (ptr, fp), - struct _reent *ptr _AND +__fgetwc (struct _reent *ptr, register FILE *fp) { wchar_t wc; @@ -219,8 +171,7 @@ _DEFUN(__fgetwc, (ptr, fp), } wint_t -_DEFUN(_fgetwc_r, (ptr, fp), - struct _reent *ptr _AND +_fgetwc_r (struct _reent *ptr, register FILE *fp) { wint_t r; @@ -233,8 +184,7 @@ _DEFUN(_fgetwc_r, (ptr, fp), } wint_t -_DEFUN(fgetwc, (fp), - FILE *fp) +fgetwc (FILE *fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fgetwc_u.c b/newlib/libc/stdio/fgetwc_u.c index 4ccd5765c..cbb97360b 100644 --- a/newlib/libc/stdio/fgetwc_u.c +++ b/newlib/libc/stdio/fgetwc_u.c @@ -30,8 +30,7 @@ #include "local.h" wint_t -_DEFUN(_fgetwc_unlocked_r, (ptr, fp), - struct _reent *ptr _AND +_fgetwc_unlocked_r (struct _reent *ptr, register FILE *fp) { ORIENT(fp, 1); @@ -39,8 +38,7 @@ _DEFUN(_fgetwc_unlocked_r, (ptr, fp), } wint_t -_DEFUN(fgetwc_unlocked, (fp), - FILE *fp) +fgetwc_unlocked (FILE *fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fgetws.c b/newlib/libc/stdio/fgetws.c index ae1f48e66..c942806c6 100644 --- a/newlib/libc/stdio/fgetws.c +++ b/newlib/libc/stdio/fgetws.c @@ -37,7 +37,7 @@ INDEX INDEX _fgetws_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include wchar_t *fgetws(wchar_t *__restrict <[ws]>, int <[n]>, FILE *__restrict <[fp]>); @@ -55,34 +55,6 @@ ANSI_SYNOPSIS wchar_t *_fgetws_unlocked_r(struct _reent *<[ptr]>, wchar_t *<[ws]>, int <[n]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - wchar_t *fgetws(<[ws]>,<[n]>,<[fp]>) - wchar_t *__restrict <[ws]>; - int <[n]>; - FILE *__restrict <[fp]>; - - #define _GNU_SOURCE - #include - wchar_t *fgetws_unlocked(<[ws]>,<[n]>,<[fp]>) - wchar_t *__restrict <[ws]>; - int <[n]>; - FILE *__restrict <[fp]>; - - #include - wchar_t *_fgetws_r(<[ptr]>, <[ws]>,<[n]>,<[fp]>) - struct _reent *<[ptr]>; - wchar_t *<[ws]>; - int <[n]>; - FILE *<[fp]>; - - #include - wchar_t *_fgetws_unlocked_r(<[ptr]>, <[ws]>,<[n]>,<[fp]>) - struct _reent *<[ptr]>; - wchar_t *<[ws]>; - int <[n]>; - FILE *<[fp]>; - DESCRIPTION Reads at most <[n-1]> wide characters from <[fp]> until a newline is found. The wide characters including to the newline are stored @@ -127,10 +99,9 @@ PORTABILITY #endif wchar_t * -_DEFUN(_fgetws_r, (ptr, ws, n, fp), - struct _reent *ptr _AND - wchar_t * ws _AND - int n _AND +_fgetws_r (struct _reent *ptr, + wchar_t * ws, + int n, FILE * fp) { wchar_t *wsp; @@ -200,9 +171,8 @@ error: } wchar_t * -_DEFUN(fgetws, (ws, n, fp), - wchar_t *__restrict ws _AND - int n _AND +fgetws (wchar_t *__restrict ws, + int n, FILE *__restrict fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fileno.c b/newlib/libc/stdio/fileno.c index 7b505827d..ceb83f834 100644 --- a/newlib/libc/stdio/fileno.c +++ b/newlib/libc/stdio/fileno.c @@ -24,7 +24,7 @@ INDEX INDEX fileno_unlocked -ANSI_SYNOPSIS +SYNOPSIS #include int fileno(FILE *<[fp]>); @@ -32,16 +32,6 @@ ANSI_SYNOPSIS #include int fileno_unlocked(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int fileno(<[fp]>) - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int fileno_unlocked(<[fp]>) - FILE *<[fp]>; - DESCRIPTION You can use <> to return the file descriptor identified by <[fp]>. @@ -73,8 +63,7 @@ Supporting OS subroutines required: none. #include "local.h" int -_DEFUN(fileno, (f), - FILE * f) +fileno (FILE * f) { int result; CHECK_INIT (_REENT, f); diff --git a/newlib/libc/stdio/fileno_u.c b/newlib/libc/stdio/fileno_u.c index 468d1127e..830a07d2b 100644 --- a/newlib/libc/stdio/fileno_u.c +++ b/newlib/libc/stdio/fileno_u.c @@ -30,8 +30,7 @@ #include "local.h" int -_DEFUN(fileno_unlocked, (f), - FILE * f) +fileno_unlocked (FILE * f) { int result; CHECK_INIT (_REENT, f); diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 737bde102..7119c051b 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -26,7 +26,7 @@ #include #include "local.h" -#ifdef _REENT_SMALL +#if defined(_REENT_SMALL) && !defined(_REENT_GLOBAL_STDIO_STREAMS) const struct __sFILE_fake __sf_fake_stdin = {_NULL, 0, 0, 0, 0, {_NULL, 0}, 0, _NULL}; const struct __sFILE_fake __sf_fake_stdout = @@ -40,13 +40,12 @@ __FILE __sf[3]; #endif #if (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) -_NOINLINE_STATIC _VOID +_NOINLINE_STATIC void #else -static _VOID +static void #endif -_DEFUN(std, (ptr, flags, file), - FILE *ptr _AND - int flags _AND +std (FILE *ptr, + int flags, int file) { ptr->_p = 0; @@ -74,7 +73,7 @@ _DEFUN(std, (ptr, flags, file), #else /* _STDIO_CLOSE_STD_STREAMS */ ptr->_close = NULL; #endif /* _STDIO_CLOSE_STD_STREAMS */ -#if !defined(__SINGLE_THREAD__) && !defined(_REENT_SMALL) +#if !defined(__SINGLE_THREAD__) && !(defined(_REENT_SMALL) && !defined(_REENT_GLOBAL_STDIO_STREAMS)) __lock_init_recursive (ptr->_lock); /* * #else @@ -124,8 +123,7 @@ struct glue_with_file { }; struct _glue * -_DEFUN(__sfmoreglue, (d, n), - struct _reent *d _AND +__sfmoreglue (struct _reent *d, register int n) { struct glue_with_file *g; @@ -146,8 +144,7 @@ _DEFUN(__sfmoreglue, (d, n), */ FILE * -_DEFUN(__sfp, (d), - struct _reent *d) +__sfp (struct _reent *d) { FILE *fp; int n; @@ -203,9 +200,8 @@ found: * The name `_cleanup' is, alas, fairly well known outside stdio. */ -_VOID -_DEFUN(_cleanup_r, (ptr), - struct _reent *ptr) +void +_cleanup_r (struct _reent *ptr) { int (*cleanup_func) (struct _reent *, FILE *); #ifdef _STDIO_BSD_SEMANTICS @@ -230,12 +226,12 @@ _DEFUN(_cleanup_r, (ptr), if (ptr->_stderr != &__sf[2]) (*cleanup_func) (ptr, ptr->_stderr); #endif - _CAST_VOID _fwalk_reent (ptr, cleanup_func); + (void) _fwalk_reent (ptr, cleanup_func); } #ifndef _REENT_ONLY -_VOID -_DEFUN_VOID(_cleanup) +void +_cleanup (void) { _cleanup_r (_GLOBAL_REENT); } @@ -245,9 +241,8 @@ _DEFUN_VOID(_cleanup) * __sinit() is called whenever stdio's internal variables must be set up. */ -_VOID -_DEFUN(__sinit, (s), - struct _reent *s) +void +__sinit (struct _reent *s) { __sinit_lock_acquire (); @@ -265,7 +260,7 @@ _DEFUN(__sinit, (s), # ifndef _REENT_GLOBAL_STDIO_STREAMS s->__sglue._niobs = 3; s->__sglue._iobs = &s->__sf[0]; -# endif +# endif /* _REENT_GLOBAL_STDIO_STREAMS */ #else s->__sglue._niobs = 0; s->__sglue._iobs = NULL; @@ -274,9 +269,15 @@ _DEFUN(__sinit, (s), __sinit if it's 0. */ if (s == _GLOBAL_REENT) s->__sdidinit = 1; +# ifndef _REENT_GLOBAL_STDIO_STREAMS s->_stdin = __sfp(s); s->_stdout = __sfp(s); s->_stderr = __sfp(s); +# else /* _REENT_GLOBAL_STDIO_STREAMS */ + s->_stdin = &__sf[0]; + s->_stdout = &__sf[1]; + s->_stderr = &__sf[2]; +# endif /* _REENT_GLOBAL_STDIO_STREAMS */ #endif #ifdef _REENT_GLOBAL_STDIO_STREAMS @@ -287,11 +288,11 @@ _DEFUN(__sinit, (s), stdout_init (&__sf[1]); stderr_init (&__sf[2]); } -#else +#else /* _REENT_GLOBAL_STDIO_STREAMS */ stdin_init (s->_stdin); stdout_init (s->_stdout); stderr_init (s->_stderr); -#endif +#endif /* _REENT_GLOBAL_STDIO_STREAMS */ s->__sdidinit = 1; @@ -303,34 +304,33 @@ _DEFUN(__sinit, (s), __LOCK_INIT_RECURSIVE(static, __sfp_recursive_mutex); __LOCK_INIT_RECURSIVE(static, __sinit_recursive_mutex); -_VOID -_DEFUN_VOID(__sfp_lock_acquire) +void +__sfp_lock_acquire (void) { __lock_acquire_recursive (__sfp_recursive_mutex); } -_VOID -_DEFUN_VOID(__sfp_lock_release) +void +__sfp_lock_release (void) { __lock_release_recursive (__sfp_recursive_mutex); } -_VOID -_DEFUN_VOID(__sinit_lock_acquire) +void +__sinit_lock_acquire (void) { __lock_acquire_recursive (__sinit_recursive_mutex); } -_VOID -_DEFUN_VOID(__sinit_lock_release) +void +__sinit_lock_release (void) { __lock_release_recursive (__sinit_recursive_mutex); } /* Walkable file locking routine. */ static int -_DEFUN(__fp_lock, (ptr), - FILE * ptr) +__fp_lock (FILE * ptr) { if (!(ptr->_flags2 & __SNLK)) _flockfile (ptr); @@ -340,8 +340,7 @@ _DEFUN(__fp_lock, (ptr), /* Walkable file unlocking routine. */ static int -_DEFUN(__fp_unlock, (ptr), - FILE * ptr) +__fp_unlock (FILE * ptr) { if (!(ptr->_flags2 & __SNLK)) _funlockfile (ptr); @@ -349,18 +348,18 @@ _DEFUN(__fp_unlock, (ptr), return 0; } -_VOID -_DEFUN_VOID(__fp_lock_all) +void +__fp_lock_all (void) { __sfp_lock_acquire (); - _CAST_VOID _fwalk (_REENT, __fp_lock); + (void) _fwalk (_REENT, __fp_lock); } -_VOID -_DEFUN_VOID(__fp_unlock_all) +void +__fp_unlock_all (void) { - _CAST_VOID _fwalk (_REENT, __fp_unlock); + (void) _fwalk (_REENT, __fp_unlock); __sfp_lock_release (); } diff --git a/newlib/libc/stdio/fiprintf.c b/newlib/libc/stdio/fiprintf.c index 7d417f88c..ff0946287 100644 --- a/newlib/libc/stdio/fiprintf.c +++ b/newlib/libc/stdio/fiprintf.c @@ -22,10 +22,9 @@ #include int -_DEFUN(_fiprintf_r, (ptr, fp, fmt), - struct _reent *ptr _AND - FILE * fp _AND - const char *fmt _DOTS) +_fiprintf_r (struct _reent *ptr, + FILE * fp, + const char *fmt, ...) { int ret; va_list ap; @@ -39,9 +38,8 @@ _DEFUN(_fiprintf_r, (ptr, fp, fmt), #ifndef _REENT_ONLY int -_DEFUN(fiprintf, (fp, fmt), - FILE * fp _AND - const char *fmt _DOTS) +fiprintf (FILE * fp, + const char *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/fiscanf.c b/newlib/libc/stdio/fiscanf.c index 53fee8454..ea93f7542 100644 --- a/newlib/libc/stdio/fiscanf.c +++ b/newlib/libc/stdio/fiscanf.c @@ -18,33 +18,18 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -fiscanf(FILE *fp, _CONST char *fmt, ...) -#else -fiscanf(FILE *fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif +fiscanf(FILE *fp, const char *fmt, ...) { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (_REENT, fp, fmt, ap); va_end (ap); return ret; @@ -53,24 +38,12 @@ fiscanf(FILE *fp, fmt, va_alist) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC -_fiscanf_r(struct _reent *ptr, FILE *fp, _CONST char *fmt, ...) -#else -_fiscanf_r(ptr, FILE *fp, fmt, va_alist) - struct _reent *ptr; - FILE *fp; - char *fmt; - va_dcl -#endif +_fiscanf_r(struct _reent *ptr, FILE *fp, const char *fmt, ...) { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (ptr, fp, fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c index 518cc33f1..71fc1f60a 100644 --- a/newlib/libc/stdio/flags.c +++ b/newlib/libc/stdio/flags.c @@ -30,9 +30,8 @@ */ int -_DEFUN(__sflags, (ptr, mode, optr), - struct _reent *ptr _AND - register char *mode _AND +__sflags (struct _reent *ptr, + register char *mode, int *optr) { register int ret, m, o; diff --git a/newlib/libc/stdio/fmemopen.c b/newlib/libc/stdio/fmemopen.c index 17a3c9b5c..0d043520e 100644 --- a/newlib/libc/stdio/fmemopen.c +++ b/newlib/libc/stdio/fmemopen.c @@ -10,7 +10,7 @@ FUNCTION INDEX fmemopen -ANSI_SYNOPSIS +SYNOPSIS #include FILE *fmemopen(void *restrict <[buf]>, size_t <[size]>, const char *restrict <[mode]>); @@ -83,10 +83,9 @@ typedef struct fmemcookie { /* Read up to non-zero N bytes into BUF from stream described by COOKIE; return number of bytes read (0 on EOF). */ static _READ_WRITE_RETURN_TYPE -_DEFUN(fmemreader, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char *buf _AND +fmemreader (struct _reent *ptr, + void *cookie, + char *buf, _READ_WRITE_BUFSIZE_TYPE n) { fmemcookie *c = (fmemcookie *) cookie; @@ -103,10 +102,9 @@ _DEFUN(fmemreader, (ptr, cookie, buf, n), /* Write up to non-zero N bytes of BUF into the stream described by COOKIE, returning the number of bytes written or EOF on failure. */ static _READ_WRITE_RETURN_TYPE -_DEFUN(fmemwriter, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - const char *buf _AND +fmemwriter (struct _reent *ptr, + void *cookie, + const char *buf, _READ_WRITE_BUFSIZE_TYPE n) { fmemcookie *c = (fmemcookie *) cookie; @@ -159,10 +157,9 @@ _DEFUN(fmemwriter, (ptr, cookie, buf, n), /* Seek to position POS relative to WHENCE within stream described by COOKIE; return resulting position or fail with EOF. */ static _fpos_t -_DEFUN(fmemseeker, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos_t pos _AND +fmemseeker (struct _reent *ptr, + void *cookie, + _fpos_t pos, int whence) { fmemcookie *c = (fmemcookie *) cookie; @@ -214,10 +211,9 @@ _DEFUN(fmemseeker, (ptr, cookie, pos, whence), COOKIE; return resulting position or fail with EOF. */ #ifdef __LARGE64_FILES static _fpos64_t -_DEFUN(fmemseeker64, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t pos _AND +fmemseeker64 (struct _reent *ptr, + void *cookie, + _fpos64_t pos, int whence) { _off64_t offset = (_off64_t) pos; @@ -256,8 +252,7 @@ _DEFUN(fmemseeker64, (ptr, cookie, pos, whence), /* Reclaim resources used by stream described by COOKIE. */ static int -_DEFUN(fmemcloser, (ptr, cookie), - struct _reent *ptr _AND +fmemcloser (struct _reent *ptr, void *cookie) { fmemcookie *c = (fmemcookie *) cookie; @@ -268,10 +263,9 @@ _DEFUN(fmemcloser, (ptr, cookie), /* Open a memstream around buffer BUF of SIZE bytes, using MODE. Return the new stream, or fail with NULL. */ FILE * -_DEFUN(_fmemopen_r, (ptr, buf, size, mode), - struct _reent *ptr _AND - void *__restrict buf _AND - size_t size _AND +_fmemopen_r (struct _reent *ptr, + void *__restrict buf, + size_t size, const char *__restrict mode) { FILE *fp; @@ -361,9 +355,8 @@ _DEFUN(_fmemopen_r, (ptr, buf, size, mode), #ifndef _REENT_ONLY FILE * -_DEFUN(fmemopen, (buf, size, mode), - void *__restrict buf _AND - size_t size _AND +fmemopen (void *__restrict buf, + size_t size, const char *__restrict mode) { return _fmemopen_r (_REENT, buf, size, mode); diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c index 6d07561a3..022992b8d 100644 --- a/newlib/libc/stdio/fopen.c +++ b/newlib/libc/stdio/fopen.c @@ -24,24 +24,13 @@ INDEX INDEX _fopen_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *fopen(const char *<[file]>, const char *<[mode]>); FILE *_fopen_r(struct _reent *<[reent]>, const char *<[file]>, const char *<[mode]>); -TRAD_SYNOPSIS - #include - FILE *fopen(<[file]>, <[mode]>) - char *<[file]>; - char *<[mode]>; - - FILE *_fopen_r(<[reent]>, <[file]>, <[mode]>) - struct _reent *<[reent]>; - char *<[file]>; - char *<[mode]>; - DESCRIPTION <> initializes the data structures needed to read or write a file. Specify the file's name as the string at <[file]>, and the kind @@ -124,10 +113,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include "local.h" FILE * -_DEFUN(_fopen_r, (ptr, file, mode), - struct _reent *ptr _AND - _CONST char *__restrict file _AND - _CONST char *__restrict mode) +_fopen_r (struct _reent *ptr, + const char *__restrict file, + const char *__restrict mode) { register FILE *fp; register int f; @@ -153,7 +141,7 @@ _DEFUN(_fopen_r, (ptr, file, mode), fp->_file = f; fp->_flags = flags; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite; fp->_seek = __sseek; @@ -174,9 +162,8 @@ _DEFUN(_fopen_r, (ptr, file, mode), #ifndef _REENT_ONLY FILE * -_DEFUN(fopen, (file, mode), - _CONST char *file _AND - _CONST char *mode) +fopen (const char *file, + const char *mode) { return _fopen_r (_REENT, file, mode); } diff --git a/newlib/libc/stdio/fopencookie.c b/newlib/libc/stdio/fopencookie.c index 3697b48d7..0861528e0 100644 --- a/newlib/libc/stdio/fopencookie.c +++ b/newlib/libc/stdio/fopencookie.c @@ -10,7 +10,7 @@ FUNCTION INDEX fopencookie -ANSI_SYNOPSIS +SYNOPSIS #include FILE *fopencookie(const void *<[cookie]>, const char *<[mode]>, cookie_io_functions_t <[functions]>); @@ -98,10 +98,9 @@ typedef struct fccookie { } fccookie; static _READ_WRITE_RETURN_TYPE -_DEFUN(fcreader, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char *buf _AND +fcreader (struct _reent *ptr, + void *cookie, + char *buf, _READ_WRITE_BUFSIZE_TYPE n) { int result; @@ -113,10 +112,9 @@ _DEFUN(fcreader, (ptr, cookie, buf, n), } static _READ_WRITE_RETURN_TYPE -_DEFUN(fcwriter, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - const char *buf _AND +fcwriter (struct _reent *ptr, + void *cookie, + const char *buf, _READ_WRITE_BUFSIZE_TYPE n) { int result; @@ -136,10 +134,9 @@ _DEFUN(fcwriter, (ptr, cookie, buf, n), } static _fpos_t -_DEFUN(fcseeker, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos_t pos _AND +fcseeker (struct _reent *ptr, + void *cookie, + _fpos_t pos, int whence) { fccookie *c = (fccookie *) cookie; @@ -164,10 +161,9 @@ _DEFUN(fcseeker, (ptr, cookie, pos, whence), #ifdef __LARGE64_FILES static _fpos64_t -_DEFUN(fcseeker64, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t pos _AND +fcseeker64 (struct _reent *ptr, + void *cookie, + _fpos64_t pos, int whence) { _off64_t offset; @@ -180,8 +176,7 @@ _DEFUN(fcseeker64, (ptr, cookie, pos, whence), #endif /* __LARGE64_FILES */ static int -_DEFUN(fccloser, (ptr, cookie), - struct _reent *ptr _AND +fccloser (struct _reent *ptr, void *cookie) { int result = 0; @@ -197,10 +192,9 @@ _DEFUN(fccloser, (ptr, cookie), } FILE * -_DEFUN(_fopencookie_r, (ptr, cookie, mode, functions), - struct _reent *ptr _AND - void *cookie _AND - const char *mode _AND +_fopencookie_r (struct _reent *ptr, + void *cookie, + const char *mode, cookie_io_functions_t functions) { FILE *fp; @@ -253,9 +247,8 @@ _DEFUN(_fopencookie_r, (ptr, cookie, mode, functions), #ifndef _REENT_ONLY FILE * -_DEFUN(fopencookie, (cookie, mode, functions), - void *cookie _AND - const char *mode _AND +fopencookie (void *cookie, + const char *mode, cookie_io_functions_t functions) { return _fopencookie_r (_REENT, cookie, mode, functions); diff --git a/newlib/libc/stdio/fprintf.c b/newlib/libc/stdio/fprintf.c index fe92a5b99..efb97ad20 100644 --- a/newlib/libc/stdio/fprintf.c +++ b/newlib/libc/stdio/fprintf.c @@ -22,10 +22,9 @@ #include int -_DEFUN(_fprintf_r, (ptr, fp, fmt), - struct _reent *ptr _AND - FILE *__restrict fp _AND - const char *__restrict fmt _DOTS) +_fprintf_r (struct _reent *ptr, + FILE *__restrict fp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -38,16 +37,15 @@ _DEFUN(_fprintf_r, (ptr, fp, fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__alias__("_fprintf_r")))); +_fiprintf_r (struct _reent *, FILE *, const char *, ...) + _ATTRIBUTE ((__alias__("_fprintf_r"))); #endif #ifndef _REENT_ONLY int -_DEFUN(fprintf, (fp, fmt), - FILE *__restrict fp _AND - const char *__restrict fmt _DOTS) +fprintf (FILE *__restrict fp, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -60,7 +58,7 @@ _DEFUN(fprintf, (fp, fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(fiprintf, (FILE *, const char *, ...) - _ATTRIBUTE ((__alias__("fprintf")))); +fiprintf (FILE *, const char *, ...) + _ATTRIBUTE ((__alias__("fprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/fpurge.c b/newlib/libc/stdio/fpurge.c index dc052e85b..2e4f61ec9 100644 --- a/newlib/libc/stdio/fpurge.c +++ b/newlib/libc/stdio/fpurge.c @@ -14,7 +14,7 @@ INDEX INDEX __fpurge -ANSI_SYNOPSIS +SYNOPSIS #include int fpurge(FILE *<[fp]>); @@ -60,8 +60,7 @@ No supporting OS subroutines are required. /* Discard I/O from a single file. */ int -_DEFUN(_fpurge_r, (ptr, fp), - struct _reent *ptr _AND +_fpurge_r (struct _reent *ptr, register FILE * fp) { int t; @@ -93,8 +92,7 @@ _DEFUN(_fpurge_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(fpurge, (fp), - register FILE * fp) +fpurge (register FILE * fp) { return _fpurge_r (_REENT, fp); } @@ -102,8 +100,7 @@ _DEFUN(fpurge, (fp), #ifndef __rtems__ void -_DEFUN(__fpurge, (fp), - register FILE * fp) +__fpurge (register FILE * fp) { _fpurge_r (_REENT, fp); } diff --git a/newlib/libc/stdio/fputc.c b/newlib/libc/stdio/fputc.c index 0aad0a9f7..1385cadea 100644 --- a/newlib/libc/stdio/fputc.c +++ b/newlib/libc/stdio/fputc.c @@ -28,7 +28,7 @@ INDEX INDEX _fputc_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include int fputc(int <[ch]>, FILE *<[fp]>); @@ -42,30 +42,6 @@ ANSI_SYNOPSIS #include int _fputc_unlocked_r(struct _rent *<[ptr]>, int <[ch]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int fputc(<[ch]>, <[fp]>) - int <[ch]>; - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - int fputc_unlocked(<[ch]>, <[fp]>) - int <[ch]>; - FILE *<[fp]>; - - #include - int _fputc_r(<[ptr]>, <[ch]>, <[fp]>) - struct _reent *<[ptr]>; - int <[ch]>; - FILE *<[fp]>; - - #include - int _fputc_unlocked_r(<[ptr]>, <[ch]>, <[fp]>) - struct _reent *<[ptr]>; - int <[ch]>; - FILE *<[fp]>; - DESCRIPTION <> converts the argument <[ch]> from an <> to an <>, then writes it to the file or stream identified by @@ -111,9 +87,8 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" int -_DEFUN(_fputc_r, (ptr, ch, file), - struct _reent *ptr _AND - int ch _AND +_fputc_r (struct _reent *ptr, + int ch, FILE * file) { int result; @@ -126,8 +101,7 @@ _DEFUN(_fputc_r, (ptr, ch, file), #ifndef _REENT_ONLY int -_DEFUN(fputc, (ch, file), - int ch _AND +fputc (int ch, FILE * file) { #if !defined(__OPTIMIZE_SIZE__) && !defined(PREFER_SIZE_OVER_SPEED) diff --git a/newlib/libc/stdio/fputc_u.c b/newlib/libc/stdio/fputc_u.c index ac64b0bc2..9e16069bc 100644 --- a/newlib/libc/stdio/fputc_u.c +++ b/newlib/libc/stdio/fputc_u.c @@ -29,9 +29,8 @@ #include "local.h" int -_DEFUN(_fputc_unlocked_r, (ptr, ch, file), - struct _reent *ptr _AND - int ch _AND +_fputc_unlocked_r (struct _reent *ptr, + int ch, FILE * file) { CHECK_INIT(ptr, file); @@ -40,8 +39,7 @@ _DEFUN(_fputc_unlocked_r, (ptr, ch, file), #ifndef _REENT_ONLY int -_DEFUN(fputc_unlocked, (ch, file), - int ch _AND +fputc_unlocked (int ch, FILE * file) { #if !defined(__OPTIMIZE_SIZE__) && !defined(PREFER_SIZE_OVER_SPEED) diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c index 75f65d96e..7a1eadb12 100644 --- a/newlib/libc/stdio/fputs.c +++ b/newlib/libc/stdio/fputs.c @@ -28,7 +28,7 @@ INDEX INDEX _fputs_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include int fputs(const char *restrict <[s]>, FILE *restrict <[fp]>); @@ -42,30 +42,6 @@ ANSI_SYNOPSIS #include int _fputs_unlocked_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>); -TRAD_SYNOPSIS - #include - int fputs(<[s]>, <[fp]>) - char *<[s]>; - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - int fputs_unlocked(<[s]>, <[fp]>) - char *<[s]>; - FILE *<[fp]>; - - #include - int _fputs_r(<[ptr]>, <[s]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[s]>; - FILE *<[fp]>; - - #include - int _fputs_unlocked_r(<[ptr]>, <[s]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[s]>; - FILE *<[fp]>; - DESCRIPTION <> writes the string at <[s]> (but without the trailing null) to the file or stream identified by <[fp]>. @@ -110,9 +86,8 @@ Supporting OS subroutines required: <>, <>, <>, * Write the given string to the given file. */ int -_DEFUN(_fputs_r, (ptr, s, fp), - struct _reent * ptr _AND - char _CONST *__restrict s _AND +_fputs_r (struct _reent * ptr, + char const *__restrict s, FILE *__restrict fp) { #ifdef _FVWRITE_IN_STREAMIO @@ -133,7 +108,7 @@ _DEFUN(_fputs_r, (ptr, s, fp), _newlib_flockfile_end (fp); return result; #else - _CONST char *p = s; + const char *p = s; CHECK_INIT(ptr, fp); @@ -159,8 +134,7 @@ error: #ifndef _REENT_ONLY int -_DEFUN(fputs, (s, fp), - char _CONST *__restrict s _AND +fputs (char const *__restrict s, FILE *__restrict fp) { return _fputs_r (_REENT, s, fp); diff --git a/newlib/libc/stdio/fputwc.c b/newlib/libc/stdio/fputwc.c index 9c2ef6c3b..9a4e80d52 100644 --- a/newlib/libc/stdio/fputwc.c +++ b/newlib/libc/stdio/fputwc.c @@ -45,7 +45,7 @@ INDEX INDEX _putwc_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include #include wint_t fputwc(wchar_t <[wc]>, FILE *<[fp]>); @@ -80,61 +80,6 @@ ANSI_SYNOPSIS #include wint_t _putwc_unlocked_r(struct _reent *<[ptr]>, wchar_t <[wc]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - #include - wint_t fputwc(<[wc]>, <[fp]>) - wchar_t <[wc]>; - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - #include - wint_t fputwc_unlocked(<[wc]>, <[fp]>) - wchar_t <[wc]>; - FILE *<[fp]>; - - #include - #include - wint_t _fputwc_r(<[ptr]>, <[wc]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t <[wc]>; - FILE *<[fp]>; - - #include - #include - wint_t _fputwc_unlocked_r(<[ptr]>, <[wc]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t <[wc]>; - FILE *<[fp]>; - - #include - #include - wint_t putwc(<[wc]>, <[fp]>) - wchar_t <[wc]>; - FILE *<[fp]>; - - #define _GNU_SOURCE - #include - #include - wint_t putwc_unlocked(<[wc]>, <[fp]>) - wchar_t <[wc]>; - FILE *<[fp]>; - - #include - #include - wint_t _putwc_r(<[ptr]>, <[wc]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t <[wc]>; - FILE *<[fp]>; - - #include - #include - wint_t _putwc_unlocked_r(<[ptr]>, <[wc]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t <[wc]>; - FILE *<[fp]>; - DESCRIPTION <> writes the wide character argument <[wc]> to the file or stream identified by <[fp]>. @@ -183,9 +128,8 @@ PORTABILITY #include "local.h" wint_t -_DEFUN(__fputwc, (ptr, wc, fp), - struct _reent *ptr _AND - wchar_t wc _AND +__fputwc (struct _reent *ptr, + wchar_t wc, FILE *fp) { char buf[MB_LEN_MAX]; @@ -218,9 +162,8 @@ _DEFUN(__fputwc, (ptr, wc, fp), } wint_t -_DEFUN(_fputwc_r, (ptr, wc, fp), - struct _reent *ptr _AND - wchar_t wc _AND +_fputwc_r (struct _reent *ptr, + wchar_t wc, FILE *fp) { wint_t r; @@ -233,8 +176,7 @@ _DEFUN(_fputwc_r, (ptr, wc, fp), } wint_t -_DEFUN(fputwc, (wc, fp), - wchar_t wc _AND +fputwc (wchar_t wc, FILE *fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fputwc_u.c b/newlib/libc/stdio/fputwc_u.c index 43be648f7..d4e51532a 100644 --- a/newlib/libc/stdio/fputwc_u.c +++ b/newlib/libc/stdio/fputwc_u.c @@ -30,9 +30,8 @@ #include "local.h" wint_t -_DEFUN(_fputwc_unlocked_r, (ptr, wc, fp), - struct _reent *ptr _AND - wchar_t wc _AND +_fputwc_unlocked_r (struct _reent *ptr, + wchar_t wc, FILE *fp) { ORIENT(fp, 1); @@ -40,8 +39,7 @@ _DEFUN(_fputwc_unlocked_r, (ptr, wc, fp), } wint_t -_DEFUN(fputwc_unlocked, (wc, fp), - wchar_t wc _AND +fputwc_unlocked (wchar_t wc, FILE *fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fputws.c b/newlib/libc/stdio/fputws.c index bb2fa6dbe..92f2cbf6a 100644 --- a/newlib/libc/stdio/fputws.c +++ b/newlib/libc/stdio/fputws.c @@ -37,7 +37,7 @@ INDEX INDEX _fputws_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include int fputws(const wchar_t *__restrict <[ws]>, FILE *__restrict <[fp]>); @@ -53,30 +53,6 @@ ANSI_SYNOPSIS int _fputws_unlocked_r(struct _reent *<[ptr]>, const wchar_t *<[ws]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int fputws(<[ws]>, <[fp]>) - wchar_t *__restrict <[ws]>; - FILE *__restrict <[fp]>; - - #define _GNU_SOURCE - #include - int fputws_unlocked(<[ws]>, <[fp]>) - wchar_t *__restrict <[ws]>; - FILE *__restrict <[fp]>; - - #include - int _fputws_r(<[ptr]>, <[ws]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t *<[ws]>; - FILE *<[fp]>; - - #include - int _fputws_unlocked_r(<[ptr]>, <[ws]>, <[fp]>) - struct _reent *<[ptr]>; - wchar_t *<[ws]>; - FILE *<[fp]>; - DESCRIPTION <> writes the wide character string at <[ws]> (but without the trailing null) to the file or stream identified by <[fp]>. @@ -118,9 +94,8 @@ PORTABILITY #endif int -_DEFUN(_fputws_r, (ptr, ws, fp), - struct _reent *ptr _AND - const wchar_t *ws _AND +_fputws_r (struct _reent *ptr, + const wchar_t *ws, FILE *fp) { size_t nbytes; @@ -182,8 +157,7 @@ error: } int -_DEFUN(fputws, (ws, fp), - const wchar_t *__restrict ws _AND +fputws (const wchar_t *__restrict ws, FILE *__restrict fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c index c6839476d..b358d2b4a 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -28,7 +28,7 @@ INDEX INDEX _fread_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include size_t fread(void *restrict <[buf]>, size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>); @@ -46,38 +46,6 @@ ANSI_SYNOPSIS size_t _fread_unlocked_r(struct _reent *<[ptr]>, void *restrict <[buf]>, size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>); -TRAD_SYNOPSIS - #include - size_t fread(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - size_t fread_unlocked(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #include - size_t _fread_r(<[ptr]>, <[buf]>, <[size]>, <[count]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #include - size_t _fread_unlocked_r(<[ptr]>, <[buf]>, <[size]>, <[count]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - DESCRIPTION <> attempts to copy, from the file or stream identified by <[fp]>, <[count]> elements (each of size <[size]>) into memory, @@ -125,11 +93,10 @@ Supporting OS subroutines required: <>, <>, <>, #ifdef __SCLE static size_t -_DEFUN(crlf_r, (ptr, fp, buf, count, eof), - struct _reent * ptr _AND - FILE * fp _AND - char * buf _AND - size_t count _AND +crlf_r (struct _reent * ptr, + FILE * fp, + char * buf, + size_t count, int eof) { int r; @@ -174,11 +141,10 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof), #endif size_t -_DEFUN(_fread_r, (ptr, buf, size, count, fp), - struct _reent * ptr _AND - _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +_fread_r (struct _reent * ptr, + void *__restrict buf, + size_t size, + size_t count, FILE * __restrict fp) { register size_t resid; @@ -205,7 +171,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), { /* First copy any available characters from ungetc buffer. */ int copy_size = resid > fp->_r ? fp->_r : resid; - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) copy_size); + (void) memcpy ((void *) p, (void *) fp->_p, (size_t) copy_size); fp->_p += copy_size; fp->_r -= copy_size; p += copy_size; @@ -254,7 +220,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), { while (resid > (r = fp->_r)) { - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) r); + (void) memcpy ((void *) p, (void *) fp->_p, (size_t) r); fp->_p += r; /* fp->_r = 0 ... done in __srefill */ p += r; @@ -273,7 +239,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), return (total - resid) / size; } } - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); + (void) memcpy ((void *) p, (void *) fp->_p, resid); fp->_r -= resid; fp->_p += resid; } @@ -292,10 +258,9 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), #ifndef _REENT_ONLY size_t -_DEFUN(fread, (buf, size, count, fp), - _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +fread (void *__restrict buf, + size_t size, + size_t count, FILE *__restrict fp) { return _fread_r (_REENT, buf, size, count, fp); diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index fb1f6c4db..0af1c1ecd 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -24,26 +24,13 @@ INDEX INDEX _freopen_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *freopen(const char *restrict <[file]>, const char *restrict <[mode]>, FILE *restrict <[fp]>); FILE *_freopen_r(struct _reent *<[ptr]>, const char *restrict <[file]>, const char *restrict <[mode]>, FILE *restrict <[fp]>); -TRAD_SYNOPSIS - #include - FILE *freopen(<[file]>, <[mode]>, <[fp]>) - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - - FILE *_freopen_r(<[ptr]>, <[file]>, <[mode]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - DESCRIPTION Use this variant of <> if you wish to specify a particular file descriptor <[fp]> (notably <>, <>, or <>) for @@ -88,10 +75,9 @@ Supporting OS subroutines required: <>, <>, <>, */ FILE * -_DEFUN(_freopen_r, (ptr, file, mode, fp), - struct _reent *ptr _AND - const char *__restrict file _AND - const char *__restrict mode _AND +_freopen_r (struct _reent *ptr, + const char *__restrict file, + const char *__restrict mode, register FILE *__restrict fp) { register int f; @@ -234,7 +220,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), fp->_flags = flags; fp->_file = f; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite; fp->_seek = __sseek; @@ -256,9 +242,8 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), #ifndef _REENT_ONLY FILE * -_DEFUN(freopen, (file, mode, fp), - _CONST char *__restrict file _AND - _CONST char *__restrict mode _AND +freopen (const char *__restrict file, + const char *__restrict mode, register FILE *__restrict fp) { return _freopen_r (_REENT, file, mode, fp); diff --git a/newlib/libc/stdio/fscanf.c b/newlib/libc/stdio/fscanf.c index 87b51dd88..af01eedbe 100644 --- a/newlib/libc/stdio/fscanf.c +++ b/newlib/libc/stdio/fscanf.c @@ -18,33 +18,18 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -fscanf(FILE *__restrict fp, _CONST char *__restrict fmt, ...) -#else -fscanf(FILE *fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif +fscanf(FILE *__restrict fp, const char *__restrict fmt, ...) { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (_REENT, fp, fmt, ap); va_end (ap); return ret; @@ -52,31 +37,19 @@ fscanf(FILE *fp, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(fiscanf, (FILE *, const char *, ...) - _ATTRIBUTE ((__alias__("fscanf")))); +fiscanf (FILE *, const char *, ...) + _ATTRIBUTE ((__alias__("fscanf"))); #endif #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC -_fscanf_r(struct _reent *ptr, FILE *__restrict fp, _CONST char *__restrict fmt, ...) -#else -_fscanf_r(ptr, FILE *fp, fmt, va_alist) - struct _reent *ptr; - FILE *fp; - char *fmt; - va_dcl -#endif +_fscanf_r(struct _reent *ptr, FILE *__restrict fp, const char *__restrict fmt, ...) { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (ptr, fp, fmt, ap); va_end (ap); return (ret); @@ -84,6 +57,6 @@ _fscanf_r(ptr, FILE *fp, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__alias__("_fscanf_r")))); +_fiscanf_r (struct _reent *, FILE *, const char *, ...) + _ATTRIBUTE ((__alias__("_fscanf_r"))); #endif diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c index b8fc36a04..9b3ea986c 100644 --- a/newlib/libc/stdio/fseek.c +++ b/newlib/libc/stdio/fseek.c @@ -28,7 +28,7 @@ INDEX INDEX _fseeko_r -ANSI_SYNOPSIS +SYNOPSIS #include int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>); int fseeko(FILE *<[fp]>, off_t <[offset]>, int <[whence]>); @@ -37,30 +37,6 @@ ANSI_SYNOPSIS int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>, off_t <[offset]>, int <[whence]>); -TRAD_SYNOPSIS - #include - int fseek(<[fp]>, <[offset]>, <[whence]>); - FILE *<[fp]>; - long <[offset]>; - int <[whence]>; - - int fseeko(<[fp]>, <[offset]>, <[whence]>); - FILE *<[fp]>; - off_t <[offset]>; - int <[whence]>; - - int _fseek_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>); - struct _reent *<[ptr]>; - FILE *<[fp]>; - long <[offset]>; - int <[whence]>; - - int _fseeko_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>); - struct _reent *<[ptr]>; - FILE *<[fp]>; - off_t <[offset]>; - int <[whence]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -105,10 +81,9 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" int -_DEFUN(_fseek_r, (ptr, fp, offset, whence), - struct _reent *ptr _AND - register FILE *fp _AND - long offset _AND +_fseek_r (struct _reent *ptr, + register FILE *fp, + long offset, int whence) { return _fseeko_r (ptr, fp, offset, whence); @@ -117,9 +92,8 @@ _DEFUN(_fseek_r, (ptr, fp, offset, whence), #ifndef _REENT_ONLY int -_DEFUN(fseek, (fp, offset, whence), - register FILE *fp _AND - long offset _AND +fseek (register FILE *fp, + long offset, int whence) { return _fseek_r (_REENT, fp, offset, whence); diff --git a/newlib/libc/stdio/fseeko.c b/newlib/libc/stdio/fseeko.c index 2c9419d97..3e0f9e90b 100644 --- a/newlib/libc/stdio/fseeko.c +++ b/newlib/libc/stdio/fseeko.c @@ -28,7 +28,7 @@ INDEX INDEX _fseeko_r -ANSI_SYNOPSIS +SYNOPSIS #include int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>) int fseeko(FILE *<[fp]>, off_t <[offset]>, int <[whence]>) @@ -37,30 +37,6 @@ ANSI_SYNOPSIS int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>, off_t <[offset]>, int <[whence]>) -TRAD_SYNOPSIS - #include - int fseek(<[fp]>, <[offset]>, <[whence]>) - FILE *<[fp]>; - long <[offset]>; - int <[whence]>; - - int fseeko(<[fp]>, <[offset]>, <[whence]>) - FILE *<[fp]>; - off_t <[offset]>; - int <[whence]>; - - int _fseek_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - long <[offset]>; - int <[whence]>; - - int _fseeko_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - off_t <[offset]>; - int <[whence]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -117,13 +93,12 @@ Supporting OS subroutines required: <>, <>, <>, */ int -_DEFUN(_fseeko_r, (ptr, fp, offset, whence), - struct _reent *ptr _AND - register FILE *fp _AND - _off_t offset _AND +_fseeko_r (struct _reent *ptr, + register FILE *fp, + _off_t offset, int whence) { - _fpos_t _EXFNPTR(seekfn, (struct _reent *, _PTR, _fpos_t, int)); + _fpos_t (*seekfn) (struct _reent *, void *, _fpos_t, int); _fpos_t target; _fpos_t curoff = 0; size_t n; @@ -383,9 +358,8 @@ dumb: #ifndef _REENT_ONLY int -_DEFUN(fseeko, (fp, offset, whence), - register FILE *fp _AND - _off_t offset _AND +fseeko (register FILE *fp, + _off_t offset, int whence) { return _fseeko_r (_REENT, fp, offset, whence); diff --git a/newlib/libc/stdio/fsetlocking.c b/newlib/libc/stdio/fsetlocking.c index 3c489f54d..062b93a92 100644 --- a/newlib/libc/stdio/fsetlocking.c +++ b/newlib/libc/stdio/fsetlocking.c @@ -30,7 +30,7 @@ FUNCTION INDEX __fsetlocking -ANSI_SYNOPSIS +SYNOPSIS #include #include int __fsetlocking(FILE *<[fp]>, int <[type]>); @@ -65,8 +65,7 @@ No supporting OS subroutines are required. #include "local.h" int -_DEFUN(__fsetlocking, (fp, type), - FILE * fp _AND +__fsetlocking (FILE * fp, int type) { int result; diff --git a/newlib/libc/stdio/fsetpos.c b/newlib/libc/stdio/fsetpos.c index d1596293b..b5334e251 100644 --- a/newlib/libc/stdio/fsetpos.c +++ b/newlib/libc/stdio/fsetpos.c @@ -24,23 +24,12 @@ INDEX INDEX _fsetpos_r -ANSI_SYNOPSIS +SYNOPSIS #include int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>); int _fsetpos_r(struct _reent *<[ptr]>, FILE *<[fp]>, const fpos_t *<[pos]>); -TRAD_SYNOPSIS - #include - int fsetpos(<[fp]>, <[pos]>) - FILE *<[fp]>; - fpos_t *<[pos]>; - - int _fsetpos_r(<[ptr]>, <[fp]>, <[pos]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - fpos_t *<[pos]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -70,10 +59,9 @@ Supporting OS subroutines required: <>, <>, <>, #include int -_DEFUN(_fsetpos_r, (ptr, iop, pos), - struct _reent * ptr _AND - FILE * iop _AND - _CONST _fpos_t * pos) +_fsetpos_r (struct _reent * ptr, + FILE * iop, + const _fpos_t * pos) { int x = _fseek_r (ptr, iop, *pos, SEEK_SET); @@ -85,9 +73,8 @@ _DEFUN(_fsetpos_r, (ptr, iop, pos), #ifndef _REENT_ONLY int -_DEFUN(fsetpos, (iop, pos), - FILE * iop _AND - _CONST _fpos_t * pos) +fsetpos (FILE * iop, + const _fpos_t * pos) { return _fsetpos_r (_REENT, iop, pos); } diff --git a/newlib/libc/stdio/ftell.c b/newlib/libc/stdio/ftell.c index 5af0709cb..e4a246199 100644 --- a/newlib/libc/stdio/ftell.c +++ b/newlib/libc/stdio/ftell.c @@ -28,29 +28,13 @@ INDEX INDEX _ftello_r -ANSI_SYNOPSIS +SYNOPSIS #include long ftell(FILE *<[fp]>); off_t ftello(FILE *<[fp]>); long _ftell_r(struct _reent *<[ptr]>, FILE *<[fp]>); off_t _ftello_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - long ftell(<[fp]>) - FILE *<[fp]>; - - off_t ftello(<[fp]>) - FILE *<[fp]>; - - long _ftell_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - off_t _ftello_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -99,8 +83,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include "local.h" long -_DEFUN(_ftell_r, (ptr, fp), - struct _reent *ptr _AND +_ftell_r (struct _reent *ptr, register FILE * fp) { _fpos_t pos; @@ -117,8 +100,7 @@ _DEFUN(_ftell_r, (ptr, fp), #ifndef _REENT_ONLY long -_DEFUN(ftell, (fp), - register FILE * fp) +ftell (register FILE * fp) { return _ftell_r (_REENT, fp); } diff --git a/newlib/libc/stdio/ftello.c b/newlib/libc/stdio/ftello.c index 3a1885e81..d083b9359 100644 --- a/newlib/libc/stdio/ftello.c +++ b/newlib/libc/stdio/ftello.c @@ -28,29 +28,13 @@ INDEX INDEX _ftello_r -ANSI_SYNOPSIS +SYNOPSIS #include long ftell(FILE *<[fp]>); off_t ftello(FILE *<[fp]>); long _ftell_r(struct _reent *<[ptr]>, FILE *<[fp]>); off_t _ftello_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - long ftell(<[fp]>) - FILE *<[fp]>; - - off_t ftello(<[fp]>) - FILE *<[fp]>; - - long _ftell_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - - off_t _ftello_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -99,8 +83,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include "local.h" _off_t -_DEFUN(_ftello_r, (ptr, fp), - struct _reent * ptr _AND +_ftello_r (struct _reent * ptr, register FILE * fp) { _fpos_t pos; @@ -115,24 +98,30 @@ _DEFUN(_ftello_r, (ptr, fp), { ptr->_errno = ESPIPE; _newlib_flockfile_exit (fp); - return -1L; + return (_off_t) -1; } - /* Find offset of underlying I/O object, then adjust for buffered - bytes. Flush a write stream, since the offset may be altered if - the stream is appending. Do not flush a read stream, since we - must not lose the ungetc buffer. */ - if (fp->_flags & __SWR) - _fflush_r (ptr, fp); - if (fp->_flags & __SOFF) + /* Find offset of underlying I/O object, then adjust for buffered bytes. */ + if (!(fp->_flags & __SRD) && (fp->_flags & __SWR) && + fp->_p != NULL && fp->_p - fp->_bf._base > 0 && + (fp->_flags & __SAPP)) + { + pos = fp->_seek (ptr, fp->_cookie, (_fpos_t) 0, SEEK_END); + if (pos == (_fpos_t) -1) + { + _newlib_flockfile_exit (fp); + return (_off_t) -1; + } + } + else if (fp->_flags & __SOFF) pos = fp->_offset; else { pos = fp->_seek (ptr, fp->_cookie, (_fpos_t) 0, SEEK_CUR); - if (pos == -1L) + if (pos == (_fpos_t) -1) { _newlib_flockfile_exit (fp); - return pos; + return (_off_t) -1; } } if (fp->_flags & __SRD) @@ -157,14 +146,13 @@ _DEFUN(_ftello_r, (ptr, fp), } _newlib_flockfile_end (fp); - return pos; + return (_off_t) pos; } #ifndef _REENT_ONLY _off_t -_DEFUN(ftello, (fp), - register FILE * fp) +ftello (register FILE * fp) { return _ftello_r (_REENT, fp); } diff --git a/newlib/libc/stdio/funopen.c b/newlib/libc/stdio/funopen.c index e71d23187..a1c0d767d 100644 --- a/newlib/libc/stdio/funopen.c +++ b/newlib/libc/stdio/funopen.c @@ -14,7 +14,7 @@ INDEX INDEX fwopen -ANSI_SYNOPSIS +SYNOPSIS #include FILE *funopen(const void *<[cookie]>, int (*<[readfn]>) (void *cookie, char *buf, int n), @@ -104,10 +104,9 @@ typedef struct funcookie { } funcookie; static _READ_WRITE_RETURN_TYPE -_DEFUN(funreader, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char *buf _AND +funreader (struct _reent *ptr, + void *cookie, + char *buf, _READ_WRITE_BUFSIZE_TYPE n) { int result; @@ -119,10 +118,9 @@ _DEFUN(funreader, (ptr, cookie, buf, n), } static _READ_WRITE_RETURN_TYPE -_DEFUN(funwriter, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - const char *buf _AND +funwriter (struct _reent *ptr, + void *cookie, + const char *buf, _READ_WRITE_BUFSIZE_TYPE n) { int result; @@ -134,10 +132,9 @@ _DEFUN(funwriter, (ptr, cookie, buf, n), } static _fpos_t -_DEFUN(funseeker, (ptr, cookie, off, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos_t off _AND +funseeker (struct _reent *ptr, + void *cookie, + _fpos_t off, int whence) { funcookie *c = (funcookie *) cookie; @@ -162,10 +159,9 @@ _DEFUN(funseeker, (ptr, cookie, off, whence), #ifdef __LARGE64_FILES static _fpos64_t -_DEFUN(funseeker64, (ptr, cookie, off, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t off _AND +funseeker64 (struct _reent *ptr, + void *cookie, + _fpos64_t off, int whence) { _fpos64_t result; @@ -178,8 +174,7 @@ _DEFUN(funseeker64, (ptr, cookie, off, whence), #endif /* __LARGE64_FILES */ static int -_DEFUN(funcloser, (ptr, cookie), - struct _reent *ptr _AND +funcloser (struct _reent *ptr, void *cookie) { int result = 0; @@ -195,12 +190,11 @@ _DEFUN(funcloser, (ptr, cookie), } FILE * -_DEFUN(_funopen_r, (ptr, cookie, readfn, writefn, seekfn, closefn), - struct _reent *ptr _AND - const void *cookie _AND - funread readfn _AND - funwrite writefn _AND - funseek seekfn _AND +_funopen_r (struct _reent *ptr, + const void *cookie, + funread readfn, + funwrite writefn, + funseek seekfn, funclose closefn) { FILE *fp; @@ -267,11 +261,10 @@ _DEFUN(_funopen_r, (ptr, cookie, readfn, writefn, seekfn, closefn), #ifndef _REENT_ONLY FILE * -_DEFUN(funopen, (cookie, readfn, writefn, seekfn, closefn), - const void *cookie _AND - funread readfn _AND - funwrite writefn _AND - funseek seekfn _AND +funopen (const void *cookie, + funread readfn, + funwrite writefn, + funseek seekfn, funclose closefn) { return _funopen_r (_REENT, cookie, readfn, writefn, seekfn, closefn); diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c index 455666006..3e3a0c6a2 100644 --- a/newlib/libc/stdio/fvwrite.c +++ b/newlib/libc/stdio/fvwrite.c @@ -26,7 +26,7 @@ #include "fvwrite.h" #define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define COPY(n) _CAST_VOID memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (n)) +#define COPY(n) (void) memmove ((void *) fp->_p, (void *) p, (size_t) (n)) #define GETIOV(extra_work) \ while (len == 0) \ @@ -45,13 +45,12 @@ */ int -_DEFUN(__sfvwrite_r, (ptr, fp, uio), - struct _reent *ptr _AND - register FILE *fp _AND +__sfvwrite_r (struct _reent *ptr, + register FILE *fp, register struct __suio *uio) { register size_t len; - register _CONST char *p = NULL; + register const char *p = NULL; register struct __siov *iov; register _READ_WRITE_RETURN_TYPE w, s; char *nl; @@ -219,7 +218,7 @@ _DEFUN(__sfvwrite_r, (ptr, fp, uio), GETIOV (nlknown = 0); if (!nlknown) { - nl = memchr ((_PTR) p, '\n', len); + nl = memchr ((void *) p, '\n', len); nldist = nl ? nl + 1 - p : len + 1; nlknown = 1; } diff --git a/newlib/libc/stdio/fvwrite.h b/newlib/libc/stdio/fvwrite.h index 5c078fe68..139d83737 100644 --- a/newlib/libc/stdio/fvwrite.h +++ b/newlib/libc/stdio/fvwrite.h @@ -22,7 +22,7 @@ * I/O descriptors for __sfvwrite_r(). */ struct __siov { - _CONST _PTR iov_base; + const void *iov_base; size_t iov_len; }; struct __suio { @@ -32,5 +32,5 @@ struct __suio { }; -extern int _EXFUN(__sfvwrite_r,(struct _reent *, FILE *, struct __suio *)); -extern int _EXFUN(__swsetup_r,(struct _reent *, FILE *)); +extern int __sfvwrite_r (struct _reent *, FILE *, struct __suio *); +extern int __swsetup_r (struct _reent *, FILE *); diff --git a/newlib/libc/stdio/fwalk.c b/newlib/libc/stdio/fwalk.c index cceaa96c2..b4b285a64 100644 --- a/newlib/libc/stdio/fwalk.c +++ b/newlib/libc/stdio/fwalk.c @@ -28,8 +28,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include "local.h" int -_DEFUN(_fwalk, (ptr, function), - struct _reent *ptr _AND +_fwalk (struct _reent *ptr, register int (*function) (FILE *)) { register FILE *fp; @@ -55,8 +54,7 @@ _DEFUN(_fwalk, (ptr, function), /* Special version of __fwalk where the function pointer is a reentrant I/O function (e.g. _fclose_r). */ int -_DEFUN(_fwalk_reent, (ptr, reent_function), - struct _reent *ptr _AND +_fwalk_reent (struct _reent *ptr, register int (*reent_function) (struct _reent *, FILE *)) { register FILE *fp; diff --git a/newlib/libc/stdio/fwide.c b/newlib/libc/stdio/fwide.c index b2aaf8a62..9b5a3d12a 100644 --- a/newlib/libc/stdio/fwide.c +++ b/newlib/libc/stdio/fwide.c @@ -7,23 +7,12 @@ INDEX INDEX _fwide_r -ANSI_SYNOPSIS +SYNOPSIS #include int fwide(FILE *<[fp]>, int <[mode]>); int _fwide_r(struct _reent *<[ptr]>, FILE *<[fp]>, int <[mode]>); -TRAD_SYNOPSIS - #include - int fwide(<[fp]>, <[mode]>); - FILE *<[fp]>; - int <[mode]>; - - int _fwide_r(<[ptr]>, <[fp]>, <[mode]>); - struct _reent *<[ptr]>; - FILE *<[fp]>; - int <[mode]>; - DESCRIPTION When <[mode]> is zero, the <> function determines the current orientation of <[fp]>. It returns a value > 0 if <[fp]> is @@ -59,9 +48,8 @@ C99, POSIX.1-2001. #include "local.h" int -_DEFUN(_fwide_r, (ptr, fp, mode), - struct _reent *ptr _AND - FILE *fp _AND +_fwide_r (struct _reent *ptr, + FILE *fp, int mode) { int ret; @@ -81,8 +69,7 @@ _DEFUN(_fwide_r, (ptr, fp, mode), } int -_DEFUN(fwide, (fp, mode), - FILE *fp _AND +fwide (FILE *fp, int mode) { return _fwide_r (_REENT, fp, mode); diff --git a/newlib/libc/stdio/fwprintf.c b/newlib/libc/stdio/fwprintf.c index 4b05824c4..d4047dcc4 100644 --- a/newlib/libc/stdio/fwprintf.c +++ b/newlib/libc/stdio/fwprintf.c @@ -23,10 +23,9 @@ #include int -_DEFUN(_fwprintf_r, (ptr, fp, fmt), - struct _reent *ptr _AND - FILE *fp _AND - const wchar_t *fmt _DOTS) +_fwprintf_r (struct _reent *ptr, + FILE *fp, + const wchar_t *fmt, ...) { int ret; va_list ap; @@ -40,9 +39,8 @@ _DEFUN(_fwprintf_r, (ptr, fp, fmt), #ifndef _REENT_ONLY int -_DEFUN(fwprintf, (fp, fmt), - FILE *__restrict fp _AND - const wchar_t *__restrict fmt _DOTS) +fwprintf (FILE *__restrict fp, + const wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c index 6b3ff9015..aa14421db 100644 --- a/newlib/libc/stdio/fwrite.c +++ b/newlib/libc/stdio/fwrite.c @@ -28,7 +28,7 @@ INDEX INDEX _fwrite_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include size_t fwrite(const void *restrict <[buf]>, size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>); @@ -46,38 +46,6 @@ ANSI_SYNOPSIS size_t _fwrite_unlocked_r(struct _reent *<[ptr]>, const void *restrict <[buf]>, size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>); -TRAD_SYNOPSIS - #include - size_t fwrite(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #define _BSD_SOURCE - #include - size_t fwrite_unlocked(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #include - size_t _fwrite_r(<[ptr]>, <[buf]>, <[size]>, <[count]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - - #include - size_t _fwrite_unlocked_r(<[ptr]>, <[buf]>, <[size]>, <[count]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - DESCRIPTION <> attempts to copy, starting from the memory location <[buf]>, <[count]> elements (each of size <[size]>) into the file or @@ -140,11 +108,10 @@ static char sccsid[] = "%W% (Berkeley) %G%"; */ size_t -_DEFUN(_fwrite_r, (ptr, buf, size, count, fp), - struct _reent * ptr _AND - _CONST _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +_fwrite_r (struct _reent * ptr, + const void *__restrict buf, + size_t size, + size_t count, FILE * __restrict fp) { size_t n; @@ -176,7 +143,7 @@ _DEFUN(_fwrite_r, (ptr, buf, size, count, fp), return (n - uio.uio_resid) / size; #else size_t i = 0; - _CONST char *p = buf; + const char *p = buf; n = count * size; CHECK_INIT (ptr, fp); @@ -202,10 +169,9 @@ ret: #ifndef _REENT_ONLY size_t -_DEFUN(fwrite, (buf, size, count, fp), - _CONST _PTR __restrict buf _AND - size_t size _AND - size_t count _AND +fwrite (const void *__restrict buf, + size_t size, + size_t count, FILE * fp) { return _fwrite_r (_REENT, buf, size, count, fp); diff --git a/newlib/libc/stdio/fwscanf.c b/newlib/libc/stdio/fwscanf.c index 8572f4185..1b86a3472 100644 --- a/newlib/libc/stdio/fwscanf.c +++ b/newlib/libc/stdio/fwscanf.c @@ -26,7 +26,7 @@ #ifndef _REENT_ONLY int -fwscanf (FILE *__restrict fp, _CONST wchar_t *__restrict fmt, ...) +fwscanf (FILE *__restrict fp, const wchar_t *__restrict fmt, ...) { int ret; va_list ap; @@ -40,7 +40,7 @@ fwscanf (FILE *__restrict fp, _CONST wchar_t *__restrict fmt, ...) #endif /* !_REENT_ONLY */ int -_fwscanf_r (struct _reent *ptr, FILE *fp, _CONST wchar_t *fmt, ...) +_fwscanf_r (struct _reent *ptr, FILE *fp, const wchar_t *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c index 7951cdc93..3c62f0bd9 100644 --- a/newlib/libc/stdio/getc.c +++ b/newlib/libc/stdio/getc.c @@ -24,23 +24,13 @@ INDEX INDEX _getc_r -ANSI_SYNOPSIS +SYNOPSIS #include int getc(FILE *<[fp]>); #include int _getc_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int getc(<[fp]>) - FILE *<[fp]>; - - #include - int _getc_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION <> is a macro, defined in <>. You can use <> to get the next single character from the file or stream @@ -86,8 +76,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef getc int -_DEFUN(_getc_r, (ptr, fp), - struct _reent *ptr _AND +_getc_r (struct _reent *ptr, register FILE *fp) { int result; @@ -101,8 +90,7 @@ _DEFUN(_getc_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(getc, (fp), - register FILE *fp) +getc (register FILE *fp) { int result; struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/getc_u.c b/newlib/libc/stdio/getc_u.c index 6b71ce52d..fb37ba4b1 100644 --- a/newlib/libc/stdio/getc_u.c +++ b/newlib/libc/stdio/getc_u.c @@ -69,8 +69,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef getc_unlocked int -_DEFUN(_getc_unlocked_r, (ptr, fp), - struct _reent *ptr _AND +_getc_unlocked_r (struct _reent *ptr, register FILE *fp) { /* CHECK_INIT is called (eventually) by __srefill_r. */ @@ -81,8 +80,7 @@ _DEFUN(_getc_unlocked_r, (ptr, fp), #ifndef _REENT_ONLY int -_DEFUN(getc_unlocked, (fp), - register FILE *fp) +getc_unlocked (register FILE *fp) { return __sgetc_r (_REENT, fp); } diff --git a/newlib/libc/stdio/getchar.c b/newlib/libc/stdio/getchar.c index 7f3ceac62..7e0b74848 100644 --- a/newlib/libc/stdio/getchar.c +++ b/newlib/libc/stdio/getchar.c @@ -24,19 +24,12 @@ INDEX INDEX _getchar_r -ANSI_SYNOPSIS +SYNOPSIS #include int getchar(void); int _getchar_r(struct _reent *<[reent]>); -TRAD_SYNOPSIS - #include - int getchar(); - - int _getchar_r(<[reent]>) - char * <[reent]>; - DESCRIPTION <> is a macro, defined in <>. You can use <> to get the next single character from the standard input stream. @@ -79,8 +72,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef getchar int -_DEFUN(_getchar_r, (reent), - struct _reent *reent) +_getchar_r (struct _reent *reent) { _REENT_SMALL_CHECK_INIT (reent); return _getc_r (reent, _stdin_r (reent)); @@ -89,7 +81,7 @@ _DEFUN(_getchar_r, (reent), #ifndef _REENT_ONLY int -_DEFUN_VOID(getchar) +getchar (void) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/getchar_u.c b/newlib/libc/stdio/getchar_u.c index 516b4dbd2..e45176dfa 100644 --- a/newlib/libc/stdio/getchar_u.c +++ b/newlib/libc/stdio/getchar_u.c @@ -70,8 +70,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef getchar_unlocked int -_DEFUN(_getchar_unlocked_r, (ptr), - struct _reent *ptr) +_getchar_unlocked_r (struct _reent *ptr) { return _getc_unlocked_r (ptr, _stdin_r (ptr)); } @@ -79,7 +78,7 @@ _DEFUN(_getchar_unlocked_r, (ptr), #ifndef _REENT_ONLY int -_DEFUN_VOID(getchar_unlocked) +getchar_unlocked (void) { /* CHECK_INIT is called (eventually) by __srefill_r. */ diff --git a/newlib/libc/stdio/getdelim.c b/newlib/libc/stdio/getdelim.c index 63a579a79..90cd5d47f 100644 --- a/newlib/libc/stdio/getdelim.c +++ b/newlib/libc/stdio/getdelim.c @@ -6,19 +6,11 @@ FUNCTION INDEX getdelim -ANSI_SYNOPSIS +SYNOPSIS #include int getdelim(char **<[bufptr]>, size_t *<[n]>, int <[delim]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int getdelim(<[bufptr]>, <[n]>, <[delim]>, <[fp]>) - char **<[bufptr]>; - size_t *<[n]>; - int <[delim]>; - FILE *<[fp]>; - DESCRIPTION <> reads a file <[fp]> up to and possibly including a specified delimiter <[delim]>. The line is read into a buffer pointed to @@ -48,10 +40,9 @@ No supporting OS subroutines are directly required. #define DEFAULT_LINE_SIZE 128 ssize_t -_DEFUN(__getdelim, (bufptr, n, delim, fp), - char **bufptr _AND - size_t *n _AND - int delim _AND +__getdelim (char **bufptr, + size_t *n, + int delim, FILE *fp) { char *buf; diff --git a/newlib/libc/stdio/getline.c b/newlib/libc/stdio/getline.c index c758ae964..1c59afd2a 100644 --- a/newlib/libc/stdio/getline.c +++ b/newlib/libc/stdio/getline.c @@ -6,17 +6,10 @@ FUNCTION INDEX getline -ANSI_SYNOPSIS +SYNOPSIS #include ssize_t getline(char **<[bufptr]>, size_t *<[n]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - ssize_t getline(<[bufptr]>, <[n]>, <[fp]>) - char **<[bufptr]>; - size_t *<[n]>; - FILE *<[fp]>; - DESCRIPTION <> reads a file <[fp]> up to and possibly including the newline character. The line is read into a buffer pointed to @@ -41,12 +34,11 @@ No supporting OS subroutines are directly required. #include <_ansi.h> #include -extern ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); +extern ssize_t __getdelim (char **, size_t *, int, FILE *); ssize_t -_DEFUN(__getline, (lptr, n, fp), - char **lptr _AND - size_t *n _AND +__getline (char **lptr, + size_t *n, FILE *fp) { return __getdelim (lptr, n, '\n', fp); diff --git a/newlib/libc/stdio/gets.c b/newlib/libc/stdio/gets.c index 6c21f3e0c..a510ec0f0 100644 --- a/newlib/libc/stdio/gets.c +++ b/newlib/libc/stdio/gets.c @@ -24,23 +24,13 @@ INDEX INDEX _gets_r -ANSI_SYNOPSIS +SYNOPSIS #include char *gets(char *<[buf]>); char *_gets_r(struct _reent *<[reent]>, char *<[buf]>); -TRAD_SYNOPSIS - #include - - char *gets(<[buf]>) - char *<[buf]>; - - char *_gets_r(<[reent]>, <[buf]>) - struct _reent *<[reent]>; - char *<[buf]>; - DESCRIPTION Reads characters from standard input until a newline is found. The characters up to the newline are stored in <[buf]>. The @@ -73,8 +63,7 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" char * -_DEFUN(_gets_r, (ptr, buf), - struct _reent *ptr _AND +_gets_r (struct _reent *ptr, char *buf) { register int c; @@ -104,8 +93,7 @@ _DEFUN(_gets_r, (ptr, buf), #ifndef _REENT_ONLY char * -_DEFUN(gets, (buf), - char *buf) +gets (char *buf) { return _gets_r (_REENT, buf); } diff --git a/newlib/libc/stdio/getw.c b/newlib/libc/stdio/getw.c index 210c5939a..a1b72e482 100644 --- a/newlib/libc/stdio/getw.c +++ b/newlib/libc/stdio/getw.c @@ -22,15 +22,10 @@ FUNCTION INDEX getw -ANSI_SYNOPSIS +SYNOPSIS #include int getw(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int getw(<[fp]>) - FILE *<[fp]>; - DESCRIPTION <> is a function, defined in <>. You can use <> to get the next word from the file or stream identified by <[fp]>. As @@ -59,8 +54,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include int -_DEFUN(getw, (fp), - register FILE *fp) +getw (register FILE *fp) { int result; if (fread ((char*)&result, sizeof (result), 1, fp) != 1) diff --git a/newlib/libc/stdio/getwc.c b/newlib/libc/stdio/getwc.c index 6d88fa869..15b397455 100644 --- a/newlib/libc/stdio/getwc.c +++ b/newlib/libc/stdio/getwc.c @@ -33,8 +33,7 @@ #undef getwc wint_t -_DEFUN(_getwc_r, (ptr, fp), - struct _reent *ptr _AND +_getwc_r (struct _reent *ptr, FILE *fp) { return _fgetwc_r (ptr, fp); @@ -45,8 +44,7 @@ _DEFUN(_getwc_r, (ptr, fp), * macro, may evaluate `fp' more than once. */ wint_t -_DEFUN(getwc, (fp), - FILE *fp) +getwc (FILE *fp) { return fgetwc(fp); } diff --git a/newlib/libc/stdio/getwc_u.c b/newlib/libc/stdio/getwc_u.c index 613b69eca..366ab0f36 100644 --- a/newlib/libc/stdio/getwc_u.c +++ b/newlib/libc/stdio/getwc_u.c @@ -34,8 +34,7 @@ #undef getwc_unlocked wint_t -_DEFUN(_getwc_unlocked_r, (ptr, fp), - struct _reent *ptr _AND +_getwc_unlocked_r (struct _reent *ptr, FILE *fp) { return _fgetwc_unlocked_r (ptr, fp); @@ -46,8 +45,7 @@ _DEFUN(_getwc_unlocked_r, (ptr, fp), * a macro, may evaluate `fp' more than once. */ wint_t -_DEFUN(getwc_unlocked, (fp), - FILE *fp) +getwc_unlocked (FILE *fp) { return fgetwc_unlocked(fp); } diff --git a/newlib/libc/stdio/getwchar.c b/newlib/libc/stdio/getwchar.c index 7ab230a4c..148539241 100644 --- a/newlib/libc/stdio/getwchar.c +++ b/newlib/libc/stdio/getwchar.c @@ -37,7 +37,7 @@ INDEX INDEX _getwchar_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include wint_t getwchar(void); @@ -51,22 +51,6 @@ ANSI_SYNOPSIS #include wint_t _getwchar_unlocked_r(struct _reent *<[reent]>); -TRAD_SYNOPSIS - #include - wint_t getwchar(); - - #define _GNU_SOURCE - #include - wint_t getwchar_unlocked(); - - #include - wint_t _getwchar_r(<[reent]>) - char * <[reent]>; - - #include - wint_t _getwchar_unlocked_r(<[reent]>) - char * <[reent]>; - DESCRIPTION <> function or macro is the wide character equivalent of the <> function. You can use <> to get the next @@ -109,8 +93,7 @@ PORTABILITY #undef getwchar wint_t -_DEFUN (_getwchar_r, (ptr), - struct _reent *ptr) +_getwchar_r (struct _reent *ptr) { return _fgetwc_r (ptr, stdin); } @@ -119,7 +102,7 @@ _DEFUN (_getwchar_r, (ptr), * Synonym for fgetwc(stdin). */ wint_t -_DEFUN_VOID (getwchar) +getwchar (void) { _REENT_SMALL_CHECK_INIT (_REENT); return fgetwc (stdin); diff --git a/newlib/libc/stdio/getwchar_u.c b/newlib/libc/stdio/getwchar_u.c index f5c50cced..c1f8d2da5 100644 --- a/newlib/libc/stdio/getwchar_u.c +++ b/newlib/libc/stdio/getwchar_u.c @@ -34,8 +34,7 @@ #undef getwchar_unlocked wint_t -_DEFUN (_getwchar_unlocked_r, (ptr), - struct _reent *ptr) +_getwchar_unlocked_r (struct _reent *ptr) { return _fgetwc_unlocked_r (ptr, stdin); } @@ -44,7 +43,7 @@ _DEFUN (_getwchar_unlocked_r, (ptr), * Synonym for fgetwc_unlocked(stdin). */ wint_t -_DEFUN_VOID (getwchar_unlocked) +getwchar_unlocked (void) { _REENT_SMALL_CHECK_INIT (_REENT); return fgetwc_unlocked (stdin); diff --git a/newlib/libc/stdio/iprintf.c b/newlib/libc/stdio/iprintf.c index c55f7ce17..507d15415 100644 --- a/newlib/libc/stdio/iprintf.c +++ b/newlib/libc/stdio/iprintf.c @@ -25,8 +25,7 @@ #ifndef _REENT_ONLY int -_DEFUN(iprintf, (fmt), - const char *fmt _DOTS) +iprintf (const char *fmt, ...) { int ret; va_list ap; @@ -42,9 +41,8 @@ _DEFUN(iprintf, (fmt), #endif /* ! _REENT_ONLY */ int -_DEFUN(_iprintf_r, (ptr, fmt), - struct _reent *ptr _AND - const char *fmt _DOTS) +_iprintf_r (struct _reent *ptr, + const char *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/iscanf.c b/newlib/libc/stdio/iscanf.c index f35acd2ed..980dabd29 100644 --- a/newlib/libc/stdio/iscanf.c +++ b/newlib/libc/stdio/iscanf.c @@ -18,33 +18,19 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -iscanf(_CONST char *fmt, ...) -#else -iscanf(fmt, va_alist) - char *fmt; - va_dcl -#endif +iscanf(const char *fmt, ...) { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (_REENT); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (_REENT, _stdin_r (_REENT), fmt, ap); va_end (ap); return ret; @@ -53,24 +39,13 @@ iscanf(fmt, va_alist) #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC -_iscanf_r(struct _reent *ptr, _CONST char *fmt, ...) -#else -_iscanf_r(ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -#endif +_iscanf_r(struct _reent *ptr, const char *fmt, ...) { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (ptr); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __svfiscanf_r (ptr, _stdin_r (ptr), fmt, ap); va_end (ap); return (ret); diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 511e5e35f..53694aa1c 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -140,64 +140,64 @@ #endif /* __SINGLE_THREAD__ || __IMPL_UNLOCKED__ */ -extern wint_t _EXFUN(__fgetwc, (struct _reent *, FILE *)); -extern wint_t _EXFUN(__fputwc, (struct _reent *, wchar_t, FILE *)); -extern u_char *_EXFUN(__sccl, (char *, u_char *fmt)); -extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); -extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); -extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); -extern int _EXFUN(__ssvfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); -extern int _EXFUN(__svfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list)); -extern int _EXFUN(__ssvfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list)); -extern int _EXFUN(__svfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list)); -extern int _EXFUN(__ssvfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list)); -int _EXFUN(_svfprintf_r,(struct _reent *, FILE *, const char *, +extern wint_t __fgetwc (struct _reent *, FILE *); +extern wint_t __fputwc (struct _reent *, wchar_t, FILE *); +extern u_char *__sccl (char *, u_char *fmt); +extern int __svfscanf_r (struct _reent *,FILE *, const char *,va_list); +extern int __ssvfscanf_r (struct _reent *,FILE *, const char *,va_list); +extern int __svfiscanf_r (struct _reent *,FILE *, const char *,va_list); +extern int __ssvfiscanf_r (struct _reent *,FILE *, const char *,va_list); +extern int __svfwscanf_r (struct _reent *,FILE *, const wchar_t *,va_list); +extern int __ssvfwscanf_r (struct _reent *,FILE *, const wchar_t *,va_list); +extern int __svfiwscanf_r (struct _reent *,FILE *, const wchar_t *,va_list); +extern int __ssvfiwscanf_r (struct _reent *,FILE *, const wchar_t *,va_list); +int _svfprintf_r (struct _reent *, FILE *, const char *, va_list) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_svfiprintf_r,(struct _reent *, FILE *, const char *, + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _svfiprintf_r (struct _reent *, FILE *, const char *, va_list) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_svfwprintf_r,(struct _reent *, FILE *, const wchar_t *, - va_list)); -int _EXFUN(_svfiwprintf_r,(struct _reent *, FILE *, const wchar_t *, - va_list)); -extern FILE *_EXFUN(__sfp,(struct _reent *)); -extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); -extern int _EXFUN(__sflush_r,(struct _reent *,FILE *)); + _ATTRIBUTE ((__format__ (__printf__, 3, 0))); +int _svfwprintf_r (struct _reent *, FILE *, const wchar_t *, + va_list); +int _svfiwprintf_r (struct _reent *, FILE *, const wchar_t *, + va_list); +extern FILE *__sfp (struct _reent *); +extern int __sflags (struct _reent *,const char*, int*); +extern int __sflush_r (struct _reent *,FILE *); #ifdef _STDIO_BSD_SEMANTICS -extern int _EXFUN(__sflushw_r,(struct _reent *,FILE *)); +extern int __sflushw_r (struct _reent *,FILE *); #endif -extern int _EXFUN(__srefill_r,(struct _reent *,FILE *)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(struct _reent *, void *, char *, - _READ_WRITE_BUFSIZE_TYPE)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__seofread,(struct _reent *, void *, +extern int __srefill_r (struct _reent *,FILE *); +extern _READ_WRITE_RETURN_TYPE __sread (struct _reent *, void *, char *, + _READ_WRITE_BUFSIZE_TYPE); +extern _READ_WRITE_RETURN_TYPE __seofread (struct _reent *, void *, char *, - _READ_WRITE_BUFSIZE_TYPE)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(struct _reent *, void *, + _READ_WRITE_BUFSIZE_TYPE); +extern _READ_WRITE_RETURN_TYPE __swrite (struct _reent *, void *, const char *, - _READ_WRITE_BUFSIZE_TYPE)); -extern _fpos_t _EXFUN(__sseek,(struct _reent *, void *, _fpos_t, int)); -extern int _EXFUN(__sclose,(struct _reent *, void *)); -extern int _EXFUN(__stextmode,(int)); -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)); -extern int _EXFUN(__submore, (struct _reent *, FILE *)); + _READ_WRITE_BUFSIZE_TYPE); +extern _fpos_t __sseek (struct _reent *, void *, _fpos_t, int); +extern int __sclose (struct _reent *, void *); +extern int __stextmode (int); +extern void __sinit (struct _reent *); +extern void _cleanup_r (struct _reent *); +extern void __smakebuf_r (struct _reent *, FILE *); +extern int __swhatbuf_r (struct _reent *, FILE *, size_t *, int *); +extern int _fwalk (struct _reent *, int (*)(FILE *)); +extern int _fwalk_reent (struct _reent *, int (*)(struct _reent *, FILE *)); +struct _glue * __sfmoreglue (struct _reent *,int n); +extern int __submore (struct _reent *, FILE *); #ifdef __LARGE64_FILES -extern _fpos64_t _EXFUN(__sseek64,(struct _reent *, void *, _fpos64_t, int)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, +extern _fpos64_t __sseek64 (struct _reent *, void *, _fpos64_t, int); +extern _READ_WRITE_RETURN_TYPE __swrite64 (struct _reent *, void *, const char *, - _READ_WRITE_BUFSIZE_TYPE)); + _READ_WRITE_BUFSIZE_TYPE); #endif /* Called by the main entry point fns to ensure stdio has been initialized. */ -#ifdef _REENT_SMALL +#if defined(_REENT_SMALL) && !defined(_REENT_GLOBAL_STDIO_STREAMS) #define CHECK_INIT(ptr, fp) \ do \ { \ @@ -212,7 +212,7 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, (fp) = _stderr_r(_check_init_ptr); \ } \ while (0) -#else /* !_REENT_SMALL */ +#else /* !_REENT_SMALL || _REENT_GLOBAL_STDIO_STREAMS */ #define CHECK_INIT(ptr, fp) \ do \ { \ @@ -221,7 +221,7 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, __sinit (_check_init_ptr); \ } \ while (0) -#endif /* !_REENT_SMALL */ +#endif /* !_REENT_SMALL || _REENT_GLOBAL_STDIO_STREAMS */ #define CHECK_STD_INIT(ptr) \ do \ @@ -279,12 +279,12 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, /* WARNING: _dcvt is defined in the stdlib directory, not here! */ -char *_EXFUN(_dcvt,(struct _reent *, char *, double, int, int, char, int)); -char *_EXFUN(_sicvt,(char *, short, char)); -char *_EXFUN(_icvt,(char *, int, char)); -char *_EXFUN(_licvt,(char *, long, char)); +char *_dcvt (struct _reent *, char *, double, int, int, char, int); +char *_sicvt (char *, short, char); +char *_icvt (char *, int, char); +char *_licvt (char *, long, char); #ifdef __GNUC__ -char *_EXFUN(_llicvt,(char *, long long, char)); +char *_llicvt (char *, long long, char); #endif #define CVT_BUF_SIZE 128 @@ -297,10 +297,10 @@ char *_EXFUN(_llicvt,(char *, long long, char)); #define __sinit_lock_acquire() #define __sinit_lock_release() #else -_VOID _EXFUN(__sfp_lock_acquire,(_VOID)); -_VOID _EXFUN(__sfp_lock_release,(_VOID)); -_VOID _EXFUN(__sinit_lock_acquire,(_VOID)); -_VOID _EXFUN(__sinit_lock_release,(_VOID)); +void __sfp_lock_acquire (void); +void __sfp_lock_release (void); +void __sinit_lock_acquire (void); +void __sinit_lock_release (void); #endif /* Types used in positional argument support in vfprinf/vfwprintf. @@ -347,6 +347,6 @@ typedef enum __packed { PWPOS, /* get positional parameter value for variable width or precision */ } __ACTION; -extern _CONST __CH_CLASS __chclass[256]; -extern _CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS]; -extern _CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS]; +extern const __CH_CLASS __chclass[256]; +extern const __STATE __state_table[MAX_STATE][MAX_CH_CLASS]; +extern const __ACTION __action_table[MAX_STATE][MAX_CH_CLASS]; diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index ab20a0838..f2da70ad6 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -34,12 +34,11 @@ * optimization) right after the _fstat() that finds the buffer size. */ -_VOID -_DEFUN(__smakebuf_r, (ptr, fp), - struct _reent *ptr _AND +void +__smakebuf_r (struct _reent *ptr, register FILE *fp) { - register _PTR p; + register void *p; int flags; size_t size; int couldbetty; @@ -76,10 +75,9 @@ _DEFUN(__smakebuf_r, (ptr, fp), * 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 +__swhatbuf_r (struct _reent *ptr, + FILE *fp, + size_t *bufsize, int *couldbetty) { #ifdef _FSEEK_OPTIMIZATION diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c index ecbc7afea..9b85eb93e 100644 --- a/newlib/libc/stdio/mktemp.c +++ b/newlib/libc/stdio/mktemp.c @@ -52,7 +52,7 @@ INDEX INDEX _mkostemps_r -ANSI_SYNOPSIS +SYNOPSIS #include char *mktemp(char *<[path]>); char *mkdtemp(char *<[path]>); @@ -139,12 +139,11 @@ Supporting OS subroutines required: <>, <>, <>, <>. #include static int -_DEFUN(_gettemp, (ptr, path, doopen, domkdir, suffixlen, flags), - struct _reent *ptr _AND - char *path _AND - register int *doopen _AND - int domkdir _AND - size_t suffixlen _AND +_gettemp (struct _reent *ptr, + char *path, + register int *doopen, + int domkdir, + size_t suffixlen, int flags) { register char *start, *trv; @@ -263,8 +262,7 @@ _DEFUN(_gettemp, (ptr, path, doopen, domkdir, suffixlen, flags), #endif int -_DEFUN(_mkstemp_r, (ptr, path), - struct _reent *ptr _AND +_mkstemp_r (struct _reent *ptr, char *path) { int fd; @@ -274,17 +272,15 @@ _DEFUN(_mkstemp_r, (ptr, path), #if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 4 char * -_DEFUN(_mkdtemp_r, (ptr, path), - struct _reent *ptr _AND +_mkdtemp_r (struct _reent *ptr, char *path) { return (_gettemp (ptr, path, (int *) NULL, 1, 0, 0) ? path : NULL); } int -_DEFUN(_mkstemps_r, (ptr, path, len), - struct _reent *ptr _AND - char *path _AND +_mkstemps_r (struct _reent *ptr, + char *path, int len) { int fd; @@ -293,9 +289,8 @@ _DEFUN(_mkstemps_r, (ptr, path, len), } int -_DEFUN(_mkostemp_r, (ptr, path, flags), - struct _reent *ptr _AND - char *path _AND +_mkostemp_r (struct _reent *ptr, + char *path, int flags) { int fd; @@ -304,10 +299,9 @@ _DEFUN(_mkostemp_r, (ptr, path, flags), } int -_DEFUN(_mkostemps_r, (ptr, path, len, flags), - struct _reent *ptr _AND - char *path _AND - int len _AND +_mkostemps_r (struct _reent *ptr, + char *path, + int len, int flags) { int fd; @@ -317,8 +311,7 @@ _DEFUN(_mkostemps_r, (ptr, path, len, flags), #endif /* _ELIX_LEVEL */ char * -_DEFUN(_mktemp_r, (ptr, path), - struct _reent *ptr _AND +_mktemp_r (struct _reent *ptr, char *path) { return (_gettemp (ptr, path, (int *) NULL, 0, 0, 0) ? path : (char *) NULL); @@ -327,8 +320,7 @@ _DEFUN(_mktemp_r, (ptr, path), #ifndef _REENT_ONLY int -_DEFUN(mkstemp, (path), - char *path) +mkstemp (char *path) { int fd; @@ -337,15 +329,13 @@ _DEFUN(mkstemp, (path), # if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 4 char * -_DEFUN(mkdtemp, (path), - char *path) +mkdtemp (char *path) { return (_gettemp (_REENT, path, (int *) NULL, 1, 0, 0) ? path : NULL); } int -_DEFUN(mkstemps, (path, len), - char *path _AND +mkstemps (char *path, int len) { int fd; @@ -354,8 +344,7 @@ _DEFUN(mkstemps, (path, len), } int -_DEFUN(mkostemp, (path, flags), - char *path _AND +mkostemp (char *path, int flags) { int fd; @@ -364,9 +353,8 @@ _DEFUN(mkostemp, (path, flags), } int -_DEFUN(mkostemps, (path, len, flags), - char *path _AND - int len _AND +mkostemps (char *path, + int len, int flags) { int fd; @@ -376,8 +364,7 @@ _DEFUN(mkostemps, (path, len, flags), # endif /* _ELIX_LEVEL */ char * -_DEFUN(mktemp, (path), - char *path) +mktemp (char *path) { return (_gettemp (_REENT, path, (int *) NULL, 0, 0, 0) ? path : (char *) NULL); } diff --git a/newlib/libc/stdio/nano-vfprintf.c b/newlib/libc/stdio/nano-vfprintf.c index f106a4167..bc7ed0743 100644 --- a/newlib/libc/stdio/nano-vfprintf.c +++ b/newlib/libc/stdio/nano-vfprintf.c @@ -87,7 +87,7 @@ INDEX INDEX _vasnprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int vprintf(const char *<[fmt]>, va_list <[list]>); @@ -172,10 +172,9 @@ static char *rcsid = "$Id$"; and vfwprintf. */ #ifdef STRING_ONLY int -_DEFUN(__ssputs_r, (ptr, fp, buf, len), - struct _reent *ptr _AND - FILE *fp _AND - _CONST char *buf _AND +__ssputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, size_t len) { register int w; @@ -229,7 +228,7 @@ _DEFUN(__ssputs_r, (ptr, fp, buf, len), if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) buf, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); fp->_w -= w; fp->_p += w; return 0; @@ -243,15 +242,14 @@ err: char output, but __ssprint_r cannot be discarded because it is used by a serial of functions like svfwprintf for wide char output. */ int -_DEFUN(__ssprint_r, (ptr, fp, uio), - struct _reent *ptr _AND - FILE *fp _AND +__ssprint_r (struct _reent *ptr, + FILE *fp, register struct __suio *uio) { register size_t len; register int w; register struct __siov *iov; - register _CONST char *p = NULL; + register const char *p = NULL; iov = uio->uio_iov; len = 0; @@ -321,7 +319,7 @@ _DEFUN(__ssprint_r, (ptr, fp, uio), if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) p, (size_t) (w)); fp->_w -= w; fp->_p += w; /* Pretend we copied all. */ @@ -347,9 +345,8 @@ err: /* Flush out all the vectors defined by the given uio, then reset it so that it can be reused. */ int -_DEFUN(__sprint_r, (ptr, fp, uio), - struct _reent *ptr _AND - FILE *fp _AND +__sprint_r (struct _reent *ptr, + FILE *fp, register struct __suio *uio) { register int err = 0; @@ -392,9 +389,8 @@ out: } _NOINLINE_STATIC int -_DEFUN(__sfputc_r, (ptr, c, fp), - struct _reent *ptr _AND - int c _AND +__sfputc_r (struct _reent *ptr, + int c, FILE *fp) { if (--fp->_w >= 0 || (fp->_w >= fp->_lbfsize && (char)c != '\n')) @@ -404,10 +400,9 @@ _DEFUN(__sfputc_r, (ptr, c, fp), } int -_DEFUN(__sfputs_r, (ptr, fp, buf, len), - struct _reent *ptr _AND - FILE *fp _AND - _CONST char *buf _AND +__sfputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, size_t len) { register int i; @@ -438,13 +433,12 @@ _DEFUN(__sfputs_r, (ptr, fp, buf, len), } #endif /* STRING_ONLY. */ -int _EXFUN(_VFPRINTF_R, (struct _reent *, FILE *, _CONST char *, va_list)); +int _VFPRINTF_R (struct _reent *, FILE *, const char *, va_list); #ifndef STRING_ONLY int -_DEFUN(VFPRINTF, (fp, fmt0, ap), - FILE * fp _AND - _CONST char *fmt0 _AND +VFPRINTF (FILE * fp, + const char *fmt0, va_list ap) { int result; @@ -453,8 +447,8 @@ _DEFUN(VFPRINTF, (fp, fmt0, ap), } int -_EXFUN(vfiprintf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vfprintf")))); +vfiprintf (FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vfprintf"))); #endif #ifdef STRING_ONLY @@ -471,10 +465,9 @@ _EXFUN(vfiprintf, (FILE *, const char *, __VALIST) #endif int -_DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), - struct _reent *data _AND - FILE * fp _AND - _CONST char *fmt0 _AND +_VFPRINTF_R (struct _reent *data, + FILE * fp, + const char *fmt0, va_list ap) { register char *fmt; /* Format string. */ @@ -482,9 +475,10 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), register char *cp; /* Handy char pointer (short term usage). */ const char *flag_chars; struct _prt_data_t prt_data; /* All data for decoding format string. */ + va_list ap_copy; /* Output function pointer. */ - int (*pfunc)(struct _reent *, FILE *, _CONST char *, size_t len); + int (*pfunc)(struct _reent *, FILE *, const char *, size_t len); pfunc = __SPRINT; @@ -519,6 +513,9 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), prt_data.blank = ' '; prt_data.zero = '0'; + /* GCC PR 14577 at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557 */ + va_copy (ap_copy, ap); + /* Scan the format for conversions (`%' character). */ for (;;) { @@ -574,7 +571,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), * -- ANSI X3J11 * They don't exclude field widths read from args. */ - prt_data.width = GET_ARG (n, ap, int); + prt_data.width = GET_ARG (n, ap_copy, int); if (prt_data.width < 0) { prt_data.width = -prt_data.width; @@ -595,7 +592,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), if (*fmt == '*') { fmt++; - prt_data.prec = GET_ARG (n, ap, int); + prt_data.prec = GET_ARG (n, ap_copy, int); if (prt_data.prec < 0) prt_data.prec = -1; } @@ -627,18 +624,16 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), if (_printf_float == NULL) { if (prt_data.flags & LONGDBL) - GET_ARG (N, ap, _LONG_DOUBLE); + GET_ARG (N, ap_copy, _LONG_DOUBLE); else - GET_ARG (N, ap, double); + GET_ARG (N, ap_copy, double); } else - { - n = _printf_float (data, &prt_data, fp, pfunc, &ap); - } + n = _printf_float (data, &prt_data, fp, pfunc, &ap_copy); } else #endif - n = _printf_i (data, &prt_data, fp, pfunc, &ap); + n = _printf_i (data, &prt_data, fp, pfunc, &ap_copy); if (n == -1) goto error; @@ -651,15 +646,16 @@ error: #ifndef STRING_ONLY _newlib_flockfile_end (fp); #endif + va_end (ap_copy); return (__sferror (fp) ? EOF : prt_data.ret); } #ifdef STRING_ONLY int -_EXFUN(_svfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_svfprintf_r")))); +_svfiprintf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_svfprintf_r"))); #else int -_EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vfprintf_r")))); +_vfiprintf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vfprintf_r"))); #endif diff --git a/newlib/libc/stdio/nano-vfprintf_float.c b/newlib/libc/stdio/nano-vfprintf_float.c index aca24aec0..071a09edc 100644 --- a/newlib/libc/stdio/nano-vfprintf_float.c +++ b/newlib/libc/stdio/nano-vfprintf_float.c @@ -164,7 +164,7 @@ int _printf_float (struct _reent *data, struct _prt_data_t *pdata, FILE * fp, - int (*pfunc) (struct _reent *, FILE *, _CONST char *, + int (*pfunc) (struct _reent *, FILE *, const char *, size_t len), va_list * ap) { #define _fpvalue (pdata->_double_) @@ -213,6 +213,8 @@ _printf_float (struct _reent *data, } if (isnan (_fpvalue)) { + if (_fpvalue < 0) + pdata->l_buf[0] = '-'; if (code <= 'G') /* 'A', 'E', 'F', or 'G'. */ cp = "NAN"; else diff --git a/newlib/libc/stdio/nano-vfprintf_i.c b/newlib/libc/stdio/nano-vfprintf_i.c index 46945b34a..f7da95251 100644 --- a/newlib/libc/stdio/nano-vfprintf_i.c +++ b/newlib/libc/stdio/nano-vfprintf_i.c @@ -51,7 +51,7 @@ _printf_common (struct _reent *data, int *realsz, FILE *fp, int (*pfunc)(struct _reent *, FILE *, - _CONST char *, size_t len)) + const char *, size_t len)) { int n; /* @@ -106,7 +106,7 @@ error: } int _printf_i (struct _reent *data, struct _prt_data_t *pdata, FILE *fp, - int (*pfunc)(struct _reent *, FILE *, _CONST char *, size_t len), + int (*pfunc)(struct _reent *, FILE *, const char *, size_t len), va_list *ap) { /* Field size expanded by dprec. */ diff --git a/newlib/libc/stdio/nano-vfprintf_local.h b/newlib/libc/stdio/nano-vfprintf_local.h index 83b479e56..15ddce08e 100644 --- a/newlib/libc/stdio/nano-vfprintf_local.h +++ b/newlib/libc/stdio/nano-vfprintf_local.h @@ -88,8 +88,8 @@ # define MAXEXPLEN 7 # define DEFPREC 6 -extern char *_dtoa_r _PARAMS((struct _reent *, double, int, - int, int *, int *, char **)); +extern char *_dtoa_r (struct _reent *, double, int, + int, int *, int *, char **); # define _DTOA_R _dtoa_r # define FREXP frexp @@ -114,7 +114,7 @@ extern char *_dtoa_r _PARAMS((struct _reent *, double, int, #define u_quad_t unsigned long typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef long * long_ptr_t; typedef int * int_ptr_t; @@ -215,11 +215,11 @@ _printf_common (struct _reent *data, int *realsz, FILE *fp, int (*pfunc)(struct _reent *, FILE *, - _CONST char *, size_t len)); + const char *, size_t len)); extern int _printf_i (struct _reent *data, struct _prt_data_t *pdata, FILE *fp, - int (*pfunc)(struct _reent *, FILE *, _CONST char *, size_t len), + int (*pfunc)(struct _reent *, FILE *, const char *, size_t len), va_list *ap); /* Make _printf_float weak symbol, so it won't be linked in if target program @@ -229,6 +229,6 @@ _printf_float (struct _reent *data, struct _prt_data_t *pdata, FILE *fp, int (*pfunc)(struct _reent *, FILE *, - _CONST char *, size_t len), + const char *, size_t len), va_list *ap) _ATTRIBUTE((__weak__)); #endif diff --git a/newlib/libc/stdio/nano-vfscanf.c b/newlib/libc/stdio/nano-vfscanf.c index 5ba00f797..97810b739 100644 --- a/newlib/libc/stdio/nano-vfscanf.c +++ b/newlib/libc/stdio/nano-vfscanf.c @@ -60,7 +60,7 @@ INDEX INDEX _vsscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int vscanf(const char *<[fmt]>, va_list <[list]>); @@ -74,40 +74,6 @@ ANSI_SYNOPSIS int _vsscanf_r(struct _reent *<[reent]>, const char *<[str]>, const char *<[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int vscanf( <[fmt]>, <[ist]>) - char *<[fmt]>; - va_list <[list]>; - - int vfscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsscanf( <[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _vscanf_r( <[reent]>, <[fmt]>, <[ist]>) - struct _reent *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, and <> are (respectively) variants of <>, <>, and <>. They differ only in @@ -169,9 +135,8 @@ Supporting OS subroutines required: #ifndef _REENT_ONLY int -_DEFUN(VFSCANF, (fp, fmt, ap), - register FILE *fp _AND - _CONST char *fmt _AND +VFSCANF (register FILE *fp, + const char *fmt, va_list ap) { CHECK_INIT(_REENT, fp); @@ -179,13 +144,12 @@ _DEFUN(VFSCANF, (fp, fmt, ap), } int -_EXFUN(vfiscanf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vfscanf")))); +vfiscanf (FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vfscanf"))); int -_DEFUN(__SVFSCANF, (fp, fmt0, ap), - register FILE *fp _AND - char _CONST *fmt0 _AND +__SVFSCANF (register FILE *fp, + char const *fmt0, va_list ap) { return __SVFSCANF_R (_REENT, fp, fmt0, ap); @@ -194,10 +158,9 @@ _DEFUN(__SVFSCANF, (fp, fmt0, ap), #endif int -_DEFUN(_VFSCANF_R, (data, fp, fmt, ap), - struct _reent *data _AND - register FILE *fp _AND - _CONST char *fmt _AND +_VFSCANF_R (struct _reent *data, + register FILE *fp, + const char *fmt, va_list ap) { CHECK_INIT(data, fp); @@ -205,8 +168,8 @@ _DEFUN(_VFSCANF_R, (data, fp, fmt, ap), } int -_EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vfscanf_r")))); +_vfiscanf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vfscanf_r"))); #endif /* !STRING_ONLY. */ #if defined (STRING_ONLY) @@ -214,9 +177,8 @@ _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) regular ungetc which will drag in file I/O items we don't need. So, we create our own trimmed-down version. */ int -_DEFUN(_sungetc_r, (data, fp, ch), - struct _reent *data _AND - int c _AND +_sungetc_r (struct _reent *data, + int c, register FILE *fp) { if (c == EOF) @@ -263,8 +225,7 @@ _DEFUN(_sungetc_r, (data, fp, ch), /* String only version of __srefill_r for sscanf family. */ int -_DEFUN(__ssrefill_r, (ptr, fp), - struct _reent * ptr _AND +__ssrefill_r (struct _reent * ptr, register FILE * fp) { /* Our only hope of further input is the ungetc buffer. @@ -287,22 +248,22 @@ _DEFUN(__ssrefill_r, (ptr, fp), } #else -int _EXFUN (_sungetc_r, (struct _reent *, int, register FILE *)); -int _EXFUN (__ssrefill_r, (struct _reent *, register FILE *)); -size_t _EXFUN (_sfread_r, (struct _reent *, _PTR buf, size_t, size_t, FILE *)); +int _sungetc_r (struct _reent *, int, register FILE *); +int __ssrefill_r (struct _reent *, register FILE *); +size_t _sfread_r (struct _reent *, void *buf, size_t, size_t, FILE *); #endif /* !STRING_ONLY. */ int -_DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), - struct _reent *rptr _AND - register FILE *fp _AND - char _CONST *fmt0 _AND +__SVFSCANF_R (struct _reent *rptr, + register FILE *fp, + char const *fmt0, va_list ap) { register u_char *fmt = (u_char *) fmt0; register int c; /* Character from format, or conversion. */ register char *p; /* Points into all kinds of strings. */ char ccltab[256]; /* Character class table for %[...]. */ + va_list ap_copy; int ret; char *cp; @@ -318,6 +279,9 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), scan_data.pfn_ungetc = _ungetc_r; scan_data.pfn_refill = __srefill_r; + /* GCC PR 14577 at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557 */ + va_copy (ap_copy, ap); + for (;;) { if (*fmt == 0) @@ -410,17 +374,18 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), continue; if (scan_data.flags & SHORT) - *GET_ARG (N, ap, short *) = scan_data.nread; + *GET_ARG (N, ap_copy, short *) = scan_data.nread; else if (scan_data.flags & LONG) - *GET_ARG (N, ap, long *) = scan_data.nread; + *GET_ARG (N, ap_copy, long *) = scan_data.nread; else - *GET_ARG (N, ap, int *) = scan_data.nread; + *GET_ARG (N, ap_copy, int *) = scan_data.nread; continue; /* Disgusting backwards compatibility hacks. XXX. */ case '\0': /* compat. */ _newlib_flockfile_exit (fp); + va_end (ap_copy); return EOF; #ifdef FLOATING_POINT @@ -458,12 +423,12 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), } ret = 0; if (scan_data.code < CT_INT) - ret = _scanf_chars (rptr, &scan_data, fp, &ap); + ret = _scanf_chars (rptr, &scan_data, fp, &ap_copy); else if (scan_data.code < CT_FLOAT) - ret = _scanf_i (rptr, &scan_data, fp, &ap); + ret = _scanf_i (rptr, &scan_data, fp, &ap_copy); #ifdef FLOATING_POINT else if (_scanf_float) - ret = _scanf_float (rptr, &scan_data, fp, &ap); + ret = _scanf_float (rptr, &scan_data, fp, &ap_copy); #endif if (ret == MATCH_FAILURE) @@ -477,22 +442,24 @@ input_failure: invalid format string), return EOF if no matches yet, else number of matches made prior to failure. */ _newlib_flockfile_exit (fp); + va_end (ap_copy); return scan_data.nassigned && !(fp->_flags & __SERR) ? scan_data.nassigned : EOF; match_failure: all_done: /* Return number of matches, which can be 0 on match failure. */ _newlib_flockfile_end (fp); + va_end (ap_copy); return scan_data.nassigned; } #ifdef STRING_ONLY int -_EXFUN(__ssvfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("__ssvfscanf_r")))); +__ssvfiscanf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("__ssvfscanf_r"))); #else int -_EXFUN(__svfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("__svfscanf_r")))); +__svfiscanf_r (struct _reent *, FILE *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("__svfscanf_r"))); #endif diff --git a/newlib/libc/stdio/nano-vfscanf_float.c b/newlib/libc/stdio/nano-vfscanf_float.c index a81fe7f70..5df9f227c 100644 --- a/newlib/libc/stdio/nano-vfscanf_float.c +++ b/newlib/libc/stdio/nano-vfscanf_float.c @@ -330,7 +330,7 @@ fskip: { flp = GET_ARG (N, *ap, float *); if (isnan (fp)) - *flp = nanf (NULL); + *flp = nanf (""); else *flp = fp; } diff --git a/newlib/libc/stdio/nano-vfscanf_i.c b/newlib/libc/stdio/nano-vfscanf_i.c index aba74b0d8..fc8011717 100644 --- a/newlib/libc/stdio/nano-vfscanf_i.c +++ b/newlib/libc/stdio/nano-vfscanf_i.c @@ -95,7 +95,7 @@ _scanf_i (struct _reent *rptr, struct _scan_data_t *pdata, FILE *fp, va_list *ap) { -#define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int)) +#define CCFN_PARAMS (struct _reent *, const char *, char **, int) /* Conversion function (strtol/strtoul). */ u_long (*ccfn)CCFN_PARAMS=0; char *p; diff --git a/newlib/libc/stdio/open_memstream.c b/newlib/libc/stdio/open_memstream.c index 5de99474d..afa4a6d62 100644 --- a/newlib/libc/stdio/open_memstream.c +++ b/newlib/libc/stdio/open_memstream.c @@ -12,7 +12,7 @@ INDEX INDEX open_wmemstream -ANSI_SYNOPSIS +SYNOPSIS #include FILE *open_memstream(char **restrict <[buf]>, size_t *restrict <[size]>); @@ -93,10 +93,9 @@ typedef struct memstream { /* Write up to non-zero N bytes of BUF into the stream described by COOKIE, returning the number of bytes written or EOF on failure. */ static _READ_WRITE_RETURN_TYPE -_DEFUN(memwriter, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - const char *buf _AND +memwriter (struct _reent *ptr, + void *cookie, + const char *buf, _READ_WRITE_BUFSIZE_TYPE n) { memstream *c = (memstream *) cookie; @@ -147,10 +146,9 @@ _DEFUN(memwriter, (ptr, cookie, buf, n), /* Seek to position POS relative to WHENCE within stream described by COOKIE; return resulting position or fail with EOF. */ static _fpos_t -_DEFUN(memseeker, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos_t pos _AND +memseeker (struct _reent *ptr, + void *cookie, + _fpos_t pos, int whence) { memstream *c = (memstream *) cookie; @@ -215,10 +213,9 @@ _DEFUN(memseeker, (ptr, cookie, pos, whence), COOKIE; return resulting position or fail with EOF. */ #ifdef __LARGE64_FILES static _fpos64_t -_DEFUN(memseeker64, (ptr, cookie, pos, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t pos _AND +memseeker64 (struct _reent *ptr, + void *cookie, + _fpos64_t pos, int whence) { _off64_t offset = (_off64_t) pos; @@ -275,8 +272,7 @@ _DEFUN(memseeker64, (ptr, cookie, pos, whence), /* Reclaim resources used by stream described by COOKIE. */ static int -_DEFUN(memcloser, (ptr, cookie), - struct _reent *ptr _AND +memcloser (struct _reent *ptr, void *cookie) { memstream *c = (memstream *) cookie; @@ -295,10 +291,9 @@ _DEFUN(memcloser, (ptr, cookie), /* Open a memstream that tracks a dynamic buffer in BUF and SIZE. Return the new stream, or fail with NULL. */ static FILE * -_DEFUN(internal_open_memstream_r, (ptr, buf, size, wide), - struct _reent *ptr _AND - char **buf _AND - size_t *size _AND +internal_open_memstream_r (struct _reent *ptr, + char **buf, + size_t *size, int wide) { FILE *fp; @@ -378,18 +373,16 @@ _DEFUN(internal_open_memstream_r, (ptr, buf, size, wide), } FILE * -_DEFUN(_open_memstream_r, (ptr, buf, size), - struct _reent *ptr _AND - char **buf _AND +_open_memstream_r (struct _reent *ptr, + char **buf, size_t *size) { return internal_open_memstream_r (ptr, buf, size, -1); } FILE * -_DEFUN(_open_wmemstream_r, (ptr, buf, size), - struct _reent *ptr _AND - wchar_t **buf _AND +_open_wmemstream_r (struct _reent *ptr, + wchar_t **buf, size_t *size) { return internal_open_memstream_r (ptr, (char **)buf, size, 1); @@ -397,16 +390,14 @@ _DEFUN(_open_wmemstream_r, (ptr, buf, size), #ifndef _REENT_ONLY FILE * -_DEFUN(open_memstream, (buf, size), - char **buf _AND +open_memstream (char **buf, size_t *size) { return _open_memstream_r (_REENT, buf, size); } FILE * -_DEFUN(open_wmemstream, (buf, size), - wchar_t **buf _AND +open_wmemstream (wchar_t **buf, size_t *size) { return _open_wmemstream_r (_REENT, buf, size); diff --git a/newlib/libc/stdio/perror.c b/newlib/libc/stdio/perror.c index 14b4d2173..68d78c227 100644 --- a/newlib/libc/stdio/perror.c +++ b/newlib/libc/stdio/perror.c @@ -24,21 +24,12 @@ INDEX INDEX _perror_r -ANSI_SYNOPSIS +SYNOPSIS #include void perror(char *<[prefix]>); void _perror_r(struct _reent *<[reent]>, char *<[prefix]>); -TRAD_SYNOPSIS - #include - void perror(<[prefix]>) - char *<[prefix]>; - - void _perror_r(<[reent]>, <[prefix]>) - struct _reent *<[reent]>; - char *<[prefix]>; - DESCRIPTION Use <> to print (on standard error) an error message corresponding to the current value of the global variable <>. @@ -67,32 +58,54 @@ Supporting OS subroutines required: <>, <>, <>, #include #include "local.h" -_VOID -_DEFUN(_perror_r, (ptr, s), - struct _reent *ptr _AND - _CONST char *s) +#define WRITE_STR(str) \ +{ \ + const char *p = (str); \ + size_t len = strlen (p); \ + while (len) \ + { \ + ssize_t len1 = _write_r (ptr, fileno (fp), p, len); \ + if (len1 < 0) \ + break; \ + len -= len1; \ + p += len1; \ + } \ +} + +void +_perror_r (struct _reent *ptr, + const char *s) { char *error; int dummy; + FILE *fp = _stderr_r (ptr); - _REENT_SMALL_CHECK_INIT (ptr); + CHECK_INIT (ptr, fp); + + _newlib_flockfile_start(fp); + _fflush_r (ptr, fp); if (s != NULL && *s != '\0') { - fputs (s, _stderr_r (ptr)); - fputs (": ", _stderr_r (ptr)); + WRITE_STR (s); + WRITE_STR (": "); } if ((error = _strerror_r (ptr, ptr->_errno, 1, &dummy)) != NULL) - fputs (error, _stderr_r (ptr)); + WRITE_STR (error); - fputc ('\n', _stderr_r (ptr)); +#ifdef __SCLE + WRITE_STR ((fp->_flags & __SCLE) ? "\r\n" : "\n"); +#else + WRITE_STR ("\n"); +#endif + fp->_flags &= ~__SOFF; + _newlib_flockfile_end(fp); } #ifndef _REENT_ONLY -_VOID -_DEFUN(perror, (s), - _CONST char *s) +void +perror (const char *s) { _perror_r (_REENT, s); } diff --git a/newlib/libc/stdio/printf.c b/newlib/libc/stdio/printf.c index d5dedf906..a9ba6118e 100644 --- a/newlib/libc/stdio/printf.c +++ b/newlib/libc/stdio/printf.c @@ -23,9 +23,8 @@ #include "local.h" int -_DEFUN(_printf_r, (ptr, fmt), - struct _reent *ptr _AND - const char *__restrict fmt _DOTS) +_printf_r (struct _reent *ptr, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -39,15 +38,14 @@ _DEFUN(_printf_r, (ptr, fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_iprintf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__alias__("_printf_r")))); +_iprintf_r (struct _reent *, const char *, ...) + _ATTRIBUTE ((__alias__("_printf_r"))); #endif #ifndef _REENT_ONLY int -_DEFUN(printf, (fmt), - const char *__restrict fmt _DOTS) +printf (const char *__restrict fmt, ...) { int ret; va_list ap; @@ -62,7 +60,7 @@ _DEFUN(printf, (fmt), #ifdef _NANO_FORMATTED_IO int -_EXFUN(iprintf, (const char *, ...) - _ATTRIBUTE ((__alias__("printf")))); +iprintf (const char *, ...) + _ATTRIBUTE ((__alias__("printf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c index 2b1fd1bf3..d4adc5a50 100644 --- a/newlib/libc/stdio/putc.c +++ b/newlib/libc/stdio/putc.c @@ -24,25 +24,13 @@ INDEX INDEX _putc_r -ANSI_SYNOPSIS +SYNOPSIS #include int putc(int <[ch]>, FILE *<[fp]>); #include int _putc_r(struct _reent *<[ptr]>, int <[ch]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int putc(<[ch]>, <[fp]>) - int <[ch]>; - FILE *<[fp]>; - - #include - int _putc_r(<[ptr]>, <[ch]>, <[fp]>) - struct _reent *<[ptr]>; - int <[ch]>; - FILE *<[fp]>; - DESCRIPTION <> is a macro, defined in <>. <> writes the argument <[ch]> to the file or stream identified by @@ -90,9 +78,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef putc int -_DEFUN(_putc_r, (ptr, c, fp), - struct _reent *ptr _AND - int c _AND +_putc_r (struct _reent *ptr, + int c, register FILE *fp) { int result; @@ -105,8 +92,7 @@ _DEFUN(_putc_r, (ptr, c, fp), #ifndef _REENT_ONLY int -_DEFUN(putc, (c, fp), - int c _AND +putc (int c, register FILE *fp) { #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/stdio/putc_u.c b/newlib/libc/stdio/putc_u.c index f710aaf57..de4ac2833 100644 --- a/newlib/libc/stdio/putc_u.c +++ b/newlib/libc/stdio/putc_u.c @@ -70,9 +70,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef putc_unlocked int -_DEFUN(_putc_unlocked_r, (ptr, c, fp), - struct _reent *ptr _AND - int c _AND +_putc_unlocked_r (struct _reent *ptr, + int c, register FILE *fp) { /* CHECK_INIT is (eventually) called by __swbuf. */ @@ -82,8 +81,7 @@ _DEFUN(_putc_unlocked_r, (ptr, c, fp), #ifndef _REENT_ONLY int -_DEFUN(putc_unlocked, (c, fp), - int c _AND +putc_unlocked (int c, register FILE *fp) { /* CHECK_INIT is (eventually) called by __swbuf. */ diff --git a/newlib/libc/stdio/putchar.c b/newlib/libc/stdio/putchar.c index bb27dc4e6..c52d38799 100644 --- a/newlib/libc/stdio/putchar.c +++ b/newlib/libc/stdio/putchar.c @@ -24,21 +24,12 @@ INDEX INDEX _putchar_r -ANSI_SYNOPSIS +SYNOPSIS #include int putchar(int <[ch]>); int _putchar_r(struct _reent *<[reent]>, int <[ch]>); -TRAD_SYNOPSIS - #include - int putchar(<[ch]>) - int <[ch]>; - - int _putchar_r(<[reent]>, <[ch]>) - struct _reent *<[reent]>; - int <[ch]>; - DESCRIPTION <> is a macro, defined in <>. <> writes its argument to the standard output stream, @@ -76,8 +67,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef putchar int -_DEFUN(_putchar_r, (ptr, c), - struct _reent *ptr _AND +_putchar_r (struct _reent *ptr, int c) { _REENT_SMALL_CHECK_INIT (ptr); @@ -87,8 +77,7 @@ _DEFUN(_putchar_r, (ptr, c), #ifndef _REENT_ONLY int -_DEFUN(putchar, (c), - int c) +putchar (int c) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/putchar_u.c b/newlib/libc/stdio/putchar_u.c index a866c7799..8f16bfbc6 100644 --- a/newlib/libc/stdio/putchar_u.c +++ b/newlib/libc/stdio/putchar_u.c @@ -61,8 +61,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #undef putchar_unlocked int -_DEFUN(_putchar_unlocked_r, (ptr, c), - struct _reent *ptr _AND +_putchar_unlocked_r (struct _reent *ptr, int c) { return putc_unlocked (c, _stdout_r (ptr)); @@ -71,8 +70,7 @@ _DEFUN(_putchar_unlocked_r, (ptr, c), #ifndef _REENT_ONLY int -_DEFUN(putchar_unlocked, (c), - int c) +putchar_unlocked (int c) { /* CHECK_INIT is (eventually) called by __swbuf. */ diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c index 74673715f..f612ece6d 100644 --- a/newlib/libc/stdio/puts.c +++ b/newlib/libc/stdio/puts.c @@ -24,21 +24,12 @@ INDEX INDEX _puts_r -ANSI_SYNOPSIS +SYNOPSIS #include int puts(const char *<[s]>); int _puts_r(struct _reent *<[reent]>, const char *<[s]>); -TRAD_SYNOPSIS - #include - int puts(<[s]>) - char *<[s]>; - - int _puts_r(<[reent]>, <[s]>) - struct _reent *<[reent]>; - char *<[s]>; - DESCRIPTION <> writes the string at <[s]> (followed by a newline, instead of the trailing null) to the standard output stream. @@ -74,9 +65,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; */ int -_DEFUN(_puts_r, (ptr, s), - struct _reent *ptr _AND - _CONST char * s) +_puts_r (struct _reent *ptr, + const char * s) { #ifdef _FVWRITE_IN_STREAMIO int result; @@ -134,8 +124,7 @@ err: #ifndef _REENT_ONLY int -_DEFUN(puts, (s), - char _CONST * s) +puts (char const * s) { return _puts_r (_REENT, s); } diff --git a/newlib/libc/stdio/putw.c b/newlib/libc/stdio/putw.c index 682015c0a..a7907bef7 100644 --- a/newlib/libc/stdio/putw.c +++ b/newlib/libc/stdio/putw.c @@ -22,16 +22,10 @@ FUNCTION INDEX putw -ANSI_SYNOPSIS +SYNOPSIS #include int putw(int <[w]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - int putw(, <[fp]>) - int ; - FILE *<[fp]>; - DESCRIPTION <> is a function, defined in <>. You can use <> to write a word to the file or stream identified by <[fp]>. As a side @@ -55,11 +49,10 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include int -_DEFUN(putw, (w, fp), - int w _AND +putw (int w, register FILE *fp) { - if (fwrite ((_CONST char*)&w, sizeof (w), 1, fp) != 1) + if (fwrite ((const char*)&w, sizeof (w), 1, fp) != 1) return EOF; return 0; } diff --git a/newlib/libc/stdio/putwc.c b/newlib/libc/stdio/putwc.c index 9a84f35fb..a6c3100d7 100644 --- a/newlib/libc/stdio/putwc.c +++ b/newlib/libc/stdio/putwc.c @@ -33,9 +33,8 @@ #undef putwc wint_t -_DEFUN(_putwc_r, (ptr, wc, fp), - struct _reent *ptr _AND - wchar_t wc _AND +_putwc_r (struct _reent *ptr, + wchar_t wc, FILE *fp) { return _fputwc_r (ptr, wc, fp); @@ -45,8 +44,7 @@ _DEFUN(_putwc_r, (ptr, wc, fp), * macro, may evaluate `fp' more than once. */ wint_t -_DEFUN(putwc, (wc, fp), - wchar_t wc _AND +putwc (wchar_t wc, FILE *fp) { return fputwc (wc, fp); diff --git a/newlib/libc/stdio/putwc_u.c b/newlib/libc/stdio/putwc_u.c index bb71acc2a..0ec11f04e 100644 --- a/newlib/libc/stdio/putwc_u.c +++ b/newlib/libc/stdio/putwc_u.c @@ -34,9 +34,8 @@ #undef putwc_unlocked wint_t -_DEFUN(_putwc_unlocked_r, (ptr, wc, fp), - struct _reent *ptr _AND - wchar_t wc _AND +_putwc_unlocked_r (struct _reent *ptr, + wchar_t wc, FILE *fp) { return _fputwc_unlocked_r (ptr, wc, fp); @@ -46,8 +45,7 @@ _DEFUN(_putwc_unlocked_r, (ptr, wc, fp), * if it is a macro, may evaluate `fp' more than once. */ wint_t -_DEFUN(putwc_unlocked, (wc, fp), - wchar_t wc _AND +putwc_unlocked (wchar_t wc, FILE *fp) { return fputwc_unlocked (wc, fp); diff --git a/newlib/libc/stdio/putwchar.c b/newlib/libc/stdio/putwchar.c index cdd254217..238cb5016 100644 --- a/newlib/libc/stdio/putwchar.c +++ b/newlib/libc/stdio/putwchar.c @@ -37,7 +37,7 @@ INDEX INDEX _putwchar_unlocked_r -ANSI_SYNOPSIS +SYNOPSIS #include wint_t putwchar(wchar_t <[wc]>); @@ -50,25 +50,6 @@ ANSI_SYNOPSIS #include wint_t _putwchar_unlocked_r(struct _reent *<[reent]>, wchar_t <[wc]>); -TRAD_SYNOPSIS - #include - wint_t putwchar(<[wc]>) - wchar_t <[wc]>; - - #include - wint_t putwchar_unlocked(<[wc]>) - wchar_t <[wc]>; - - #include - wint_t _putwchar_r(<[reent]>, <[wc]>) - struct _reent *<[reent]>; - wchar_t <[wc]>; - - #include - wint_t _putwchar_unlocked_r(<[reent]>, <[wc]>) - struct _reent *<[reent]>; - wchar_t <[wc]>; - DESCRIPTION The <> function or macro is the wide-character equivalent of the <> function. It writes the wide character wc to stdout. @@ -106,8 +87,7 @@ PORTABILITY #undef putwchar wint_t -_DEFUN(_putwchar_r, (ptr, wc), - struct _reent *ptr _AND +_putwchar_r (struct _reent *ptr, wchar_t wc) { return _fputwc_r (ptr, wc, stdout); @@ -117,8 +97,7 @@ _DEFUN(_putwchar_r, (ptr, wc), * Synonym for fputwc(wc, stdout). */ wint_t -_DEFUN(putwchar, (wc), - wchar_t wc) +putwchar (wchar_t wc) { _REENT_SMALL_CHECK_INIT (_REENT); return fputwc (wc, stdout); diff --git a/newlib/libc/stdio/putwchar_u.c b/newlib/libc/stdio/putwchar_u.c index 3235472a2..a5e6a57da 100644 --- a/newlib/libc/stdio/putwchar_u.c +++ b/newlib/libc/stdio/putwchar_u.c @@ -34,8 +34,7 @@ #undef putwchar_unlocked wint_t -_DEFUN(_putwchar_unlocked_r, (ptr, wc), - struct _reent *ptr _AND +_putwchar_unlocked_r (struct _reent *ptr, wchar_t wc) { return _fputwc_unlocked_r (ptr, wc, stdout); @@ -45,8 +44,7 @@ _DEFUN(_putwchar_unlocked_r, (ptr, wc), * Synonym for fputwc_unlocked(wc, stdout). */ wint_t -_DEFUN(putwchar_unlocked, (wc), - wchar_t wc) +putwchar_unlocked (wchar_t wc) { _REENT_SMALL_CHECK_INIT (_REENT); return fputwc_unlocked (wc, stdout); diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c index 9d853f94d..87a715b84 100644 --- a/newlib/libc/stdio/refill.c +++ b/newlib/libc/stdio/refill.c @@ -23,8 +23,7 @@ #include "local.h" static int -_DEFUN(lflush, (fp), - FILE *fp) +lflush (FILE *fp) { if ((fp->_flags & (__SLBF | __SWR)) == (__SLBF | __SWR)) return fflush (fp); @@ -37,8 +36,7 @@ _DEFUN(lflush, (fp), */ int -_DEFUN(__srefill_r, (ptr, fp), - struct _reent * ptr _AND +__srefill_r (struct _reent * ptr, register FILE * fp) { /* make sure stdio is set up */ @@ -107,7 +105,7 @@ _DEFUN(__srefill_r, (ptr, fp), /* Ignore this file in _fwalk to avoid potential deadlock. */ short orig_flags = fp->_flags; fp->_flags = 1; - _CAST_VOID _fwalk (_GLOBAL_REENT, lflush); + (void) _fwalk (_GLOBAL_REENT, lflush); fp->_flags = orig_flags; /* Now flush this file without locking it. */ diff --git a/newlib/libc/stdio/remove.c b/newlib/libc/stdio/remove.c index 5a3e16be9..a10582832 100644 --- a/newlib/libc/stdio/remove.c +++ b/newlib/libc/stdio/remove.c @@ -24,21 +24,12 @@ INDEX INDEX _remove_r -ANSI_SYNOPSIS +SYNOPSIS #include int remove(char *<[filename]>); int _remove_r(struct _reent *<[reent]>, char *<[filename]>); -TRAD_SYNOPSIS - #include - int remove(<[filename]>) - char *<[filename]>; - - int _remove_r(<[reent]>, <[filename]>) - struct _reent *<[reent]>; - char *<[filename]>; - DESCRIPTION Use <> to dissolve the association between a particular filename (the string at <[filename]>) and the file it represents. @@ -68,9 +59,8 @@ Supporting OS subroutine required: <>. #include int -_DEFUN(_remove_r, (ptr, filename), - struct _reent *ptr _AND - _CONST char *filename) +_remove_r (struct _reent *ptr, + const char *filename) { if (_unlink_r (ptr, filename) == -1) return -1; @@ -81,8 +71,7 @@ _DEFUN(_remove_r, (ptr, filename), #ifndef _REENT_ONLY int -_DEFUN(remove, (filename), - _CONST char *filename) +remove (const char *filename) { return _remove_r (_REENT, filename); } diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c index 6eb1f7d19..b3c745a10 100644 --- a/newlib/libc/stdio/rename.c +++ b/newlib/libc/stdio/rename.c @@ -22,16 +22,10 @@ FUNCTION INDEX rename -ANSI_SYNOPSIS +SYNOPSIS #include int rename(const char *<[old]>, const char *<[new]>); -TRAD_SYNOPSIS - #include - int rename(<[old]>, <[new]>) - char *<[old]>; - char *<[new]>; - DESCRIPTION Use <> to establish a new name (the string at <[new]>) for a file now known by the string at <[old]>. After a successful @@ -60,9 +54,8 @@ Supporting OS subroutines required: <>, <>, or <>. #ifndef _REENT_ONLY int -_DEFUN(rename, (old, new), - _CONST char *old _AND - _CONST char *new) +rename (const char *old, + const char *new) { return _rename_r (_REENT, old, new); } diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c index fb03e5be7..a65847d5e 100644 --- a/newlib/libc/stdio/rewind.c +++ b/newlib/libc/stdio/rewind.c @@ -24,20 +24,11 @@ INDEX INDEX _rewind_r -ANSI_SYNOPSIS +SYNOPSIS #include void rewind(FILE *<[fp]>); void _rewind_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - void rewind(<[fp]>) - FILE *<[fp]>; - - void _rewind_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION <> returns the file position indicator (if any) for the file or stream identified by <[fp]> to the beginning of the file. It also @@ -60,20 +51,18 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include #include -_VOID -_DEFUN(_rewind_r, (ptr, fp), - struct _reent * ptr _AND +void +_rewind_r (struct _reent * ptr, register FILE * fp) { - _CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET); + (void) _fseek_r (ptr, fp, 0L, SEEK_SET); clearerr (fp); } #ifndef _REENT_ONLY -_VOID -_DEFUN(rewind, (fp), - register FILE * fp) +void +rewind (register FILE * fp) { _rewind_r (_REENT, fp); } diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c index 9474bd9f6..656e5661b 100644 --- a/newlib/libc/stdio/rget.c +++ b/newlib/libc/stdio/rget.c @@ -32,8 +32,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; */ int -_DEFUN(__srget_r, (ptr, fp), - struct _reent *ptr _AND +__srget_r (struct _reent *ptr, register FILE *fp) { /* Ensure that any fake std stream is resolved before @@ -52,8 +51,7 @@ _DEFUN(__srget_r, (ptr, fp), required for backward compatibility with applications built against earlier dynamically built newlib libraries. */ int -_DEFUN(__srget, (fp), - register FILE *fp) +__srget (register FILE *fp) { return __srget_r (_REENT, fp); } diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c index 23e97b83d..898c6e7af 100644 --- a/newlib/libc/stdio/scanf.c +++ b/newlib/libc/stdio/scanf.c @@ -18,34 +18,20 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -scanf(_CONST char *__restrict fmt, ...) -#else -scanf(fmt, va_alist) - char *fmt; - va_dcl -#endif +scanf(const char *__restrict fmt, ...) { int ret; va_list ap; struct _reent *reent = _REENT; _REENT_SMALL_CHECK_INIT (reent); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (reent, _stdin_r (reent), fmt, ap); va_end (ap); return ret; @@ -53,31 +39,20 @@ scanf(fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(iscanf, (const char *, ...) - _ATTRIBUTE ((__alias__("scanf")))); +iscanf (const char *, ...) + _ATTRIBUTE ((__alias__("scanf"))); #endif #endif /* !_REENT_ONLY */ int -#ifdef _HAVE_STDC -_scanf_r(struct _reent *ptr, _CONST char *__restrict fmt, ...) -#else -_scanf_r(ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -#endif +_scanf_r(struct _reent *ptr, const char *__restrict fmt, ...) { int ret; va_list ap; _REENT_SMALL_CHECK_INIT (ptr); -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _vfscanf_r (ptr, _stdin_r (ptr), fmt, ap); va_end (ap); return (ret); @@ -85,6 +60,6 @@ _scanf_r(ptr, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(_iscanf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__alias__("_scanf_r")))); +_iscanf_r (struct _reent *, const char *, ...) + _ATTRIBUTE ((__alias__("_scanf_r"))); #endif diff --git a/newlib/libc/stdio/sccl.c b/newlib/libc/stdio/sccl.c index b01801145..c1bf2b189 100644 --- a/newlib/libc/stdio/sccl.c +++ b/newlib/libc/stdio/sccl.c @@ -31,8 +31,7 @@ */ u_char * -_DEFUN(__sccl, (tab, fmt), - register char *tab _AND +__sccl (register char *tab, register u_char *fmt) { register int c, n, v; diff --git a/newlib/libc/stdio/setbuf.c b/newlib/libc/stdio/setbuf.c index cffb6fbf4..f5471866d 100644 --- a/newlib/libc/stdio/setbuf.c +++ b/newlib/libc/stdio/setbuf.c @@ -22,16 +22,10 @@ FUNCTION INDEX setbuf -ANSI_SYNOPSIS +SYNOPSIS #include void setbuf(FILE *<[fp]>, char *<[buf]>); -TRAD_SYNOPSIS - #include - void setbuf(<[fp]>, <[buf]>) - FILE *<[fp]>; - char *<[buf]>; - DESCRIPTION <> specifies that output to the file or stream identified by <[fp]> should be fully buffered. All output for this file will go to a @@ -70,10 +64,9 @@ Supporting OS subroutines required: <>, <>, <>, #include #include "local.h" -_VOID -_DEFUN(setbuf, (fp, buf), - FILE *__restrict fp _AND +void +setbuf (FILE *__restrict fp, char *__restrict buf) { - _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); + (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); } diff --git a/newlib/libc/stdio/setbuffer.c b/newlib/libc/stdio/setbuffer.c index e88187446..35d17da3b 100644 --- a/newlib/libc/stdio/setbuffer.c +++ b/newlib/libc/stdio/setbuffer.c @@ -27,17 +27,10 @@ FUNCTION INDEX setbuffer -ANSI_SYNOPSIS +SYNOPSIS #include void setbuffer(FILE *<[fp]>, char *<[buf]>, int <[size]>); -TRAD_SYNOPSIS - #include - void setbuffer(<[fp]>, <[buf]>, <[size]>) - FILE *<[fp]>; - char *<[buf]>; - int <[size]>; - DESCRIPTION <> specifies that output to the file or stream identified by <[fp]> should be fully buffered. All output for this file will go to a @@ -71,11 +64,10 @@ Supporting OS subroutines required: <>, <>, <>, #include #include "local.h" -_VOID -_DEFUN(setbuffer, (fp, buf, size), - FILE * fp _AND - char *buf _AND +void +setbuffer (FILE * fp, + char *buf, int size) { - _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size); + (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size); } diff --git a/newlib/libc/stdio/setlinebuf.c b/newlib/libc/stdio/setlinebuf.c index 0df6a579a..d623b3014 100644 --- a/newlib/libc/stdio/setlinebuf.c +++ b/newlib/libc/stdio/setlinebuf.c @@ -27,15 +27,10 @@ FUNCTION INDEX setlinebuf -ANSI_SYNOPSIS +SYNOPSIS #include void setlinebuf(FILE *<[fp]>); -TRAD_SYNOPSIS - #include - void setlinebuf(<[fp]>) - FILE *<[fp]>; - DESCRIPTION <> specifies that output to the file or stream identified by <[fp]> should be line buffered. This causes the file or stream to pass @@ -61,8 +56,7 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" int -_DEFUN(setlinebuf, (fp), - FILE * fp) +setlinebuf (FILE * fp) { return (setvbuf (fp, (char *) NULL, _IOLBF, (size_t) 0)); } diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c index a8e46a5d0..63c9970e4 100644 --- a/newlib/libc/stdio/setvbuf.c +++ b/newlib/libc/stdio/setvbuf.c @@ -22,19 +22,11 @@ FUNCTION INDEX setvbuf -ANSI_SYNOPSIS +SYNOPSIS #include int setvbuf(FILE *<[fp]>, char *<[buf]>, int <[mode]>, size_t <[size]>); -TRAD_SYNOPSIS - #include - int setvbuf(<[fp]>, <[buf]>, <[mode]>, <[size]>) - FILE *<[fp]>; - char *<[buf]>; - int <[mode]>; - size_t <[size]>; - DESCRIPTION Use <> to specify what kind of buffering you want for the file or stream identified by <[fp]>, by using one of the following @@ -96,10 +88,9 @@ Supporting OS subroutines required: <>, <>, <>, */ int -_DEFUN(setvbuf, (fp, buf, mode, size), - register FILE * fp _AND - char *buf _AND - register int mode _AND +setvbuf (register FILE * fp, + char *buf, + register int mode, register size_t size) { int ret = 0; @@ -131,7 +122,7 @@ _DEFUN(setvbuf, (fp, buf, mode, size), FREEUB(reent, fp); fp->_r = fp->_lbfsize = 0; if (fp->_flags & __SMBF) - _free_r (reent, (_PTR) fp->_bf._base); + _free_r (reent, (void *) fp->_bf._base); fp->_flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SNPT | __SEOF); if (mode == _IONBF) diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c index f0a80980c..be000f629 100644 --- a/newlib/libc/stdio/siprintf.c +++ b/newlib/libc/stdio/siprintf.c @@ -44,7 +44,7 @@ INDEX INDEX _asniprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include int iprintf(const char *<[format]>, ...); @@ -94,27 +94,14 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include "local.h" int -#ifdef _HAVE_STDC -_DEFUN(_siprintf_r, (ptr, str, fmt), - struct _reent *ptr _AND - char *str _AND - _CONST char *fmt _DOTS) -#else -_siprintf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - char *str; - _CONST char *fmt; - va_dcl -#endif +_siprintf_r (struct _reent *ptr, + char *str, + const char *fmt, ...) { int ret; va_list ap; @@ -124,11 +111,7 @@ _siprintf_r(ptr, str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); *f._p = 0; @@ -138,16 +121,8 @@ _siprintf_r(ptr, str, fmt, va_alist) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -_DEFUN(siprintf, (str, fmt), - char *str _AND - _CONST char *fmt _DOTS) -#else -siprintf(str, fmt, va_alist) - char *str; - _CONST char *fmt; - va_dcl -#endif +siprintf (char *str, + const char *fmt, ...) { int ret; va_list ap; @@ -157,11 +132,7 @@ siprintf(str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (_REENT, &f, fmt, ap); va_end (ap); *f._p = 0; diff --git a/newlib/libc/stdio/siscanf.c b/newlib/libc/stdio/siscanf.c index a6a812670..355d2662a 100644 --- a/newlib/libc/stdio/siscanf.c +++ b/newlib/libc/stdio/siscanf.c @@ -32,7 +32,7 @@ INDEX INDEX _siscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include int iscanf(const char *<[format]>, ...); @@ -45,36 +45,6 @@ ANSI_SYNOPSIS int _siscanf_r(struct _reent *<[ptr]>, const char *<[str]>, const char *<[format]>, ...); - -TRAD_SYNOPSIS - #include - - int iscanf(<[format]> [, <[arg]>, ...]) - char *<[format]>; - - int fiscanf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - char *<[format]>; - - int siscanf(<[str]>, <[format]> [, <[arg]>, ...]); - char *<[str]>; - char *<[format]>; - - int _iscanf_r(<[ptr]>, <[format]> [, <[arg]>, ...]) - struct _reent *<[ptr]>; - char *<[format]>; - - int _fiscanf_r(<[ptr]>, <[fd]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - FILE *<[fd]>; - char *<[format]>; - - int _siscanf_r(<[ptr]>, <[str]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - char *<[str]>; - char *<[format]>; - - DESCRIPTION <>, <>, and <> are the same as <>, <>, and <> respectively, only that @@ -106,27 +76,14 @@ Supporting OS subroutines required: <>, <>, <>, #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY -#ifdef _HAVE_STDC int -_DEFUN(siscanf, (str, fmt), - _CONST char *str _AND - _CONST char *fmt _DOTS) -#else -int -siscanf(str, fmt, va_alist) - _CONST char *str; - _CONST char *fmt; - va_dcl -#endif +siscanf (const char *str, + const char *fmt, ...) { int ret; va_list ap; @@ -139,11 +96,7 @@ siscanf(str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfiscanf_r (_REENT, &f, fmt, ap); va_end (ap); return ret; @@ -151,20 +104,10 @@ siscanf(str, fmt, va_alist) #endif /* !_REENT_ONLY */ -#ifdef _HAVE_STDC int -_DEFUN(_siscanf_r, (ptr, str, fmt), - struct _reent *ptr _AND - _CONST char *str _AND - _CONST char *fmt _DOTS) -#else -int -_siscanf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - _CONST char *str; - _CONST char *fmt; - va_dcl -#endif +_siscanf_r (struct _reent *ptr, + const char *str, + const char *fmt, ...) { int ret; va_list ap; @@ -177,11 +120,7 @@ _siscanf_r(ptr, str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfiscanf_r (ptr, &f, fmt, ap); va_end (ap); return ret; diff --git a/newlib/libc/stdio/sniprintf.c b/newlib/libc/stdio/sniprintf.c index 98a2c2509..840c564dc 100644 --- a/newlib/libc/stdio/sniprintf.c +++ b/newlib/libc/stdio/sniprintf.c @@ -21,30 +21,16 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include #include "local.h" int -#ifdef _HAVE_STDC -_DEFUN (_sniprintf_r, (ptr, str, size, fmt), - struct _reent *ptr _AND - char *str _AND - size_t size _AND - _CONST char *fmt _DOTS) -#else -_sniprintf_r (ptr, str, size, fmt, va_alist) - struct _reent *ptr; - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif +_sniprintf_r (struct _reent *ptr, + char *str, + size_t size, + const char *fmt, ...) { int ret; va_list ap; @@ -59,11 +45,7 @@ _sniprintf_r (ptr, str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) @@ -76,18 +58,9 @@ _sniprintf_r (ptr, str, size, fmt, va_alist) #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -_DEFUN (sniprintf, (str, size, fmt), - char *str _AND - size_t size _AND - _CONST char *fmt _DOTS) -#else -sniprintf (str, size, fmt, va_alist) - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif +sniprintf (char *str, + size_t size, + const char *fmt, ...) { int ret; va_list ap; @@ -103,11 +76,7 @@ sniprintf (str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfiprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) diff --git a/newlib/libc/stdio/snprintf.c b/newlib/libc/stdio/snprintf.c index d2408b2f0..809b52b51 100644 --- a/newlib/libc/stdio/snprintf.c +++ b/newlib/libc/stdio/snprintf.c @@ -20,30 +20,16 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include #include "local.h" int -#ifdef _HAVE_STDC -_DEFUN(_snprintf_r, (ptr, str, size, fmt), - struct _reent *ptr _AND - char *__restrict str _AND - size_t size _AND - _CONST char *__restrict fmt _DOTS) -#else -_snprintf_r(ptr, str, size, fmt, va_alist) - struct _reent *ptr; - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif +_snprintf_r (struct _reent *ptr, + char *__restrict str, + size_t size, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -58,11 +44,7 @@ _snprintf_r(ptr, str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) @@ -74,25 +56,16 @@ _snprintf_r(ptr, str, size, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...) - _ATTRIBUTE ((__alias__("_snprintf_r")))); +_sniprintf_r (struct _reent *, char *, size_t, const char *, ...) + _ATTRIBUTE ((__alias__("_snprintf_r"))); #endif #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -_DEFUN(snprintf, (str, size, fmt), - char *__restrict str _AND - size_t size _AND - _CONST char *__restrict fmt _DOTS) -#else -snprintf(str, size, fmt, va_alist) - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif +snprintf (char *__restrict str, + size_t size, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -108,11 +81,7 @@ snprintf(str, size, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); if (ret < EOF) @@ -124,7 +93,7 @@ snprintf(str, size, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(sniprintf, (char *, size_t, const char *, ...) - _ATTRIBUTE ((__alias__("snprintf")))); +sniprintf (char *, size_t, const char *, ...) + _ATTRIBUTE ((__alias__("snprintf"))); #endif #endif diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c index d74c6f891..096ca216a 100644 --- a/newlib/libc/stdio/sprintf.c +++ b/newlib/libc/stdio/sprintf.c @@ -44,7 +44,7 @@ INDEX INDEX _asnprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include int printf(const char *restrict <[format]>, ...); @@ -570,27 +570,14 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include #include "local.h" int -#ifdef _HAVE_STDC -_DEFUN(_sprintf_r, (ptr, str, fmt), - struct _reent *ptr _AND - char *__restrict str _AND - _CONST char *__restrict fmt _DOTS) -#else -_sprintf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - char *__restrict str; - _CONST char *__restrict fmt; - va_dcl -#endif +_sprintf_r (struct _reent *ptr, + char *__restrict str, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -600,11 +587,7 @@ _sprintf_r(ptr, str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (ptr, &f, fmt, ap); va_end (ap); *f._p = '\0'; /* terminate the string */ @@ -613,23 +596,15 @@ _sprintf_r(ptr, str, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...) - _ATTRIBUTE ((__alias__("_sprintf_r")))); +_siprintf_r (struct _reent *, char *, const char *, ...) + _ATTRIBUTE ((__alias__("_sprintf_r"))); #endif #ifndef _REENT_ONLY int -#ifdef _HAVE_STDC -_DEFUN(sprintf, (str, fmt), - char *__restrict str _AND - _CONST char *__restrict fmt _DOTS) -#else -sprintf(str, fmt, va_alist) - char *str; - _CONST char *fmt; - va_dcl -#endif +sprintf (char *__restrict str, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -639,11 +614,7 @@ sprintf(str, fmt, va_alist) f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = _svfprintf_r (_REENT, &f, fmt, ap); va_end (ap); *f._p = '\0'; /* terminate the string */ @@ -652,7 +623,7 @@ sprintf(str, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(siprintf, (char *, const char *, ...) - _ATTRIBUTE ((__alias__("sprintf")))); +siprintf (char *, const char *, ...) + _ATTRIBUTE ((__alias__("sprintf"))); #endif #endif diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c index 7961294e7..99054e245 100644 --- a/newlib/libc/stdio/sscanf.c +++ b/newlib/libc/stdio/sscanf.c @@ -32,7 +32,7 @@ INDEX INDEX _sscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include int scanf(const char *restrict <[format]>, ...); @@ -45,36 +45,6 @@ ANSI_SYNOPSIS int _sscanf_r(struct _reent *<[ptr]>, const char *restrict <[str]>, const char *restrict <[format]>, ...); - -TRAD_SYNOPSIS - #include - - int scanf(<[format]> [, <[arg]>, ...]) - char *<[format]>; - - int fscanf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - char *<[format]>; - - int sscanf(<[str]>, <[format]> [, <[arg]>, ...]); - char *<[str]>; - char *<[format]>; - - int _scanf_r(<[ptr]>, <[format]> [, <[arg]>, ...]) - struct _reent *<[ptr]>; - char *<[format]>; - - int _fscanf_r(<[ptr]>, <[fd]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - FILE *<[fd]>; - char *<[format]>; - - int _sscanf_r(<[ptr]>, <[str]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - char *<[str]>; - char *<[format]>; - - DESCRIPTION <> scans a series of input fields from standard input, one character at a time. Each field is interpreted according to @@ -445,27 +415,14 @@ Supporting OS subroutines required: <>, <>, <>, #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY -#ifdef _HAVE_STDC int -_DEFUN(sscanf, (str, fmt), - _CONST char *__restrict str _AND - _CONST char * fmt _DOTS) -#else -int -sscanf(str, fmt, va_alist) - _CONST char *str; - _CONST char *fmt; - va_dcl -#endif +sscanf (const char *__restrict str, + const char * fmt, ...) { int ret; va_list ap; @@ -478,11 +435,7 @@ sscanf(str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfscanf_r (_REENT, &f, fmt, ap); va_end (ap); return ret; @@ -490,26 +443,16 @@ sscanf(str, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(siscanf, (const char *, const char *, ...) - _ATTRIBUTE ((__alias__("sscanf")))); +siscanf (const char *, const char *, ...) + _ATTRIBUTE ((__alias__("sscanf"))); #endif #endif /* !_REENT_ONLY */ -#ifdef _HAVE_STDC int -_DEFUN(_sscanf_r, (ptr, str, fmt), - struct _reent *ptr _AND - _CONST char *__restrict str _AND - _CONST char *__restrict fmt _DOTS) -#else -int -_sscanf_r(ptr, str, fmt, va_alist) - struct _reent *ptr; - _CONST char *__restrict str; - _CONST char *__restrict fmt; - va_dcl -#endif +_sscanf_r (struct _reent *ptr, + const char *__restrict str, + const char *__restrict fmt, ...) { int ret; va_list ap; @@ -522,11 +465,7 @@ _sscanf_r(ptr, str, fmt, va_alist) f._ub._base = NULL; f._lb._base = NULL; f._file = -1; /* No file. */ -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif ret = __ssvfscanf_r (ptr, &f, fmt, ap); va_end (ap); return ret; @@ -534,6 +473,6 @@ _sscanf_r(ptr, str, fmt, va_alist) #ifdef _NANO_FORMATTED_IO int -_EXFUN(_siscanf_r, (struct _reent *, const char *, const char *, ...) - _ATTRIBUTE ((__alias__("_sscanf_r")))); +_siscanf_r (struct _reent *, const char *, const char *, ...) + _ATTRIBUTE ((__alias__("_sscanf_r"))); #endif diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c index a6e28f5a9..a72fb74d0 100644 --- a/newlib/libc/stdio/stdio.c +++ b/newlib/libc/stdio/stdio.c @@ -30,10 +30,9 @@ */ _READ_WRITE_RETURN_TYPE -_DEFUN(__sread, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char *buf _AND +__sread (struct _reent *ptr, + void *cookie, + char *buf, _READ_WRITE_BUFSIZE_TYPE n) { register FILE *fp = (FILE *) cookie; @@ -63,20 +62,18 @@ _DEFUN(__sread, (ptr, cookie, buf, n), /* Dummy function used in sscanf/swscanf. */ _READ_WRITE_RETURN_TYPE -_DEFUN(__seofread, (ptr, cookie, buf, len), - struct _reent *_ptr _AND - _PTR cookie _AND - char *buf _AND +__seofread (struct _reent *_ptr, + void *cookie, + char *buf, _READ_WRITE_BUFSIZE_TYPE len) { return 0; } _READ_WRITE_RETURN_TYPE -_DEFUN(__swrite, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char const *buf _AND +__swrite (struct _reent *ptr, + void *cookie, + char const *buf, _READ_WRITE_BUFSIZE_TYPE n) { register FILE *fp = (FILE *) cookie; @@ -105,10 +102,9 @@ _DEFUN(__swrite, (ptr, cookie, buf, n), } _fpos_t -_DEFUN(__sseek, (ptr, cookie, offset, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos_t offset _AND +__sseek (struct _reent *ptr, + void *cookie, + _fpos_t offset, int whence) { register FILE *fp = (FILE *) cookie; @@ -126,8 +122,7 @@ _DEFUN(__sseek, (ptr, cookie, offset, whence), } int -_DEFUN(__sclose, (ptr, cookie), - struct _reent *ptr _AND +__sclose (struct _reent *ptr, void *cookie) { FILE *fp = (FILE *) cookie; @@ -137,8 +132,7 @@ _DEFUN(__sclose, (ptr, cookie), #ifdef __SCLE int -_DEFUN(__stextmode, (fd), - int fd) +__stextmode (int fd) { #ifdef __CYGWIN__ extern int _cygwin_istext_for_stdio (int); diff --git a/newlib/libc/stdio/stdio_ext.c b/newlib/libc/stdio/stdio_ext.c index 588209d18..857091fd7 100644 --- a/newlib/libc/stdio/stdio_ext.c +++ b/newlib/libc/stdio/stdio_ext.c @@ -17,7 +17,7 @@ INDEX INDEX __fwriting -ANSI_SYNOPSIS +SYNOPSIS #include #include size_t __fbufsize(FILE *<[fp]>); @@ -62,50 +62,43 @@ No supporting OS subroutines are required. /* Subroutine versions of the inline or macro functions. */ size_t -_DEFUN(__fbufsize, (fp), - FILE * fp) +__fbufsize (FILE * fp) { return (size_t) fp->_bf._size; } size_t -_DEFUN(__fpending, (fp), - FILE * fp) +__fpending (FILE * fp) { return fp->_p - fp->_bf._base; } int -_DEFUN(__flbf, (fp), - FILE * fp) +__flbf (FILE * fp) { return (fp->_flags & __SLBF) != 0; } int -_DEFUN(__freadable, (fp), - FILE * fp) +__freadable (FILE * fp) { return (fp->_flags & (__SRD | __SRW)) != 0; } int -_DEFUN(__fwritable, (fp), - FILE * fp) +__fwritable (FILE * fp) { return (fp->_flags & (__SWR | __SRW)) != 0; } int -_DEFUN(__freading, (fp), - FILE * fp) +__freading (FILE * fp) { return (fp->_flags & __SRD) != 0; } int -_DEFUN(__fwriting, (fp), - FILE * fp) +__fwriting (FILE * fp) { return (fp->_flags & __SWR) != 0; } diff --git a/newlib/libc/stdio/swprintf.c b/newlib/libc/stdio/swprintf.c index 2233b3ba7..fa3b43e7a 100644 --- a/newlib/libc/stdio/swprintf.c +++ b/newlib/libc/stdio/swprintf.c @@ -32,7 +32,7 @@ INDEX INDEX _swprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include int wprintf(const wchar_t *<[format]>, ...); @@ -553,11 +553,10 @@ Supporting OS subroutines required: <>, <>, <>, * a variable set to _REENT. */ int -_DEFUN(_swprintf_r, (ptr, str, size, fmt), - struct _reent *ptr _AND - wchar_t *str _AND - size_t size _AND - _CONST wchar_t *fmt _DOTS) +_swprintf_r (struct _reent *ptr, + wchar_t *str, + size_t size, + const wchar_t *fmt, ...) { int ret; va_list ap; @@ -594,10 +593,9 @@ _DEFUN(_swprintf_r, (ptr, str, size, fmt), #ifndef _REENT_ONLY int -_DEFUN(swprintf, (str, size, fmt), - wchar_t *__restrict str _AND - size_t size _AND - _CONST wchar_t *__restrict fmt _DOTS) +swprintf (wchar_t *__restrict str, + size_t size, + const wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/swscanf.c b/newlib/libc/stdio/swscanf.c index 6a469ac31..c8ae05b42 100644 --- a/newlib/libc/stdio/swscanf.c +++ b/newlib/libc/stdio/swscanf.c @@ -32,7 +32,7 @@ INDEX INDEX _swscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include int wscanf(const wchar_t *__restrict <[format]>, ...); @@ -47,36 +47,6 @@ ANSI_SYNOPSIS int _swscanf_r(struct _reent *<[ptr]>, const wchar_t *<[str]>, const wchar_t *<[format]>, ...); - -TRAD_SYNOPSIS - #include - - int wscanf(<[format]> [, <[arg]>, ...]) - wchar_t *__restrict <[format]>; - - int fwscanf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - wchar_t *<[format]>; - - int swscanf(<[str]>, <[format]> [, <[arg]>, ...]); - wchar_t *__restrict <[str]>; - wchar_t *__restrict <[format]>; - - int _wscanf_r(<[ptr]>, <[format]> [, <[arg]>, ...]) - struct _reent *<[ptr]>; - wchar_t *<[format]>; - - int _fwscanf_r(<[ptr]>, <[fd]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - FILE *<[fd]>; - wchar_t *<[format]>; - - int _swscanf_r(<[ptr]>, <[str]>, <[format]> [, <[arg]>, ...]); - struct _reent *<[ptr]>; - wchar_t *<[str]>; - wchar_t *<[format]>; - - DESCRIPTION <> scans a series of input fields from standard input, one wide character at a time. Each field is interpreted according to @@ -445,7 +415,7 @@ Supporting OS subroutines required: <>, <>, <>, #ifndef _REENT_ONLY int -swscanf (_CONST wchar_t *__restrict str, _CONST wchar_t *__restrict fmt, ...) +swscanf (const wchar_t *__restrict str, const wchar_t *__restrict fmt, ...) { int ret; va_list ap; @@ -467,7 +437,7 @@ swscanf (_CONST wchar_t *__restrict str, _CONST wchar_t *__restrict fmt, ...) #endif /* !_REENT_ONLY */ int -_swscanf_r (struct _reent *ptr, _CONST wchar_t *str, _CONST wchar_t *fmt, ...) +_swscanf_r (struct _reent *ptr, const wchar_t *str, const wchar_t *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c index eca4ec735..f209a3edf 100644 --- a/newlib/libc/stdio/tmpfile.c +++ b/newlib/libc/stdio/tmpfile.c @@ -7,19 +7,12 @@ INDEX INDEX _tmpfile_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *tmpfile(void); FILE *_tmpfile_r(struct _reent *<[reent]>); -TRAD_SYNOPSIS - #include - FILE *tmpfile(); - - FILE *_tmpfile_r(<[reent]>) - struct _reent *<[reent]>; - DESCRIPTION Create a temporary file (a file which will be deleted automatically), using a name generated by <>. The temporary file is opened with @@ -57,8 +50,7 @@ Supporting OS subroutines required: <>, <>, <>, #endif FILE * -_DEFUN(_tmpfile_r, (ptr), - struct _reent *ptr) +_tmpfile_r (struct _reent *ptr) { FILE *fp; int e; @@ -80,7 +72,7 @@ _DEFUN(_tmpfile_r, (ptr), e = ptr->_errno; if (!fp) _close_r (ptr, fd); - _CAST_VOID _remove_r (ptr, f); + (void) _remove_r (ptr, f); ptr->_errno = e; return fp; } @@ -88,7 +80,7 @@ _DEFUN(_tmpfile_r, (ptr), #ifndef _REENT_ONLY FILE * -_DEFUN_VOID(tmpfile) +tmpfile (void) { return _tmpfile_r (_REENT); } diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c index ee722e630..3bd5b6a58 100644 --- a/newlib/libc/stdio/tmpnam.c +++ b/newlib/libc/stdio/tmpnam.c @@ -15,31 +15,13 @@ INDEX INDEX _tempnam_r -ANSI_SYNOPSIS +SYNOPSIS #include char *tmpnam(char *<[s]>); char *tempnam(char *<[dir]>, char *<[pfx]>); char *_tmpnam_r(struct _reent *<[reent]>, char *<[s]>); char *_tempnam_r(struct _reent *<[reent]>, char *<[dir]>, char *<[pfx]>); -TRAD_SYNOPSIS - #include - char *tmpnam(<[s]>) - char *<[s]>; - - char *tempnam(<[dir]>, <[pfx]>) - char *<[dir]>; - char *<[pfx]>; - - char *_tmpnam_r(<[reent]>, <[s]>) - struct _reent *<[reent]>; - char *<[s]>; - - char *_tempnam_r(<[reent]>, <[dir]>, <[pfx]>) - struct *<[reent]>; - char *<[dir]>; - char *<[pfx]>; - DESCRIPTION Use either of these functions to generate a name for a temporary file. The generated name is guaranteed to avoid collision with other files @@ -104,12 +86,11 @@ The global pointer <> is also required. another one. Return nonzero if successful, otherwise zero. */ static int -_DEFUN(worker, (ptr, result, part1, part2, part3, part4), - struct _reent *ptr _AND - char *result _AND - _CONST char *part1 _AND - _CONST char *part2 _AND - int part3 _AND +worker (struct _reent *ptr, + char *result, + const char *part1, + const char *part2, + int part3, int *part4) { /* Generate the filename and make sure that there isn't one called @@ -136,8 +117,7 @@ _DEFUN(worker, (ptr, result, part1, part2, part3, part4), } char * -_DEFUN(_tmpnam_r, (p, s), - struct _reent *p _AND +_tmpnam_r (struct _reent *p, char *s) { char *result; @@ -165,14 +145,13 @@ _DEFUN(_tmpnam_r, (p, s), } char * -_DEFUN(_tempnam_r, (p, dir, pfx), - struct _reent *p _AND - _CONST char *dir _AND - _CONST char *pfx) +_tempnam_r (struct _reent *p, + const char *dir, + const char *pfx) { char *filename; int length; - _CONST char *prefix = (pfx) ? pfx : ""; + const char *prefix = (pfx) ? pfx : ""; if (dir == NULL && (dir = getenv ("TMPDIR")) == NULL) dir = P_tmpdir; @@ -192,16 +171,14 @@ _DEFUN(_tempnam_r, (p, dir, pfx), #ifndef _REENT_ONLY char * -_DEFUN(tempnam, (dir, pfx), - _CONST char *dir _AND - _CONST char *pfx) +tempnam (const char *dir, + const char *pfx) { return _tempnam_r (_REENT, dir, pfx); } char * -_DEFUN(tmpnam, (s), - char *s) +tmpnam (char *s) { return _tmpnam_r (_REENT, s); } diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c index e385ce8fb..444577585 100644 --- a/newlib/libc/stdio/ungetc.c +++ b/newlib/libc/stdio/ungetc.c @@ -23,7 +23,7 @@ INDEX INDEX _ungetc_r -ANSI_SYNOPSIS +SYNOPSIS #include int ungetc(int <[c]>, FILE *<[stream]>); @@ -77,8 +77,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; /*static*/ int -_DEFUN(__submore, (rptr, fp), - struct _reent *rptr _AND +__submore (struct _reent *rptr, register FILE *fp) { register int i; @@ -100,10 +99,10 @@ _DEFUN(__submore, (rptr, fp), return 0; } i = fp->_ub._size; - p = (unsigned char *) _realloc_r (rptr, (_PTR) (fp->_ub._base), i << 1); + p = (unsigned char *) _realloc_r (rptr, (void *) (fp->_ub._base), i << 1); if (p == NULL) return EOF; - _CAST_VOID memcpy ((_PTR) (p + i), (_PTR) p, (size_t) i); + (void) memcpy ((void *) (p + i), (void *) p, (size_t) i); fp->_p = p + i; fp->_ub._base = p; fp->_ub._size = i << 1; @@ -111,9 +110,8 @@ _DEFUN(__submore, (rptr, fp), } int -_DEFUN(_ungetc_r, (rptr, c, fp), - struct _reent *rptr _AND - int c _AND +_ungetc_r (struct _reent *rptr, + int c, register FILE *fp) { if (c == EOF) @@ -208,8 +206,7 @@ _DEFUN(_ungetc_r, (rptr, c, fp), #ifndef _REENT_ONLY int -_DEFUN(ungetc, (c, fp), - int c _AND +ungetc (int c, register FILE *fp) { return _ungetc_r (_REENT, c, fp); diff --git a/newlib/libc/stdio/ungetwc.c b/newlib/libc/stdio/ungetwc.c index a69449eb2..16d37f2d1 100644 --- a/newlib/libc/stdio/ungetwc.c +++ b/newlib/libc/stdio/ungetwc.c @@ -33,7 +33,7 @@ INDEX INDEX _ungetwc_r -ANSI_SYNOPSIS +SYNOPSIS #include #include wint_t ungetwc(wint_t <[wc]>, FILE *<[stream]>); @@ -74,9 +74,8 @@ C99 #include "local.h" wint_t -_DEFUN(_ungetwc_r, (ptr, wc, fp), - struct _reent *ptr _AND - wint_t wc _AND +_ungetwc_r (struct _reent *ptr, + wint_t wc, register FILE *fp) { char buf[MB_LEN_MAX]; @@ -106,8 +105,7 @@ _DEFUN(_ungetwc_r, (ptr, wc, fp), * MT-safe version. */ wint_t -_DEFUN(ungetwc, (wint_t wc, FILE *fp), - wint_t wc _AND +ungetwc (wint_t wc, FILE *fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/vasiprintf.c b/newlib/libc/stdio/vasiprintf.c index f96de0d79..c7c5e35e4 100644 --- a/newlib/libc/stdio/vasiprintf.c +++ b/newlib/libc/stdio/vasiprintf.c @@ -31,9 +31,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vasiprintf, (strp, fmt, ap), - char **strp _AND - const char *fmt _AND +vasiprintf (char **strp, + const char *fmt, va_list ap) { return _vasiprintf_r (_REENT, strp, fmt, ap); @@ -42,10 +41,9 @@ _DEFUN(vasiprintf, (strp, fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_vasiprintf_r, (ptr, strp, fmt, ap), - struct _reent *ptr _AND - char **strp _AND - const char *fmt _AND +_vasiprintf_r (struct _reent *ptr, + char **strp, + const char *fmt, va_list ap) { int ret; diff --git a/newlib/libc/stdio/vasniprintf.c b/newlib/libc/stdio/vasniprintf.c index 56db45ec0..edfbd2242 100644 --- a/newlib/libc/stdio/vasniprintf.c +++ b/newlib/libc/stdio/vasniprintf.c @@ -14,11 +14,10 @@ #include "local.h" char * -_DEFUN(_vasniprintf_r, (ptr, buf, lenp, fmt, ap), - struct _reent *ptr _AND - char *buf _AND - size_t *lenp _AND - const char *fmt _AND +_vasniprintf_r (struct _reent *ptr, + char *buf, + size_t *lenp, + const char *fmt, va_list ap) { int ret; @@ -59,10 +58,9 @@ _DEFUN(_vasniprintf_r, (ptr, buf, lenp, fmt, ap), #ifndef _REENT_ONLY char * -_DEFUN(vasniprintf, (buf, lenp, fmt, ap), - char *buf _AND - size_t *lenp _AND - const char *fmt _AND +vasniprintf (char *buf, + size_t *lenp, + const char *fmt, va_list ap) { return _vasniprintf_r (_REENT, buf, lenp, fmt, ap); diff --git a/newlib/libc/stdio/vasnprintf.c b/newlib/libc/stdio/vasnprintf.c index 4cb43ce7a..1fbf5a171 100644 --- a/newlib/libc/stdio/vasnprintf.c +++ b/newlib/libc/stdio/vasnprintf.c @@ -14,11 +14,10 @@ #include "local.h" char * -_DEFUN(_vasnprintf_r, (ptr, buf, lenp, fmt, ap), - struct _reent *ptr _AND - char *buf _AND - size_t *lenp _AND - const char *fmt _AND +_vasnprintf_r (struct _reent *ptr, + char *buf, + size_t *lenp, + const char *fmt, va_list ap) { int ret; @@ -58,18 +57,17 @@ _DEFUN(_vasnprintf_r, (ptr, buf, lenp, fmt, ap), #ifdef _NANO_FORMATTED_IO char * -_EXFUN(_vasniprintf_r, (struct _reent*, char *, size_t *, +_vasniprintf_r (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vasnprintf_r")))); + _ATTRIBUTE ((__alias__("_vasnprintf_r"))); #endif #ifndef _REENT_ONLY char * -_DEFUN(vasnprintf, (buf, lenp, fmt, ap), - char *buf _AND - size_t *lenp _AND - const char *fmt _AND +vasnprintf (char *buf, + size_t *lenp, + const char *fmt, va_list ap) { return _vasnprintf_r (_REENT, buf, lenp, fmt, ap); @@ -77,7 +75,7 @@ _DEFUN(vasnprintf, (buf, lenp, fmt, ap), #ifdef _NANO_FORMATTED_IO char * -_EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vasnprintf")))); +vasniprintf (char *, size_t *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vasnprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/vasprintf.c b/newlib/libc/stdio/vasprintf.c index 5ba817d7b..8fe635462 100644 --- a/newlib/libc/stdio/vasprintf.c +++ b/newlib/libc/stdio/vasprintf.c @@ -31,9 +31,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vasprintf, (strp, fmt, ap), - char **strp _AND - const char *fmt _AND +vasprintf (char **strp, + const char *fmt, va_list ap) { return _vasprintf_r (_REENT, strp, fmt, ap); @@ -41,17 +40,16 @@ _DEFUN(vasprintf, (strp, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(vasiprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vasprintf")))); +vasiprintf (char **, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vasprintf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vasprintf_r, (ptr, strp, fmt, ap), - struct _reent *ptr _AND - char **strp _AND - const char *fmt _AND +_vasprintf_r (struct _reent *ptr, + char **strp, + const char *fmt, va_list ap) { int ret; @@ -72,6 +70,6 @@ _DEFUN(_vasprintf_r, (ptr, strp, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_vasiprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vasprintf_r")))); +_vasiprintf_r (struct _reent *, char **, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vasprintf_r"))); #endif diff --git a/newlib/libc/stdio/vdiprintf.c b/newlib/libc/stdio/vdiprintf.c index 51bdb000e..22a71b326 100644 --- a/newlib/libc/stdio/vdiprintf.c +++ b/newlib/libc/stdio/vdiprintf.c @@ -13,10 +13,9 @@ #include "local.h" int -_DEFUN(_vdiprintf_r, (ptr, fd, format, ap), - struct _reent *ptr _AND - int fd _AND - const char *format _AND +_vdiprintf_r (struct _reent *ptr, + int fd, + const char *format, va_list ap) { char *p; @@ -36,9 +35,8 @@ _DEFUN(_vdiprintf_r, (ptr, fd, format, ap), #ifndef _REENT_ONLY int -_DEFUN(vdiprintf, (fd, format, ap), - int fd _AND - const char *format _AND +vdiprintf (int fd, + const char *format, va_list ap) { return _vdiprintf_r (_REENT, fd, format, ap); diff --git a/newlib/libc/stdio/vdprintf.c b/newlib/libc/stdio/vdprintf.c index c295a3959..d22463e49 100644 --- a/newlib/libc/stdio/vdprintf.c +++ b/newlib/libc/stdio/vdprintf.c @@ -13,10 +13,9 @@ #include "local.h" int -_DEFUN(_vdprintf_r, (ptr, fd, format, ap), - struct _reent *ptr _AND - int fd _AND - const char *__restrict format _AND +_vdprintf_r (struct _reent *ptr, + int fd, + const char *__restrict format, va_list ap) { char *p; @@ -35,16 +34,15 @@ _DEFUN(_vdprintf_r, (ptr, fd, format, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vdprintf_r")))); +_vdiprintf_r (struct _reent *, int, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vdprintf_r"))); #endif #ifndef _REENT_ONLY int -_DEFUN(vdprintf, (fd, format, ap), - int fd _AND - const char *__restrict format _AND +vdprintf (int fd, + const char *__restrict format, va_list ap) { return _vdprintf_r (_REENT, fd, format, ap); @@ -52,7 +50,7 @@ _DEFUN(vdprintf, (fd, format, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(vdiprintf, (int, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vdprintf")))); +vdiprintf (int, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vdprintf"))); #endif #endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 3585423af..c4bf2dbe3 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -63,7 +63,7 @@ INDEX INDEX _vasnprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int vprintf(const char *<[fmt]>, va_list <[list]>); @@ -198,10 +198,9 @@ static char *rcsid = "$Id$"; #ifdef INTEGER_ONLY #ifndef _FVWRITE_IN_STREAMIO int -_DEFUN(__ssputs_r, (ptr, fp, buf, len), - struct _reent *ptr _AND - FILE *fp _AND - _CONST char *buf _AND +__ssputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, size_t len) { register int w; @@ -254,7 +253,7 @@ _DEFUN(__ssputs_r, (ptr, fp, buf, len), } if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) buf, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); fp->_w -= w; fp->_p += w; @@ -267,15 +266,14 @@ err: #endif int -_DEFUN(__ssprint_r, (ptr, fp, uio), - struct _reent *ptr _AND - FILE *fp _AND +__ssprint_r (struct _reent *ptr, + FILE *fp, register struct __suio *uio) { register size_t len; register int w; register struct __siov *iov; - register _CONST char *p = NULL; + register const char *p = NULL; iov = uio->uio_iov; len = 0; @@ -339,7 +337,7 @@ _DEFUN(__ssprint_r, (ptr, fp, uio), } if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) p, (size_t) (w)); fp->_w -= w; fp->_p += w; w = len; /* pretend we copied all */ @@ -359,7 +357,7 @@ err: } #else /* !INTEGER_ONLY */ #ifndef _FVWRITE_IN_STREAMIO -int __ssputs_r (struct _reent *, FILE *, _CONST char *, size_t); +int __ssputs_r (struct _reent *, FILE *, const char *, size_t); #endif int __ssprint_r (struct _reent *, FILE *, register struct __suio *); #endif /* !INTEGER_ONLY */ @@ -369,10 +367,9 @@ int __ssprint_r (struct _reent *, FILE *, register struct __suio *); #ifndef _FVWRITE_IN_STREAMIO int -_DEFUN(__sfputs_r, (ptr, fp, buf, len), - struct _reent *ptr _AND - FILE *fp _AND - _CONST char *buf _AND +__sfputs_r (struct _reent *ptr, + FILE *fp, + const char *buf, size_t len) { register int i; @@ -403,9 +400,8 @@ _DEFUN(__sfputs_r, (ptr, fp, buf, len), * then reset it so that it can be reused. */ int -_DEFUN(__sprint_r, (ptr, fp, uio), - struct _reent *ptr _AND - FILE *fp _AND +__sprint_r (struct _reent *ptr, + FILE *fp, register struct __suio *uio) { register int err = 0; @@ -442,7 +438,7 @@ out: } #else /* !INTEGER_ONLY */ #ifndef _FVWRITE_IN_STREAMIO -int __sfputs_r (struct _reent *, FILE *, _CONST char *buf, size_t); +int __sfputs_r (struct _reent *, FILE *, const char *buf, size_t); #endif int __sprint_r (struct _reent *, FILE *, register struct __suio *); #endif /* !INTEGER_ONLY */ @@ -456,10 +452,9 @@ int __sprint_r (struct _reent *, FILE *, register struct __suio *); * Make sure to avoid inlining. */ _NOINLINE_STATIC int -_DEFUN(__sbprintf, (rptr, fp, fmt, ap), - struct _reent *rptr _AND - register FILE *fp _AND - _CONST char *fmt _AND +__sbprintf (struct _reent *rptr, + register FILE *fp, + const char *fmt, va_list ap) { int ret; @@ -510,8 +505,8 @@ _DEFUN(__sbprintf, (rptr, fp, fmt, ap), # ifdef _NO_LONGDBL -extern char *_dtoa_r _PARAMS((struct _reent *, double, int, - int, int *, int *, char **)); +extern char *_dtoa_r (struct _reent *, double, int, + int, int *, int *, char **); # define _PRINTF_FLOAT_TYPE double # define _DTOA_R _dtoa_r @@ -519,10 +514,10 @@ extern char *_dtoa_r _PARAMS((struct _reent *, double, int, # else /* !_NO_LONGDBL */ -extern char *_ldtoa_r _PARAMS((struct _reent *, _LONG_DOUBLE, int, - int, int *, int *, char **)); +extern char *_ldtoa_r (struct _reent *, _LONG_DOUBLE, int, + int, int *, int *, char **); -extern int _EXFUN(_ldcheck,(_LONG_DOUBLE *)); +extern int _ldcheck (_LONG_DOUBLE *); # define _PRINTF_FLOAT_TYPE _LONG_DOUBLE # define _DTOA_R _ldtoa_r @@ -571,7 +566,7 @@ static int exponent(char *, int, int); #endif typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef long * long_ptr_t; typedef int * int_ptr_t; @@ -605,9 +600,9 @@ union arg_val }; static union arg_val * -_EXFUN(get_arg, (struct _reent *data, int n, char *fmt, +get_arg (struct _reent *data, int n, char *fmt, va_list *ap, int *numargs, union arg_val *args, - int *arg_type, char **last_fmt)); + int *arg_type, char **last_fmt); #endif /* !_NO_POS_ARGS */ /* @@ -644,13 +639,12 @@ _EXFUN(get_arg, (struct _reent *data, int n, char *fmt, # define GROUPING 0x400 /* use grouping ("'" flag) */ #endif -int _EXFUN(_VFPRINTF_R, (struct _reent *, FILE *, _CONST char *, va_list)); +int _VFPRINTF_R (struct _reent *, FILE *, const char *, va_list); #ifndef STRING_ONLY int -_DEFUN(VFPRINTF, (fp, fmt0, ap), - FILE * fp _AND - _CONST char *fmt0 _AND +VFPRINTF (FILE * fp, + const char *fmt0, va_list ap) { int result; @@ -660,10 +654,9 @@ _DEFUN(VFPRINTF, (fp, fmt0, ap), #endif /* STRING_ONLY */ int -_DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), - struct _reent *data _AND - FILE * fp _AND - _CONST char *fmt0 _AND +_VFPRINTF_R (struct _reent *data, + FILE * fp, + const char *fmt0, va_list ap) { register char *fmt; /* format string */ @@ -736,9 +729,9 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), * below longer. */ #define PADSIZE 16 /* pad chunk size */ - static _CONST char blanks[PADSIZE] = + static const char blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static _CONST char zeroes[PADSIZE] = + static const char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; #ifdef _MB_CAPABLE @@ -1175,7 +1168,7 @@ reswitch: switch (ch) { if (ch == 'C' || (flags & LONGINT)) { mbstate_t ps; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); if ((size = (int)_wcrtomb_r (data, cp, (wchar_t)GET_ARG (N, ap, wint_t), &ps)) == -1) { @@ -1459,11 +1452,11 @@ string: #ifdef _MB_CAPABLE if (ch == 'S' || (flags & LONGINT)) { mbstate_t ps; - _CONST wchar_t *wcp; + const wchar_t *wcp; - wcp = (_CONST wchar_t *)cp; + wcp = (const wchar_t *)cp; size = m = 0; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); /* Count number of bytes needed for multibyte string that will be produced from widechar @@ -1491,7 +1484,7 @@ string: fp->_flags |= __SERR; goto error; } - wcp = (_CONST wchar_t *)cp; + wcp = (const wchar_t *)cp; } if (size == 0) @@ -1509,7 +1502,7 @@ string: cp = buf; /* Convert widechar string to multibyte string. */ - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); if (_wcsrtombs_r (data, cp, &wcp, size, &ps) != size) { fp->_flags |= __SERR; @@ -1974,7 +1967,7 @@ exponent(char *p0, int exp, int fmtch) the STRING_ONLY/INTEGER_ONLY versions here. */ #if defined (STRING_ONLY) && defined(INTEGER_ONLY) -_CONST __CH_CLASS __chclass[256] = { +const __CH_CLASS __chclass[256] = { /* 00-07 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* 08-0f */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, /* 10-17 */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, @@ -2009,7 +2002,7 @@ _CONST __CH_CLASS __chclass[256] = { /* f8-ff */ OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, OTHER, }; -_CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS] = { +const __STATE __state_table[MAX_STATE][MAX_CH_CLASS] = { /* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */ /* START */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE }, /* SFLAG */ { SFLAG, WDIG, DONE, SMOD, DONE, SDOT, VARW, SFLAG, DONE }, @@ -2024,7 +2017,7 @@ _CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS] = { /* VPDIG */ { DONE, DONE, PREC, DONE, DONE, DONE, DONE, DONE, DONE }, }; -_CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS] = { +const __ACTION __action_table[MAX_STATE][MAX_CH_CLASS] = { /* '0' '1-9' '$' MODFR SPEC '.' '*' FLAG OTHER */ /* START */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP }, /* SFLAG */ { NOOP, NUMBER, NOOP, GETMOD, GETARG, NOOP, NOOP, NOOP, NOOP }, @@ -2043,14 +2036,13 @@ _CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS] = { /* function to get positional parameter N where n = N - 1 */ static union arg_val * -_DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), - struct _reent *data _AND - int n _AND - char *fmt _AND - va_list *ap _AND - int *numargs_p _AND - union arg_val *args _AND - int *arg_type _AND +get_arg (struct _reent *data, + int n, + char *fmt, + va_list *ap, + int *numargs_p, + union arg_val *args, + int *arg_type, char **last_fmt) { int ch; @@ -2098,6 +2090,8 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), if (*fmt == '\0') break; + + fmt++; # endif /* ! _MB_CAPABLE */ state = START; flags = 0; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 544d8db7f..9c38eebf4 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -32,7 +32,7 @@ INDEX INDEX _vsscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int vscanf(const char *<[fmt]>, va_list <[list]>); @@ -46,40 +46,6 @@ ANSI_SYNOPSIS int _vsscanf_r(struct _reent *<[reent]>, const char *<[str]>, const char *<[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int vscanf( <[fmt]>, <[ist]>) - char *<[fmt]>; - va_list <[list]>; - - int vfscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsscanf( <[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _vscanf_r( <[reent]>, <[fmt]>, <[ist]>) - struct _reent *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, and <> are (respectively) variants of <>, <>, and <>. They differ only in @@ -212,6 +178,7 @@ static void * get_arg (int, va_list *, int *, void **); #define SUPPRESS 0x10 /* suppress assignment */ #define POINTER 0x20 /* weird %p pointer (`fake hex') */ #define NOSKIP 0x40 /* do not skip blanks */ +#define MALLOC 0x80 /* handle 'm' modifier */ /* * The following are used in numeric conversions only: @@ -257,9 +224,8 @@ typedef unsigned long long u_long_long; #ifndef _REENT_ONLY int -_DEFUN(VFSCANF, (fp, fmt, ap), - register FILE *fp _AND - _CONST char *fmt _AND +VFSCANF (register FILE *fp, + const char *fmt, va_list ap) { struct _reent *reent = _REENT; @@ -269,9 +235,8 @@ _DEFUN(VFSCANF, (fp, fmt, ap), } int -_DEFUN(__SVFSCANF, (fp, fmt0, ap), - register FILE *fp _AND - char _CONST *fmt0 _AND +__SVFSCANF (register FILE *fp, + char const *fmt0, va_list ap) { return __SVFSCANF_R (_REENT, fp, fmt0, ap); @@ -280,10 +245,9 @@ _DEFUN(__SVFSCANF, (fp, fmt0, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_VFSCANF_R, (data, fp, fmt, ap), - struct _reent *data _AND - register FILE *fp _AND - _CONST char *fmt _AND +_VFSCANF_R (struct _reent *data, + register FILE *fp, + const char *fmt, va_list ap) { CHECK_INIT(data, fp); @@ -296,9 +260,8 @@ _DEFUN(_VFSCANF_R, (data, fp, fmt, ap), * regular ungetc which will drag in file I/O items we don't need. * So, we create our own trimmed-down version. */ int -_DEFUN(_sungetc_r, (data, fp, ch), - struct _reent *data _AND - int c _AND +_sungetc_r (struct _reent *data, + int c, register FILE *fp) { if (c == EOF) @@ -354,8 +317,7 @@ _DEFUN(_sungetc_r, (data, fp, ch), /* String only version of __srefill_r for sscanf family. */ int -_DEFUN(__ssrefill_r, (ptr, fp), - struct _reent * ptr _AND +__ssrefill_r (struct _reent * ptr, register FILE * fp) { /* @@ -380,11 +342,10 @@ _DEFUN(__ssrefill_r, (ptr, fp), } size_t -_DEFUN(_sfread_r, (ptr, buf, size, count, fp), - struct _reent * ptr _AND - _PTR buf _AND - size_t size _AND - size_t count _AND +_sfread_r (struct _reent * ptr, + void *buf, + size_t size, + size_t count, FILE * fp) { register size_t resid; @@ -400,7 +361,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp), while (resid > (r = fp->_r)) { - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) r); + (void) memcpy ((void *) p, (void *) fp->_p, (size_t) r); fp->_p += r; fp->_r = 0; p += r; @@ -411,22 +372,33 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp), return (total - resid) / size; } } - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); + (void) memcpy ((void *) p, (void *) fp->_p, resid); fp->_r -= resid; fp->_p += resid; return count; } #else /* !STRING_ONLY || !INTEGER_ONLY */ -int _EXFUN (_sungetc_r, (struct _reent *, int, register FILE *)); -int _EXFUN (__ssrefill_r, (struct _reent *, register FILE *)); -size_t _EXFUN (_sfread_r, (struct _reent *, _PTR buf, size_t, size_t, FILE *)); +int _sungetc_r (struct _reent *, int, register FILE *); +int __ssrefill_r (struct _reent *, register FILE *); +size_t _sfread_r (struct _reent *, void *buf, size_t, size_t, FILE *); #endif /* !STRING_ONLY || !INTEGER_ONLY */ +static inline int +__wctob (struct _reent *rptr, wint_t wc) +{ + mbstate_t mbs; + unsigned char pmb[MB_LEN_MAX]; + + if (wc == WEOF) + return EOF; + memset (&mbs, '\0', sizeof (mbs)); + return __WCTOMB (rptr, (char *) pmb, wc, &mbs) == 1 ? (int) pmb[0] : 0; +} + int -_DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), - struct _reent *rptr _AND - register FILE *fp _AND - char _CONST *fmt0 _AND +__SVFSCANF_R (struct _reent *rptr, + register FILE *fp, + char const *fmt0, va_list ap) { register u_char *fmt = (u_char *) fmt0; @@ -449,12 +421,133 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), int nbytes = 1; /* number of bytes read from fmt string */ wchar_t wc; /* wchar to use to read format string */ wchar_t *wcp; /* handy wide character pointer */ - size_t mbslen; /* length of converted multibyte sequence */ + size_t mbslen = 0; /* length of converted multibyte sequence */ #ifdef _MB_CAPABLE mbstate_t state; /* value to keep track of multibyte state */ #endif +#ifdef _WANT_IO_C99_FORMATS +#define _WANT_IO_POSIX_EXTENSIONS +#endif +#ifdef _WANT_IO_POSIX_EXTENSIONS + /* POSIX requires that fscanf frees all allocated strings from 'm' + conversions in case it returns EOF. m_ptr is used to keep track. + It will be allocated on the stack the first time an 'm' conversion + takes place, and it will be free'd on return from the function. + This implementation tries to save space by only allocating 8 + pointer slots at a time. Most scenarios should never have to call + realloc again. This implementation allows only up to 65528 'm' + conversions per fscanf invocation for now. That should be enough + for almost all scenarios, right? */ + struct m_ptrs { + void ***m_arr; /* Array of pointer args to 'm' conversion */ + uint16_t m_siz; /* Number of slots in m_arr */ + uint16_t m_cnt; /* Number of valid entries in m_arr */ + } *m_ptr = NULL; + #define init_m_ptr() \ + do \ + { \ + if (!m_ptr) \ + { \ + m_ptr = (struct m_ptrs *) alloca (sizeof *m_ptr); \ + m_ptr->m_arr = NULL; \ + m_ptr->m_siz = 0; \ + m_ptr->m_cnt = 0; \ + } \ + } \ + while (0) + #define push_m_ptr(arg) \ + do \ + { \ + if (m_ptr->m_cnt >= m_ptr->m_siz) \ + { \ + void ***n = NULL; \ + \ + if (m_ptr->m_siz + 8 > 0 && m_ptr->m_siz + 8 < UINT16_MAX) \ + n = (void ***) realloc (m_ptr->m_arr, \ + (m_ptr->m_siz + 8) * \ + sizeof (void **)); \ + if (!n) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + m_ptr->m_arr = n; \ + m_ptr->m_siz += 8; \ + } \ + m_ptr->m_arr[m_ptr->m_cnt++] = (void **) (arg); \ + } \ + while (0) + #define alloc_m_ptr(_type, _p, _p0, _p_p, _w) \ + ({ \ + _p_p = GET_ARG (N, ap, _type **); \ + if (!_p_p) \ + goto match_failure; \ + _p0 = (_type *) malloc ((_w) * sizeof (_type)); \ + if (!_p0) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + *_p_p = _p0; \ + push_m_ptr (_p_p); \ + _p = _p0; \ + _w; \ + }) + /* For systems with wchar_t == 2 (UTF-16) check if there's room for + at least 2 wchar_t's (surrogate pairs). */ + #define realloc_m_ptr(_type, _p, _p0, _p_p, _w) \ + ({ \ + size_t _nw = (_w); \ + ptrdiff_t _dif = _p - _p0; \ + if (_p_p && \ + ((sizeof (_type) == 2 && _dif >= _nw - 1) \ + || _dif >= _nw)) \ + { \ + _p0 = (_type *) realloc (_p0, (_nw << 1) * sizeof (_type)); \ + if (!_p0) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + _p = _p0 + _dif; \ + *_p_p = _p0; \ + _nw <<= 1; \ + } \ + _nw; \ + }) + #define shrink_m_ptr(_type, _p_p, _w, _cw) \ + ({ \ + size_t _nw = (_w); \ + if (_p_p && _nw < _cw) \ + { \ + _type *_np_p = (_type *) \ + realloc (*_p_p, _nw * sizeof (_type)); \ + if (_np_p) \ + *_p_p = _np_p; \ + } \ + }) + #define free_m_ptr() \ + do \ + { \ + if (m_ptr) \ + { \ + if (nassigned == EOF) \ + { \ + int i; \ + for (i = 0; i < m_ptr->m_cnt; ++i) \ + { \ + free (*m_ptr->m_arr[i]); \ + *m_ptr->m_arr[i] = NULL; \ + } \ + } \ + if (m_ptr->m_arr) \ + free (m_ptr->m_arr); \ + } \ + } \ + while (0) +#endif - #define CCFN_PARAMS _PARAMS((struct _reent *, const char *, char **, int)) + #define CCFN_PARAMS (struct _reent *, const char *, char **, int) u_long (*ccfn)CCFN_PARAMS=0; /* conversion function (strtol/strtoul) */ char ccltab[256]; /* character class table for %[...] */ char buf[BUF]; /* buffer for numeric conversions */ @@ -474,7 +567,7 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), #endif /* `basefix' is used to avoid `if' tests in the integer scanner */ - static _CONST short basefix[17] = + static const short basefix[17] = {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; /* Macro to support positional arguments */ @@ -564,9 +657,14 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), continue; case '*': + if ((flags & (CHAR | SHORT | LONG | LONGDBL | SUPPRESS | MALLOC)) + || width) + goto match_failure; flags |= SUPPRESS; goto again; case 'l': + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; #if defined _WANT_IO_C99_FORMATS || !defined _NO_LONGLONG if (*fmt == 'l') /* Check for 'll' = long long (SUSv3) */ { @@ -578,9 +676,13 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), flags |= LONG; goto again; case 'L': + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; flags |= LONGDBL; goto again; case 'h': + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; #ifdef _WANT_IO_C99_FORMATS if (*fmt == 'h') /* Check for 'hh' = char int (SUSv3) */ { @@ -593,12 +695,16 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), goto again; #ifdef _WANT_IO_C99_FORMATS case 'j': /* intmax_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (intmax_t) == sizeof (long)) flags |= LONG; else flags |= LONGDBL; goto again; case 't': /* ptrdiff_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (ptrdiff_t) < sizeof (int)) /* POSIX states ptrdiff_t is 16 or more bits, as is short. */ @@ -615,6 +721,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), flags |= LONGDBL; goto again; case 'z': /* size_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (size_t) < sizeof (int)) /* POSIX states size_t is 16 or more bits, as is short. */ flags |= SHORT; @@ -630,6 +738,14 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), flags |= LONGDBL; goto again; #endif /* _WANT_IO_C99_FORMATS */ +#ifdef _WANT_IO_POSIX_EXTENSIONS + case 'm': + if (flags & (CHAR | SHORT | LONG | LONGDBL | MALLOC)) + goto match_failure; + init_m_ptr (); + flags |= MALLOC; + goto again; +#endif case '0': case '1': @@ -641,11 +757,15 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), case '7': case '8': case '9': + if (flags & (CHAR | SHORT | LONG | LONGDBL | MALLOC)) + goto match_failure; width = width * 10 + c - '0'; goto again; #ifndef _NO_POS_ARGS case '$': + if (flags & (CHAR | SHORT | LONG | LONGDBL | SUPPRESS | MALLOC)) + goto match_failure; if (width <= MAX_POS_ARGS) { N = width - 1; @@ -787,20 +907,8 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), } continue; - /* - * Disgusting backwards compatibility hacks. XXX - */ - case '\0': /* compat */ - _newlib_flockfile_exit (fp); - return EOF; - - default: /* compat */ - if (isupper (c)) - flags |= LONG; - c = CT_INT; - ccfn = (u_long (*)CCFN_PARAMS)_strtol_r; - base = 10; - break; + default: + goto match_failure; } /* @@ -844,12 +952,20 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), #if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 if (flags & LONG) { +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **wcp_p = NULL; + wchar_t *wcp0 = NULL; + size_t wcp_siz = 0; +#endif mbstate_t state; - memset (&state, 0, sizeof (mbstate_t)); - if ((flags & SUPPRESS) == 0) - wcp = GET_ARG (N, ap, wchar_t *); - else + if (flags & SUPPRESS) wcp = NULL; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + wcp_siz = alloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, 32); +#endif + else + wcp = GET_ARG (N, ap, wchar_t *); n = 0; while (width != 0) { @@ -858,6 +974,10 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), buf[n++] = *fp->_p; fp->_r -= 1; fp->_p += 1; + /* Got a high surrogate, allow low surrogate to slip + through */ + if (mbslen != 3 || state.__count != 4) + memset (&state, 0, sizeof (mbstate_t)); if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state)) == (size_t)-1) goto input_failure; /* Invalid sequence */ @@ -866,9 +986,17 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), if (mbslen != (size_t)-2) /* Incomplete sequence */ { nread += n; - width -= 1; + /* Handle high surrogate */ + if (mbslen != 3 || state.__count != 4) + width -= 1; if (!(flags & SUPPRESS)) - wcp += 1; + { +#ifdef _WANT_IO_POSIX_EXTENSIONS + wcp_siz = realloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, + wcp_siz); +#endif + wcp++; + } n = 0; } if (BufferEmpty) @@ -878,12 +1006,15 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), break; } } +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, wcp_p, wcp - wcp0, wcp_siz); +#endif if (!(flags & SUPPRESS)) nassigned++; } else -#endif - if (flags & SUPPRESS) +#endif /* ELIX_LEVEL */ + if (flags & SUPPRESS) { size_t sum = 0; for (;;) @@ -912,10 +1043,20 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), } else { - size_t r = _fread_r (rptr, (_PTR) GET_ARG (N, ap, char *), 1, width, fp); - + size_t r; +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **p_p = NULL; + if (flags & MALLOC) + alloc_m_ptr (char, p, p0, p_p, width); + else +#endif + p = GET_ARG (N, ap, char *); + r = _fread_r (rptr, p, 1, width, fp); if (r == 0) goto input_failure; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, p_p, r, width); +#endif nread += r; nassigned++; } @@ -924,8 +1065,81 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), case CT_CCL: /* scan a (nonempty) character class (sets NOSKIP) */ if (width == 0) - width = ~0; /* `infinity' */ + width = SIZE_MAX; /* take only those things in the class */ +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 + if (flags & LONG) + { +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **wcp_p = NULL; + wchar_t *wcp0 = NULL; + size_t wcp_siz = 0; +#endif + mbstate_t state; + if (flags & SUPPRESS) + wcp = &wc; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + wcp_siz = alloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, 32); +#endif + else + wcp = GET_ARG (N, ap, wchar_t *); + n = 0; + while (width != 0) { + if (n == MB_CUR_MAX) + goto input_failure; + buf[n++] = *fp->_p; + fp->_r -= 1; + fp->_p += 1; + /* Got a high surrogate, allow low surrogate to slip + through */ + if (mbslen != 3 || state.__count != 4) + memset (&state, 0, sizeof (mbstate_t)); + if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state)) + == (size_t)-1) + goto input_failure; + if (mbslen == 0) + *wcp = L'\0'; + if (mbslen != (size_t)-2) /* Incomplete sequence */ + { + if (!ccltab[__wctob (rptr, *wcp)]) + { + while (n != 0) + _ungetc_r (rptr, (unsigned char) buf[--n], fp); + break; + } + nread += n; + /* Handle high surrogate */ + if (mbslen != 3 || state.__count != 4) + width -= 1; + if ((flags & SUPPRESS) == 0) + { + wcp += 1; +#ifdef _WANT_IO_POSIX_EXTENSIONS + wcp_siz = realloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, + wcp_siz); +#endif + } + n = 0; + } + if (BufferEmpty) + { + if (n != 0) + goto input_failure; + break; + } + } + if (!(flags & SUPPRESS)) + { + *wcp = L'\0'; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, wcp_p, wcp - wcp0 + 1, wcp_siz); +#endif + nassigned++; + } + } + else +#endif /* ELIX_LEVEL */ if (flags & SUPPRESS) { n = 0; @@ -943,14 +1157,26 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), } if (n == 0) goto match_failure; + nread += n; } else { - p0 = p = GET_ARG (N, ap, char *); +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **p_p = NULL; + size_t p_siz = 0; + + if (flags & MALLOC) + p_siz = alloc_m_ptr (char, p, p0, p_p, 32); + else +#endif + p0 = p = GET_ARG (N, ap, char *); while (ccltab[*fp->_p]) { fp->_r--; *p++ = *fp->_p++; +#ifdef _WANT_IO_POSIX_EXTENSIONS + p_siz = realloc_m_ptr (char, p, p0, p_p, p_siz); +#endif if (--width == 0) break; if (BufferEmpty) @@ -964,25 +1190,36 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), if (n == 0) goto match_failure; *p = 0; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, p_p, n + 1, p_siz); +#endif nassigned++; + nread += n; } - nread += n; break; case CT_STRING: /* like CCL, but zero-length string OK, & no NOSKIP */ if (width == 0) - width = (size_t)~0; + width = SIZE_MAX; #if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 if (flags & LONG) { +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **wcp_p = NULL; + wchar_t *wcp0 = NULL; + size_t wcp_siz = 0; +#endif /* Process %S and %ls placeholders */ mbstate_t state; - memset (&state, 0, sizeof (mbstate_t)); - if ((flags & SUPPRESS) == 0) - wcp = GET_ARG (N, ap, wchar_t *); - else + if (flags & SUPPRESS) wcp = &wc; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + wcp_siz = alloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, 32); +#endif + else + wcp = GET_ARG (N, ap, wchar_t *); n = 0; while (!isspace (*fp->_p) && width != 0) { @@ -991,6 +1228,10 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), buf[n++] = *fp->_p; fp->_r -= 1; fp->_p += 1; + /* Got a high surrogate, allow low surrogate to slip + through */ + if (mbslen != 3 || state.__count != 4) + memset (&state, 0, sizeof (mbstate_t)); if ((mbslen = _mbrtowc_r (rptr, wcp, buf, n, &state)) == (size_t)-1) goto input_failure; @@ -1005,9 +1246,17 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), break; } nread += n; - width -= 1; + /* Handle high surrogate */ + if (mbslen != 3 || state.__count != 4) + width -= 1; if ((flags & SUPPRESS) == 0) - wcp += 1; + { + wcp += 1; +#ifdef _WANT_IO_POSIX_EXTENSIONS + wcp_siz = realloc_m_ptr (wchar_t, wcp, wcp0, wcp_p, + wcp_siz); +#endif + } n = 0; } if (BufferEmpty) @@ -1020,12 +1269,15 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), if (!(flags & SUPPRESS)) { *wcp = L'\0'; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, wcp_p, wcp - wcp0 + 1, wcp_siz); +#endif nassigned++; } } else #endif - if (flags & SUPPRESS) + if (flags & SUPPRESS) { n = 0; while (!isspace (*fp->_p)) @@ -1040,17 +1292,32 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), } else { - p0 = p = GET_ARG (N, ap, char *); +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **p_p = NULL; + size_t p_siz = 0; + + if (flags & MALLOC) + p_siz = alloc_m_ptr (char, p, p0, p_p, 32); + else +#endif + p0 = GET_ARG (N, ap, char *); + p = p0; while (!isspace (*fp->_p)) { fp->_r--; *p++ = *fp->_p++; +#ifdef _WANT_IO_POSIX_EXTENSIONS + p_siz = realloc_m_ptr (char, p, p0, p_p, p_siz); +#endif if (--width == 0) break; if (BufferEmpty) break; } *p = 0; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, p_p, p - p0 + 1, p_siz); +#endif nread += p - p0; nassigned++; } @@ -1619,7 +1886,7 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap), { flp = GET_ARG (N, ap, float *); if (isnan (res)) - *flp = nanf (NULL); + *flp = nanf (""); else *flp = res; } @@ -1635,12 +1902,14 @@ input_failure: should have been set prior to here. On EOF failure (including invalid format string), return EOF if no matches yet, else number of matches made prior to failure. */ - _newlib_flockfile_exit (fp); - return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; + nassigned = nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; match_failure: all_done: /* Return number of matches, which can be 0 on match failure. */ _newlib_flockfile_end (fp); +#ifdef _WANT_IO_POSIX_EXTENSIONS + free_m_ptr (); +#endif return nassigned; } diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index 4786ed6a9..980b31e3b 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -47,7 +47,7 @@ INDEX INDEX _vswprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include #include @@ -149,7 +149,7 @@ SEEALSO # undef _NO_LONGLONG #endif -int _EXFUN(_VFWPRINTF_R, (struct _reent *, FILE *, _CONST wchar_t *, va_list)); +int _VFWPRINTF_R (struct _reent *, FILE *, const wchar_t *, va_list); /* Defined in vfprintf.c. */ #ifdef _FVWRITE_IN_STREAMIO # ifdef STRING_ONLY @@ -157,14 +157,14 @@ int _EXFUN(_VFWPRINTF_R, (struct _reent *, FILE *, _CONST wchar_t *, va_list)); # else # define __SPRINT __sprint_r # endif -int _EXFUN(__SPRINT, (struct _reent *, FILE *, register struct __suio *)); +int __SPRINT (struct _reent *, FILE *, register struct __suio *); #else # ifdef STRING_ONLY # define __SPRINT __ssputs_r # else # define __SPRINT __sfputs_r # endif -int _EXFUN(__SPRINT, (struct _reent *, FILE *, _CONST char *, size_t)); +int __SPRINT (struct _reent *, FILE *, const char *, size_t); #endif #ifndef STRING_ONLY #ifdef _UNBUF_STREAM_OPT @@ -174,10 +174,9 @@ int _EXFUN(__SPRINT, (struct _reent *, FILE *, _CONST char *, size_t)); * worries about ungetc buffers and so forth. */ static int -_DEFUN(__sbwprintf, (rptr, fp, fmt, ap), - struct _reent *rptr _AND - register FILE *fp _AND - _CONST wchar_t *fmt _AND +__sbwprintf (struct _reent *rptr, + register FILE *fp, + const wchar_t *fmt, va_list ap) { int ret; @@ -228,8 +227,8 @@ _DEFUN(__sbwprintf, (rptr, fp, fmt, ap), # ifdef _NO_LONGDBL -extern char *_dtoa_r _PARAMS((struct _reent *, double, int, - int, int *, int *, char **)); +extern char *_dtoa_r (struct _reent *, double, int, + int, int *, int *, char **); # define _PRINTF_FLOAT_TYPE double # define _DTOA_R _dtoa_r @@ -237,10 +236,10 @@ extern char *_dtoa_r _PARAMS((struct _reent *, double, int, # else /* !_NO_LONGDBL */ -extern char *_ldtoa_r _PARAMS((struct _reent *, _LONG_DOUBLE, int, - int, int *, int *, char **)); +extern char *_ldtoa_r (struct _reent *, _LONG_DOUBLE, int, + int, int *, int *, char **); -extern int _EXFUN(_ldcheck,(_LONG_DOUBLE *)); +extern int _ldcheck (_LONG_DOUBLE *); # define _PRINTF_FLOAT_TYPE _LONG_DOUBLE # define _DTOA_R _ldtoa_r @@ -289,7 +288,7 @@ static int wexponent(wchar_t *, int, int); #endif typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef wchar_t* wchar_ptr_t; typedef long * long_ptr_t; @@ -325,9 +324,9 @@ union arg_val }; static union arg_val * -_EXFUN(get_arg, (struct _reent *data, int n, wchar_t *fmt, +get_arg (struct _reent *data, int n, wchar_t *fmt, va_list *ap, int *numargs, union arg_val *args, - int *arg_type, wchar_t **last_fmt)); + int *arg_type, wchar_t **last_fmt); #endif /* !_NO_POS_ARGS */ /* @@ -366,9 +365,8 @@ _EXFUN(get_arg, (struct _reent *data, int n, wchar_t *fmt, #ifndef STRING_ONLY int -_DEFUN(VFWPRINTF, (fp, fmt0, ap), - FILE *__restrict fp _AND - _CONST wchar_t *__restrict fmt0 _AND +VFWPRINTF (FILE *__restrict fp, + const wchar_t *__restrict fmt0, va_list ap) { int result; @@ -378,10 +376,9 @@ _DEFUN(VFWPRINTF, (fp, fmt0, ap), #endif /* STRING_ONLY */ int -_DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), - struct _reent *data _AND - FILE * fp _AND - _CONST wchar_t *fmt0 _AND +_VFWPRINTF_R (struct _reent *data, + FILE * fp, + const wchar_t *fmt0, va_list ap) { register wchar_t *fmt; /* format string */ @@ -452,10 +449,10 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), * below longer. */ #define PADSIZE 16 /* pad chunk size */ - static _CONST wchar_t blanks[PADSIZE] = + static const wchar_t blanks[PADSIZE] = {L' ',L' ',L' ',L' ',L' ',L' ',L' ',L' ', L' ',L' ',L' ',L' ',L' ',L' ',L' ',L' '}; - static _CONST wchar_t zeroes[PADSIZE] = + static const wchar_t zeroes[PADSIZE] = {L'0',L'0',L'0',L'0',L'0',L'0',L'0',L'0', L'0',L'0',L'0',L'0',L'0',L'0',L'0',L'0'}; @@ -519,7 +516,7 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap), } #else #define PRINT(ptr, len) { \ - if (__SPRINT (data, fp, (_CONST char *)(ptr), (len) * sizeof (wchar_t)) == EOF) \ + if (__SPRINT (data, fp, (const char *)(ptr), (len) * sizeof (wchar_t)) == EOF) \ goto error; \ } #define PAD(howmany, with) { \ @@ -1199,7 +1196,7 @@ string: if (prec >= 0) { char *p = arg; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); while (nchars < (size_t)prec) { nconv = mbrlen (p, MB_CUR_MAX, &ps); if (nconv == 0 || nconv == (size_t)-1 || @@ -1224,7 +1221,7 @@ string: cp = malloc_buf; } else cp = buf; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); p = cp; while (insize != 0) { nconv = _mbrtowc_r (data, p, arg, insize, &ps); @@ -1734,14 +1731,13 @@ wexponent(wchar_t *p0, int exp, int fmtch) /* function to get positional parameter N where n = N - 1 */ static union arg_val * -_DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), - struct _reent *data _AND - int n _AND - wchar_t *fmt _AND - va_list *ap _AND - int *numargs_p _AND - union arg_val *args _AND - int *arg_type _AND +get_arg (struct _reent *data, + int n, + wchar_t *fmt, + va_list *ap, + int *numargs_p, + union arg_val *args, + int *arg_type, wchar_t **last_fmt) { wchar_t ch; diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c index 5b35601be..0464b0837 100644 --- a/newlib/libc/stdio/vfwscanf.c +++ b/newlib/libc/stdio/vfwscanf.c @@ -32,7 +32,7 @@ INDEX INDEX _vswscanf -ANSI_SYNOPSIS +SYNOPSIS #include #include int vwscanf(const wchar_t *__restrict <[fmt]>, va_list <[list]>); @@ -48,40 +48,6 @@ ANSI_SYNOPSIS int _vswscanf(struct _reent *<[reent]>, const wchar_t *<[str]>, const wchar_t *<[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int vwscanf( <[fmt]>, <[ist]>) - wchar_t *__restrict <[fmt]>; - va_list <[list]>; - - int vfwscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *__restrict <[fp]>; - wchar_t *__restrict <[fmt]>; - va_list <[list]>; - - int vswscanf( <[str]>, <[fmt]>, <[list]>) - wchar_t *__restrict <[str]>; - wchar_t *__restrict <[fmt]>; - va_list <[list]>; - - int _vwscanf( <[reent]>, <[fmt]>, <[ist]>) - struct _reent *<[reent]>; - wchar_t *<[fmt]>; - va_list <[list]>; - - int _vfwscanf( <[reent]>, <[fp]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - FILE *<[fp]>; - wchar_t *<[fmt]>; - va_list <[list]>; - - int _vswscanf( <[reent]>, <[str]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - wchar_t *<[str]>; - wchar_t *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, and <> are (respectively) variants of <>, <>, and <>. They differ only in @@ -172,7 +138,7 @@ C99, POSIX-1.2008 #define _NO_LONGDBL #if defined _WANT_IO_LONG_DOUBLE && (LDBL_MANT_DIG > DBL_MANT_DIG) #undef _NO_LONGDBL -extern _LONG_DOUBLE _wcstold_r _PARAMS((wchar_t *s, wchar_t **sptr)); +extern _LONG_DOUBLE _wcstold_r (wchar_t *s, wchar_t **sptr); #endif #include "floatio.h" @@ -219,6 +185,7 @@ static void * get_arg (int, va_list *, int *, void **); #define SUPPRESS 0x10 /* suppress assignment */ #define POINTER 0x20 /* weird %p pointer (`fake hex') */ #define NOSKIP 0x40 /* do not skip blanks */ +#define MALLOC 0x80 /* handle 'm' modifier */ /* * The following are used in numeric conversions only: @@ -259,9 +226,8 @@ static void * get_arg (int, va_list *, int *, void **); #ifndef _REENT_ONLY int -_DEFUN(VFWSCANF, (fp, fmt, ap), - register FILE *__restrict fp _AND - _CONST wchar_t *__restrict fmt _AND +VFWSCANF (register FILE *__restrict fp, + const wchar_t *__restrict fmt, va_list ap) { struct _reent *reent = _REENT; @@ -271,9 +237,8 @@ _DEFUN(VFWSCANF, (fp, fmt, ap), } int -_DEFUN(__SVFWSCANF, (fp, fmt0, ap), - register FILE *fp _AND - wchar_t _CONST *fmt0 _AND +__SVFWSCANF (register FILE *fp, + wchar_t const *fmt0, va_list ap) { return __SVFWSCANF_R (_REENT, fp, fmt0, ap); @@ -282,10 +247,9 @@ _DEFUN(__SVFWSCANF, (fp, fmt0, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_VFWSCANF_R, (data, fp, fmt, ap), - struct _reent *data _AND - register FILE *fp _AND - _CONST wchar_t *fmt _AND +_VFWSCANF_R (struct _reent *data, + register FILE *fp, + const wchar_t *fmt, va_list ap) { CHECK_INIT(data, fp); @@ -298,9 +262,8 @@ _DEFUN(_VFWSCANF_R, (data, fp, fmt, ap), * regular ungetwc which will drag in file I/O items we don't need. * So, we create our own trimmed-down version. */ static wint_t -_DEFUN(_sungetwc_r, (data, fp, ch), - struct _reent *data _AND - wint_t wc _AND +_sungetwc_r (struct _reent *data, + wint_t wc, register FILE *fp) { if (wc == WEOF) @@ -355,11 +318,10 @@ _DEFUN(_sungetwc_r, (data, fp, ch), return wc; } -extern int __ssrefill_r _PARAMS ((struct _reent *ptr, register FILE * fp)); +extern int __ssrefill_r (struct _reent *ptr, register FILE * fp); static size_t -_DEFUN(_sfgetwc_r, (ptr, fp), - struct _reent * ptr _AND +_sfgetwc_r (struct _reent * ptr, FILE * fp) { wchar_t wc; @@ -374,10 +336,9 @@ _DEFUN(_sfgetwc_r, (ptr, fp), #endif /* STRING_ONLY */ int -_DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), - struct _reent *rptr _AND - register FILE *fp _AND - wchar_t _CONST *fmt0 _AND +__SVFWSCANF_R (struct _reent *rptr, + register FILE *fp, + wchar_t const *fmt0, va_list ap) { register wchar_t *fmt = (wchar_t *) fmt0; @@ -400,7 +361,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), mbstate_t mbs; /* value to keep track of multibyte state */ - #define CCFN_PARAMS _PARAMS((struct _reent *, const wchar_t *, wchar_t **, int)) + #define CCFN_PARAMS (struct _reent *, const wchar_t *, wchar_t **, int) unsigned long (*ccfn)CCFN_PARAMS=0; /* conversion function (wcstol/wcstoul) */ wchar_t buf[BUF]; /* buffer for numeric conversions */ const wchar_t *ccls; /* character class start */ @@ -409,7 +370,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), wint_t wi; /* handy wint_t */ char *mbp = NULL; /* multibyte string pointer for %c %s %[ */ size_t nconv; /* number of bytes in mb. conversion */ - char mbbuf[MB_LEN_MAX]; /* temporary mb. character buffer */ + char mbbuf[MB_LEN_MAX]; /* temporary mb. character buffer */ char *cp; short *sp; @@ -424,9 +385,130 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), #ifndef _NO_LONGLONG long long *llp; #endif +#ifdef _WANT_IO_C99_FORMATS +#define _WANT_IO_POSIX_EXTENSIONS +#endif +#ifdef _WANT_IO_POSIX_EXTENSIONS + /* POSIX requires that fwscanf frees all allocated strings from 'm' + conversions in case it returns EOF. m_ptr is used to keep track. + It will be allocated on the stack the first time an 'm' conversion + takes place, and it will be free'd on return from the function. + This implementation tries to save space by only allocating 8 + pointer slots at a time. Most scenarios should never have to call + realloc again. This implementation allows only up to 65528 'm' + conversions per fwscanf invocation for now. That should be enough + for almost all scenarios, right? */ + struct m_ptrs { + void ***m_arr; /* Array of pointer args to 'm' conversion */ + uint16_t m_siz; /* Number of slots in m_arr */ + uint16_t m_cnt; /* Number of valid entries in m_arr */ + } *m_ptr = NULL; + #define init_m_ptr() \ + do \ + { \ + if (!m_ptr) \ + { \ + m_ptr = (struct m_ptrs *) alloca (sizeof *m_ptr); \ + m_ptr->m_arr = NULL; \ + m_ptr->m_siz = 0; \ + m_ptr->m_cnt = 0; \ + } \ + } \ + while (0) + #define push_m_ptr(arg) \ + do \ + { \ + if (m_ptr->m_cnt >= m_ptr->m_siz) \ + { \ + void ***n = NULL; \ + \ + if (m_ptr->m_siz + 8 > 0 && m_ptr->m_siz + 8 < UINT16_MAX) \ + n = (void ***) realloc (m_ptr->m_arr, \ + (m_ptr->m_siz + 8) * \ + sizeof (void **)); \ + if (!n) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + m_ptr->m_arr = n; \ + m_ptr->m_siz += 8; \ + } \ + m_ptr->m_arr[m_ptr->m_cnt++] = (void **) (arg); \ + } \ + while (0) + #define alloc_m_ptr(_type, _p, _p0, _p_p, _w) \ + ({ \ + _p_p = GET_ARG (N, ap, _type **); \ + if (!_p_p) \ + goto match_failure; \ + _p0 = (_type *) malloc ((_w) * sizeof (_type)); \ + if (!_p0) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + *_p_p = _p0; \ + push_m_ptr (_p_p); \ + _p = _p0; \ + _w; \ + }) + /* For char output, check if there's room for at least MB_CUR_MAX + characters. */ + #define realloc_m_ptr(_type, _p, _p0, _p_p, _w) \ + ({ \ + size_t _nw = (_w); \ + ptrdiff_t _dif = _p - _p0; \ + if (_p_p && \ + ((sizeof (_type) == 1 && _dif >= _nw - MB_CUR_MAX) \ + || _dif >= _nw)) \ + { \ + _p0 = (_type *) realloc (_p0, (_nw << 1) * sizeof (_type)); \ + if (!_p0) \ + { \ + nassigned = EOF; \ + goto match_failure; \ + } \ + _p = _p0 + _dif; \ + *_p_p = _p0; \ + _nw <<= 1; \ + } \ + _nw; \ + }) + #define shrink_m_ptr(_type, _p_p, _w, _cw) \ + ({ \ + size_t _nw = (_w); \ + if (_p_p && _nw < _cw) \ + { \ + _type *_np_p = (_type *) \ + realloc (*_p_p, _nw * sizeof (_type)); \ + if (_np_p) \ + *_p_p = _np_p; \ + } \ + }) + #define free_m_ptr() \ + do \ + { \ + if (m_ptr) \ + { \ + if (nassigned == EOF) \ + { \ + int i; \ + for (i = 0; i < m_ptr->m_cnt; ++i) \ + { \ + free (*m_ptr->m_arr[i]); \ + *m_ptr->m_arr[i] = NULL; \ + } \ + } \ + if (m_ptr->m_arr) \ + free (m_ptr->m_arr); \ + } \ + } \ + while (0) +#endif /* `basefix' is used to avoid `if' tests in the integer scanner */ - static _CONST short basefix[17] = + static const short basefix[17] = {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; /* Macro to support positional arguments */ @@ -518,9 +600,13 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), continue; case L'*': + if ((flags & (CHAR | SHORT | LONG | LONGDBL | SUPPRESS | MALLOC)) + || width) flags |= SUPPRESS; goto again; case L'l': + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; #if defined _WANT_IO_C99_FORMATS || !defined _NO_LONGLONG if (*fmt == L'l') /* Check for 'll' = long long (SUSv3) */ { @@ -532,10 +618,14 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), flags |= LONG; goto again; case L'L': + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; flags |= LONGDBL; goto again; case L'h': #ifdef _WANT_IO_C99_FORMATS + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (*fmt == 'h') /* Check for 'hh' = char int (SUSv3) */ { ++fmt; @@ -547,12 +637,16 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), goto again; #ifdef _WANT_IO_C99_FORMATS case L'j': /* intmax_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (intmax_t) == sizeof (long)) flags |= LONG; else flags |= LONGDBL; goto again; case L't': /* ptrdiff_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (ptrdiff_t) < sizeof (int)) /* POSIX states ptrdiff_t is 16 or more bits, as is short. */ @@ -569,6 +663,8 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), flags |= LONGDBL; goto again; case L'z': /* size_t */ + if (flags & (CHAR | SHORT | LONG | LONGDBL)) + goto match_failure; if (sizeof (size_t) < sizeof (int)) /* POSIX states size_t is 16 or more bits, as is short. */ flags |= SHORT; @@ -584,6 +680,14 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), flags |= LONGDBL; goto again; #endif /* _WANT_IO_C99_FORMATS */ +#ifdef _WANT_IO_POSIX_EXTENSIONS + case 'm': + if (flags & (CHAR | SHORT | LONG | LONGDBL | MALLOC)) + goto match_failure; + init_m_ptr (); + flags |= MALLOC; + goto again; +#endif case L'0': case L'1': @@ -595,11 +699,15 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), case L'7': case L'8': case L'9': + if (flags & (CHAR | SHORT | LONG | LONGDBL | MALLOC)) + goto match_failure; width = width * 10 + c - L'0'; goto again; #ifndef _NO_POS_ARGS case L'$': + if (flags & (CHAR | SHORT | LONG | LONGDBL | SUPPRESS | MALLOC)) + goto match_failure; if (width <= MAX_POS_ARGS) { N = width - 1; @@ -669,7 +777,6 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), break; case L'[': - ccls = fmt; if (*fmt == '^') { cclcompl = 1; @@ -677,6 +784,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), } else cclcompl = 0; + ccls = fmt; if (*fmt == ']') fmt++; while (*fmt != '\0' && *fmt != ']') @@ -740,14 +848,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), } continue; - /* - * Disgusting backwards compatibility hacks. XXX - */ - case L'\0': /* compat */ - _newlib_flockfile_exit (fp); - return EOF; - - default: /* compat */ + default: goto match_failure; } @@ -776,56 +877,83 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), width = 1; if (flags & LONG) { - if (!(flags & SUPPRESS)) +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **p_p = NULL; + wchar_t *p0 = NULL; + size_t p_siz = 0; +#endif + + if (flags & SUPPRESS) + ; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + p_siz = alloc_m_ptr (wchar_t, p, p0, p_p, 32); +#endif + else p = GET_ARG(N, ap, wchar_t *); n = 0; while (width-- != 0 && (wi = _fgetwc_r (rptr, fp)) != WEOF) { if (!(flags & SUPPRESS)) - *p++ = (wchar_t) wi; + { +#ifdef _WANT_IO_POSIX_EXTENSIONS + /* Check before ++ because we never add a \0 */ + p_siz = realloc_m_ptr (wchar_t, p, p0, p_p, p_siz); +#endif + *p++ = (wchar_t) wi; + } n++; } if (n == 0) goto input_failure; nread += n; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, p_p, p - p0, p_siz); +#endif if (!(flags & SUPPRESS)) nassigned++; } else { - if (!(flags & SUPPRESS)) +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **mbp_p = NULL; + char *mbp0 = NULL; + size_t mbp_siz = 0; +#endif + + if (flags & SUPPRESS) + mbp = mbbuf; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + mbp_siz = alloc_m_ptr (char, mbp, mbp0, mbp_p, 32); +#endif + else mbp = GET_ARG(N, ap, char *); n = 0; - memset ((_PTR)&mbs, '\0', sizeof (mbstate_t)); + memset ((void *)&mbs, '\0', sizeof (mbstate_t)); while (width != 0 && (wi = _fgetwc_r (rptr, fp)) != WEOF) { - if (width >= MB_CUR_MAX && !(flags & SUPPRESS)) - { - nconv = _wcrtomb_r (rptr, mbp, wi, &mbs); - if (nconv == (size_t) -1) - goto input_failure; - } - else - { - nconv = _wcrtomb_r (rptr, mbbuf, wi, &mbs); - if (nconv == (size_t) -1) - goto input_failure; - if (nconv > width) - { - _ungetwc_r (rptr, wi, fp); - break; - } - if (!(flags & SUPPRESS)) - memcpy(mbp, mbbuf, nconv); - } + nconv = _wcrtomb_r (rptr, mbp, wi, &mbs); + if (nconv == (size_t) -1) + goto input_failure; + /* Ignore high surrogate in width counting */ + if (nconv != 0 || mbs.__count != -4) + width--; if (!(flags & SUPPRESS)) - mbp += nconv; - width -= nconv; + { +#ifdef _WANT_IO_POSIX_EXTENSIONS + mbp_siz = realloc_m_ptr (char, mbp, mbp0, mbp_p, mbp_siz); +#endif + mbp += nconv; + } n++; } if (n == 0) goto input_failure; nread += n; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, mbp_p, mbp - mbp0, mbp_siz); +#endif if (!(flags & SUPPRESS)) nassigned++; } @@ -834,7 +962,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), case CT_CCL: /* scan a (nonempty) character class (sets NOSKIP) */ if (width == 0) - width = (size_t) ~0; /* `infinity' */ + width = SIZE_MAX; /* `infinity' */ /* take only those things in the class */ if ((flags & SUPPRESS) && (flags & LONG)) { @@ -849,46 +977,68 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), } else if (flags & LONG) { - p0 = p = GET_ARG(N, ap, wchar_t *); +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **p_p = NULL; + size_t p_siz = 0; + + if (flags & MALLOC) + p_siz = alloc_m_ptr (wchar_t, p, p0, p_p, 32); + else +#endif + p0 = p = GET_ARG(N, ap, wchar_t *); while ((wi = _fgetwc_r (rptr, fp)) != WEOF && width-- != 0 && INCCL (wi)) - *p++ = (wchar_t) wi; + { + *p++ = (wchar_t) wi; +#ifdef _WANT_IO_POSIX_EXTENSIONS + p_siz = realloc_m_ptr (wchar_t, p, p0, p_p, p_siz); +#endif + } if (wi != WEOF) _ungetwc_r (rptr, wi, fp); n = p - p0; if (n == 0) goto match_failure; *p = L'\0'; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, p_p, n + 1, p_siz); +#endif nassigned++; } else { - if (!(flags & SUPPRESS)) +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **mbp_p = NULL; + char *mbp0 = NULL; + size_t mbp_siz = 0; +#endif + + if (flags & SUPPRESS) + mbp = mbbuf; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + mbp_siz = alloc_m_ptr (char, mbp, mbp0, mbp_p, 32); +#endif + else mbp = GET_ARG(N, ap, char *); n = 0; - memset ((_PTR) &mbs, '\0', sizeof (mbstate_t)); + memset ((void *) &mbs, '\0', sizeof (mbstate_t)); while ((wi = _fgetwc_r (rptr, fp)) != WEOF - && width-- != 0 && INCCL (wi)) + && width != 0 && INCCL (wi)) { - if (width >= MB_CUR_MAX && !(flags & SUPPRESS)) - { - nconv = _wcrtomb_r (rptr, mbp, wi, &mbs); - if (nconv == (size_t) -1) - goto input_failure; - } - else - { - nconv = wcrtomb(mbbuf, wi, &mbs); - if (nconv == (size_t) -1) - goto input_failure; - if (nconv > width) - break; - if (!(flags & SUPPRESS)) - memcpy(mbp, mbbuf, nconv); - } + nconv = _wcrtomb_r (rptr, mbp, wi, &mbs); + if (nconv == (size_t) -1) + goto input_failure; + /* Ignore high surrogate in width counting */ + if (nconv != 0 || mbs.__count != -4) + width--; if (!(flags & SUPPRESS)) - mbp += nconv; - width -= nconv; + { + mbp += nconv; +#ifdef _WANT_IO_POSIX_EXTENSIONS + mbp_siz = realloc_m_ptr (char, mbp, mbp0, mbp_p, mbp_siz); +#endif + } n++; } if (wi != WEOF) @@ -896,6 +1046,9 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), if (!(flags & SUPPRESS)) { *mbp = 0; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, mbp_p, mbp - mbp0 + 1, mbp_siz); +#endif nassigned++; } } @@ -905,7 +1058,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), case CT_STRING: /* like CCL, but zero-length string OK, & no NOSKIP */ if (width == 0) - width = (size_t)~0; + width = SIZE_MAX; if ((flags & SUPPRESS) && (flags & LONG)) { while ((wi = _fgetwc_r (rptr, fp)) != WEOF @@ -916,45 +1069,65 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), } else if (flags & LONG) { - p0 = p = GET_ARG(N, ap, wchar_t *); +#ifdef _WANT_IO_POSIX_EXTENSIONS + wchar_t **p_p = NULL; + size_t p_siz = 0; + + if (flags & MALLOC) + p_siz = alloc_m_ptr (wchar_t, p, p0, p_p, 32); + else +#endif + p0 = p = GET_ARG(N, ap, wchar_t *); while ((wi = _fgetwc_r (rptr, fp)) != WEOF && width-- != 0 && !iswspace (wi)) { *p++ = (wchar_t) wi; +#ifdef _WANT_IO_POSIX_EXTENSIONS + p_siz = realloc_m_ptr (wchar_t, p, p0, p_p, p_siz); +#endif nread++; } if (wi != WEOF) _ungetwc_r (rptr, wi, fp); *p = L'\0'; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (wchar_t, p_p, p - p0 + 1, p_siz); +#endif nassigned++; } else { - if (!(flags & SUPPRESS)) +#ifdef _WANT_IO_POSIX_EXTENSIONS + char **mbp_p = NULL; + char *mbp0 = NULL; + size_t mbp_siz = 0; +#endif + + if (flags & SUPPRESS) + mbp = mbbuf; +#ifdef _WANT_IO_POSIX_EXTENSIONS + else if (flags & MALLOC) + mbp_siz = alloc_m_ptr (char, mbp, mbp0, mbp_p, 32); +#endif + else mbp = GET_ARG(N, ap, char *); - memset ((_PTR) &mbs, '\0', sizeof (mbstate_t)); + memset ((void *) &mbs, '\0', sizeof (mbstate_t)); while ((wi = _fgetwc_r (rptr, fp)) != WEOF && width != 0 && !iswspace (wi)) { - if (width >= MB_CUR_MAX && !(flags & SUPPRESS)) - { - nconv = wcrtomb(mbp, wi, &mbs); - if (nconv == (size_t)-1) - goto input_failure; - } - else - { - nconv = wcrtomb(mbbuf, wi, &mbs); - if (nconv == (size_t)-1) - goto input_failure; - if (nconv > width) - break; - if (!(flags & SUPPRESS)) - memcpy(mbp, mbbuf, nconv); - } + nconv = wcrtomb(mbp, wi, &mbs); + if (nconv == (size_t)-1) + goto input_failure; + /* Ignore high surrogate in width counting */ + if (nconv != 0 || mbs.__count != -4) + width--; if (!(flags & SUPPRESS)) - mbp += nconv; - width -= nconv; + { + mbp += nconv; +#ifdef _WANT_IO_POSIX_EXTENSIONS + mbp_siz = realloc_m_ptr (char, mbp, mbp0, mbp_p, mbp_siz); +#endif + } nread++; } if (wi != WEOF) @@ -962,6 +1135,9 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), if (!(flags & SUPPRESS)) { *mbp = 0; +#ifdef _WANT_IO_POSIX_EXTENSIONS + shrink_m_ptr (char, mbp_p, mbp - mbp0 + 1, mbp_siz); +#endif nassigned++; } } @@ -1460,7 +1636,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), { flp = GET_ARG (N, ap, float *); if (isnan (res)) - *flp = nanf (NULL); + *flp = nanf (""); else *flp = res; } @@ -1476,12 +1652,14 @@ input_failure: should have been set prior to here. On EOF failure (including invalid format string), return EOF if no matches yet, else number of matches made prior to failure. */ - _newlib_flockfile_exit (fp); - return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; + nassigned = nassigned && !(fp->_flags & __SERR) ? nassigned : EOF; match_failure: all_done: /* Return number of matches, which can be 0 on match failure. */ _newlib_flockfile_end (fp); +#ifdef _WANT_IO_POSIX_EXTENSIONS + free_m_ptr (); +#endif return nassigned; } diff --git a/newlib/libc/stdio/viprintf.c b/newlib/libc/stdio/viprintf.c index fec92fa8a..a59bc9c19 100644 --- a/newlib/libc/stdio/viprintf.c +++ b/newlib/libc/stdio/viprintf.c @@ -44,7 +44,7 @@ INDEX INDEX _vasniprintf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int viprintf(const char *<[fmt]>, va_list <[list]>); @@ -95,18 +95,13 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -_DEFUN(viprintf, (fmt, ap), - _CONST char *fmt _AND +viprintf (const char *fmt, va_list ap) { struct _reent *reent = _REENT; @@ -118,9 +113,8 @@ _DEFUN(viprintf, (fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_viprintf_r, (ptr, fmt, ap), - struct _reent *ptr _AND - _CONST char *fmt _AND +_viprintf_r (struct _reent *ptr, + const char *fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); diff --git a/newlib/libc/stdio/viscanf.c b/newlib/libc/stdio/viscanf.c index 9a7d0c5f2..c19d1b16a 100644 --- a/newlib/libc/stdio/viscanf.c +++ b/newlib/libc/stdio/viscanf.c @@ -34,7 +34,7 @@ INDEX INDEX _vsiscanf_r -ANSI_SYNOPSIS +SYNOPSIS #include #include int viscanf(const char *<[fmt]>, va_list <[list]>); @@ -48,40 +48,6 @@ ANSI_SYNOPSIS int _vsiscanf_r(struct _reent *<[reent]>, const char *<[str]>, const char *<[fmt]>, va_list <[list]>); -TRAD_SYNOPSIS - #include - #include - int viscanf( <[fmt]>, <[ist]>) - char *<[fmt]>; - va_list <[list]>; - - int vfiscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsiscanf( <[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _viscanf_r( <[reent]>, <[fmt]>, <[ist]>) - struct _reent *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfiscanf_r( <[reent]>, <[fp]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsiscanf_r( <[reent]>, <[str]>, <[fmt]>, <[list]>) - struct _reent *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - DESCRIPTION <>, <>, and <> are (respectively) variants of <>, <>, and <>. They differ only in @@ -113,18 +79,13 @@ Supporting OS subroutines required: #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -_DEFUN(viscanf, (fmt, ap), - _CONST char *fmt _AND +viscanf (const char *fmt, va_list ap) { struct _reent *reent = _REENT; @@ -136,9 +97,8 @@ _DEFUN(viscanf, (fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_viscanf_r, (ptr, fmt, ap), - struct _reent *ptr _AND - _CONST char *fmt _AND +_viscanf_r (struct _reent *ptr, + const char *fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c index 00b8023b7..b195a1ecf 100644 --- a/newlib/libc/stdio/vprintf.c +++ b/newlib/libc/stdio/vprintf.c @@ -19,18 +19,13 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -_DEFUN(vprintf, (fmt, ap), - _CONST char *fmt _AND +vprintf (const char *fmt, va_list ap) { struct _reent *reent = _REENT; @@ -41,15 +36,14 @@ _DEFUN(vprintf, (fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(viprintf, (const char *, __VALIST) _ATTRIBUTE ((__alias__("vprintf")))); +viprintf (const char *, __VALIST) _ATTRIBUTE ((__alias__("vprintf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vprintf_r, (ptr, fmt, ap), - struct _reent *ptr _AND - _CONST char *__restrict fmt _AND +_vprintf_r (struct _reent *ptr, + const char *__restrict fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); @@ -58,6 +52,6 @@ _DEFUN(_vprintf_r, (ptr, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vprintf_r")))); +_viprintf_r (struct _reent *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vprintf_r"))); #endif diff --git a/newlib/libc/stdio/vscanf.c b/newlib/libc/stdio/vscanf.c index 4371e23a7..567f5cb3e 100644 --- a/newlib/libc/stdio/vscanf.c +++ b/newlib/libc/stdio/vscanf.c @@ -20,18 +20,13 @@ #include <_ansi.h> #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -_DEFUN(vscanf, (fmt, ap), - _CONST char *fmt _AND +vscanf (const char *fmt, va_list ap) { struct _reent *reent = _REENT; @@ -42,15 +37,14 @@ _DEFUN(vscanf, (fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(viscanf, (const char *, __VALIST) _ATTRIBUTE ((__alias__("vscanf")))); +viscanf (const char *, __VALIST) _ATTRIBUTE ((__alias__("vscanf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vscanf_r, (ptr, fmt, ap), - struct _reent *ptr _AND - _CONST char *__restrict fmt _AND +_vscanf_r (struct _reent *ptr, + const char *__restrict fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); @@ -59,6 +53,6 @@ _DEFUN(_vscanf_r, (ptr, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vscanf_r")))); +_viscanf_r (struct _reent *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vscanf_r"))); #endif diff --git a/newlib/libc/stdio/vsiprintf.c b/newlib/libc/stdio/vsiprintf.c index 150b4e7d0..74eae0253 100644 --- a/newlib/libc/stdio/vsiprintf.c +++ b/newlib/libc/stdio/vsiprintf.c @@ -31,9 +31,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vsiprintf, (str, fmt, ap), - char *str _AND - const char *fmt _AND +vsiprintf (char *str, + const char *fmt, va_list ap) { return _vsiprintf_r (_REENT, str, fmt, ap); @@ -42,10 +41,9 @@ _DEFUN(vsiprintf, (str, fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_vsiprintf_r, (ptr, str, fmt, ap), - struct _reent *ptr _AND - char *str _AND - const char *fmt _AND +_vsiprintf_r (struct _reent *ptr, + char *str, + const char *fmt, va_list ap) { int ret; diff --git a/newlib/libc/stdio/vsiscanf.c b/newlib/libc/stdio/vsiscanf.c index 01295995e..b21dcb1a2 100644 --- a/newlib/libc/stdio/vsiscanf.c +++ b/newlib/libc/stdio/vsiscanf.c @@ -21,11 +21,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* @@ -35,9 +31,8 @@ #ifndef _REENT_ONLY int -_DEFUN(vsiscanf, (str, fmt, ap), - _CONST char *str _AND - _CONST char *fmt _AND +vsiscanf (const char *str, + const char *fmt, va_list ap) { return _vsiscanf_r (_REENT, str, fmt, ap); @@ -46,10 +41,9 @@ _DEFUN(vsiscanf, (str, fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_vsiscanf_r, (ptr, str, fmt, ap), - struct _reent *ptr _AND - _CONST char *str _AND - _CONST char *fmt _AND +_vsiscanf_r (struct _reent *ptr, + const char *str, + const char *fmt, va_list ap) { FILE f; diff --git a/newlib/libc/stdio/vsniprintf.c b/newlib/libc/stdio/vsniprintf.c index c4305c1a9..6036c8cb8 100644 --- a/newlib/libc/stdio/vsniprintf.c +++ b/newlib/libc/stdio/vsniprintf.c @@ -32,10 +32,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vsniprintf, (str, size, fmt, ap), - char *str _AND - size_t size _AND - const char *fmt _AND +vsniprintf (char *str, + size_t size, + const char *fmt, va_list ap) { return _vsniprintf_r (_REENT, str, size, fmt, ap); @@ -44,11 +43,10 @@ _DEFUN(vsniprintf, (str, size, fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_vsniprintf_r, (ptr, str, size, fmt, ap), - struct _reent *ptr _AND - char *str _AND - size_t size _AND - const char *fmt _AND +_vsniprintf_r (struct _reent *ptr, + char *str, + size_t size, + const char *fmt, va_list ap) { int ret; diff --git a/newlib/libc/stdio/vsnprintf.c b/newlib/libc/stdio/vsnprintf.c index e08f267bd..bcaffa30f 100644 --- a/newlib/libc/stdio/vsnprintf.c +++ b/newlib/libc/stdio/vsnprintf.c @@ -32,10 +32,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vsnprintf, (str, size, fmt, ap), - char *__restrict str _AND - size_t size _AND - const char *__restrict fmt _AND +vsnprintf (char *__restrict str, + size_t size, + const char *__restrict fmt, va_list ap) { return _vsnprintf_r (_REENT, str, size, fmt, ap); @@ -43,18 +42,17 @@ _DEFUN(vsnprintf, (str, size, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vsnprintf")))); +vsniprintf (char *, size_t, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vsnprintf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vsnprintf_r, (ptr, str, size, fmt, ap), - struct _reent *ptr _AND - char *__restrict str _AND - size_t size _AND - const char *__restrict fmt _AND +_vsnprintf_r (struct _reent *ptr, + char *__restrict str, + size_t size, + const char *__restrict fmt, va_list ap) { int ret; @@ -79,6 +77,6 @@ _DEFUN(_vsnprintf_r, (ptr, str, size, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vsnprintf_r")))); +_vsniprintf_r (struct _reent *, char *, size_t, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vsnprintf_r"))); #endif diff --git a/newlib/libc/stdio/vsprintf.c b/newlib/libc/stdio/vsprintf.c index 742cde0df..823cacb56 100644 --- a/newlib/libc/stdio/vsprintf.c +++ b/newlib/libc/stdio/vsprintf.c @@ -31,9 +31,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifndef _REENT_ONLY int -_DEFUN(vsprintf, (str, fmt, ap), - char *__restrict str _AND - const char *__restrict fmt _AND +vsprintf (char *__restrict str, + const char *__restrict fmt, va_list ap) { return _vsprintf_r (_REENT, str, fmt, ap); @@ -41,17 +40,16 @@ _DEFUN(vsprintf, (str, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(vsiprintf, (char *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vsprintf")))); +vsiprintf (char *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vsprintf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vsprintf_r, (ptr, str, fmt, ap), - struct _reent *ptr _AND - char *__restrict str _AND - const char *__restrict fmt _AND +_vsprintf_r (struct _reent *ptr, + char *__restrict str, + const char *__restrict fmt, va_list ap) { int ret; @@ -68,6 +66,6 @@ _DEFUN(_vsprintf_r, (ptr, str, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vsprintf_r")))); +_vsiprintf_r (struct _reent *, char *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vsprintf_r"))); #endif diff --git a/newlib/libc/stdio/vsscanf.c b/newlib/libc/stdio/vsscanf.c index 1660fa1cf..f4e096b50 100644 --- a/newlib/libc/stdio/vsscanf.c +++ b/newlib/libc/stdio/vsscanf.c @@ -21,11 +21,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* @@ -35,9 +31,8 @@ #ifndef _REENT_ONLY int -_DEFUN(vsscanf, (str, fmt, ap), - _CONST char *__restrict str _AND - _CONST char *__restrict fmt _AND +vsscanf (const char *__restrict str, + const char *__restrict fmt, va_list ap) { return _vsscanf_r (_REENT, str, fmt, ap); @@ -45,17 +40,16 @@ _DEFUN(vsscanf, (str, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(vsiscanf, (const char *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("vsscanf")))); +vsiscanf (const char *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("vsscanf"))); #endif #endif /* !_REENT_ONLY */ int -_DEFUN(_vsscanf_r, (ptr, str, fmt, ap), - struct _reent *ptr _AND - _CONST char *__restrict str _AND - _CONST char *__restrict fmt _AND +_vsscanf_r (struct _reent *ptr, + const char *__restrict str, + const char *__restrict fmt, va_list ap) { FILE f; @@ -72,6 +66,6 @@ _DEFUN(_vsscanf_r, (ptr, str, fmt, ap), #ifdef _NANO_FORMATTED_IO int -_EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST) - _ATTRIBUTE ((__alias__("_vsscanf_r")))); +_vsiscanf_r (struct _reent *, const char *, const char *, __VALIST) + _ATTRIBUTE ((__alias__("_vsscanf_r"))); #endif diff --git a/newlib/libc/stdio/vswprintf.c b/newlib/libc/stdio/vswprintf.c index ac321b662..5297a27cf 100644 --- a/newlib/libc/stdio/vswprintf.c +++ b/newlib/libc/stdio/vswprintf.c @@ -31,11 +31,10 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include "local.h" int -_DEFUN(_vswprintf_r, (ptr, str, size, fmt, ap), - struct _reent *ptr _AND - wchar_t *str _AND - size_t size _AND - const wchar_t *fmt _AND +_vswprintf_r (struct _reent *ptr, + wchar_t *str, + size_t size, + const wchar_t *fmt, va_list ap) { int ret; @@ -70,10 +69,9 @@ _DEFUN(_vswprintf_r, (ptr, str, size, fmt, ap), #ifndef _REENT_ONLY int -_DEFUN(vswprintf, (str, size, fmt, ap), - wchar_t *__restrict str _AND - size_t size _AND - const wchar_t *__restrict fmt _AND +vswprintf (wchar_t *__restrict str, + size_t size, + const wchar_t *__restrict fmt, va_list ap) { return _vswprintf_r (_REENT, str, size, fmt, ap); diff --git a/newlib/libc/stdio/vswscanf.c b/newlib/libc/stdio/vswscanf.c index 0d090f021..7687001ab 100644 --- a/newlib/libc/stdio/vswscanf.c +++ b/newlib/libc/stdio/vswscanf.c @@ -23,11 +23,7 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" /* @@ -37,7 +33,7 @@ #ifndef _REENT_ONLY int -vswscanf (_CONST wchar_t *__restrict str, _CONST wchar_t * __restrict fmt, +vswscanf (const wchar_t *__restrict str, const wchar_t * __restrict fmt, va_list ap) { return _vswscanf_r (_REENT, str, fmt, ap); @@ -46,7 +42,7 @@ vswscanf (_CONST wchar_t *__restrict str, _CONST wchar_t * __restrict fmt, #endif /* !_REENT_ONLY */ int -_vswscanf_r (struct _reent *ptr, _CONST wchar_t *str, _CONST wchar_t *fmt, +_vswscanf_r (struct _reent *ptr, const wchar_t *str, const wchar_t *fmt, va_list ap) { FILE f; diff --git a/newlib/libc/stdio/vwprintf.c b/newlib/libc/stdio/vwprintf.c index 51d1df3a9..d1b7d4cd0 100644 --- a/newlib/libc/stdio/vwprintf.c +++ b/newlib/libc/stdio/vwprintf.c @@ -26,8 +26,7 @@ #ifndef _REENT_ONLY int -_DEFUN(vwprintf, (fmt, ap), - _CONST wchar_t *__restrict fmt _AND +vwprintf (const wchar_t *__restrict fmt, va_list ap) { struct _reent *reent = _REENT; @@ -39,9 +38,8 @@ _DEFUN(vwprintf, (fmt, ap), #endif /* !_REENT_ONLY */ int -_DEFUN(_vwprintf_r, (ptr, fmt, ap), - struct _reent *ptr _AND - _CONST wchar_t *fmt _AND +_vwprintf_r (struct _reent *ptr, + const wchar_t *fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); diff --git a/newlib/libc/stdio/vwscanf.c b/newlib/libc/stdio/vwscanf.c index e40bdede5..1f33db6af 100644 --- a/newlib/libc/stdio/vwscanf.c +++ b/newlib/libc/stdio/vwscanf.c @@ -22,17 +22,13 @@ #include #include #include -#ifdef _HAVE_STDC #include -#else -#include -#endif #include "local.h" #ifndef _REENT_ONLY int -vwscanf (_CONST wchar_t *__restrict fmt, va_list ap) +vwscanf (const wchar_t *__restrict fmt, va_list ap) { struct _reent *reent = _REENT; @@ -43,7 +39,7 @@ vwscanf (_CONST wchar_t *__restrict fmt, va_list ap) #endif /* !_REENT_ONLY */ int -_vwscanf_r (struct _reent *ptr, _CONST wchar_t *fmt, va_list ap) +_vwscanf_r (struct _reent *ptr, const wchar_t *fmt, va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); return __svfwscanf_r (ptr, _stdin_r (ptr), fmt, ap); diff --git a/newlib/libc/stdio/wbuf.c b/newlib/libc/stdio/wbuf.c index f9197ea9e..034d8ebcc 100644 --- a/newlib/libc/stdio/wbuf.c +++ b/newlib/libc/stdio/wbuf.c @@ -33,9 +33,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; */ int -_DEFUN(__swbuf_r, (ptr, c, fp), - struct _reent *ptr _AND - register int c _AND +__swbuf_r (struct _reent *ptr, + register int c, register FILE *fp) { register int n; @@ -88,8 +87,7 @@ _DEFUN(__swbuf_r, (ptr, c, fp), required for backward compatibility with applications built against earlier dynamically built newlib libraries. */ int -_DEFUN(__swbuf, (c, fp), - register int c _AND +__swbuf (register int c, register FILE *fp) { return __swbuf_r (_REENT, c, fp); diff --git a/newlib/libc/stdio/wprintf.c b/newlib/libc/stdio/wprintf.c index e05ba1013..176b16a20 100644 --- a/newlib/libc/stdio/wprintf.c +++ b/newlib/libc/stdio/wprintf.c @@ -24,9 +24,8 @@ #include "local.h" int -_DEFUN(_wprintf_r, (ptr, fmt), - struct _reent *ptr _AND - const wchar_t *fmt _DOTS) +_wprintf_r (struct _reent *ptr, + const wchar_t *fmt, ...) { int ret; va_list ap; @@ -41,8 +40,7 @@ _DEFUN(_wprintf_r, (ptr, fmt), #ifndef _REENT_ONLY int -_DEFUN(wprintf, (fmt), - const wchar_t *__restrict fmt _DOTS) +wprintf (const wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/wscanf.c b/newlib/libc/stdio/wscanf.c index f953d9f81..5a7c35a08 100644 --- a/newlib/libc/stdio/wscanf.c +++ b/newlib/libc/stdio/wscanf.c @@ -26,7 +26,7 @@ #ifndef _REENT_ONLY int -wscanf(_CONST wchar_t *__restrict fmt, ...) +wscanf(const wchar_t *__restrict fmt, ...) { int ret; va_list ap; @@ -42,7 +42,7 @@ wscanf(_CONST wchar_t *__restrict fmt, ...) #endif /* !_REENT_ONLY */ int -_wscanf_r(struct _reent *ptr, _CONST wchar_t *fmt, ...) +_wscanf_r(struct _reent *ptr, const wchar_t *fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/wsetup.c b/newlib/libc/stdio/wsetup.c index 08ae70f2c..5a4fc0ace 100644 --- a/newlib/libc/stdio/wsetup.c +++ b/newlib/libc/stdio/wsetup.c @@ -30,8 +30,7 @@ */ int -_DEFUN(__swsetup_r, (ptr, fp), - struct _reent *ptr _AND +__swsetup_r (struct _reent *ptr, register FILE * fp) { /* Make sure stdio is set up. */ diff --git a/newlib/libc/stdio64/Makefile.in b/newlib/libc/stdio64/Makefile.in index 5e77115c7..d002af62a 100644 --- a/newlib/libc/stdio64/Makefile.in +++ b/newlib/libc/stdio64/Makefile.in @@ -300,7 +300,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) AM_CFLAGS = -I $(srcdir)/../stdio CHEWOUT_FILES = \ fdopen64.def \ @@ -627,8 +627,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/stdio64/fdopen64.c b/newlib/libc/stdio64/fdopen64.c index f386583ca..9d9645b36 100644 --- a/newlib/libc/stdio64/fdopen64.c +++ b/newlib/libc/stdio64/fdopen64.c @@ -35,10 +35,9 @@ File pointer or <>, as for <>. extern int __sflags (); FILE * -_DEFUN (_fdopen64_r, (ptr, fd, mode), - struct _reent *ptr _AND - int fd _AND - _CONST char *mode) +_fdopen64_r (struct _reent *ptr, + int fd, + const char *mode) { register FILE *fp; int flags, oflags; @@ -76,7 +75,7 @@ _DEFUN (_fdopen64_r, (ptr, fd, mode), _fcntl_r (ptr, fd, F_SETFL, fdflags | O_APPEND); #endif fp->_file = fd; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; #undef _read #undef _write @@ -108,9 +107,8 @@ _DEFUN (_fdopen64_r, (ptr, fd, mode), #ifndef _REENT_ONLY FILE * -_DEFUN (fdopen64, (fd, mode), - int fd _AND - _CONST char *mode) +fdopen64 (int fd, + const char *mode) { return _fdopen64_r (_REENT, fd, mode); } diff --git a/newlib/libc/stdio64/fgetpos64.c b/newlib/libc/stdio64/fgetpos64.c index 36f7ec90b..52ead9d0d 100644 --- a/newlib/libc/stdio64/fgetpos64.c +++ b/newlib/libc/stdio64/fgetpos64.c @@ -7,22 +7,12 @@ INDEX INDEX _fgetpos64_r -ANSI_SYNOPSIS +SYNOPSIS #include int fgetpos64(FILE *<[fp]>, _fpos64_t *<[pos]>); int _fgetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>, _fpos64_t *<[pos]>); -TRAD_SYNOPSIS - #include - int fgetpos64(<[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - - int _fgetpos64_r(<[ptr]>, <[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -55,9 +45,8 @@ No supporting OS subroutines are required. #ifdef __LARGE64_FILES int -_DEFUN (_fgetpos64_r, (ptr, fp, pos), - struct _reent * ptr _AND - FILE * fp _AND +_fgetpos64_r (struct _reent * ptr, + FILE * fp, _fpos64_t * pos) { *pos = (_fpos64_t)_ftello64_r (ptr, fp); @@ -72,8 +61,7 @@ _DEFUN (_fgetpos64_r, (ptr, fp, pos), #ifndef _REENT_ONLY int -_DEFUN (fgetpos64, (fp, pos), - FILE * fp _AND +fgetpos64 (FILE * fp, _fpos64_t * pos) { return _fgetpos64_r (_REENT, fp, pos); diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c index 84f7b6e49..8c8df9141 100644 --- a/newlib/libc/stdio64/fopen64.c +++ b/newlib/libc/stdio64/fopen64.c @@ -24,23 +24,12 @@ INDEX INDEX _fopen64_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *fopen64(const char *<[file]>, const char *<[mode]>); FILE *_fopen64_r(void *<[reent]>, const char *<[file]>, const char *<[mode]>); -TRAD_SYNOPSIS - #include - FILE *fopen64(<[file]>, <[mode]>) - char *<[file]>; - char *<[mode]>; - - FILE *_fopen64_r(<[reent]>, <[file]>, <[mode]>) - char *<[reent]>; - char *<[file]>; - char *<[mode]>; - DESCRIPTION <> is identical to <> except it opens a large file that is potentially >2GB in size. See <> for further details. @@ -75,10 +64,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifdef __LARGE64_FILES FILE * -_DEFUN (_fopen64_r, (ptr, file, mode), - struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode) +_fopen64_r (struct _reent *ptr, + const char *file, + const char *mode) { register FILE *fp; register int f; @@ -104,7 +92,7 @@ _DEFUN (_fopen64_r, (ptr, file, mode), fp->_file = f; fp->_flags = flags; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite64; fp->_seek = __sseek; @@ -128,9 +116,8 @@ _DEFUN (_fopen64_r, (ptr, file, mode), #ifndef _REENT_ONLY FILE * -_DEFUN (fopen64, (file, mode), - _CONST char *file _AND - _CONST char *mode) +fopen64 (const char *file, + const char *mode) { return _fopen64_r (_REENT, file, mode); } diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index f7df35407..17942b74a 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -24,26 +24,13 @@ INDEX INDEX _freopen64_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *freopen64(const char *<[file]>, const char *<[mode]>, FILE *<[fp]>); FILE *_freopen64_r(struct _reent *<[ptr]>, const char *<[file]>, const char *<[mode]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - FILE *freopen64(<[file]>, <[mode]>, <[fp]>) - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - - FILE *_freopen64_r(<[ptr]>, <[file]>, <[mode]>, <[fp]>) - struct _reent *<[ptr]>; - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - DESCRIPTION Use this variant of <> if you wish to specify a particular file descriptor <[fp]> (notably <>, <>, or <>) for @@ -88,10 +75,9 @@ Supporting OS subroutines required: <>, <>, <>, #ifdef __LARGE64_FILES FILE * -_DEFUN (_freopen64_r, (ptr, file, mode, fp), - struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode _AND +_freopen64_r (struct _reent *ptr, + const char *file, + const char *mode, register FILE *fp) { register int f; @@ -235,7 +221,7 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), fp->_flags = flags; fp->_file = f; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite64; fp->_seek = __sseek; @@ -260,9 +246,8 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), #ifndef _REENT_ONLY FILE * -_DEFUN (freopen64, (file, mode, fp), - _CONST char *file _AND - _CONST char *mode _AND +freopen64 (const char *file, + const char *mode, register FILE *fp) { return _freopen64_r (_REENT, file, mode, fp); diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c index 34eee6783..0672086a3 100644 --- a/newlib/libc/stdio64/fseeko64.c +++ b/newlib/libc/stdio64/fseeko64.c @@ -24,24 +24,11 @@ INDEX INDEX _fseeko64_r -ANSI_SYNOPSIS +SYNOPSIS #include int fseeko64(FILE *<[fp]>, _off64_t <[offset]>, int <[whence]>); int _fseeko64_r (struct _reent *<[ptr]>, FILE *<[fp]>, _off64_t <[offset]>, int <[whence]>); -TRAD_SYNOPSIS - #include - - int fseeko64(<[fp]>, <[offset]>, <[whence]>); - FILE *<[fp]>; - _off64_t <[offset]>; - int <[whence]>; - - int _fseeko64_r (<[ptr]>, <[fp]>, <[offset]>, <[whence]>); - struct _reent *<[ptr]>; - FILE *<[fp]>; - _off64_t <[offset]>; - int <[whence]>; DESCRIPTION Objects of type <> can have a ``position'' that records how much @@ -98,13 +85,12 @@ Supporting OS subroutines required: <>, <>, <>, */ _off64_t -_DEFUN (_fseeko64_r, (ptr, fp, offset, whence), - struct _reent *ptr _AND - register FILE *fp _AND - _off64_t offset _AND +_fseeko64_r (struct _reent *ptr, + register FILE *fp, + _off64_t offset, int whence) { - _fpos64_t _EXFNPTR(seekfn, (struct _reent *, void *, _fpos64_t, int)); + _fpos64_t (*seekfn) (struct _reent *, void *, _fpos64_t, int); _fpos64_t target, curoff; size_t n; @@ -355,9 +341,8 @@ dumb: #ifndef _REENT_ONLY _off64_t -_DEFUN (fseeko64, (fp, offset, whence), - register FILE *fp _AND - _off64_t offset _AND +fseeko64 (register FILE *fp, + _off64_t offset, int whence) { return _fseeko64_r (_REENT, fp, offset, whence); diff --git a/newlib/libc/stdio64/fsetpos64.c b/newlib/libc/stdio64/fsetpos64.c index 046990d7a..254eb53d7 100644 --- a/newlib/libc/stdio64/fsetpos64.c +++ b/newlib/libc/stdio64/fsetpos64.c @@ -7,23 +7,12 @@ INDEX INDEX _fsetpos64_r -ANSI_SYNOPSIS +SYNOPSIS #include int fsetpos64(FILE *<[fp]>, const _fpos64_t *<[pos]>); int _fsetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>, const _fpos64_t *<[pos]>); -TRAD_SYNOPSIS - #include - int fsetpos64(<[fp]>, <[pos]>) - FILE *<[fp]>; - _fpos64_t *<[pos]>; - - int _fsetpos64_r(<[ptr]>, <[fp]>, <[pos]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - _fpos64_t *<[pos]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -52,10 +41,9 @@ Supporting OS subroutines required: <>, <>, <>, #ifdef __LARGE64_FILES int -_DEFUN (_fsetpos64_r, (ptr, iop, pos), - struct _reent *ptr _AND - FILE * iop _AND - _CONST _fpos64_t * pos) +_fsetpos64_r (struct _reent *ptr, + FILE * iop, + const _fpos64_t * pos) { int x = _fseeko64_r (ptr, iop, (_off64_t)(*pos), SEEK_SET); @@ -67,9 +55,8 @@ _DEFUN (_fsetpos64_r, (ptr, iop, pos), #ifndef _REENT_ONLY int -_DEFUN (fsetpos64, (iop, pos), - FILE * iop _AND - _CONST _fpos64_t * pos) +fsetpos64 (FILE * iop, + const _fpos64_t * pos) { return _fsetpos64_r (_REENT, iop, pos); } diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c index c4d6da24b..7221d5eaf 100644 --- a/newlib/libc/stdio64/ftello64.c +++ b/newlib/libc/stdio64/ftello64.c @@ -24,20 +24,11 @@ INDEX INDEX _ftello64_r -ANSI_SYNOPSIS +SYNOPSIS #include _off64_t ftello64(FILE *<[fp]>); _off64_t _ftello64_r(struct _reent *<[ptr]>, FILE *<[fp]>); -TRAD_SYNOPSIS - #include - _off64_t ftello64(<[fp]>) - FILE *<[fp]>; - - _off64_t _ftello64_r(<[ptr]>, <[fp]>) - struct _reent *<[ptr]>; - FILE *<[fp]>; - DESCRIPTION Objects of type <> can have a ``position'' that records how much of the file your program has already read. Many of the <> functions @@ -85,8 +76,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #ifdef __LARGE64_FILES _off64_t -_DEFUN (_ftello64_r, (ptr, fp), - struct _reent *ptr _AND +_ftello64_r (struct _reent *ptr, register FILE * fp) { _fpos64_t pos; @@ -105,24 +95,30 @@ _DEFUN (_ftello64_r, (ptr, fp), { ptr->_errno = ESPIPE; _newlib_flockfile_exit(fp); - return -1L; + return (_off64_t) -1; } - /* Find offset of underlying I/O object, then adjust for buffered - bytes. Flush a write stream, since the offset may be altered if - the stream is appending. Do not flush a read stream, since we - must not lose the ungetc buffer. */ - if (fp->_flags & __SWR) - _fflush_r (ptr, fp); - if (fp->_flags & __SOFF) + /* Find offset of underlying I/O object, then adjust for buffered bytes. */ + if (!(fp->_flags & __SRD) && (fp->_flags & __SWR) && + fp->_p != NULL && fp->_p - fp->_bf._base > 0 && + (fp->_flags & __SAPP)) + { + pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_END); + if (pos == (_fpos64_t) -1) + { + _newlib_flockfile_exit (fp); + return (_off64_t) -1; + } + } + else if (fp->_flags & __SOFF) pos = fp->_offset; else { pos = fp->_seek64 (ptr, fp->_cookie, (_fpos64_t) 0, SEEK_CUR); - if (pos == -1L) + if (pos == (_fpos64_t) -1) { _newlib_flockfile_exit(fp); - return pos; + return (_off64_t) pos; } } if (fp->_flags & __SRD) @@ -147,14 +143,13 @@ _DEFUN (_ftello64_r, (ptr, fp), } _newlib_flockfile_end(fp); - return pos; + return (_off64_t) pos; } #ifndef _REENT_ONLY _off64_t -_DEFUN (ftello64, (fp), - register FILE * fp) +ftello64 (register FILE * fp) { return _ftello64_r (_REENT, fp); } diff --git a/newlib/libc/stdio64/stdio64.c b/newlib/libc/stdio64/stdio64.c index dd3b4adc9..8e5efc8b0 100644 --- a/newlib/libc/stdio64/stdio64.c +++ b/newlib/libc/stdio64/stdio64.c @@ -26,10 +26,9 @@ #ifdef __LARGE64_FILES _fpos64_t -_DEFUN(__sseek64, (ptr, cookie, offset, whence), - struct _reent *ptr _AND - void *cookie _AND - _fpos64_t offset _AND +__sseek64 (struct _reent *ptr, + void *cookie, + _fpos64_t offset, int whence) { register FILE *fp = (FILE *) cookie; @@ -47,10 +46,9 @@ _DEFUN(__sseek64, (ptr, cookie, offset, whence), } _READ_WRITE_RETURN_TYPE -_DEFUN(__swrite64, (ptr, cookie, buf, n), - struct _reent *ptr _AND - void *cookie _AND - char const *buf _AND +__swrite64 (struct _reent *ptr, + void *cookie, + char const *buf, _READ_WRITE_BUFSIZE_TYPE n) { register FILE *fp = (FILE *) cookie; diff --git a/newlib/libc/stdio64/tmpfile64.c b/newlib/libc/stdio64/tmpfile64.c index 98a7d7817..18a38d65c 100644 --- a/newlib/libc/stdio64/tmpfile64.c +++ b/newlib/libc/stdio64/tmpfile64.c @@ -7,19 +7,12 @@ INDEX INDEX _tmpfile64_r -ANSI_SYNOPSIS +SYNOPSIS #include FILE *tmpfile64(void); FILE *_tmpfile64_r(void *<[reent]>); -TRAD_SYNOPSIS - #include - FILE *tmpfile64(); - - FILE *_tmpfile64_r(<[reent]>) - char *<[reent]>; - DESCRIPTION Create a large temporary file (a file which will be deleted automatically), using a name generated by <>. The temporary file is opened with @@ -60,8 +53,7 @@ Supporting OS subroutines required: <>, <>, <>, #ifdef __LARGE64_FILES FILE * -_DEFUN (_tmpfile64_r, (ptr), - struct _reent *ptr) +_tmpfile64_r (struct _reent *ptr) { FILE *fp; int e; @@ -83,7 +75,7 @@ _DEFUN (_tmpfile64_r, (ptr), e = ptr->_errno; if (!fp) _close_r (ptr, fd); - _CAST_VOID _remove_r (ptr, f); + (void) _remove_r (ptr, f); ptr->_errno = e; return fp; } @@ -91,7 +83,7 @@ _DEFUN (_tmpfile64_r, (ptr), #ifndef _REENT_ONLY FILE * -_DEFUN_VOID (tmpfile64) +tmpfile64 (void) { return _tmpfile64_r (_REENT); } diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am index f9bab0b64..357e37beb 100644 --- a/newlib/libc/stdlib/Makefile.am +++ b/newlib/libc/stdlib/Makefile.am @@ -58,10 +58,8 @@ GENERAL_SOURCES = \ reallocf.c \ sb_charsets.c \ strtod.c \ - strtodg.c \ strtoimax.c \ strtol.c \ - strtorx.c \ strtoul.c \ strtoumax.c \ utoa.c \ @@ -77,7 +75,9 @@ GENERAL_SOURCES = \ if HAVE_LONG_DOUBLE GENERAL_SOURCES += \ - strtold.c \ + strtodg.c \ + strtold.c \ + strtorx.c \ wcstold.c endif # HAVE_LONG_DOUBLE diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in index 00d07bf6d..1da271af3 100644 --- a/newlib/libc/stdlib/Makefile.in +++ b/newlib/libc/stdlib/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.12.2 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -57,11 +58,15 @@ host_triplet = @host@ @HAVE_LONG_DOUBLE_TRUE@ wcstold.c DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/../../mkinstalldirs + $(srcdir)/Makefile.am subdir = stdlib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../acinclude.m4 \ - $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ + $(top_srcdir)/../../ltoptions.m4 \ + $(top_srcdir)/../../ltsugar.m4 \ + $(top_srcdir)/../../ltversion.m4 \ + $(top_srcdir)/../../lt~obsolete.m4 \ + $(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs @@ -149,7 +154,8 @@ am__objects_6 = lib_a-rpmatch.$(OBJEXT) lib_a-system.$(OBJEXT) @USE_LIBTOOL_FALSE@ $(am__objects_3) $(am__objects_7) lib_a_OBJECTS = $(am_lib_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) -@HAVE_LONG_DOUBLE_TRUE@am__objects_8 = strtold.lo wcstold.lo +@HAVE_LONG_DOUBLE_TRUE@am__objects_8 = strtodg.lo strtold.lo strtorx.lo \ + wcstold.lo am__objects_9 = __adjust.lo __atexit.lo __call_atexit.lo __exp10.lo \ __ten_mu.lo _Exit.lo abort.lo abs.lo aligned_alloc.lo \ assert.lo atexit.lo atof.lo atoff.lo atoi.lo atol.lo calloc.lo \ @@ -160,10 +166,10 @@ am__objects_9 = __adjust.lo __atexit.lo __call_atexit.lo __exp10.lo \ mbtowc.lo mbtowc_r.lo mlock.lo mprec.lo mstats.lo \ on_exit_args.lo quick_exit.lo rand.lo rand_r.lo random.lo \ realloc.lo reallocarray.lo reallocf.lo sb_charsets.lo \ - strtod.lo strtodg.lo strtoimax.lo strtol.lo strtorx.lo \ - strtoul.lo strtoumax.lo utoa.lo wcstod.lo wcstoimax.lo \ - wcstol.lo wcstoul.lo wcstoumax.lo wcstombs.lo wcstombs_r.lo \ - wctomb.lo wctomb_r.lo $(am__objects_8) + strtod.lo strtoimax.lo strtol.lo strtoul.lo strtoumax.lo \ + utoa.lo wcstod.lo wcstoimax.lo wcstol.lo wcstoul.lo \ + wcstoumax.lo wcstombs.lo wcstombs_r.lo wctomb.lo wctomb_r.lo \ + $(am__objects_8) am__objects_10 = arc4random.lo arc4random_uniform.lo cxa_atexit.lo \ cxa_finalize.lo drand48.lo ecvtbuf.lo efgcvt.lo erand48.lo \ jrand48.lo lcong48.lo lrand48.lo mrand48.lo msize.lo mtrim.lo \ @@ -269,10 +275,8 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ NM = @NM@ @@ -301,7 +305,6 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ aext = @aext@ @@ -500,7 +503,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB CHEWOUT_FILES = \ _Exit.def \ @@ -598,14 +601,12 @@ lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done libstdlib.la: $(libstdlib_la_OBJECTS) $(libstdlib_la_DEPENDENCIES) $(EXTRA_libstdlib_la_DEPENDENCIES) $(libstdlib_la_LINK) $(am_libstdlib_la_rpath) $(libstdlib_la_OBJECTS) $(libstdlib_la_LIBADD) $(LIBS) @@ -1417,20 +1418,6 @@ GTAGS: && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-am: @@ -1541,7 +1528,7 @@ uninstall-am: .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ - cscopelist ctags distclean distclean-compile distclean-generic \ + ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ @@ -1561,8 +1548,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/stdlib/_Exit.c b/newlib/libc/stdlib/_Exit.c index 3f189a21f..8e205a0c3 100644 --- a/newlib/libc/stdlib/_Exit.c +++ b/newlib/libc/stdlib/_Exit.c @@ -5,15 +5,10 @@ FUNCTION INDEX _Exit -ANSI_SYNOPSIS +SYNOPSIS #include void _Exit(int <[code]>); -TRAD_SYNOPSIS - #include - void _Exit(<[code]>) - int <[code]>; - DESCRIPTION Use <<_Exit>> to return control from a program to the host operating environment. Use the argument <[code]> to pass an exit status to the @@ -39,8 +34,7 @@ Supporting OS subroutines required: <<_exit>>. #include void -_DEFUN (_Exit, (code), - int code) +_Exit (int code) { _exit (code); } diff --git a/newlib/libc/stdlib/__adjust.c b/newlib/libc/stdlib/__adjust.c index d5c70758b..4c478f30b 100644 --- a/newlib/libc/stdlib/__adjust.c +++ b/newlib/libc/stdlib/__adjust.c @@ -9,10 +9,9 @@ #define abs(x) (((x) < 0) ? -(x) : (x)) double -_DEFUN (__adjust, (ptr, acc, dexp, sign), - struct _reent *ptr _AND - double *acc _AND - int dexp _AND +__adjust (struct _reent *ptr, + double *acc, + int dexp, int sign) /* *acc the 64 bit accumulator */ /* dexp decimal exponent */ diff --git a/newlib/libc/stdlib/__atexit.c b/newlib/libc/stdlib/__atexit.c index 0f4aeb8a9..97ce053bf 100644 --- a/newlib/libc/stdlib/__atexit.c +++ b/newlib/libc/stdlib/__atexit.c @@ -39,7 +39,9 @@ #include "atexit.h" /* Make this a weak reference to avoid pulling in malloc. */ +#ifndef MALLOC_PROVIDED void * malloc(size_t) _ATTRIBUTE((__weak__)); +#endif #ifdef _LITE_EXIT /* As __call_exitprocs is weak reference in lite exit, make a @@ -63,11 +65,9 @@ static struct _atexit _global_atexit0 = _ATEXIT_INIT; */ int -_DEFUN (__register_exitproc, - (type, fn, arg, d), - int type _AND - void (*fn) (void) _AND - void *arg _AND +__register_exitproc (int type, + void (*fn) (void), + void *arg, void *d) { struct _on_exit_args * args; @@ -89,22 +89,12 @@ _DEFUN (__register_exitproc, } if (p->_ind >= _ATEXIT_SIZE) { -#ifndef _ATEXIT_DYNAMIC_ALLOC +#if !defined (_ATEXIT_DYNAMIC_ALLOC) || !defined (MALLOC_PROVIDED) #ifndef __SINGLE_THREAD__ __lock_release_recursive(__atexit_recursive_mutex); #endif return -1; #else - /* Don't dynamically allocate the atexit array if malloc is not - available. */ - if (!malloc) - { -#ifndef __SINGLE_THREAD__ - __lock_release_recursive(__atexit_recursive_mutex); -#endif - return -1; - } - p = (struct _atexit *) malloc (sizeof *p); if (p == NULL) { diff --git a/newlib/libc/stdlib/__call_atexit.c b/newlib/libc/stdlib/__call_atexit.c index 6a809cc4d..3eec11214 100644 --- a/newlib/libc/stdlib/__call_atexit.c +++ b/newlib/libc/stdlib/__call_atexit.c @@ -9,7 +9,9 @@ #include "atexit.h" /* Make this a weak reference to avoid pulling in free. */ +#ifndef MALLOC_PROVIDED void free(void *) _ATTRIBUTE((__weak__)); +#endif #ifndef __SINGLE_THREAD__ __LOCK_INIT_RECURSIVE(, __atexit_recursive_mutex); @@ -65,8 +67,7 @@ register_fini(void) */ void -_DEFUN (__call_exitprocs, (code, d), - int code _AND _PTR d) +__call_exitprocs (int code, void *d) { register struct _atexit *p; struct _atexit **lastp; @@ -119,9 +120,9 @@ _DEFUN (__call_exitprocs, (code, d), if (!args || (args->_fntypes & i) == 0) fn (); else if ((args->_is_cxa & i) == 0) - (*((void (*)(int, _PTR)) fn))(code, args->_fnargs[n]); + (*((void (*)(int, void *)) fn))(code, args->_fnargs[n]); else - (*((void (*)(_PTR)) fn))(args->_fnargs[n]); + (*((void (*)(void *)) fn))(args->_fnargs[n]); /* The function we called call atexit and registered another function (or functions). Call these new functions before @@ -130,14 +131,9 @@ _DEFUN (__call_exitprocs, (code, d), goto restart; } -#ifndef _ATEXIT_DYNAMIC_ALLOC +#if !defined (_ATEXIT_DYNAMIC_ALLOC) || !defined (MALLOC_PROVIDED) break; #else - /* Don't dynamically free the atexit array if free is not - available. */ - if (!free) - break; - /* Move to the next block. Free empty blocks except the last one, which is part of _GLOBAL_REENT. */ if (p->_ind == 0 && p->_next) diff --git a/newlib/libc/stdlib/__exp10.c b/newlib/libc/stdlib/__exp10.c index 4e368b830..cf223742b 100644 --- a/newlib/libc/stdlib/__exp10.c +++ b/newlib/libc/stdlib/__exp10.c @@ -6,10 +6,9 @@ #include "std.h" double -_DEFUN (__exp10, (x), - unsigned x) +__exp10 (unsigned x) { - static _CONST double powtab[] = + static const double powtab[] = {1.0, 10.0, 100.0, diff --git a/newlib/libc/stdlib/__ten_mu.c b/newlib/libc/stdlib/__ten_mu.c index 637197be2..25af8d0c7 100644 --- a/newlib/libc/stdlib/__ten_mu.c +++ b/newlib/libc/stdlib/__ten_mu.c @@ -9,8 +9,7 @@ #include "std.h" int -_DEFUN (__ten_mul, (acc, digit), - double *acc _AND +__ten_mul (double *acc, int digit) { /* diff --git a/newlib/libc/stdlib/a64l.c b/newlib/libc/stdlib/a64l.c index ee3d40d49..dcac2e050 100644 --- a/newlib/libc/stdlib/a64l.c +++ b/newlib/libc/stdlib/a64l.c @@ -7,19 +7,11 @@ INDEX INDEX l64a -ANSI_SYNOPSIS +SYNOPSIS #include long a64l(const char *<[input]>); char *l64a(long <[input]>); -TRAD_SYNOPSIS - #include - long a64l(<[input]>) - const char *<[input]>; - - char *l64a(<[input]>) - long <[input]>; - DESCRIPTION Conversion is performed between long and radix-64 characters. The <> routine transforms up to 32 bits of input value starting from @@ -64,8 +56,7 @@ Supporting OS subroutines required: None. #include long -_DEFUN (a64l, (input), - const char *input) +a64l (const char *input) { const char *ptr; char ch; diff --git a/newlib/libc/stdlib/abort.c b/newlib/libc/stdlib/abort.c index 93f7c2f42..065dee5b6 100644 --- a/newlib/libc/stdlib/abort.c +++ b/newlib/libc/stdlib/abort.c @@ -15,14 +15,10 @@ FUNCTION INDEX abort -ANSI_SYNOPSIS +SYNOPSIS #include void abort(void); -TRAD_SYNOPSIS - #include - void abort(); - DESCRIPTION Use <> to signal that your program has detected a condition it cannot deal with. Normally, <> ends your program's execution. @@ -50,8 +46,8 @@ Supporting OS subroutines required: <<_exit>> and optionally, <>. #include #include -_VOID -_DEFUN_VOID (abort) +void +abort (void) { #ifdef ABORT_MESSAGE write (2, "Abort called\n", sizeof ("Abort called\n")-1); diff --git a/newlib/libc/stdlib/abs.c b/newlib/libc/stdlib/abs.c index 0308b5729..85a3fecd8 100644 --- a/newlib/libc/stdlib/abs.c +++ b/newlib/libc/stdlib/abs.c @@ -5,15 +5,10 @@ FUNCTION INDEX abs -ANSI_SYNOPSIS +SYNOPSIS #include int abs(int <[i]>); -TRAD_SYNOPSIS - #include - int abs(<[i]>) - int <[i]>; - DESCRIPTION <> returns @tex @@ -37,7 +32,7 @@ No supporting OS subroutines are required. #include int -_DEFUN (abs, (i), int i) +abs (int i) { return (i < 0) ? -i : i; } diff --git a/newlib/libc/stdlib/arc4random.c b/newlib/libc/stdlib/arc4random.c index 3cccc3ed4..7632de164 100644 --- a/newlib/libc/stdlib/arc4random.c +++ b/newlib/libc/stdlib/arc4random.c @@ -99,7 +99,7 @@ _rs_stir(void) rs->rs_have = 0; memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); - rs->rs_count = 1600000; + rs->rs_count = (SIZE_MAX <= 65535) ? 65000 : 1600000; } static inline void diff --git a/newlib/libc/stdlib/assert.c b/newlib/libc/stdlib/assert.c index 135bf1519..46ac92b8c 100644 --- a/newlib/libc/stdlib/assert.c +++ b/newlib/libc/stdlib/assert.c @@ -5,7 +5,7 @@ FUNCTION INDEX assert -ANSI_SYNOPSIS +SYNOPSIS #include void assert(int <[expression]>); @@ -50,10 +50,9 @@ Supporting OS subroutines required (only if enabled): <>, <>, #ifndef HAVE_ASSERT_FUNC /* func can be NULL, in which case no function information is given. */ void -_DEFUN (__assert_func, (file, line, func, failedexpr), - const char *file _AND - int line _AND - const char *func _AND +__assert_func (const char *file, + int line, + const char *func, const char *failedexpr) { fiprintf(stderr, @@ -66,9 +65,8 @@ _DEFUN (__assert_func, (file, line, func, failedexpr), #endif /* HAVE_ASSERT_FUNC */ void -_DEFUN (__assert, (file, line, failedexpr), - const char *file _AND - int line _AND +__assert (const char *file, + int line, const char *failedexpr) { __assert_func (file, line, NULL, failedexpr); diff --git a/newlib/libc/stdlib/atexit.c b/newlib/libc/stdlib/atexit.c index fa91deb03..63617f821 100644 --- a/newlib/libc/stdlib/atexit.c +++ b/newlib/libc/stdlib/atexit.c @@ -12,15 +12,10 @@ FUNCTION INDEX atexit -ANSI_SYNOPSIS +SYNOPSIS #include int atexit (void (*<[function]>)(void)); -TRAD_SYNOPSIS - #include - int atexit ((<[function]>) - void (*<[function]>)(); - DESCRIPTION You can use <> to enroll functions in a list of functions that will be called when your program terminates normally. The argument is @@ -58,9 +53,7 @@ Supporting OS subroutines required: <>, <>, <>, */ int -_DEFUN (atexit, - (fn), - _VOID _EXFNPTR(fn, (_VOID))) +atexit (void (*fn) (void)) { return __register_exitproc (__et_atexit, fn, NULL, NULL); } diff --git a/newlib/libc/stdlib/atexit.h b/newlib/libc/stdlib/atexit.h index e37a146a0..df99963d5 100644 --- a/newlib/libc/stdlib/atexit.h +++ b/newlib/libc/stdlib/atexit.h @@ -9,6 +9,6 @@ enum __atexit_types __et_cxa }; -void __call_exitprocs _PARAMS ((int, _PTR)); -int __register_exitproc _PARAMS ((int, void (*fn) (void), _PTR, _PTR)); +void __call_exitprocs (int, void *); +int __register_exitproc (int, void (*fn) (void), void *, void *); diff --git a/newlib/libc/stdlib/atof.c b/newlib/libc/stdlib/atof.c index 8497f6807..17ba0fa52 100644 --- a/newlib/libc/stdlib/atof.c +++ b/newlib/libc/stdlib/atof.c @@ -7,19 +7,11 @@ INDEX INDEX atoff -ANSI_SYNOPSIS +SYNOPSIS #include double atof(const char *<[s]>); float atoff(const char *<[s]>); -TRAD_SYNOPSIS - #include - double atof(<[s]>) - char *<[s]>; - - float atoff(<[s]>) - char *<[s]>; - DESCRIPTION <> converts the initial portion of a string to a <>. <> converts the initial portion of a string to a <>. @@ -65,8 +57,7 @@ Supporting OS subroutines required: <>, <>, <>, #include <_ansi.h> double -_DEFUN (atof, (s), - _CONST char *s) +atof (const char *s) { return strtod (s, NULL); } diff --git a/newlib/libc/stdlib/atoff.c b/newlib/libc/stdlib/atoff.c index c97b78fb1..e25ff2917 100644 --- a/newlib/libc/stdlib/atoff.c +++ b/newlib/libc/stdlib/atoff.c @@ -2,8 +2,7 @@ #include <_ansi.h> float -_DEFUN (atoff, (s), - _CONST char *s) +atoff (const char *s) { return strtof (s, NULL); } diff --git a/newlib/libc/stdlib/atoi.c b/newlib/libc/stdlib/atoi.c index 6156eda4d..4da53e80a 100644 --- a/newlib/libc/stdlib/atoi.c +++ b/newlib/libc/stdlib/atoi.c @@ -11,30 +11,13 @@ INDEX INDEX _atol_r -ANSI_SYNOPSIS +SYNOPSIS #include int atoi(const char *<[s]>); long atol(const char *<[s]>); int _atoi_r(struct _reent *<[ptr]>, const char *<[s]>); long _atol_r(struct _reent *<[ptr]>, const char *<[s]>); -TRAD_SYNOPSIS - #include - int atoi(<[s]>) - char *<[s]>; - - long atol(<[s]>) - char *<[s]>; - - int _atoi_r(<[ptr]>, <[s]>) - struct _reent *<[ptr]>; - char *<[s]>; - - long _atol_r(<[ptr]>, <[s]>) - struct _reent *<[ptr]>; - char *<[s]>; - - DESCRIPTION <> converts the initial portion of a string to an <>. <> converts the initial portion of a string to a <>. @@ -64,17 +47,15 @@ No supporting OS subroutines are required. #ifndef _REENT_ONLY int -_DEFUN (atoi, (s), - _CONST char *s) +atoi (const char *s) { return (int) strtol (s, NULL, 10); } #endif /* !_REENT_ONLY */ int -_DEFUN (_atoi_r, (s), - struct _reent *ptr _AND - _CONST char *s) +_atoi_r (struct _reent *ptr, + const char *s) { return (int) _strtol_r (ptr, s, NULL, 10); } diff --git a/newlib/libc/stdlib/atol.c b/newlib/libc/stdlib/atol.c index 8d0e5cd0b..a5c8ee9f4 100644 --- a/newlib/libc/stdlib/atol.c +++ b/newlib/libc/stdlib/atol.c @@ -7,14 +7,14 @@ #ifndef _REENT_ONLY long -_DEFUN (atol, (s), _CONST char *s) +atol (const char *s) { return strtol (s, NULL, 10); } #endif /* !_REENT_ONLY */ long -_DEFUN (_atol_r, (ptr, s), struct _reent *ptr _AND _CONST char *s) +_atol_r (struct _reent *ptr, const char *s) { return _strtol_r (ptr, s, NULL, 10); } diff --git a/newlib/libc/stdlib/atoll.c b/newlib/libc/stdlib/atoll.c index a6abd9595..a8c56fe16 100644 --- a/newlib/libc/stdlib/atoll.c +++ b/newlib/libc/stdlib/atoll.c @@ -7,20 +7,11 @@ INDEX INDEX _atoll_r -ANSI_SYNOPSIS +SYNOPSIS #include long long atoll(const char *<[str]>); long long _atoll_r(struct _reent *<[ptr]>, const char *<[str]>); -TRAD_SYNOPSIS - #include - long long atoll(<[str]>) - const char *<[str]>; - - long long _atoll_r(<[ptr]>, <[str]>) - struct _reent *<[ptr]>; - const char *<[str]>; - DESCRIPTION The function <> converts the initial portion of the string pointed to by <<*<[str]>>> to a type <>. A call to @@ -78,17 +69,15 @@ No supporting OS subroutines are required. #ifndef _REENT_ONLY long long -_DEFUN(atoll, (str), - _CONST char *str) +atoll (const char *str) { return strtoll(str, (char **)NULL, 10); } #endif /* !_REENT_ONLY */ long long -_DEFUN(_atoll_r, (ptr, str), - struct _reent *ptr _AND - _CONST char *str) +_atoll_r (struct _reent *ptr, + const char *str) { return _strtoll_r(ptr, str, (char **)NULL, 10); } diff --git a/newlib/libc/stdlib/calloc.c b/newlib/libc/stdlib/calloc.c index 4415c6591..208e27eb1 100644 --- a/newlib/libc/stdlib/calloc.c +++ b/newlib/libc/stdlib/calloc.c @@ -11,22 +11,10 @@ INDEX INDEX _calloc_r -ANSI_SYNOPSIS +SYNOPSIS #include void *calloc(size_t <[n]>, size_t <[s]>); void *_calloc_r(void *<[reent]>, size_t <[n]>, size_t <[s]>); - -TRAD_SYNOPSIS - #include - char *calloc(<[n]>, <[s]>) - size_t <[n]>, <[s]>; - - char *_calloc_r(<[reent]>, <[n]>, <[s]>) - char *<[reent]>; - size_t <[n]>; - size_t <[s]>; - - DESCRIPTION Use <> to request a block of memory sufficient to hold an @@ -57,9 +45,8 @@ Supporting OS subroutines required: <>, <>, <>, #ifndef _REENT_ONLY -_PTR -_DEFUN (calloc, (n, size), - size_t n _AND +void * +calloc (size_t n, size_t size) { return _calloc_r (_REENT, n, size); diff --git a/newlib/libc/stdlib/cxa_atexit.c b/newlib/libc/stdlib/cxa_atexit.c index 39a59d53a..ae2d21a60 100644 --- a/newlib/libc/stdlib/cxa_atexit.c +++ b/newlib/libc/stdlib/cxa_atexit.c @@ -22,15 +22,13 @@ const void * const __cxa_atexit_dummy = &__on_exit_args; */ int -_DEFUN (__cxa_atexit, - (fn, arg, d), - void (*fn) (void *) _AND - void *arg _AND +__cxa_atexit (void (*fn) (void *), + void *arg, void *d) { #ifdef _LITE_EXIT /* Refer to comments in __atexit.c for more details of lite exit. */ - int __register_exitproc _PARAMS ((int, void (*fn) (void), _PTR, _PTR)) + int __register_exitproc (int, void (*fn) (void), void *, void *) __attribute__ ((weak)); if (!__register_exitproc) diff --git a/newlib/libc/stdlib/cxa_finalize.c b/newlib/libc/stdlib/cxa_finalize.c index 17d0526a7..467532881 100644 --- a/newlib/libc/stdlib/cxa_finalize.c +++ b/newlib/libc/stdlib/cxa_finalize.c @@ -13,8 +13,7 @@ */ void -_DEFUN (__cxa_finalize, (d), - void * d) +__cxa_finalize (void * d) { __call_exitprocs (0, d); } diff --git a/newlib/libc/stdlib/div.c b/newlib/libc/stdlib/div.c index 816c3fb3c..20ad7b865 100644 --- a/newlib/libc/stdlib/div.c +++ b/newlib/libc/stdlib/div.c @@ -5,15 +5,10 @@ FUNCTION INDEX div -ANSI_SYNOPSIS +SYNOPSIS #include div_t div(int <[n]>, int <[d]>); -TRAD_SYNOPSIS - #include - div_t div(<[n]>, <[d]>) - int <[n]>, <[d]>; - DESCRIPTION Divide @tex @@ -86,8 +81,7 @@ No supporting OS subroutines are required. #include /* div_t */ div_t -_DEFUN (div, (num, denom), - int num _AND +div (int num, int denom) { div_t r; diff --git a/newlib/libc/stdlib/drand48.c b/newlib/libc/stdlib/drand48.c index 89fe6af1d..061689448 100644 --- a/newlib/libc/stdlib/drand48.c +++ b/newlib/libc/stdlib/drand48.c @@ -14,8 +14,7 @@ #include "rand48.h" double -_DEFUN (_drand48_r, (r), - struct _reent *r) +_drand48_r (struct _reent *r) { _REENT_CHECK_RAND48(r); return _erand48_r(r, __rand48_seed); @@ -23,7 +22,7 @@ _DEFUN (_drand48_r, (r), #ifndef _REENT_ONLY double -_DEFUN_VOID (drand48) +drand48 (void) { return _drand48_r (_REENT); } diff --git a/newlib/libc/stdlib/dtoa.c b/newlib/libc/stdlib/dtoa.c index c72ffac5e..c38f37afd 100644 --- a/newlib/libc/stdlib/dtoa.c +++ b/newlib/libc/stdlib/dtoa.c @@ -33,9 +33,7 @@ #include "mprec.h" static int -_DEFUN (quorem, - (b, S), - _Bigint * b _AND _Bigint * S) +quorem (_Bigint * b, _Bigint * S) { int n; __Long borrow, y; @@ -177,14 +175,12 @@ _DEFUN (quorem, char * -_DEFUN (_dtoa_r, - (ptr, _d, mode, ndigits, decpt, sign, rve), - struct _reent *ptr _AND - double _d _AND - int mode _AND - int ndigits _AND - int *decpt _AND - int *sign _AND +_dtoa_r (struct _reent *ptr, + double _d, + int mode, + int ndigits, + int *decpt, + int *sign, char **rve) { /* Arguments ndigits, decpt, sign are similar to those diff --git a/newlib/libc/stdlib/dtoastub.c b/newlib/libc/stdlib/dtoastub.c index f4929f228..d1c8a6756 100644 --- a/newlib/libc/stdlib/dtoastub.c +++ b/newlib/libc/stdlib/dtoastub.c @@ -8,13 +8,11 @@ #ifndef _REENT_ONLY char * -_DEFUN (__dtoa, - (d, mode, ndigits, decpt, sign, rve), - double d _AND - int mode _AND - int ndigits _AND - int *decpt _AND - int *sign _AND +__dtoa (double d, + int mode, + int ndigits, + int *decpt, + int *sign, char **rve) { return _dtoa_r (_REENT, d, mode, ndigits, decpt, sign, rve); diff --git a/newlib/libc/stdlib/ecvtbuf.c b/newlib/libc/stdlib/ecvtbuf.c index feaa33fd0..e3d7b55d8 100644 --- a/newlib/libc/stdlib/ecvtbuf.c +++ b/newlib/libc/stdlib/ecvtbuf.c @@ -7,7 +7,7 @@ INDEX INDEX fcvtbuf -ANSI_SYNOPSIS +SYNOPSIS #include char *ecvtbuf(double <[val]>, int <[chars]>, int *<[decpt]>, @@ -16,23 +16,6 @@ ANSI_SYNOPSIS char *fcvtbuf(double <[val]>, int <[decimals]>, int *<[decpt]>, int *<[sgn]>, char *<[buf]>); -TRAD_SYNOPSIS - #include - - char *ecvtbuf(<[val]>, <[chars]>, <[decpt]>, <[sgn]>, <[buf]>); - double <[val]>; - int <[chars]>; - int *<[decpt]>; - int *<[sgn]>; - char *<[buf]>; - - char *fcvtbuf(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>, <[buf]>); - double <[val]>; - int <[decimals]>; - int *<[decpt]>; - int *<[sgn]>; - char *<[buf]>; - DESCRIPTION <> and <> produce (null-terminated) strings of digits representating the <> number <[val]>. @@ -75,13 +58,12 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" static void -_DEFUN (print_f, (ptr, buf, invalue, ndigit, type, dot, mode), - struct _reent *ptr _AND - char *buf _AND - double invalue _AND - int ndigit _AND - char type _AND - int dot _AND +print_f (struct _reent *ptr, + char *buf, + double invalue, + int ndigit, + char type, + int dot, int mode) { int decpt; @@ -143,12 +125,11 @@ _DEFUN (print_f, (ptr, buf, invalue, ndigit, type, dot, mode), WIDTH is the number of digits of precision after the decimal point. */ static void -_DEFUN (print_e, (ptr, buf, invalue, width, type, dot), - struct _reent *ptr _AND - char *buf _AND - double invalue _AND - int width _AND - char type _AND +print_e (struct _reent *ptr, + char *buf, + double invalue, + int width, + char type, int dot) { int sign; @@ -226,11 +207,10 @@ _DEFUN (print_e, (ptr, buf, invalue, width, type, dot), support ecvt and fcvt, which aren't ANSI anyway. */ char * -_DEFUN (fcvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), - double invalue _AND - int ndigit _AND - int *decpt _AND - int *sign _AND +fcvtbuf (double invalue, + int ndigit, + int *decpt, + int *sign, char *fcvt_buf) { struct _reent *reent = _REENT; @@ -283,11 +263,10 @@ _DEFUN (fcvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), } char * -_DEFUN (ecvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), - double invalue _AND - int ndigit _AND - int *decpt _AND - int *sign _AND +ecvtbuf (double invalue, + int ndigit, + int *decpt, + int *sign, char *fcvt_buf) { struct _reent *reent = _REENT; @@ -334,12 +313,11 @@ _DEFUN (ecvtbuf, (invalue, ndigit, decpt, sign, fcvt_buf), #endif char * -_DEFUN (_gcvt, (ptr, invalue, ndigit, buf, type, dot), - struct _reent *ptr _AND - double invalue _AND - int ndigit _AND - char *buf _AND - char type _AND +_gcvt (struct _reent *ptr, + double invalue, + int ndigit, + char *buf, + char type, int dot) { char *save = buf; @@ -442,13 +420,12 @@ _DEFUN (_gcvt, (ptr, invalue, ndigit, buf, type, dot), } char * -_DEFUN (_dcvt, (ptr, buffer, invalue, precision, width, type, dot), - struct _reent *ptr _AND - char *buffer _AND - double invalue _AND - int precision _AND - int width _AND - char type _AND +_dcvt (struct _reent *ptr, + char *buffer, + double invalue, + int precision, + int width, + char type, int dot) { switch (type) diff --git a/newlib/libc/stdlib/efgcvt.c b/newlib/libc/stdlib/efgcvt.c index b7d9812f6..9314bf361 100644 --- a/newlib/libc/stdlib/efgcvt.c +++ b/newlib/libc/stdlib/efgcvt.c @@ -11,7 +11,7 @@ INDEX INDEX fcvtf -ANSI_SYNOPSIS +SYNOPSIS #include char *ecvt(double <[val]>, int <[chars]>, int *<[decpt]>, int *<[sgn]>); @@ -22,31 +22,6 @@ ANSI_SYNOPSIS char *fcvtf(float <[val]>, int <[decimals]>, int *<[decpt]>, int *<[sgn]>); -TRAD_SYNOPSIS - #include - - char *ecvt(<[val]>, <[chars]>, <[decpt]>, <[sgn]>); - double <[val]>; - int <[chars]>; - int *<[decpt]>; - int *<[sgn]>; - char *ecvtf(<[val]>, <[chars]>, <[decpt]>, <[sgn]>); - float <[val]>; - int <[chars]>; - int *<[decpt]>; - int *<[sgn]>; - - char *fcvt(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>); - double <[val]>; - int <[decimals]>; - int *<[decpt]>; - int *<[sgn]>; - char *fcvtf(<[val]>, <[decimals]>, <[decpt]>, <[sgn]>); - float <[val]>; - int <[decimals]>; - int *<[decpt]>; - int *<[sgn]>; - DESCRIPTION <> and <> produce (null-terminated) strings of digits representating the <> number <[val]>. @@ -91,24 +66,12 @@ INDEX INDEX gcvtf -ANSI_SYNOPSIS +SYNOPSIS #include char *gcvt(double <[val]>, int <[precision]>, char *<[buf]>); char *gcvtf(float <[val]>, int <[precision]>, char *<[buf]>); -TRAD_SYNOPSIS - #include - - char *gcvt(<[val]>, <[precision]>, <[buf]>); - double <[val]>; - int <[precision]>; - char *<[buf]>; - char *gcvtf(<[val]>, <[precision]>, <[buf]>); - float <[val]>; - int <[precision]>; - char *<[buf]>; - DESCRIPTION <> writes a fully formatted number as a null-terminated string in the buffer <<*<[buf]>>>. <> produces corresponding @@ -140,20 +103,18 @@ Supporting OS subroutines required: <>, <>, <>, #include "local.h" char * -_DEFUN (fcvt, (d, ndigit, decpt, sign), - double d _AND - int ndigit _AND - int *decpt _AND +fcvt (double d, + int ndigit, + int *decpt, int *sign) { return fcvtbuf (d, ndigit, decpt, sign, NULL); } char * -_DEFUN (fcvtf, (d, ndigit, decpt, sign), - float d _AND - int ndigit _AND - int *decpt _AND +fcvtf (float d, + int ndigit, + int *decpt, int *sign) { return fcvt ((float) d, ndigit, decpt, sign); @@ -161,9 +122,8 @@ _DEFUN (fcvtf, (d, ndigit, decpt, sign), char * -_DEFUN (gcvtf, (d, ndigit, buf), - float d _AND - int ndigit _AND +gcvtf (float d, + int ndigit, char *buf) { double asd = d; @@ -172,20 +132,18 @@ _DEFUN (gcvtf, (d, ndigit, buf), char * -_DEFUN (ecvt, (d, ndigit, decpt, sign), - double d _AND - int ndigit _AND - int *decpt _AND +ecvt (double d, + int ndigit, + int *decpt, int *sign) { return ecvtbuf (d, ndigit, decpt, sign, NULL); } char * -_DEFUN (ecvtf, (d, ndigit, decpt, sign), - float d _AND - int ndigit _AND - int *decpt _AND +ecvtf (float d, + int ndigit, + int *decpt, int *sign) { return ecvt ((double) d, ndigit, decpt, sign); @@ -193,9 +151,8 @@ _DEFUN (ecvtf, (d, ndigit, decpt, sign), char * -_DEFUN (gcvt, (d, ndigit, buf), - double d _AND - int ndigit _AND +gcvt (double d, + int ndigit, char *buf) { char *tbuf = buf; diff --git a/newlib/libc/stdlib/envlock.c b/newlib/libc/stdlib/envlock.c index 410a28a9c..3afe30ee9 100644 --- a/newlib/libc/stdlib/envlock.c +++ b/newlib/libc/stdlib/envlock.c @@ -7,18 +7,11 @@ INDEX INDEX __env_unlock -ANSI_SYNOPSIS +SYNOPSIS #include void __env_lock (struct _reent *<[reent]>); void __env_unlock (struct _reent *<[reent]>); -TRAD_SYNOPSIS - void __env_lock(<[reent]>) - struct _reent *<[reent]>; - - void __env_unlock(<[reent]>) - struct _reent *<[reent]>; - DESCRIPTION The <> family of routines call these functions when they need to modify the environ variable. The version of these routines supplied in the diff --git a/newlib/libc/stdlib/erand48.c b/newlib/libc/stdlib/erand48.c index 26b39fb5b..1be4a953e 100644 --- a/newlib/libc/stdlib/erand48.c +++ b/newlib/libc/stdlib/erand48.c @@ -14,8 +14,7 @@ #include "rand48.h" double -_DEFUN (_erand48_r, (r, xseed), - struct _reent *r _AND +_erand48_r (struct _reent *r, unsigned short xseed[3]) { __dorand48(r, xseed); @@ -26,8 +25,7 @@ _DEFUN (_erand48_r, (r, xseed), #ifndef _REENT_ONLY double -_DEFUN (erand48, (xseed), - unsigned short xseed[3]) +erand48 (unsigned short xseed[3]) { return _erand48_r (_REENT, xseed); } diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c index 1dc56944a..3e618914e 100644 --- a/newlib/libc/stdlib/exit.c +++ b/newlib/libc/stdlib/exit.c @@ -12,15 +12,10 @@ FUNCTION INDEX exit -ANSI_SYNOPSIS +SYNOPSIS #include void exit(int <[code]>); -TRAD_SYNOPSIS - #include - void exit(<[code]>) - int <[code]>; - DESCRIPTION Use <> to return control from a program to the host operating environment. Use the argument <[code]> to pass an exit status to the @@ -55,12 +50,11 @@ Supporting OS subroutines required: <<_exit>>. */ void -_DEFUN (exit, (code), - int code) +exit (int code) { #ifdef _LITE_EXIT /* Refer to comments in __atexit.c for more details of lite exit. */ - void __call_exitprocs _PARAMS ((int, _PTR)) __attribute__((weak)); + void __call_exitprocs (int, void *) __attribute__((weak)); if (__call_exitprocs) #endif __call_exitprocs (code, NULL); diff --git a/newlib/libc/stdlib/gd_qnan.h b/newlib/libc/stdlib/gd_qnan.h deleted file mode 100644 index b775f82d4..000000000 --- a/newlib/libc/stdlib/gd_qnan.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifdef __IEEE_BIG_ENDIAN - -#if !defined(__mips) -#define f_QNAN 0x7fc00000 -#define d_QNAN0 0x7ff80000 -#define d_QNAN1 0x0 -#define ld_QNAN0 0x7ff80000 -#define ld_QNAN1 0x0 -#define ld_QNAN2 0x0 -#define ld_QNAN3 0x0 -#define ldus_QNAN0 0x7ff8 -#define ldus_QNAN1 0x0 -#define ldus_QNAN2 0x0 -#define ldus_QNAN3 0x0 -#define ldus_QNAN4 0x0 -#elif defined(__mips_nan2008) -#define f_QNAN 0x7fc00000 -#define d_QNAN0 0x7ff80000 -#define d_QNAN1 0x0 -#else -#define f_QNAN 0x7fbfffff -#define d_QNAN0 0x7ff7ffff -#define d_QNAN1 0xffffffff -#endif - -#elif defined(__IEEE_LITTLE_ENDIAN) - -#if !defined(__mips) -#define f_QNAN 0xffc00000 -#define d_QNAN0 0x0 -#define d_QNAN1 0xfff80000 -#define ld_QNAN0 0x0 -#define ld_QNAN1 0xc0000000 -#define ld_QNAN2 0xffff -#define ld_QNAN3 0x0 -#define ldus_QNAN0 0x0 -#define ldus_QNAN1 0x0 -#define ldus_QNAN2 0x0 -#define ldus_QNAN3 0xc000 -#define ldus_QNAN4 0xffff -#elif defined(__mips_nan2008) -#define f_QNAN 0x7fc00000 -#define d_QNAN0 0x0 -#define d_QNAN1 0x7ff80000 -#else -#define f_QNAN 0x7fbfffff -#define d_QNAN0 0xffffffff -#define d_QNAN1 0x7ff7ffff -#endif - -#else -#error IEEE endian not defined -#endif diff --git a/newlib/libc/stdlib/gdtoa-gethex.c b/newlib/libc/stdlib/gdtoa-gethex.c index fd3903c4f..e0c2fff5e 100644 --- a/newlib/libc/stdlib/gdtoa-gethex.c +++ b/newlib/libc/stdlib/gdtoa-gethex.c @@ -35,10 +35,9 @@ THIS SOFTWARE. #include #include "mprec.h" #include "gdtoa.h" -#include "gd_qnan.h" #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) -_CONST unsigned char __hexdig[256]= +const unsigned char __hexdig[256]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -59,8 +58,7 @@ _CONST unsigned char __hexdig[256]= }; #else /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ unsigned char -_DEFUN (__hexdig_fun, (c), - unsigned char c) +__hexdig_fun (unsigned char c) { if(c>='0' && c<='9') return c-'0'+0x10; else if(c>='a' && c<='f') return c-'a'+0x10+10; @@ -70,8 +68,7 @@ _DEFUN (__hexdig_fun, (c), #endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ static void -_DEFUN(rshift, (b, k), - _Bigint *b _AND +rshift (_Bigint *b, int k) { __ULong *x, *x1, *xe, y; @@ -101,8 +98,7 @@ _DEFUN(rshift, (b, k), } static _Bigint * -_DEFUN (increment, (ptr, b), - struct _reent *ptr _AND +increment (struct _reent *ptr, _Bigint *b) { __ULong *x, *xe; @@ -149,17 +145,17 @@ gethex (struct _reent *ptr, const char **sp, const FPI *fpi, Long *exp, _Bigint **bp, int sign, locale_t loc) { _Bigint *b; - _CONST unsigned char *decpt, *s0, *s, *s1; + const unsigned char *decpt, *s0, *s, *s1; int esign, havedig, irv, k, n, nbits, up, zret; __ULong L, lostbits, *x; Long e, e1; - unsigned char *decimalpoint = (unsigned char *) - __localeconv_l (loc)->decimal_point; + const unsigned char *decimalpoint = (unsigned char *) + __get_numeric_locale(loc)->decimal_point; size_t decp_len = strlen ((const char *) decimalpoint); unsigned char decp_end = decimalpoint[decp_len - 1]; havedig = 0; - s0 = *(_CONST unsigned char **)sp + 2; + s0 = *(const unsigned char **)sp + 2; while(s0[havedig] == '0') havedig++; s0 += havedig; diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c index 24e3783be..a17e5a699 100644 --- a/newlib/libc/stdlib/gdtoa-hexnan.c +++ b/newlib/libc/stdlib/gdtoa-hexnan.c @@ -45,12 +45,11 @@ THIS SOFTWARE. #ifdef INFNAN_CHECK int -_DEFUN (match, (sp, t), - _CONST char **sp _AND +match (const char **sp, char *t) { int c, d; - _CONST char *s = *sp; + const char *s = *sp; while( (d = *t++) !=0) { if ((c = *++s) >= 'A' && c <= 'Z') @@ -63,9 +62,8 @@ _DEFUN (match, (sp, t), } static void -_DEFUN (L_shift, (x, x1, i), - __ULong *x _AND - __ULong *x1 _AND +L_shift (__ULong *x, + __ULong *x1, int i) { int j; @@ -80,13 +78,12 @@ _DEFUN (L_shift, (x, x1, i), } int -_DEFUN (hexnan, (sp, fpi, x0), - _CONST char **sp _AND - _CONST FPI *fpi _AND +hexnan (const char **sp, + const FPI *fpi, __ULong *x0) { __ULong c, h, *x, *x1, *xe; - _CONST char *s; + const char *s; int havedig, hd0, i, nbits; nbits = fpi->nbits; @@ -97,7 +94,7 @@ _DEFUN (hexnan, (sp, fpi, x0), x1 = xe = x; havedig = hd0 = i = 0; s = *sp; - while((c = *(_CONST unsigned char*)++s)) { + while((c = *(const unsigned char*)++s)) { if (!(h = __get_hexdig(c))) { if (c <= ' ') { if (hd0 < havedig) { diff --git a/newlib/libc/stdlib/getenv.c b/newlib/libc/stdlib/getenv.c index 79360ac42..107376bcd 100644 --- a/newlib/libc/stdlib/getenv.c +++ b/newlib/libc/stdlib/getenv.c @@ -7,15 +7,10 @@ INDEX INDEX environ -ANSI_SYNOPSIS +SYNOPSIS #include char *getenv(const char *<[name]>); -TRAD_SYNOPSIS - #include - char *getenv(<[name]>) - char *<[name]>; - DESCRIPTION <> searches the list of environment variable names and values (using the global pointer ``<>'') for a variable whose @@ -69,8 +64,7 @@ variables vary from one system to another. */ char * -_DEFUN (_findenv, (name, offset), - register _CONST char *name _AND +_findenv (register const char *name, int *offset) { return _findenv_r (_REENT, name, offset); @@ -82,8 +76,7 @@ _DEFUN (_findenv, (name, offset), */ char * -_DEFUN (getenv, (name), - _CONST char *name) +getenv (const char *name) { int offset; diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c index cdc12c0a9..aac11367c 100644 --- a/newlib/libc/stdlib/getenv_r.c +++ b/newlib/libc/stdlib/getenv_r.c @@ -7,16 +7,10 @@ INDEX INDEX environ -ANSI_SYNOPSIS +SYNOPSIS #include char *_getenv_r(struct _reent *<[reent_ptr]>, const char *<[name]>); -TRAD_SYNOPSIS - #include - char *_getenv_r(<[reent_ptr]>, <[name]>) - struct _reent *<[reent_ptr]>; - char *<[name]>; - DESCRIPTION <<_getenv_r>> searches the list of environment variable names and values (using the global pointer ``<>'') for a variable whose @@ -80,14 +74,13 @@ static char ***p_environ = &environ; */ char * -_DEFUN (_findenv_r, (reent_ptr, name, offset), - struct _reent *reent_ptr _AND - register _CONST char *name _AND +_findenv_r (struct _reent *reent_ptr, + register const char *name, int *offset) { register int len; register char **p; - _CONST char *c; + const char *c; ENV_LOCK; @@ -125,9 +118,8 @@ _DEFUN (_findenv_r, (reent_ptr, name, offset), */ char * -_DEFUN (_getenv_r, (reent_ptr, name), - struct _reent *reent_ptr _AND - _CONST char *name) +_getenv_r (struct _reent *reent_ptr, + const char *name) { int offset; diff --git a/newlib/libc/stdlib/getopt.c b/newlib/libc/stdlib/getopt.c index 109474764..d4f225a7a 100644 --- a/newlib/libc/stdlib/getopt.c +++ b/newlib/libc/stdlib/getopt.c @@ -118,6 +118,8 @@ int optopt = '?'; /* static variables */ static int optwhere = 0; +static int permute_from = 0; +static int num_nonopts = 0; /* functions */ @@ -163,6 +165,8 @@ read_globals (struct getopt_data *data) data->opterr = opterr; data->optopt = optopt; data->optwhere = optwhere; + data->permute_from = permute_from; + data->num_nonopts = num_nonopts; } /* write_globals: write the values into the globals from a getopt_data @@ -175,6 +179,8 @@ write_globals (struct getopt_data *data) opterr = data->opterr; optopt = data->optopt; optwhere = data->optwhere; + permute_from = data->permute_from; + num_nonopts = data->num_nonopts; } /* getopt_internal: the function that does all the dirty work @@ -186,8 +192,6 @@ getopt_internal (int argc, char *const argv[], const char *shortopts, struct getopt_data *data) { GETOPT_ORDERING_T ordering = PERMUTE; - size_t permute_from = 0; - int num_nonopts = 0; int optindex = 0; size_t match_chars = 0; char *possible_arg = 0; @@ -209,7 +213,12 @@ getopt_internal (int argc, char *const argv[], const char *shortopts, /* if this is our first time through */ if (data->optind == 0) - data->optind = data->optwhere = 1; + { + data->optind = 1; + data->optwhere = 1; + data->permute_from = 0; + data->num_nonopts = 0; + } /* define ordering */ if (shortopts != 0 && (*shortopts == '-' || *shortopts == '+')) @@ -237,24 +246,24 @@ getopt_internal (int argc, char *const argv[], const char *shortopts, { default: /* shouldn't happen */ case PERMUTE: - permute_from = data->optind; - num_nonopts = 0; + data->permute_from = data->optind; + data->num_nonopts = 0; while (!is_option (argv[data->optind], only)) { data->optind++; - num_nonopts++; + data->num_nonopts++; } if (argv[data->optind] == 0) { /* no more options */ - data->optind = permute_from; + data->optind = data->permute_from; return EOF; } else if (strcmp (argv[data->optind], "--") == 0) { /* no more options, but have to get `--' out of the way */ - permute (argv + permute_from, num_nonopts, 1); - data->optind = permute_from + 1; + permute (argv + data->permute_from, data->num_nonopts, 1); + data->optind = data->permute_from + 1; return EOF; } break; @@ -426,10 +435,10 @@ getopt_internal (int argc, char *const argv[], const char *shortopts, } /* do we have to permute or otherwise modify data->optind? */ - if (ordering == PERMUTE && data->optwhere == 1 && num_nonopts != 0) + if (ordering == PERMUTE && data->optwhere == 1 && data->num_nonopts != 0) { - permute (argv + permute_from, num_nonopts, 1 + arg_next); - data->optind = permute_from + 1 + arg_next; + permute (argv + data->permute_from, data->num_nonopts, 1 + arg_next); + data->optind = data->permute_from + 1 + arg_next; } else if (data->optwhere == 1) data->optind = data->optind + 1 + arg_next; diff --git a/newlib/libc/stdlib/itoa.c b/newlib/libc/stdlib/itoa.c index 377834d03..7a7daf0ce 100644 --- a/newlib/libc/stdlib/itoa.c +++ b/newlib/libc/stdlib/itoa.c @@ -5,7 +5,7 @@ FUNCTION INDEX itoa -ANSI_SYNOPSIS +SYNOPSIS #include char *itoa(int <[value]>, char *<[str]>, int <[base]>); char *__itoa(int <[value]>, char *<[str]>, int <[base]>); @@ -30,9 +30,8 @@ No supporting OS subroutine calls are required. #include char * -_DEFUN (__itoa, (value, str, base), - int value _AND - char *str _AND +__itoa (int value, + char *str, int base) { unsigned uvalue; @@ -60,9 +59,8 @@ _DEFUN (__itoa, (value, str, base), } char * -_DEFUN (itoa, (value, str, base), - int value _AND - char *str _AND +itoa (int value, + char *str, int base) { return __itoa (value, str, base); diff --git a/newlib/libc/stdlib/jrand48.c b/newlib/libc/stdlib/jrand48.c index 9e2f92cb6..185e0da90 100644 --- a/newlib/libc/stdlib/jrand48.c +++ b/newlib/libc/stdlib/jrand48.c @@ -14,8 +14,7 @@ #include "rand48.h" long -_DEFUN (_jrand48_r, (r, xseed), - struct _reent *r _AND +_jrand48_r (struct _reent *r, unsigned short xseed[3]) { __dorand48(r, xseed); @@ -24,8 +23,7 @@ _DEFUN (_jrand48_r, (r, xseed), #ifndef _REENT_ONLY long -_DEFUN (jrand48, (xseed), - unsigned short xseed[3]) +jrand48 (unsigned short xseed[3]) { return _jrand48_r (_REENT, xseed); } diff --git a/newlib/libc/stdlib/l64a.c b/newlib/libc/stdlib/l64a.c index d415d0478..45282e32d 100644 --- a/newlib/libc/stdlib/l64a.c +++ b/newlib/libc/stdlib/l64a.c @@ -27,15 +27,13 @@ static const char R64_ARRAY[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; char * -_DEFUN (l64a, (value), - long value) +l64a (long value) { return _l64a_r (_REENT, value); } char * -_DEFUN (_l64a_r, (rptr, value), - struct _reent *rptr _AND +_l64a_r (struct _reent *rptr, long value) { char *ptr; diff --git a/newlib/libc/stdlib/labs.c b/newlib/libc/stdlib/labs.c index 634cf7348..f6761d0cc 100644 --- a/newlib/libc/stdlib/labs.c +++ b/newlib/libc/stdlib/labs.c @@ -5,15 +5,10 @@ FUNCTION INDEX labs -ANSI_SYNOPSIS +SYNOPSIS #include long labs(long <[i]>); -TRAD_SYNOPSIS - #include - long labs(<[i]>) - long <[i]>; - DESCRIPTION <> returns @tex @@ -38,8 +33,7 @@ No supporting OS subroutine calls are required. #include long -_DEFUN (labs, (x), - long x) +labs (long x) { if (x < 0) { diff --git a/newlib/libc/stdlib/lcong48.c b/newlib/libc/stdlib/lcong48.c index 548f32757..78e9e5746 100644 --- a/newlib/libc/stdlib/lcong48.c +++ b/newlib/libc/stdlib/lcong48.c @@ -13,9 +13,8 @@ #include "rand48.h" -_VOID -_DEFUN (_lcong48_r, (r, p), - struct _reent *r _AND +void +_lcong48_r (struct _reent *r, unsigned short p[7]) { _REENT_CHECK_RAND48(r); @@ -29,9 +28,8 @@ _DEFUN (_lcong48_r, (r, p), } #ifndef _REENT_ONLY -_VOID -_DEFUN (lcong48, (p), - unsigned short p[7]) +void +lcong48 (unsigned short p[7]) { _lcong48_r (_REENT, p); } diff --git a/newlib/libc/stdlib/ldiv.c b/newlib/libc/stdlib/ldiv.c index d7508f1c5..294cc8602 100644 --- a/newlib/libc/stdlib/ldiv.c +++ b/newlib/libc/stdlib/ldiv.c @@ -5,15 +5,10 @@ FUNCTION INDEX ldiv -ANSI_SYNOPSIS +SYNOPSIS #include ldiv_t ldiv(long <[n]>, long <[d]>); -TRAD_SYNOPSIS - #include - ldiv_t ldiv(<[n]>, <[d]>) - long <[n]>, <[d]>; - DESCRIPTION Divide @tex @@ -87,8 +82,7 @@ No supporting OS subroutines are required. #include /* ldiv_t */ ldiv_t -_DEFUN (ldiv, (num, denom), - long num _AND +ldiv (long num, long denom) { ldiv_t r; diff --git a/newlib/libc/stdlib/ldtoa.c b/newlib/libc/stdlib/ldtoa.c index a44413cd6..751386233 100644 --- a/newlib/libc/stdlib/ldtoa.c +++ b/newlib/libc/stdlib/ldtoa.c @@ -61,13 +61,13 @@ typedef struct unsigned short equot[NI]; } LDPARMS; -static void esub (_CONST short unsigned int *a, _CONST short unsigned int *b, +static void esub (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp); -static void emul (_CONST short unsigned int *a, _CONST short unsigned int *b, +static void emul (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp); -static void ediv (_CONST short unsigned int *a, _CONST short unsigned int *b, +static void ediv (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp); -static int ecmp (_CONST short unsigned int *a, _CONST short unsigned int *b); +static int ecmp (const short unsigned int *a, const short unsigned int *b); static int enormlz (short unsigned int *x); static int eshift (short unsigned int *x, int sc); static void eshup1 (register short unsigned int *x); @@ -77,7 +77,7 @@ static void eshdn1 (register short unsigned int *x); static void eshdn8 (register short unsigned int *x); static void eshdn6 (register short unsigned int *x); static void eneg (short unsigned int *x); -static void emov (register _CONST short unsigned int *a, +static void emov (register const short unsigned int *a, register short unsigned int *b); static void eclear (register short unsigned int *x); static void einfin (register short unsigned int *x, register LDPARMS * ldp); @@ -111,24 +111,24 @@ static void e113toe (short unsigned int *pe, short unsigned int *y, #if NE == 10 /* 0.0 */ -static _CONST unsigned short ezero[NE] = { 0x0000, 0x0000, 0x0000, 0x0000, +static const unsigned short ezero[NE] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; /* 1.0E0 */ -static _CONST unsigned short eone[NE] = { 0x0000, 0x0000, 0x0000, 0x0000, +static const unsigned short eone[NE] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff, }; #else /* 0.0 */ -static _CONST unsigned short ezero[NE] = { +static const unsigned short ezero[NE] = { 0, 0000000, 0000000, 0000000, 0000000, 0000000, }; /* 1.0E0 */ -static _CONST unsigned short eone[NE] = { +static const unsigned short eone[NE] = { 0, 0000000, 0000000, 0000000, 0100000, 0x3fff, }; @@ -140,7 +140,7 @@ static _CONST unsigned short eone[NE] = { * messages is bound to the error codes defined * in mconf.h. */ -static _CONST char *_CONST ermsg[7] = { +static const char *const ermsg[7] = { "unknown", /* error code 0 */ "domain", /* error code 1 */ "singularity", /* et seq. */ @@ -412,8 +412,10 @@ static void eaddm (short unsigned int *x, short unsigned int *y); static void esubm (short unsigned int *x, short unsigned int *y); static void emdnorm (short unsigned int *s, int lost, int subflg, long int exp, int rcntrl, LDPARMS * ldp); +#if 0 /* Broken, unusable implementation of strtold */ static int asctoeg (char *ss, short unsigned int *y, int oprec, LDPARMS * ldp); +#endif static void enan (short unsigned int *nan, int size); #if LDBL_MANT_DIG == 24 static void toe24 (short unsigned int *x, short unsigned int *y); @@ -432,17 +434,17 @@ static int edivm (short unsigned int *den, short unsigned int *num, LDPARMS * ldp); static int emulm (short unsigned int *a, short unsigned int *b, LDPARMS * ldp); -static int eisneg (_CONST short unsigned int *x); -static int eisinf (_CONST short unsigned int *x); -static void emovi (_CONST short unsigned int *a, short unsigned int *b); +static int eisneg (const short unsigned int *x); +static int eisinf (const short unsigned int *x); +static void emovi (const short unsigned int *a, short unsigned int *b); static void emovo (short unsigned int *a, short unsigned int *b, LDPARMS * ldp); static void emovz (register short unsigned int *a, register short unsigned int *b); static void ecleaz (register short unsigned int *xi); -static void eadd1 (_CONST short unsigned int *a, _CONST short unsigned int *b, +static void eadd1 (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, int subflg, LDPARMS * ldp); -static int eisnan (_CONST short unsigned int *x); +static int eisnan (const short unsigned int *x); static int eiisnan (short unsigned int *x); #ifdef DEC @@ -473,7 +475,7 @@ eclear (register short unsigned int *x) */ static void -emov (register _CONST short unsigned int *a, register short unsigned int *b) +emov (register const short unsigned int *a, register short unsigned int *b) { register int i; @@ -506,7 +508,7 @@ eneg (short unsigned int *x) * else return zero. */ static int -eisneg (_CONST short unsigned int *x) +eisneg (const short unsigned int *x) { #ifdef NANS @@ -524,7 +526,7 @@ eisneg (_CONST short unsigned int *x) * else return zero. */ static int -eisinf (_CONST short unsigned int *x) +eisinf (const short unsigned int *x) { if ((x[NE - 1] & 0x7fff) == 0x7fff) @@ -542,7 +544,7 @@ eisinf (_CONST short unsigned int *x) /* Check if e-type number is not a number. */ static int -eisnan (_CONST short unsigned int *x) +eisnan (const short unsigned int *x) { #ifdef NANS @@ -612,9 +614,9 @@ einfin (register short unsigned int *x, register LDPARMS * ldp) * converting it to internal format. */ static void -emovi (_CONST short unsigned int *a, short unsigned int *b) +emovi (const short unsigned int *a, short unsigned int *b) { - register _CONST unsigned short *p; + register const unsigned short *p; register unsigned short *q; int i; @@ -1421,7 +1423,7 @@ mdfin: */ static void -esub (_CONST short unsigned int *a, _CONST short unsigned int *b, +esub (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp) { @@ -1452,7 +1454,7 @@ esub (_CONST short unsigned int *a, _CONST short unsigned int *b, static void -eadd1 (_CONST short unsigned int *a, _CONST short unsigned int *b, +eadd1 (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, int subflg, LDPARMS * ldp) { unsigned short ai[NI], bi[NI], ci[NI]; @@ -1563,7 +1565,7 @@ done: ; ediv( a, b, c, ldp ); c = b / a */ static void -ediv (_CONST short unsigned int *a, _CONST short unsigned int *b, +ediv (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp) { unsigned short ai[NI], bi[NI]; @@ -1669,7 +1671,7 @@ dnzro2: ; emul( a, b, c, ldp ); c = b * a */ static void -emul (_CONST short unsigned int *a, _CONST short unsigned int *b, +emul (const short unsigned int *a, const short unsigned int *b, short unsigned int *c, LDPARMS * ldp) { unsigned short ai[NI], bi[NI]; @@ -1834,6 +1836,7 @@ e113toe (short unsigned int *pe, short unsigned int *y, LDPARMS * ldp) /* move out internal format to ieee long double */ static void +__attribute__ ((__unused__)) toe113 (short unsigned int *a, short unsigned int *b) { register unsigned short *p, *q; @@ -1970,6 +1973,7 @@ e64toe (short unsigned int *pe, short unsigned int *y, LDPARMS * ldp) /* move out internal format to ieee long double */ static void +__attribute__ ((__unused__)) toe64 (short unsigned int *a, short unsigned int *b) { register unsigned short *p, *q; @@ -2150,6 +2154,7 @@ etoe53 (x, e) } static void +__attribute__ ((__unused__)) toe53 (x, y) unsigned short *x, *y; { @@ -2159,6 +2164,7 @@ toe53 (x, y) #else static void +__attribute__ ((__unused__)) toe53 (short unsigned int *x, short unsigned int *y) { unsigned short i; @@ -2327,6 +2333,7 @@ e24toe (short unsigned int *pe, short unsigned int *y, LDPARMS * ldp) } static void +__attribute__ ((__unused__)) toe24 (short unsigned int *x, short unsigned int *y) { unsigned short i; @@ -2415,7 +2422,7 @@ toe24 (short unsigned int *x, short unsigned int *y) * -2 if either a or b is a NaN. */ static int -ecmp (_CONST short unsigned int *a, _CONST short unsigned int *b) +ecmp (const short unsigned int *a, const short unsigned int *b) { unsigned short ai[NI], bi[NI]; register unsigned short *p, *q; @@ -2627,7 +2634,7 @@ normdn: #define MAXP 4096 #if NE == 10 -static _CONST unsigned short etens[NTEN + 1][NE] = { +static const unsigned short etens[NTEN + 1][NE] = { {0x6576, 0x4a92, 0x804a, 0x153f, 0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */ {0x6a32, 0xce52, 0x329a, 0x28ce, @@ -2656,7 +2663,7 @@ static _CONST unsigned short etens[NTEN + 1][NE] = { 0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */ }; -static _CONST unsigned short emtens[NTEN + 1][NE] = { +static const unsigned short emtens[NTEN + 1][NE] = { {0x2030, 0xcffc, 0xa1c3, 0x8123, 0x2de3, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */ {0x8264, 0xd2cb, 0xf2ea, 0x12d4, @@ -2685,7 +2692,7 @@ static _CONST unsigned short emtens[NTEN + 1][NE] = { 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */ }; #else -static _CONST unsigned short etens[NTEN + 1][NE] = { +static const unsigned short etens[NTEN + 1][NE] = { {0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */ {0xa74d, 0x5de4, 0xc53d, 0x3b5d, 0x9e8b, 0x5a92,}, /* 10**2048 */ {0x650d, 0x0c17, 0x8175, 0x7586, 0xc976, 0x4d48,}, @@ -2701,7 +2708,7 @@ static _CONST unsigned short etens[NTEN + 1][NE] = { {0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */ }; -static _CONST unsigned short emtens[NTEN + 1][NE] = { +static const unsigned short emtens[NTEN + 1][NE] = { {0x2de4, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */ {0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */ {0x87a6, 0xc0bd, 0xda57, 0x82a5, 0xa2a6, 0x32b5,}, @@ -2973,7 +2980,7 @@ etoasc (short unsigned int *x, char *string, int ndigits, int outformat, { long digit; unsigned short y[NI], t[NI], u[NI], w[NI]; - _CONST unsigned short *p, *r, *ten; + const unsigned short *p, *r, *ten; unsigned short sign; int i, j, k, expon, rndsav, ndigs; char *s, *ss; @@ -3328,7 +3335,7 @@ asctoeg (char *ss, short unsigned int *y, int oprec, LDPARMS * ldp) int k, trail, c, rndsav; long lexp; unsigned short nsign; - _CONST unsigned short *p; + const unsigned short *p; char *sp, *s, *lstr; int lenldstr; int mflag = 0; @@ -3654,7 +3661,7 @@ aexit: * * efloor( x, y, ldp ); */ -static _CONST unsigned short bmask[] = { +static const unsigned short bmask[] = { 0xffff, 0xfffe, 0xfffc, @@ -3756,47 +3763,47 @@ eiremain (short unsigned int *den, short unsigned int *num, LDPARMS * ldp) */ #ifdef MIEEE #if !defined(__mips) -static _CONST unsigned short nan113[8] = { +static const unsigned short nan113[8] = { 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan64[6] = { +static const unsigned short nan64[6] = { 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan53[4] = { 0x7fff, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan24[2] = { 0x7fff, 0xffff }; +static const unsigned short nan53[4] = { 0x7fff, 0xffff, 0xffff, 0xffff }; +static const unsigned short nan24[2] = { 0x7fff, 0xffff }; #elif defined(__mips_nan2008) /* __mips */ -static _CONST unsigned short nan113[8] = { 0x7fff, 0x8000, 0, 0, 0, 0, 0, 0 }; -static _CONST unsigned short nan64[6] = { 0x7fff, 0xc000, 0, 0, 0, 0 }; -static _CONST unsigned short nan53[4] = { 0x7ff8, 0, 0, 0 }; -static _CONST unsigned short nan24[2] = { 0x7fc0, 0 }; +static const unsigned short nan113[8] = { 0x7fff, 0x8000, 0, 0, 0, 0, 0, 0 }; +static const unsigned short nan64[6] = { 0x7fff, 0xc000, 0, 0, 0, 0 }; +static const unsigned short nan53[4] = { 0x7ff8, 0, 0, 0 }; +static const unsigned short nan24[2] = { 0x7fc0, 0 }; #else /* __mips && !__mips_nan2008 */ -static _CONST unsigned short nan113[8] = { +static const unsigned short nan113[8] = { 0x7fff, 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan64[6] = { +static const unsigned short nan64[6] = { 0x7fff, 0xbfff, 0xffff, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan53[4] = { 0x7ff7, 0xffff, 0xffff, 0xffff }; -static _CONST unsigned short nan24[2] = { 0x7fbf, 0xffff }; +static const unsigned short nan53[4] = { 0x7ff7, 0xffff, 0xffff, 0xffff }; +static const unsigned short nan24[2] = { 0x7fbf, 0xffff }; #endif /* __mips && !__mips_nan2008 */ #else /* !MIEEE */ #if !defined(__mips) || defined(__mips_nan2008) -static _CONST unsigned short nan113[8] = { 0, 0, 0, 0, 0, 0, 0x8000, 0x7fff }; -static _CONST unsigned short nan64[6] = { 0, 0, 0, 0, 0xc000, 0x7fff }; -static _CONST unsigned short nan53[4] = { 0, 0, 0, 0x7ff8 }; -static _CONST unsigned short nan24[2] = { 0, 0x7fc0 }; +static const unsigned short nan113[8] = { 0, 0, 0, 0, 0, 0, 0x8000, 0x7fff }; +static const unsigned short nan64[6] = { 0, 0, 0, 0, 0xc000, 0x7fff }; +static const unsigned short nan53[4] = { 0, 0, 0, 0x7ff8 }; +static const unsigned short nan24[2] = { 0, 0x7fc0 }; #else /* __mips && !__mips_nan2008 */ -static _CONST unsigned short nan113[8] = { +static const unsigned short nan113[8] = { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x7fff, 0x7fff }; -static _CONST unsigned short nan64[6] = { +static const unsigned short nan64[6] = { 0xffff, 0xffff, 0xffff, 0xffff, 0xbfff, 0x7fff }; -static _CONST unsigned short nan53[4] = { 0xffff, 0xffff, 0xffff, 0x7ff7 }; -static _CONST unsigned short nan24[2] = { 0xffff, 0x7fbf }; +static const unsigned short nan53[4] = { 0xffff, 0xffff, 0xffff, 0x7ff7 }; +static const unsigned short nan24[2] = { 0xffff, 0x7fbf }; #endif /* __mips && !__mips_nan2008 */ #endif /* !MIEEE */ @@ -3805,7 +3812,7 @@ static void enan (short unsigned int *nan, int size) { int i, n; - _CONST unsigned short *p; + const unsigned short *p; switch (size) { diff --git a/newlib/libc/stdlib/llabs.c b/newlib/libc/stdlib/llabs.c index 496373910..a020deadf 100644 --- a/newlib/libc/stdlib/llabs.c +++ b/newlib/libc/stdlib/llabs.c @@ -5,15 +5,10 @@ FUNCTION INDEX llabs -ANSI_SYNOPSIS +SYNOPSIS #include long long llabs(long long <[j]>); -TRAD_SYNOPSIS - #include - long long llabs(<[j]>) - long long <[j]>; - DESCRIPTION The <> function computes the absolute value of the long long integer argument <[j]> (also called the magnitude of <[j]>). @@ -59,8 +54,7 @@ No supporting OS subroutines are required. #include long long -_DEFUN(llabs, (j), - long long j) +llabs (long long j) { return (j < 0 ? -j : j); } diff --git a/newlib/libc/stdlib/lldiv.c b/newlib/libc/stdlib/lldiv.c index 6b853e4b6..2dadf0e1e 100644 --- a/newlib/libc/stdlib/lldiv.c +++ b/newlib/libc/stdlib/lldiv.c @@ -5,15 +5,10 @@ FUNCTION INDEX lldiv -ANSI_SYNOPSIS +SYNOPSIS #include lldiv_t lldiv(long long <[n]>, long long <[d]>); -TRAD_SYNOPSIS - #include - lldiv_t lldiv(<[n]>, <[d]>) - long long <[n]>, <[d]>; - DESCRIPTION Divide @tex @@ -99,8 +94,7 @@ No supporting OS subroutines are required. * subtract denom from r.rem. */ lldiv_t -_DEFUN (lldiv, (number, denom), - long long numer _AND long long denom) +lldiv (long long numer, long long denom) { lldiv_t retval; diff --git a/newlib/libc/stdlib/local.h b/newlib/libc/stdlib/local.h index 0b950d2f4..a96ed2cc4 100644 --- a/newlib/libc/stdlib/local.h +++ b/newlib/libc/stdlib/local.h @@ -3,7 +3,7 @@ #ifndef _LOCAL_H_ #define _LOCAL_H_ -char * _EXFUN(_gcvt,(struct _reent *, double , int , char *, char, int)); +char * _gcvt (struct _reent *, double , int , char *, char, int); #include "../locale/setlocale.h" diff --git a/newlib/libc/stdlib/lrand48.c b/newlib/libc/stdlib/lrand48.c index bfc693b75..a28284e61 100644 --- a/newlib/libc/stdlib/lrand48.c +++ b/newlib/libc/stdlib/lrand48.c @@ -14,8 +14,7 @@ #include "rand48.h" long -_DEFUN (_lrand48_r, (r), - struct _reent *r) +_lrand48_r (struct _reent *r) { _REENT_CHECK_RAND48(r); __dorand48(r, __rand48_seed); @@ -25,7 +24,7 @@ _DEFUN (_lrand48_r, (r), #ifndef _REENT_ONLY long -_DEFUN_VOID (lrand48) +lrand48 (void) { return _lrand48_r (_REENT); } diff --git a/newlib/libc/stdlib/malign.c b/newlib/libc/stdlib/malign.c index 1eded306b..480060c43 100644 --- a/newlib/libc/stdlib/malign.c +++ b/newlib/libc/stdlib/malign.c @@ -8,9 +8,8 @@ #ifndef _REENT_ONLY -_PTR -_DEFUN (memalign, (align, nbytes), - size_t align _AND +void * +memalign (size_t align, size_t nbytes) { return _memalign_r (_REENT, align, nbytes); diff --git a/newlib/libc/stdlib/malloc.c b/newlib/libc/stdlib/malloc.c index 160a13eff..f5ac29208 100644 --- a/newlib/libc/stdlib/malloc.c +++ b/newlib/libc/stdlib/malloc.c @@ -43,7 +43,7 @@ INDEX INDEX _malloc_usable_size_r -ANSI_SYNOPSIS +SYNOPSIS #include void *malloc(size_t <[nbytes]>); void *realloc(void *<[aptr]>, size_t <[nbytes]>); @@ -66,56 +66,6 @@ ANSI_SYNOPSIS size_t _malloc_usable_size_r(void *<[reent]>, void *<[aptr]>); -TRAD_SYNOPSIS - #include - char *malloc(<[nbytes]>) - size_t <[nbytes]>; - - char *realloc(<[aptr]>, <[nbytes]>) - char *<[aptr]>; - size_t <[nbytes]>; - - char *reallocf(<[aptr]>, <[nbytes]>) - char *<[aptr]>; - size_t <[nbytes]>; - - void free(<[aptr]>) - char *<[aptr]>; - - char *memalign(<[align]>, <[nbytes]>) - size_t <[align]>; - size_t <[nbytes]>; - - size_t malloc_usable_size(<[aptr]>) - char *<[aptr]>; - - char *_malloc_r(<[reent]>,<[nbytes]>) - char *<[reent]>; - size_t <[nbytes]>; - - char *_realloc_r(<[reent]>, <[aptr]>, <[nbytes]>) - char *<[reent]>; - char *<[aptr]>; - size_t <[nbytes]>; - - char *_reallocf_r(<[reent]>, <[aptr]>, <[nbytes]>) - char *<[reent]>; - char *<[aptr]>; - size_t <[nbytes]>; - - void _free_r(<[reent]>, <[aptr]>) - char *<[reent]>; - char *<[aptr]>; - - char *_memalign_r(<[reent]>, <[align]>, <[nbytes]>) - char *<[reent]>; - size_t <[align]>; - size_t <[nbytes]>; - - size_t malloc_usable_size(<[reent]>, <[aptr]>) - char *<[reent]>; - char *<[aptr]>; - DESCRIPTION These functions manage a pool of system memory. @@ -208,16 +158,14 @@ Supporting OS subroutines required: <>. */ #ifndef _REENT_ONLY -_PTR -_DEFUN (malloc, (nbytes), - size_t nbytes) /* get a block */ +void * +malloc (size_t nbytes) /* get a block */ { return _malloc_r (_REENT, nbytes); } void -_DEFUN (free, (aptr), - _PTR aptr) +free (void *aptr) { _free_r (_REENT, aptr); } diff --git a/newlib/libc/stdlib/mallocr.c b/newlib/libc/stdlib/mallocr.c index ecc445f3d..26d1c89cc 100644 --- a/newlib/libc/stdlib/mallocr.c +++ b/newlib/libc/stdlib/mallocr.c @@ -2198,13 +2198,18 @@ static void malloc_extend_top(RARG nb) RDECL INTERNAL_SIZE_T nb; /* Guarantee the next brk will be at a page boundary */ correction += pagesz - ((POINTER_UINT)(brk + sbrk_size) & (pagesz - 1)); + /* To guarantee page boundary, correction should be less than pagesz */ + correction &= (pagesz - 1); + /* Allocate correction */ new_brk = (char*)(MORECORE (correction)); if (new_brk == (char*)(MORECORE_FAILURE)) { correction = 0; correction_failed = 1; - new_brk = brk; + new_brk = brk + sbrk_size; + if (front_misalign > 0) + new_brk -= (MALLOC_ALIGNMENT) - front_misalign; } sbrked_mem += correction; diff --git a/newlib/libc/stdlib/mbctype.h b/newlib/libc/stdlib/mbctype.h index 65cf24c34..359c83c77 100644 --- a/newlib/libc/stdlib/mbctype.h +++ b/newlib/libc/stdlib/mbctype.h @@ -7,10 +7,10 @@ /* functions used to support SHIFT_JIS, EUC-JP, and JIS multibyte encodings */ -int _EXFUN(_issjis1, (int c)); -int _EXFUN(_issjis2, (int c)); -int _EXFUN(_iseucjp, (int c)); -int _EXFUN(_isjis, (int c)); +int _issjis1 (int c); +int _issjis2 (int c); +int _iseucjp (int c); +int _isjis (int c); #define _issjis1(c) (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0 && (c) <= 0xef)) #define _issjis2(c) (((c) >= 0x40 && (c) <= 0x7e) || ((c) >= 0x80 && (c) <= 0xfc)) diff --git a/newlib/libc/stdlib/mblen.c b/newlib/libc/stdlib/mblen.c index f9fb46466..3753d3673 100644 --- a/newlib/libc/stdlib/mblen.c +++ b/newlib/libc/stdlib/mblen.c @@ -5,16 +5,10 @@ FUNCTION INDEX mblen -ANSI_SYNOPSIS +SYNOPSIS #include int mblen(const char *<[s]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - int mblen(<[s]>, <[n]>) - const char *<[s]>; - size_t <[n]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <>. In this case, the @@ -49,8 +43,7 @@ effects vary with the locale. #include "local.h" int -_DEFUN (mblen, (s, n), - const char *s _AND +mblen (const char *s, size_t n) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/mblen_r.c b/newlib/libc/stdlib/mblen_r.c index 9c1533ec4..ff1737002 100644 --- a/newlib/libc/stdlib/mblen_r.c +++ b/newlib/libc/stdlib/mblen_r.c @@ -5,18 +5,10 @@ FUNCTION INDEX _mblen_r -ANSI_SYNOPSIS +SYNOPSIS #include int _mblen_r(struct _reent *<[r]>, const char *<[s]>, size_t <[n]>, int *<[state]>); -TRAD_SYNOPSIS - #include - int _mblen_r(<[r]>, <[s]>, <[n]>, <[state]>) - struct _reent *<[r]>; - const char *<[s]>; - size_t <[n]>; - int *<[state]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <<_mblen_r>>. In this case, the @@ -49,10 +41,9 @@ effects vary with the locale. #include "local.h" int -_DEFUN (_mblen_r, (r, s, n, state), - struct _reent *r _AND - const char *s _AND - size_t n _AND +_mblen_r (struct _reent *r, + const char *s, + size_t n, mbstate_t *state) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/mbrtowc.c b/newlib/libc/stdlib/mbrtowc.c index 69e3acb62..65284a0eb 100644 --- a/newlib/libc/stdlib/mbrtowc.c +++ b/newlib/libc/stdlib/mbrtowc.c @@ -8,11 +8,10 @@ #include "local.h" size_t -_DEFUN (_mbrtowc_r, (ptr, pwc, s, n, ps), - struct _reent *ptr _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +_mbrtowc_r (struct _reent *ptr, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *ps) { int retval = 0; @@ -42,10 +41,9 @@ _DEFUN (_mbrtowc_r, (ptr, pwc, s, n, ps), #ifndef _REENT_ONLY size_t -_DEFUN (mbrtowc, (pwc, s, n, ps), - wchar_t *__restrict pwc _AND - const char *__restrict s _AND - size_t n _AND +mbrtowc (wchar_t *__restrict pwc, + const char *__restrict s, + size_t n, mbstate_t *__restrict ps) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/stdlib/mbsnrtowcs.c b/newlib/libc/stdlib/mbsnrtowcs.c index 7ab384721..d3ce25084 100644 --- a/newlib/libc/stdlib/mbsnrtowcs.c +++ b/newlib/libc/stdlib/mbsnrtowcs.c @@ -11,7 +11,7 @@ INDEX INDEX _mbsnrtowcs_r -ANSI_SYNOPSIS +SYNOPSIS #include size_t mbsrtowcs(wchar_t *__restrict <[dst]>, const char **__restrict <[src]>, @@ -33,39 +33,6 @@ ANSI_SYNOPSIS const char **<[src]>, size_t <[nms]>, size_t <[len]>, mbstate_t *<[ps]>); -TRAD_SYNOPSIS - #include - size_t mbsrtowcs(<[dst]>, <[src]>, <[len]>, <[ps]>) - wchar_t *__restrict <[dst]>; - const char **__restrict <[src]>; - size_t <[len]>; - mbstate_t *__restrict <[ps]>; - - #include - size_t _mbsrtowcs_r(<[ptr]>, <[dst]>, <[src]>, <[len]>, <[ps]>) - struct _reent *<[ptr]>; - wchar_t *<[dst]>; - const char **<[src]>; - size_t <[len]>; - mbstate_t *<[ps]>; - - #include - size_t mbsnrtowcs(<[dst]>, <[src]>, <[nms]>, <[len]>, <[ps]>) - wchar_t *__restrict <[dst]>; - const char **__restrict <[src]>; - size_t <[nms]>; - size_t <[len]>; - mbstate_t *__restrict <[ps]>; - - #include - size_t _mbsnrtowcs_r(<[ptr]>, <[dst]>, <[src]>, <[nms]>, <[len]>, <[ps]>) - struct _reent *<[ptr]>; - wchar_t *<[dst]>; - const char **<[src]>; - size_t <[nms]>; - size_t <[len]>; - mbstate_t *<[ps]>; - DESCRIPTION The <> function converts a sequence of multibyte characters pointed to indirectly by <[src]> into a sequence of corresponding wide @@ -104,12 +71,11 @@ PORTABILITY #include size_t -_DEFUN (_mbsnrtowcs_r, (r, dst, src, nms, len, ps), - struct _reent *r _AND - wchar_t *dst _AND - const char **src _AND - size_t nms _AND - size_t len _AND +_mbsnrtowcs_r (struct _reent *r, + wchar_t *dst, + const char **src, + size_t nms, + size_t len, mbstate_t *ps) { wchar_t *ptr = dst; @@ -170,11 +136,10 @@ _DEFUN (_mbsnrtowcs_r, (r, dst, src, nms, len, ps), #ifndef _REENT_ONLY size_t -_DEFUN (mbsnrtowcs, (dst, src, nms, len, ps), - wchar_t *__restrict dst _AND - const char **__restrict src _AND - size_t nms _AND - size_t len _AND +mbsnrtowcs (wchar_t *__restrict dst, + const char **__restrict src, + size_t nms, + size_t len, mbstate_t *__restrict ps) { return _mbsnrtowcs_r (_REENT, dst, src, nms, len, ps); diff --git a/newlib/libc/stdlib/mbsrtowcs.c b/newlib/libc/stdlib/mbsrtowcs.c index 65e46d32e..82589c606 100644 --- a/newlib/libc/stdlib/mbsrtowcs.c +++ b/newlib/libc/stdlib/mbsrtowcs.c @@ -8,11 +8,10 @@ #include size_t -_DEFUN (_mbsrtowcs_r, (r, dst, src, len, ps), - struct _reent *r _AND - wchar_t *dst _AND - const char **src _AND - size_t len _AND +_mbsrtowcs_r (struct _reent *r, + wchar_t *dst, + const char **src, + size_t len, mbstate_t *ps) { return _mbsnrtowcs_r (r, dst, src, (size_t) -1, len, ps); @@ -20,10 +19,9 @@ _DEFUN (_mbsrtowcs_r, (r, dst, src, len, ps), #ifndef _REENT_ONLY size_t -_DEFUN (mbsrtowcs, (dst, src, len, ps), - wchar_t *__restrict dst _AND - const char **__restrict src _AND - size_t len _AND +mbsrtowcs (wchar_t *__restrict dst, + const char **__restrict src, + size_t len, mbstate_t *__restrict ps) { return _mbsnrtowcs_r (_REENT, dst, src, (size_t) -1, len, ps); diff --git a/newlib/libc/stdlib/mbstowcs.c b/newlib/libc/stdlib/mbstowcs.c index 09543451c..253059cf8 100644 --- a/newlib/libc/stdlib/mbstowcs.c +++ b/newlib/libc/stdlib/mbstowcs.c @@ -5,17 +5,10 @@ FUNCTION INDEX mbstowcs -ANSI_SYNOPSIS +SYNOPSIS #include int mbstowcs(wchar_t *restrict <[pwc]>, const char *restrict <[s]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - int mbstowcs(<[pwc]>, <[s]>, <[n]>) - wchar_t *<[pwc]>; - const char *<[s]>; - size_t <[n]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <>. In this case, the @@ -54,9 +47,8 @@ effects vary with the locale. #include size_t -_DEFUN (mbstowcs, (pwcs, s, n), - wchar_t *__restrict pwcs _AND - const char *__restrict s _AND +mbstowcs (wchar_t *__restrict pwcs, + const char *__restrict s, size_t n) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/mbstowcs_r.c b/newlib/libc/stdlib/mbstowcs_r.c index 495049972..43aea2cdf 100644 --- a/newlib/libc/stdlib/mbstowcs_r.c +++ b/newlib/libc/stdlib/mbstowcs_r.c @@ -3,11 +3,10 @@ #include "local.h" size_t -_DEFUN (_mbstowcs_r, (reent, pwcs, s, n, state), - struct _reent *r _AND - wchar_t *__restrict pwcs _AND - const char *__restrict s _AND - size_t n _AND +_mbstowcs_r (struct _reent *r, + wchar_t *__restrict pwcs, + const char *__restrict s, + size_t n, mbstate_t *state) { size_t ret = 0; diff --git a/newlib/libc/stdlib/mbtowc.c b/newlib/libc/stdlib/mbtowc.c index 7b8be771c..2dc413f2d 100644 --- a/newlib/libc/stdlib/mbtowc.c +++ b/newlib/libc/stdlib/mbtowc.c @@ -5,17 +5,10 @@ FUNCTION INDEX mbtowc -ANSI_SYNOPSIS +SYNOPSIS #include int mbtowc(wchar_t *restrict <[pwc]>, const char *restrict <[s]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - int mbtowc(<[pwc]>, <[s]>, <[n]>) - wchar_t *<[pwc]>; - const char *<[s]>; - size_t <[n]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <>. In this case, @@ -57,9 +50,8 @@ effects vary with the locale. #include "local.h" int -_DEFUN (mbtowc, (pwc, s, n), - wchar_t *__restrict pwc _AND - const char *__restrict s _AND +mbtowc (wchar_t *__restrict pwc, + const char *__restrict s, size_t n) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c index 9d782566f..920a7ea3c 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -8,22 +8,20 @@ #include "local.h" int -_DEFUN (_mbtowc_r, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *__restrict pwc _AND - const char *__restrict s _AND - size_t n _AND +_mbtowc_r (struct _reent *r, + wchar_t *__restrict pwc, + const char *__restrict s, + size_t n, mbstate_t *state) { return __MBTOWC (r, pwc, s, n, state); } int -_DEFUN (__ascii_mbtowc, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +__ascii_mbtowc (struct _reent *r, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *state) { wchar_t dummy; @@ -528,11 +526,10 @@ __cp_mbtowc (int val) #endif /* _MB_EXTENDED_CHARSETS_WINDOWS */ int -_DEFUN (__utf8_mbtowc, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +__utf8_mbtowc (struct _reent *r, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *state) { wchar_t dummy; @@ -730,11 +727,10 @@ _DEFUN (__utf8_mbtowc, (r, pwc, s, n, state), because the underlying OS requires wchar_t == UTF-16. */ #ifndef __CYGWIN__ int -_DEFUN (__sjis_mbtowc, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +__sjis_mbtowc (struct _reent *r, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *state) { wchar_t dummy; @@ -787,11 +783,10 @@ _DEFUN (__sjis_mbtowc, (r, pwc, s, n, state), } int -_DEFUN (__eucjp_mbtowc, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +__eucjp_mbtowc (struct _reent *r, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *state) { wchar_t dummy; @@ -870,11 +865,10 @@ _DEFUN (__eucjp_mbtowc, (r, pwc, s, n, state), } int -_DEFUN (__jis_mbtowc, (r, pwc, s, n, state), - struct _reent *r _AND - wchar_t *pwc _AND - const char *s _AND - size_t n _AND +__jis_mbtowc (struct _reent *r, + wchar_t *pwc, + const char *s, + size_t n, mbstate_t *state) { wchar_t dummy; diff --git a/newlib/libc/stdlib/mlock.c b/newlib/libc/stdlib/mlock.c index 4c392947d..23aa10173 100644 --- a/newlib/libc/stdlib/mlock.c +++ b/newlib/libc/stdlib/mlock.c @@ -8,18 +8,11 @@ INDEX INDEX __malloc_unlock -ANSI_SYNOPSIS +SYNOPSIS #include void __malloc_lock (struct _reent *<[reent]>); void __malloc_unlock (struct _reent *<[reent]>); -TRAD_SYNOPSIS - void __malloc_lock(<[reent]>) - struct _reent *<[reent]>; - - void __malloc_unlock(<[reent]>) - struct _reent *<[reent]>; - DESCRIPTION The <> family of routines call these functions when they need to lock the memory pool. The version of these routines supplied in the library use diff --git a/newlib/libc/stdlib/mprec.c b/newlib/libc/stdlib/mprec.c index 2b982ef55..e433fa8c1 100644 --- a/newlib/libc/stdlib/mprec.c +++ b/newlib/libc/stdlib/mprec.c @@ -94,7 +94,7 @@ */ _Bigint * -_DEFUN (Balloc, (ptr, k), struct _reent *ptr _AND int k) +Balloc (struct _reent *ptr, int k) { int x; _Bigint *rv ; @@ -133,7 +133,7 @@ _DEFUN (Balloc, (ptr, k), struct _reent *ptr _AND int k) } void -_DEFUN (Bfree, (ptr, v), struct _reent *ptr _AND _Bigint * v) +Bfree (struct _reent *ptr, _Bigint * v) { _REENT_CHECK_MP(ptr); if (v) @@ -144,10 +144,9 @@ _DEFUN (Bfree, (ptr, v), struct _reent *ptr _AND _Bigint * v) } _Bigint * -_DEFUN (multadd, (ptr, b, m, a), - struct _reent *ptr _AND - _Bigint * b _AND - int m _AND +multadd (struct _reent *ptr, + _Bigint * b, + int m, int a) { int i, wds; @@ -191,11 +190,10 @@ _DEFUN (multadd, (ptr, b, m, a), } _Bigint * -_DEFUN (s2b, (ptr, s, nd0, nd, y9), - struct _reent * ptr _AND - _CONST char *s _AND - int nd0 _AND - int nd _AND +s2b (struct _reent * ptr, + const char *s, + int nd0, + int nd, __ULong y9) { _Bigint *b; @@ -231,8 +229,7 @@ _DEFUN (s2b, (ptr, s, nd0, nd, y9), } int -_DEFUN (hi0bits, - (x), register __ULong x) +hi0bits (register __ULong x) { register int k = 0; @@ -266,7 +263,7 @@ _DEFUN (hi0bits, } int -_DEFUN (lo0bits, (y), __ULong *y) +lo0bits (__ULong *y) { register int k; register __ULong x = *y; @@ -316,7 +313,7 @@ _DEFUN (lo0bits, (y), __ULong *y) } _Bigint * -_DEFUN (i2b, (ptr, i), struct _reent * ptr _AND int i) +i2b (struct _reent * ptr, int i) { _Bigint *b; @@ -327,7 +324,7 @@ _DEFUN (i2b, (ptr, i), struct _reent * ptr _AND int i) } _Bigint * -_DEFUN (mult, (ptr, a, b), struct _reent * ptr _AND _Bigint * a _AND _Bigint * b) +mult (struct _reent * ptr, _Bigint * a, _Bigint * b) { _Bigint *c; int k, wa, wb, wc; @@ -419,12 +416,11 @@ _DEFUN (mult, (ptr, a, b), struct _reent * ptr _AND _Bigint * a _AND _Bigint * b } _Bigint * -_DEFUN (pow5mult, - (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k) +pow5mult (struct _reent * ptr, _Bigint * b, int k) { _Bigint *b1, *p5, *p51; int i; - static _CONST int p05[3] = {5, 25, 125}; + static const int p05[3] = {5, 25, 125}; if ((i = k & 3) != 0) b = multadd (ptr, b, p05[i - 1], 0); @@ -459,7 +455,7 @@ _DEFUN (pow5mult, } _Bigint * -_DEFUN (lshift, (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k) +lshift (struct _reent * ptr, _Bigint * b, int k) { int i, k1, n, n1; _Bigint *b1; @@ -519,7 +515,7 @@ _DEFUN (lshift, (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k) } int -_DEFUN (cmp, (a, b), _Bigint * a _AND _Bigint * b) +cmp (_Bigint * a, _Bigint * b) { __ULong *xa, *xa0, *xb, *xb0; int i, j; @@ -549,8 +545,8 @@ _DEFUN (cmp, (a, b), _Bigint * a _AND _Bigint * b) } _Bigint * -_DEFUN (diff, (ptr, a, b), struct _reent * ptr _AND - _Bigint * a _AND _Bigint * b) +diff (struct _reent * ptr, + _Bigint * a, _Bigint * b) { _Bigint *c; int i, wa, wb; @@ -633,7 +629,7 @@ _DEFUN (diff, (ptr, a, b), struct _reent * ptr _AND } double -_DEFUN (ulp, (_x), double _x) +ulp (double _x) { union double_union x, a; register __Long L; @@ -679,8 +675,7 @@ _DEFUN (ulp, (_x), double _x) } double -_DEFUN (b2d, (a, e), - _Bigint * a _AND int *e) +b2d (_Bigint * a, int *e) { __ULong *xa, *xa0, w, y, z; int k; @@ -756,11 +751,9 @@ ret_d: } _Bigint * -_DEFUN (d2b, - (ptr, _d, e, bits), - struct _reent * ptr _AND - double _d _AND - int *e _AND +d2b (struct _reent * ptr, + double _d, + int *e, int *bits) { @@ -911,7 +904,7 @@ _DEFUN (d2b, #undef d1 double -_DEFUN (ratio, (a, b), _Bigint * a _AND _Bigint * b) +ratio (_Bigint * a, _Bigint * b) { union double_union da, db; @@ -951,7 +944,7 @@ _DEFUN (ratio, (a, b), _Bigint * a _AND _Bigint * b) } -_CONST double +const double tens[] = { 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, @@ -961,23 +954,22 @@ _CONST double }; #if !defined(_DOUBLE_IS_32BITS) && !defined(__v800) -_CONST double bigtens[] = +const double bigtens[] = {1e16, 1e32, 1e64, 1e128, 1e256}; -_CONST double tinytens[] = +const double tinytens[] = {1e-16, 1e-32, 1e-64, 1e-128, 1e-256}; #else -_CONST double bigtens[] = +const double bigtens[] = {1e16, 1e32}; -_CONST double tinytens[] = +const double tinytens[] = {1e-16, 1e-32}; #endif double -_DEFUN (_mprec_log10, (dig), - int dig) +_mprec_log10 (int dig) { double v = 1.0; if (dig < 24) @@ -991,9 +983,8 @@ _DEFUN (_mprec_log10, (dig), } void -_DEFUN (copybits, (c, n, b), - __ULong *c _AND - int n _AND +copybits (__ULong *c, + int n, _Bigint *b) { __ULong *ce, *x, *xe; @@ -1020,8 +1011,7 @@ _DEFUN (copybits, (c, n, b), } __ULong -_DEFUN (any_on, (b, k), - _Bigint *b _AND +any_on (_Bigint *b, int k) { int n, nwds; diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h index 330c3981b..7e9a88be4 100644 --- a/newlib/libc/stdlib/mprec.h +++ b/newlib/libc/stdlib/mprec.h @@ -265,39 +265,6 @@ typedef union { double d; __ULong i[2]; } U; #define INFNAN_CHECK #endif -/* - * NAN_WORD0 and NAN_WORD1 are only referenced in strtod.c. Prior to - * 20050115, they used to be hard-wired here (to 0x7ff80000 and 0, - * respectively), but now are determined by compiling and running - * qnan.c to generate gd_qnan.h, which specifies d_QNAN0 and d_QNAN1. - * Formerly gdtoaimp.h recommended supplying suitable -DNAN_WORD0=... - * and -DNAN_WORD1=... values if necessary. This should still work. - * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.) - */ -#ifdef IEEE_Arith -#ifdef IEEE_MC68k -#define _0 0 -#define _1 1 -#ifndef NAN_WORD0 -#define NAN_WORD0 d_QNAN0 -#endif -#ifndef NAN_WORD1 -#define NAN_WORD1 d_QNAN1 -#endif -#else -#define _0 1 -#define _1 0 -#ifndef NAN_WORD0 -#define NAN_WORD0 d_QNAN1 -#endif -#ifndef NAN_WORD1 -#define NAN_WORD1 d_QNAN0 -#endif -#endif -#else -#undef INFNAN_CHECK -#endif - #ifdef RND_PRODQUOT #define rounded_product(a,b) a = rnd_prod(a, b) #define rounded_quotient(a,b) a = rnd_quot(a, b) @@ -385,26 +352,26 @@ typedef struct _Bigint _Bigint; struct _reent ; struct FPI; -double _EXFUN(ulp,(double x)); -double _EXFUN(b2d,(_Bigint *a , int *e)); -_Bigint * _EXFUN(Balloc,(struct _reent *p, int k)); -void _EXFUN(Bfree,(struct _reent *p, _Bigint *v)); -_Bigint * _EXFUN(multadd,(struct _reent *p, _Bigint *, int, int)); -_Bigint * _EXFUN(s2b,(struct _reent *, const char*, int, int, __ULong)); -_Bigint * _EXFUN(i2b,(struct _reent *,int)); -_Bigint * _EXFUN(mult, (struct _reent *, _Bigint *, _Bigint *)); -_Bigint * _EXFUN(pow5mult, (struct _reent *, _Bigint *, int k)); -int _EXFUN(hi0bits,(__ULong)); -int _EXFUN(lo0bits,(__ULong *)); -_Bigint * _EXFUN(d2b,(struct _reent *p, double d, int *e, int *bits)); -_Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k)); -int _EXFUN(match,(const char**, char*)); -_Bigint * _EXFUN(diff,(struct _reent *p, _Bigint *a, _Bigint *b)); -int _EXFUN(cmp,(_Bigint *a, _Bigint *b)); -int _EXFUN(gethex,(struct _reent *p, _CONST char **sp, _CONST struct FPI *fpi, Long *exp, _Bigint **bp, int sign, locale_t loc)); -double _EXFUN(ratio,(_Bigint *a, _Bigint *b)); -__ULong _EXFUN(any_on,(_Bigint *b, int k)); -void _EXFUN(copybits,(__ULong *c, int n, _Bigint *b)); +double ulp (double x); +double b2d (_Bigint *a , int *e); +_Bigint * Balloc (struct _reent *p, int k); +void Bfree (struct _reent *p, _Bigint *v); +_Bigint * multadd (struct _reent *p, _Bigint *, int, int); +_Bigint * s2b (struct _reent *, const char*, int, int, __ULong); +_Bigint * i2b (struct _reent *,int); +_Bigint * mult (struct _reent *, _Bigint *, _Bigint *); +_Bigint * pow5mult (struct _reent *, _Bigint *, int k); +int hi0bits (__ULong); +int lo0bits (__ULong *); +_Bigint * d2b (struct _reent *p, double d, int *e, int *bits); +_Bigint * lshift (struct _reent *p, _Bigint *b, int k); +int match (const char**, char*); +_Bigint * diff (struct _reent *p, _Bigint *a, _Bigint *b); +int cmp (_Bigint *a, _Bigint *b); +int gethex (struct _reent *p, const char **sp, const struct FPI *fpi, Long *exp, _Bigint **bp, int sign, locale_t loc); +double ratio (_Bigint *a, _Bigint *b); +__ULong any_on (_Bigint *b, int k); +void copybits (__ULong *c, int n, _Bigint *b); double _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, locale_t loc); #if defined (_HAVE_LONG_DOUBLE) && !defined (_LDBL_EQ_DBL) @@ -416,20 +383,20 @@ int _strtodg_l (struct _reent *p, const char *s00, char **se, #endif /* _HAVE_LONG_DOUBLE && !_LDBL_EQ_DBL */ #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) || defined(_SMALL_HEXDIG) -unsigned char _EXFUN(__hexdig_fun,(unsigned char)); +unsigned char __hexdig_fun (unsigned char); #endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ #ifdef INFNAN_CHECK -int _EXFUN(hexnan,(_CONST char **sp, _CONST struct FPI *fpi, __ULong *x0)); +int hexnan (const char **sp, const struct FPI *fpi, __ULong *x0); #endif #define Bcopy(x,y) memcpy((char *)&x->_sign, (char *)&y->_sign, y->_wds*sizeof(__Long) + 2*sizeof(int)) -extern _CONST double tinytens[]; -extern _CONST double bigtens[]; -extern _CONST double tens[]; +extern const double tinytens[]; +extern const double bigtens[]; +extern const double tens[]; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) -extern _CONST unsigned char __hexdig[]; +extern const unsigned char __hexdig[]; #endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */ -double _EXFUN(_mprec_log10,(int)); +double _mprec_log10 (int); diff --git a/newlib/libc/stdlib/mrand48.c b/newlib/libc/stdlib/mrand48.c index 28f4f7d2b..bb1e454c9 100644 --- a/newlib/libc/stdlib/mrand48.c +++ b/newlib/libc/stdlib/mrand48.c @@ -14,8 +14,7 @@ #include "rand48.h" long -_DEFUN (_mrand48_r, (r), - struct _reent *r) +_mrand48_r (struct _reent *r) { _REENT_CHECK_RAND48(r); __dorand48(r, __rand48_seed); @@ -24,7 +23,7 @@ _DEFUN (_mrand48_r, (r), #ifndef _REENT_ONLY long -_DEFUN_VOID (mrand48) +mrand48 (void) { return _mrand48_r (_REENT); } diff --git a/newlib/libc/stdlib/msize.c b/newlib/libc/stdlib/msize.c index e33e4aa37..108550dcd 100644 --- a/newlib/libc/stdlib/msize.c +++ b/newlib/libc/stdlib/msize.c @@ -9,8 +9,7 @@ #ifndef _REENT_ONLY size_t -_DEFUN (malloc_usable_size, (ptr), - _PTR ptr) +malloc_usable_size (void *ptr) { return _malloc_usable_size_r (_REENT, ptr); } diff --git a/newlib/libc/stdlib/mstats.c b/newlib/libc/stdlib/mstats.c index ba89f494d..85c20f1bc 100644 --- a/newlib/libc/stdlib/mstats.c +++ b/newlib/libc/stdlib/mstats.c @@ -25,7 +25,7 @@ INDEX INDEX _mallopt_r -ANSI_SYNOPSIS +SYNOPSIS #include struct mallinfo mallinfo(void); void malloc_stats(void); @@ -35,27 +35,6 @@ ANSI_SYNOPSIS void _malloc_stats_r(void *<[reent]>); int _mallopt_r(void *<[reent]>, int <[parameter]>, <[value]>); -TRAD_SYNOPSIS - #include - struct mallinfo mallinfo(); - - void malloc_stats(); - - int mallopt(<[parameter]>, <[value]>) - int <[parameter]>; - int <[value]>; - - struct mallinfo _mallinfo_r(<[reent]>); - char *<[reent]>; - - void _malloc_stats_r(<[reent]>); - char *<[reent]>; - - int _mallopt_r(<[reent]>, <[parameter]>, <[value]>) - char *<[reent]>; - int <[parameter]>; - int <[value]>; - DESCRIPTION <> returns a structure describing the current state of memory allocation. The structure is defined in malloc.h. The @@ -105,21 +84,20 @@ not portable. #ifndef _REENT_ONLY struct mallinfo -_DEFUN_VOID (mallinfo) +mallinfo (void) { return _mallinfo_r (_REENT); } #if !defined (_ELIX_LEVEL) || _ELIX_LEVEL >= 2 void -_DEFUN_VOID (malloc_stats) +malloc_stats (void) { _malloc_stats_r (_REENT); } int -_DEFUN (mallopt, (p, v), - int p _AND +mallopt (int p, int v) { return _mallopt_r (_REENT, p, v); @@ -136,8 +114,7 @@ _DEFUN (mallopt, (p, v), malloc_stats. */ void -_DEFUN (_mstats_r, (ptr, s), - struct _reent *ptr _AND +_mstats_r (struct _reent *ptr, char *s) { _REENT_SMALL_CHECK_INIT(ptr); @@ -147,8 +124,7 @@ _DEFUN (_mstats_r, (ptr, s), #ifndef _REENT_ONLY void -_DEFUN (mstats, (s), - char *s) +mstats (char *s) { _mstats_r (_REENT, s); } diff --git a/newlib/libc/stdlib/mtrim.c b/newlib/libc/stdlib/mtrim.c index 328eb715e..bf927fa84 100644 --- a/newlib/libc/stdlib/mtrim.c +++ b/newlib/libc/stdlib/mtrim.c @@ -9,8 +9,7 @@ #ifndef _REENT_ONLY int -_DEFUN (malloc_trim, (pad), - size_t pad) +malloc_trim (size_t pad) { return _malloc_trim_r (_REENT, pad); } diff --git a/newlib/libc/stdlib/nano-mallocr.c b/newlib/libc/stdlib/nano-mallocr.c index a0accdd36..13b72c99f 100644 --- a/newlib/libc/stdlib/nano-mallocr.c +++ b/newlib/libc/stdlib/nano-mallocr.c @@ -35,6 +35,7 @@ #include #include #include +#include #if DEBUG #include @@ -150,20 +151,6 @@ typedef struct malloc_chunk struct malloc_chunk * next; }chunk; -/* Copied from malloc.h */ -struct mallinfo -{ - size_t arena; /* total space allocated from system */ - size_t ordblks; /* number of non-inuse chunks */ - size_t smblks; /* unused -- always zero */ - size_t hblks; /* number of mmapped regions */ - size_t hblkhd; /* total space in mmapped regions */ - size_t usmblks; /* unused -- always zero */ - size_t fsmblks; /* unused -- always zero */ - size_t uordblks; /* total allocated space */ - size_t fordblks; /* total non-inuse space */ - size_t keepcost; /* top-most, releasable (via malloc_trim) space */ -}; #define CHUNK_OFFSET ((malloc_size_t)(&(((struct malloc_chunk *)0)->next))) @@ -181,7 +168,6 @@ extern void * nano_malloc(RARG malloc_size_t); extern void nano_free (RARG void * free_p); extern void nano_cfree(RARG void * ptr); extern void * nano_calloc(RARG malloc_size_t n, malloc_size_t elem); -extern struct mallinfo nano_mallinfo(RONEARG); extern void nano_malloc_stats(RONEARG); extern malloc_size_t nano_malloc_usable_size(RARG void * ptr); extern void * nano_realloc(RARG void * ptr, malloc_size_t size); diff --git a/newlib/libc/stdlib/nrand48.c b/newlib/libc/stdlib/nrand48.c index 39e9fb13c..cca0e5f7a 100644 --- a/newlib/libc/stdlib/nrand48.c +++ b/newlib/libc/stdlib/nrand48.c @@ -14,8 +14,7 @@ #include "rand48.h" long -_DEFUN (_nrand48_r, (r, xseed), - struct _reent *r _AND +_nrand48_r (struct _reent *r, unsigned short xseed[3]) { __dorand48 (r, xseed); @@ -25,8 +24,7 @@ _DEFUN (_nrand48_r, (r, xseed), #ifndef _REENT_ONLY long -_DEFUN (nrand48, (xseed), - unsigned short xseed[3]) +nrand48 (unsigned short xseed[3]) { return _nrand48_r (_REENT, xseed); } diff --git a/newlib/libc/stdlib/on_exit.c b/newlib/libc/stdlib/on_exit.c index a405b1b51..2eaf03564 100644 --- a/newlib/libc/stdlib/on_exit.c +++ b/newlib/libc/stdlib/on_exit.c @@ -14,16 +14,10 @@ FUNCTION INDEX on_exit -ANSI_SYNOPSIS +SYNOPSIS #include int on_exit (void (*<[function]>)(int, void *), void *<[arg]>); -TRAD_SYNOPSIS - #include - int on_exit ((<[function]>, <[arg]>) - void (*<[function]>)(int, void *); - void *<[arg]>; - DESCRIPTION You can use <> to enroll functions in a list of functions that will be called when your program terminates normally. The argument is @@ -72,10 +66,8 @@ const void * const __on_exit_dummy = &__on_exit_args; */ int -_DEFUN (on_exit, - (fn, arg), - _VOID _EXFNPTR(fn, (int, _PTR)) _AND - _PTR arg) +on_exit (void (*fn) (int, void *), + void *arg) { return __register_exitproc (__et_onexit, (void (*)(void)) fn, arg, NULL); } diff --git a/newlib/libc/stdlib/putenv.c b/newlib/libc/stdlib/putenv.c index 978f7c5d6..7a8d7f7d3 100644 --- a/newlib/libc/stdlib/putenv.c +++ b/newlib/libc/stdlib/putenv.c @@ -23,8 +23,7 @@ #include int -_DEFUN (putenv, (str), - char *str) +putenv (char *str) { return _putenv_r (_REENT, str); } diff --git a/newlib/libc/stdlib/putenv_r.c b/newlib/libc/stdlib/putenv_r.c index a0f476721..8c23a823d 100644 --- a/newlib/libc/stdlib/putenv_r.c +++ b/newlib/libc/stdlib/putenv_r.c @@ -31,8 +31,7 @@ or replaces the environment variable "name" with "value" which is specified by str as "name=value". */ int -_DEFUN (_putenv_r, (reent_ptr, str), - struct _reent *reent_ptr _AND +_putenv_r (struct _reent *reent_ptr, char *str) { register char *p, *equal; diff --git a/newlib/libc/stdlib/rand.c b/newlib/libc/stdlib/rand.c index 42acde4aa..209cb32ff 100644 --- a/newlib/libc/stdlib/rand.c +++ b/newlib/libc/stdlib/rand.c @@ -9,23 +9,12 @@ INDEX INDEX rand_r -ANSI_SYNOPSIS +SYNOPSIS #include int rand(void); void srand(unsigned int <[seed]>); int rand_r(unsigned int *<[seed]>); -TRAD_SYNOPSIS - #include - int rand(); - - void srand(<[seed]>) - unsigned int <[seed]>; - - void rand_r(<[seed]>) - unsigned int *<[seed]>; - - DESCRIPTION <> returns a different integer each time it is called; each integer is chosen by an algorithm designed to be unpredictable, so @@ -70,7 +59,7 @@ on two different systems. #include void -_DEFUN (srand, (seed), unsigned int seed) +srand (unsigned int seed) { struct _reent *reent = _REENT; @@ -79,7 +68,7 @@ _DEFUN (srand, (seed), unsigned int seed) } int -_DEFUN_VOID (rand) +rand (void) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdlib/rand48.c b/newlib/libc/stdlib/rand48.c index af2be3c07..626b3ef84 100644 --- a/newlib/libc/stdlib/rand48.c +++ b/newlib/libc/stdlib/rand48.c @@ -36,7 +36,7 @@ INDEX INDEX lcong48 -ANSI_SYNOPSIS +SYNOPSIS #include double drand48(void); double erand48(unsigned short <[xseed]>[3]); @@ -48,32 +48,6 @@ ANSI_SYNOPSIS unsigned short *seed48(unsigned short <[xseed]>[3]); void lcong48(unsigned short <[p]>[7]); -TRAD_SYNOPSIS - #include - double drand48(); - - double erand48(<[xseed]>) - unsigned short <[xseed]>[3]; - - long lrand48(); - - long nrand48(<[xseed]>) - unsigned short <[xseed]>[3]; - - long mrand48(); - - long jrand48(<[xseed]>) - unsigned short <[xseed]>[3]; - - void srand48(<[seed]>) - long <[seed]>; - - unsigned short *seed48(<[xseed]>) - unsigned short <[xseed]>[3]; - - void lcong48(<[p]>) - unsigned short <[p]>[7]; - DESCRIPTION The <> family of functions generates pseudo-random numbers using a linear congruential algorithm working on integers 48 bits in size. @@ -156,8 +130,7 @@ No supporting OS subroutines are required. #include "rand48.h" void -_DEFUN (__dorand48, (r, xseed), - struct _reent *r _AND +__dorand48 (struct _reent *r, unsigned short xseed[3]) { unsigned long accu; diff --git a/newlib/libc/stdlib/rand48.h b/newlib/libc/stdlib/rand48.h index a6cb479ef..26455e35a 100644 --- a/newlib/libc/stdlib/rand48.h +++ b/newlib/libc/stdlib/rand48.h @@ -17,7 +17,7 @@ #include #include -extern void _EXFUN(__dorand48,(struct _reent *r, unsigned short[3])); +extern void __dorand48 (struct _reent *r, unsigned short[3]); #define __rand48_seed _REENT_RAND48_SEED(r) #define __rand48_mult _REENT_RAND48_MULT(r) #define __rand48_add _REENT_RAND48_ADD(r) diff --git a/newlib/libc/stdlib/rand_r.c b/newlib/libc/stdlib/rand_r.c index 437739ef5..0670285a0 100644 --- a/newlib/libc/stdlib/rand_r.c +++ b/newlib/libc/stdlib/rand_r.c @@ -22,7 +22,7 @@ */ int -_DEFUN (rand_r, (seed), unsigned int *seed) +rand_r (unsigned int *seed) { long k; long s = (long)(*seed); diff --git a/newlib/libc/stdlib/random.c b/newlib/libc/stdlib/random.c index de132f363..131dc056c 100644 --- a/newlib/libc/stdlib/random.c +++ b/newlib/libc/stdlib/random.c @@ -7,7 +7,7 @@ INDEX INDEX srandom -ANSI_SYNOPSIS +SYNOPSIS #define _XOPEN_SOURCE 500 #include long int random(void); @@ -57,7 +57,7 @@ algorithm as <>. #include void -_DEFUN (srandom, (seed), unsigned int seed) +srandom (unsigned int seed) { struct _reent *reent = _REENT; @@ -66,7 +66,7 @@ _DEFUN (srandom, (seed), unsigned int seed) } long int -_DEFUN_VOID (random) +random (void) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdlib/realloc.c b/newlib/libc/stdlib/realloc.c index 2caa6e4d2..999e8e00b 100644 --- a/newlib/libc/stdlib/realloc.c +++ b/newlib/libc/stdlib/realloc.c @@ -1,5 +1,5 @@ #ifdef MALLOC_PROVIDED -int _dummy_calloc = 1; +int _dummy_realloc = 1; #else /* realloc.c -- a wrapper for realloc_r. */ @@ -10,9 +10,8 @@ int _dummy_calloc = 1; #ifndef _REENT_ONLY -_PTR -_DEFUN (realloc, (ap, nbytes), - _PTR ap _AND +void * +realloc (void *ap, size_t nbytes) { return _realloc_r (_REENT, ap, nbytes); diff --git a/newlib/libc/stdlib/reallocf.c b/newlib/libc/stdlib/reallocf.c index a9d329398..d62752a80 100644 --- a/newlib/libc/stdlib/reallocf.c +++ b/newlib/libc/stdlib/reallocf.c @@ -30,10 +30,9 @@ #include -_PTR -_DEFUN (_reallocf_r, (reentptr, ptr, size), - struct _reent *reentptr _AND - _PTR ptr _AND +void * +_reallocf_r (struct _reent *reentptr, + void *ptr, size_t size) { void *nptr; @@ -45,9 +44,8 @@ _DEFUN (_reallocf_r, (reentptr, ptr, size), } #ifndef _REENT_ONLY -_PTR -_DEFUN (reallocf, (ptr, size), - _PTR ptr _AND +void * +reallocf (void *ptr, size_t size) { return _reallocf_r(_REENT, ptr, size); diff --git a/newlib/libc/stdlib/rpmatch.c b/newlib/libc/stdlib/rpmatch.c index 0bbdf43ed..42a351343 100644 --- a/newlib/libc/stdlib/rpmatch.c +++ b/newlib/libc/stdlib/rpmatch.c @@ -5,15 +5,10 @@ FUNCTION INDEX rpmatch -ANSI_SYNOPSIS +SYNOPSIS #include int rpmatch(const char *<[response]>); -TRAD_SYNOPSIS - #include - int rpmatch(<[response]>) - const char *<[response]>; - DESCRIPTION The <> function determines whether <[response]> is an affirmative or negative response to a question according to the current locale. @@ -64,8 +59,7 @@ No supporting OS subroutines are required. #include int -_DEFUN(rpmatch, (response), - const char *response) +rpmatch (const char *response) { regex_t yes, no; int ret; diff --git a/newlib/libc/stdlib/seed48.c b/newlib/libc/stdlib/seed48.c index 43629cc40..25f0e501e 100644 --- a/newlib/libc/stdlib/seed48.c +++ b/newlib/libc/stdlib/seed48.c @@ -14,8 +14,7 @@ #include "rand48.h" unsigned short * -_DEFUN (_seed48_r, (r, xseed), - struct _reent *r _AND +_seed48_r (struct _reent *r, unsigned short xseed[3]) { static unsigned short sseed[3]; @@ -36,8 +35,7 @@ _DEFUN (_seed48_r, (r, xseed), #ifndef _REENT_ONLY unsigned short * -_DEFUN (seed48, (xseed), - unsigned short xseed[3]) +seed48 (unsigned short xseed[3]) { return _seed48_r (_REENT, xseed); } diff --git a/newlib/libc/stdlib/setenv.c b/newlib/libc/stdlib/setenv.c index d423678f3..b0c1585d4 100644 --- a/newlib/libc/stdlib/setenv.c +++ b/newlib/libc/stdlib/setenv.c @@ -23,7 +23,7 @@ #include #include -extern int _unsetenv_r _PARAMS ((struct _reent *, const char *)); +extern int _unsetenv_r (struct _reent *, const char *); /* * setenv -- @@ -32,9 +32,8 @@ extern int _unsetenv_r _PARAMS ((struct _reent *, const char *)); */ int -_DEFUN (setenv, (name, value, rewrite), - _CONST char *name _AND - _CONST char *value _AND +setenv (const char *name, + const char *value, int rewrite) { return _setenv_r (_REENT, name, value, rewrite); @@ -45,8 +44,7 @@ _DEFUN (setenv, (name, value, rewrite), * Delete environmental variable "name". */ int -_DEFUN (unsetenv, (name), - _CONST char *name) +unsetenv (const char *name) { return _unsetenv_r (_REENT, name); } diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c index c32c6aca9..f1f885789 100644 --- a/newlib/libc/stdlib/setenv_r.c +++ b/newlib/libc/stdlib/setenv_r.c @@ -38,7 +38,7 @@ extern char **environ; static char ***p_environ = &environ; /* _findenv_r is defined in getenv_r.c. */ -extern char *_findenv_r _PARAMS ((struct _reent *, const char *, int *)); +extern char *_findenv_r (struct _reent *, const char *, int *); /* * _setenv_r -- @@ -49,10 +49,9 @@ extern char *_findenv_r _PARAMS ((struct _reent *, const char *, int *)); */ int -_DEFUN (_setenv_r, (reent_ptr, name, value, rewrite), - struct _reent *reent_ptr _AND - _CONST char *name _AND - _CONST char *value _AND +_setenv_r (struct _reent *reent_ptr, + const char *name, + const char *value, int rewrite) { static int alloced; /* if allocated space before */ @@ -133,9 +132,8 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite), * Delete environmental variable "name". */ int -_DEFUN (_unsetenv_r, (reent_ptr, name), - struct _reent *reent_ptr _AND - _CONST char *name) +_unsetenv_r (struct _reent *reent_ptr, + const char *name) { register char **P; int offset; diff --git a/newlib/libc/stdlib/srand48.c b/newlib/libc/stdlib/srand48.c index 69bdbfc3b..573f62018 100644 --- a/newlib/libc/stdlib/srand48.c +++ b/newlib/libc/stdlib/srand48.c @@ -13,9 +13,8 @@ #include "rand48.h" -_VOID -_DEFUN (_srand48_r, (r, seed), - struct _reent *r _AND +void +_srand48_r (struct _reent *r, long seed) { _REENT_CHECK_RAND48(r); @@ -29,9 +28,8 @@ _DEFUN (_srand48_r, (r, seed), } #ifndef _REENT_ONLY -_VOID -_DEFUN (srand48, (seed), - long seed) +void +srand48 (long seed) { _srand48_r (_REENT, seed); } diff --git a/newlib/libc/stdlib/std.h b/newlib/libc/stdlib/std.h index b20820be4..c000a67c6 100644 --- a/newlib/libc/stdlib/std.h +++ b/newlib/libc/stdlib/std.h @@ -22,12 +22,6 @@ #define ESIGN 0x02 #define DECP 0x04 -#ifdef _HAVE_STDC int __ten_mul(double *acc, int digit); double __adjust(struct _reent *ptr, double *acc, int dexp, int sign); double __exp10(unsigned x); -#else -int __ten_mul(); -double __adjust(); -double __exp10(); -#endif diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index 82e847c40..8bb75ef0a 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -23,7 +23,7 @@ INDEX INDEX _strtod_r -ANSI_SYNOPSIS +SYNOPSIS #include double strtod(const char *restrict <[str]>, char **restrict <[tail]>); float strtof(const char *restrict <[str]>, char **restrict <[tail]>); @@ -42,21 +42,6 @@ ANSI_SYNOPSIS double _strtod_r(void *<[reent]>, const char *restrict <[str]>, char **restrict <[tail]>); -TRAD_SYNOPSIS - #include - double strtod(<[str]>,<[tail]>) - char *<[str]>; - char **<[tail]>; - - float strtof(<[str]>,<[tail]>) - char *<[str]>; - char **<[tail]>; - - double _strtod_r(<[reent]>,<[str]>,<[tail]>) - char *<[reent]>; - char *<[str]>; - char **<[tail]>; - DESCRIPTION <>, <>, <> parse the character string <[str]>, producing a substring which can be converted to a double, @@ -152,7 +137,6 @@ THIS SOFTWARE. #include #include "mprec.h" #include "gdtoa.h" -#include "gd_qnan.h" #include "../locale/setlocale.h" /* #ifndef NO_FENV_H */ @@ -167,7 +151,7 @@ THIS SOFTWARE. #undef tinytens /* The factor of 2^106 in tinytens[4] helps us avoid setting the underflow */ /* flag unnecessarily. It leads to a song and dance at the end of strtod. */ -static _CONST double tinytens[] = { 1e-16, 1e-32, +static const double tinytens[] = { 1e-16, 1e-32, #ifdef _DOUBLE_IS_32BITS 0.0, 0.0, 0.0 #else @@ -187,10 +171,17 @@ static _CONST double tinytens[] = { 1e-16, 1e-32, #define Rounding Flt_Rounds #endif +#ifdef IEEE_MC68k +#define _0 0 +#define _1 1 +#else +#define _0 1 +#define _1 0 +#endif + #ifdef Avoid_Underflow /*{*/ static double -_DEFUN (sulp, (x, scale), - U x _AND +sulp (U x, int scale) { U u; @@ -212,10 +203,9 @@ _DEFUN (sulp, (x, scale), #ifndef NO_HEX_FP static void -_DEFUN (ULtod, (L, bits, exp, k), - __ULong *L _AND - __ULong *bits _AND - Long exp _AND +ULtod (__ULong *L, + __ULong *bits, + Long exp, int k) { switch(k & STRTOG_Retmask) { @@ -258,7 +248,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, #endif int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, dsign, e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; - _CONST char *s, *s0, *s1; + const char *s, *s0, *s1; double aadj, adj; U aadj1, rv, rv0; Long L; @@ -273,8 +263,8 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, #ifdef Honor_FLT_ROUNDS int rounding; #endif - struct lconv *lconv = __localeconv_l (loc); - int dec_len = strlen (lconv->decimal_point); + const char *decimal_point = __get_numeric_locale(loc)->decimal_point; + int dec_len = strlen (decimal_point); delta = bs = bd = NULL; sign = nz0 = nz = decpt = 0; @@ -303,7 +293,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, if (*s == '0') { #ifndef NO_HEX_FP { - static _CONST FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; + static const FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; Long exp; __ULong bits[2]; switch(s[1]) { @@ -354,7 +344,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, else z = 10*z + c - '0'; nd0 = nd; - if (strncmp (s, lconv->decimal_point, dec_len) == 0) + if (strncmp (s, decimal_point, dec_len) == 0) { decpt = 1; c = *(s += dec_len); @@ -430,7 +420,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, #ifdef INFNAN_CHECK /* Check for Nan and Infinity */ __ULong bits[2]; - static _CONST FPI fpinan = /* only 52 explicit bits */ + static const FPI fpinan = /* only 52 explicit bits */ { 52, 1-1023-53+1, 2046-1023-53+1, 1, SI }; if (!decpt) switch(c) { @@ -461,10 +451,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, } else { #endif - dword0(rv) = NAN_WORD0; -#ifndef _DOUBLE_IS_32BITS - dword1(rv) = NAN_WORD1; -#endif /*!_DOUBLE_IS_32BITS*/ + dval(rv) = nan (""); #ifndef No_Hex_NaN } #endif @@ -1203,7 +1190,16 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, #endif if (y == z) { /* Can we stop now? */ +#ifndef _DOUBLE_IS_32BITS + /* If FE_INVALID floating point exceptions are + enabled, a conversion to a 32 bit value is + dangerous. A positive double value can result + in a negative 32 bit int, thus raising SIGFPE. + To avoid this, always convert into 64 bit here. */ + __int64_t L = (__int64_t)aadj; +#else L = (Long)aadj; +#endif aadj -= L; /* The tolerances below are conservative. */ if (dsign || dword1(rv) || dword0(rv) & Bndry_mask) { @@ -1267,9 +1263,8 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, } double -_DEFUN (_strtod_r, (ptr, s00, se), - struct _reent *ptr _AND - _CONST char *__restrict s00 _AND +_strtod_r (struct _reent *ptr, + const char *__restrict s00, char **__restrict se) { return _strtod_l (ptr, s00, se, __get_current_locale ()); @@ -1284,8 +1279,7 @@ strtod_l (const char *__restrict s00, char **__restrict se, locale_t loc) } double -_DEFUN (strtod, (s00, se), - _CONST char *__restrict s00 _AND char **__restrict se) +strtod (const char *__restrict s00, char **__restrict se) { return _strtod_l (_REENT, s00, se, __get_current_locale ()); } @@ -1295,7 +1289,7 @@ strtof_l (const char *__restrict s00, char **__restrict se, locale_t loc) { double val = _strtod_l (_REENT, s00, se, loc); if (isnan (val)) - return nanf (NULL); + return signbit (val) ? -nanf ("") : nanf (""); float retval = (float) val; #ifndef NO_ERRNO if (isinf (retval) && !isinf (val)) @@ -1305,13 +1299,12 @@ strtof_l (const char *__restrict s00, char **__restrict se, locale_t loc) } float -_DEFUN (strtof, (s00, se), - _CONST char *__restrict s00 _AND +strtof (const char *__restrict s00, char **__restrict se) { double val = _strtod_l (_REENT, s00, se, __get_current_locale ()); if (isnan (val)) - return nanf (NULL); + return signbit (val) ? -nanf ("") : nanf (""); float retval = (float) val; #ifndef NO_ERRNO if (isinf (retval) && !isinf (val)) diff --git a/newlib/libc/stdlib/strtodg.c b/newlib/libc/stdlib/strtodg.c index d8546c336..013315946 100644 --- a/newlib/libc/stdlib/strtodg.c +++ b/newlib/libc/stdlib/strtodg.c @@ -35,7 +35,6 @@ THIS SOFTWARE. #include #include "mprec.h" #include "gdtoa.h" -#include "gd_qnan.h" #include "locale.h" @@ -420,8 +419,8 @@ _strtodg_l (struct _reent *p, const char *s00, char **se, FPI *fpi, Long *exp, Long L; __ULong y, z; _Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0; - struct lconv *lconv = __localeconv_l (loc); - int dec_len = strlen (lconv->decimal_point); + const char *decimal_point = __get_numeric_locale(loc)->decimal_point; + int dec_len = strlen (decimal_point); irv = STRTOG_Zero; denorm = sign = nz0 = nz = 0; @@ -480,7 +479,7 @@ _strtodg_l (struct _reent *p, const char *s00, char **se, FPI *fpi, Long *exp, z = 10*z + c - '0'; nd0 = nd; #ifdef USE_LOCALE - if (strncmp (s, lconv->decimal_point, dec_len) == 0) + if (strncmp (s, decimal_point, dec_len) == 0) #else if (c == '.') #endif @@ -688,13 +687,13 @@ _strtodg_l (struct _reent *p, const char *s00, char **se, FPI *fpi, Long *exp, dval(rv) *= tens[i]; if (e1 &= ~15) { e1 >>= 4; - while(e1 >= (1 << n_bigtens-1)) { + while(e1 >= (1 << (n_bigtens-1))) { e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; word0(rv) &= ~Exp_mask; word0(rv) |= Bias << Exp_shift1; dval(rv) *= bigtens[n_bigtens-1]; - e1 -= 1 << n_bigtens-1; + e1 -= 1 << (n_bigtens-1); } e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; word0(rv) &= ~Exp_mask; @@ -710,13 +709,13 @@ _strtodg_l (struct _reent *p, const char *s00, char **se, FPI *fpi, Long *exp, dval(rv) /= tens[i]; if (e1 &= ~15) { e1 >>= 4; - while(e1 >= (1 << n_bigtens-1)) { + while(e1 >= (1 << (n_bigtens-1))) { e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; word0(rv) &= ~Exp_mask; word0(rv) |= Bias << Exp_shift1; dval(rv) *= tinytens[n_bigtens-1]; - e1 -= 1 << n_bigtens-1; + e1 -= 1 << (n_bigtens-1); } e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; word0(rv) &= ~Exp_mask; @@ -912,7 +911,7 @@ _strtodg_l (struct _reent *p, const char *s00, char **se, FPI *fpi, Long *exp, } else irv = STRTOG_Normal | STRTOG_Inexhi; - if (bbbits < nbits && !denorm || !(rvb->_x[0] & 1)) + if ((bbbits < nbits && !denorm) || !(rvb->_x[0] & 1)) break; if (dsign) { rvb = increment(p, rvb); diff --git a/newlib/libc/stdlib/strtoimax.c b/newlib/libc/stdlib/strtoimax.c index b0efa3e51..c3f27df2e 100644 --- a/newlib/libc/stdlib/strtoimax.c +++ b/newlib/libc/stdlib/strtoimax.c @@ -60,11 +60,11 @@ static intmax_t _strtoimax_l(struct _reent *rptr, const char * __restrict nptr, char ** __restrict endptr, int base, locale_t loc) { - const char *s = (const unsigned char *)nptr; - uintmax_t acc; + const char *s = nptr; + uintmax_t acc = 0; char c; uintmax_t cutoff; - int neg = 0, any, cutlim; + int neg = 0, any = 0, cutlim; /* * Skip white space and pick up leading +/- sign if any. @@ -91,6 +91,9 @@ _strtoimax_l(struct _reent *rptr, const char * __restrict nptr, if (base == 0) base = c == '0' ? 8 : 10; + if (base < 2 || base > 36) + goto noconv; + /* * Compute the cutoff value between legal numbers and illegal * numbers. That is the largest legal value, divided by the diff --git a/newlib/libc/stdlib/strtol.c b/newlib/libc/stdlib/strtol.c index 276ad1340..f7572b169 100644 --- a/newlib/libc/stdlib/strtol.c +++ b/newlib/libc/stdlib/strtol.c @@ -11,7 +11,7 @@ INDEX INDEX _strtol_r -ANSI_SYNOPSIS +SYNOPSIS #include long strtol(const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); @@ -23,19 +23,6 @@ ANSI_SYNOPSIS long _strtol_r(void *<[reent]>, const char *restrict <[s]>, char **restrict <[ptr]>,int <[base]>); -TRAD_SYNOPSIS - #include - long strtol (<[s]>, <[ptr]>, <[base]>) - char *<[s]>; - char **<[ptr]>; - int <[base]>; - - long _strtol_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to a <>. First, it breaks down the string into three parts: @@ -225,10 +212,9 @@ _strtol_l (struct _reent *rptr, const char *__restrict nptr, } long -_DEFUN (_strtol_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST char *__restrict nptr _AND - char **__restrict endptr _AND +_strtol_r (struct _reent *rptr, + const char *__restrict nptr, + char **__restrict endptr, int base) { return _strtol_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -244,9 +230,8 @@ strtol_l (const char *__restrict s, char **__restrict ptr, int base, } long -_DEFUN (strtol, (s, ptr, base), - _CONST char *__restrict s _AND - char **__restrict ptr _AND +strtol (const char *__restrict s, + char **__restrict ptr, int base) { return _strtol_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/strtoll.c b/newlib/libc/stdlib/strtoll.c index e61a62a7d..295886e8f 100644 --- a/newlib/libc/stdlib/strtoll.c +++ b/newlib/libc/stdlib/strtoll.c @@ -11,7 +11,7 @@ INDEX INDEX _strtoll_r -ANSI_SYNOPSIS +SYNOPSIS #include long long strtoll(const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); @@ -25,19 +25,6 @@ ANSI_SYNOPSIS const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - long long strtoll (<[s]>, <[ptr]>, <[base]>) - const char *<[s]>; - char **<[ptr]>; - int <[base]>; - - long long _strtoll_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) - char *<[reent]>; - const char *<[s]>; - char **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to a <>. First, it breaks down the string into three parts: @@ -146,7 +133,7 @@ No supporting OS subroutines are required. * Convert a string to a long long integer. */ static long long -_strtoll_l (struct _reent *rptr, _CONST char *__restrict nptr, +_strtoll_l (struct _reent *rptr, const char *__restrict nptr, char **__restrict endptr, int base, locale_t loc) { register const unsigned char *s = (const unsigned char *)nptr; @@ -227,10 +214,9 @@ _strtoll_l (struct _reent *rptr, _CONST char *__restrict nptr, } long long -_DEFUN (_strtoll_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST char *__restrict nptr _AND - char **__restrict endptr _AND +_strtoll_r (struct _reent *rptr, + const char *__restrict nptr, + char **__restrict endptr, int base) { return _strtoll_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -246,9 +232,8 @@ strtoll_l (const char *__restrict s, char **__restrict ptr, int base, } long long -_DEFUN (strtoll, (s, ptr, base), - _CONST char *__restrict s _AND - char **__restrict ptr _AND +strtoll (const char *__restrict s, + char **__restrict ptr, int base) { return _strtoll_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c index aeeb25066..4faed8542 100644 --- a/newlib/libc/stdlib/strtorx.c +++ b/newlib/libc/stdlib/strtorx.c @@ -35,13 +35,9 @@ THIS SOFTWARE. #include #include "mprec.h" #include "gdtoa.h" -#include "gd_qnan.h" #if defined (_HAVE_LONG_DOUBLE) && !defined (_LDBL_EQ_DBL) -#undef _0 -#undef _1 - /* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ #ifdef IEEE_MC68k @@ -93,11 +89,7 @@ ULtox(__UShort *L, __ULong *bits, Long exp, int k) break; case STRTOG_NaN: - L[0] = ldus_QNAN0; - L[1] = ldus_QNAN1; - L[2] = ldus_QNAN2; - L[3] = ldus_QNAN3; - L[4] = ldus_QNAN4; + *((long double*)L) = __builtin_nanl (""); } if (k & STRTOG_Neg) L[_0] |= 0x8000; diff --git a/newlib/libc/stdlib/strtoul.c b/newlib/libc/stdlib/strtoul.c index aa5897e13..f2fba37f2 100644 --- a/newlib/libc/stdlib/strtoul.c +++ b/newlib/libc/stdlib/strtoul.c @@ -11,7 +11,7 @@ INDEX INDEX _strtoul_r -ANSI_SYNOPSIS +SYNOPSIS #include unsigned long strtoul(const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); @@ -24,19 +24,6 @@ ANSI_SYNOPSIS unsigned long _strtoul_r(void *<[reent]>, const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - unsigned long strtoul(<[s]>, <[ptr]>, <[base]>) - char *<[s]>; - char **<[ptr]>; - int <[base]>; - - unsigned long _strtoul_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to an <>. First, it breaks down the string into three parts: @@ -204,10 +191,9 @@ _strtoul_l (struct _reent *rptr, const char *__restrict nptr, } unsigned long -_DEFUN (_strtoul_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST char *__restrict nptr _AND - char **__restrict endptr _AND +_strtoul_r (struct _reent *rptr, + const char *__restrict nptr, + char **__restrict endptr, int base) { return _strtoul_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -223,9 +209,8 @@ strtoul_l (const char *__restrict s, char **__restrict ptr, int base, } unsigned long -_DEFUN (strtoul, (s, ptr, base), - _CONST char *__restrict s _AND - char **__restrict ptr _AND +strtoul (const char *__restrict s, + char **__restrict ptr, int base) { return _strtoul_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/strtoull.c b/newlib/libc/stdlib/strtoull.c index ba6452e62..ce4de6e7e 100644 --- a/newlib/libc/stdlib/strtoull.c +++ b/newlib/libc/stdlib/strtoull.c @@ -8,7 +8,7 @@ INDEX INDEX strtoull_l -ANSI_SYNOPSIS +SYNOPSIS #include unsigned long long strtoull(const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); @@ -22,19 +22,6 @@ ANSI_SYNOPSIS const char *restrict <[s]>, char **restrict <[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - unsigned long long strtoull(<[s]>, <[ptr]>, <[base]>) - char *<[s]>; - char **<[ptr]>; - int <[base]>; - - unsigned long long _strtoull_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) - char *<[reent]>; - char *<[s]>; - char **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the string <<*<[s]>>> to an <>. First, it breaks down the string into three parts: @@ -202,10 +189,9 @@ _strtoull_l (struct _reent *rptr, const char *__restrict nptr, } unsigned long long -_DEFUN (_strtoull_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST char *__restrict nptr _AND - char **__restrict endptr _AND +_strtoull_r (struct _reent *rptr, + const char *__restrict nptr, + char **__restrict endptr, int base) { return _strtoull_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -221,9 +207,8 @@ strtoull_l (const char *__restrict s, char **__restrict ptr, int base, } unsigned long long -_DEFUN (strtoull, (s, ptr, base), - _CONST char *__restrict s _AND - char **__restrict ptr _AND +strtoull (const char *__restrict s, + char **__restrict ptr, int base) { return _strtoull_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/strtoumax.c b/newlib/libc/stdlib/strtoumax.c index aa4a0ac42..cf1a427fe 100644 --- a/newlib/libc/stdlib/strtoumax.c +++ b/newlib/libc/stdlib/strtoumax.c @@ -60,7 +60,7 @@ static uintmax_t _strtoumax_l(struct _reent *rptr, const char * __restrict nptr, char ** __restrict endptr, int base, locale_t loc) { - const char *s = (const unsigned char *)nptr; + const char *s = nptr; uintmax_t acc; char c; uintmax_t cutoff; diff --git a/newlib/libc/stdlib/system.c b/newlib/libc/stdlib/system.c index 135a9d05b..f30b7df80 100644 --- a/newlib/libc/stdlib/system.c +++ b/newlib/libc/stdlib/system.c @@ -7,21 +7,12 @@ INDEX INDEX _system_r -ANSI_SYNOPSIS +SYNOPSIS #include int system(char *<[s]>); int _system_r(void *<[reent]>, char *<[s]>); -TRAD_SYNOPSIS - #include - int system(<[s]>) - char *<[s]>; - - int _system_r(<[reent]>, <[s]>) - char *<[reent]>; - char *<[s]>; - DESCRIPTION Use <> to pass a command string <<*<[s]>>> to <> on @@ -62,13 +53,12 @@ Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>, #include #if defined (unix) || defined (__CYGWIN__) -static int _EXFUN(do_system, (struct _reent *ptr _AND _CONST char *s)); +static int do_system (struct _reent *ptr, const char *s); #endif int -_DEFUN(_system_r, (ptr, s), - struct _reent *ptr _AND - _CONST char *s) +_system_r (struct _reent *ptr, + const char *s) { #if defined(HAVE_SYSTEM) return _system (s); @@ -102,8 +92,7 @@ _DEFUN(_system_r, (ptr, s), #ifndef _REENT_ONLY int -_DEFUN(system, (s), - _CONST char *s) +system (const char *s) { return _system_r (_REENT, s); } @@ -119,9 +108,8 @@ extern char **environ; static char ***p_environ = &environ; static int -_DEFUN(do_system, (ptr, s), - struct _reent *ptr _AND - _CONST char *s) +do_system (struct _reent *ptr, + const char *s) { char *argv[4]; int pid, status; @@ -151,9 +139,8 @@ _DEFUN(do_system, (ptr, s), #if defined (__CYGWIN__) static int -_DEFUN(do_system, (ptr, s), - struct _reent *ptr _AND - _CONST char *s) +do_system (struct _reent *ptr, + const char *s) { char *argv[4]; int pid, status; diff --git a/newlib/libc/stdlib/utoa.c b/newlib/libc/stdlib/utoa.c index 7738c2321..5ef304ce4 100644 --- a/newlib/libc/stdlib/utoa.c +++ b/newlib/libc/stdlib/utoa.c @@ -5,7 +5,7 @@ FUNCTION INDEX utoa -ANSI_SYNOPSIS +SYNOPSIS #include char *utoa(unsigned <[value]>, char *<[str]>, int <[base]>); char *__utoa(unsigned <[value]>, char *<[str]>, int <[base]>); @@ -28,9 +28,8 @@ No supporting OS subroutine calls are required. #include char * -_DEFUN (__utoa, (value, str, base), - unsigned value _AND - char *str _AND +__utoa (unsigned value, + char *str, int base) { const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; @@ -67,9 +66,8 @@ _DEFUN (__utoa, (value, str, base), } char * -_DEFUN (utoa, (value, str, base), - unsigned value _AND - char *str _AND +utoa (unsigned value, + char *str, int base) { return __utoa (value, str, base); diff --git a/newlib/libc/stdlib/valloc.c b/newlib/libc/stdlib/valloc.c index 26a44df44..025386663 100644 --- a/newlib/libc/stdlib/valloc.c +++ b/newlib/libc/stdlib/valloc.c @@ -8,16 +8,14 @@ #ifndef _REENT_ONLY -_PTR -_DEFUN (valloc, (nbytes), - size_t nbytes) +void * +valloc (size_t nbytes) { return _valloc_r (_REENT, nbytes); } -_PTR -_DEFUN (pvalloc, (nbytes), - size_t nbytes) +void * +pvalloc (size_t nbytes) { return _pvalloc_r (_REENT, nbytes); } diff --git a/newlib/libc/stdlib/wcrtomb.c b/newlib/libc/stdlib/wcrtomb.c index df7741a8c..97436cb74 100644 --- a/newlib/libc/stdlib/wcrtomb.c +++ b/newlib/libc/stdlib/wcrtomb.c @@ -7,10 +7,9 @@ #include "local.h" size_t -_DEFUN (_wcrtomb_r, (ptr, s, wc, ps), - struct _reent *ptr _AND - char *s _AND - wchar_t wc _AND +_wcrtomb_r (struct _reent *ptr, + char *s, + wchar_t wc, mbstate_t *ps) { int retval = 0; @@ -41,9 +40,8 @@ _DEFUN (_wcrtomb_r, (ptr, s, wc, ps), #ifndef _REENT_ONLY size_t -_DEFUN (wcrtomb, (s, wc, ps), - char *__restrict s _AND - wchar_t wc _AND +wcrtomb (char *__restrict s, + wchar_t wc, mbstate_t *__restrict ps) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/stdlib/wcsnrtombs.c b/newlib/libc/stdlib/wcsnrtombs.c index 8e5c38703..43dd2f3e6 100644 --- a/newlib/libc/stdlib/wcsnrtombs.c +++ b/newlib/libc/stdlib/wcsnrtombs.c @@ -11,7 +11,7 @@ INDEX INDEX _wcsnrtombs_r -ANSI_SYNOPSIS +SYNOPSIS #include size_t wcsrtombs(char *__restrict <[dst]>, const wchar_t **__restrict <[src]>, size_t <[len]>, @@ -33,39 +33,6 @@ ANSI_SYNOPSIS const wchar_t **<[src]>, size_t <[nwc]>, size_t <[len]>, mbstate_t *<[ps]>); -TRAD_SYNOPSIS - #include - size_t wcsrtombs(<[dst]>, <[src]>, <[len]>, <[ps]>) - char *__restrict <[dst]>; - const wchar_t **__restrict <[src]>; - size_t <[len]>; - mbstate_t *__restrict <[ps]>; - - #include - size_t _wcsrtombs_r(<[ptr]>, <[dst]>, <[src]>, <[len]>, <[ps]>) - struct _rent *<[ptr]>; - char *<[dst]>; - const wchar_t **<[src]>; - size_t <[len]>; - mbstate_t *<[ps]>; - - #include - size_t wcsnrtombs(<[dst]>, <[src]>, <[nwc]>, <[len]>, <[ps]>) - char *__restrict <[dst]>; - const wchar_t **__restrict <[src]>; - size_t <[nwc]>; - size_t <[len]>; - mbstate_t *__restrict <[ps]>; - - #include - size_t _wcsnrtombs_r(<[ptr]>, <[dst]>, <[src]>, <[nwc]>, <[len]>, <[ps]>) - struct _rent *<[ptr]>; - char *<[dst]>; - const wchar_t **<[src]>; - size_t <[nwc]>; - size_t <[len]>; - mbstate_t *<[ps]>; - DESCRIPTION The <> function converts a string of wide characters indirectly pointed to by <[src]> to a corresponding multibyte character string stored in @@ -171,12 +138,11 @@ _wcsnrtombs_l (struct _reent *r, char *dst, const wchar_t **src, size_t nwc, } size_t -_DEFUN (_wcsnrtombs_r, (r, dst, src, nwc, len, ps), - struct _reent *r _AND - char *dst _AND - const wchar_t **src _AND - size_t nwc _AND - size_t len _AND +_wcsnrtombs_r (struct _reent *r, + char *dst, + const wchar_t **src, + size_t nwc, + size_t len, mbstate_t *ps) { return _wcsnrtombs_l (_REENT, dst, src, nwc, len, ps, @@ -185,11 +151,10 @@ _DEFUN (_wcsnrtombs_r, (r, dst, src, nwc, len, ps), #ifndef _REENT_ONLY size_t -_DEFUN (wcsnrtombs, (dst, src, nwc, len, ps), - char *__restrict dst _AND - const wchar_t **__restrict src _AND - size_t nwc _AND - size_t len _AND +wcsnrtombs (char *__restrict dst, + const wchar_t **__restrict src, + size_t nwc, + size_t len, mbstate_t *__restrict ps) { return _wcsnrtombs_l (_REENT, dst, src, nwc, len, ps, diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c index 2b6777cae..dc4807d2a 100644 --- a/newlib/libc/stdlib/wcsrtombs.c +++ b/newlib/libc/stdlib/wcsrtombs.c @@ -5,11 +5,10 @@ #include size_t -_DEFUN (_wcsrtombs_r, (r, dst, src, len, ps), - struct _reent *r _AND - char *dst _AND - const wchar_t **src _AND - size_t len _AND +_wcsrtombs_r (struct _reent *r, + char *dst, + const wchar_t **src, + size_t len, mbstate_t *ps) { return _wcsnrtombs_r (r, dst, src, (size_t) -1, len, ps); @@ -17,10 +16,9 @@ _DEFUN (_wcsrtombs_r, (r, dst, src, len, ps), #ifndef _REENT_ONLY size_t -_DEFUN (wcsrtombs, (dst, src, len, ps), - char *__restrict dst _AND - const wchar_t **__restrict src _AND - size_t len _AND +wcsrtombs (char *__restrict dst, + const wchar_t **__restrict src, + size_t len, mbstate_t *__restrict ps) { return _wcsnrtombs_r (_REENT, dst, src, (size_t) -1, len, ps); diff --git a/newlib/libc/stdlib/wcstod.c b/newlib/libc/stdlib/wcstod.c index 605fca40b..375ffe288 100644 --- a/newlib/libc/stdlib/wcstod.c +++ b/newlib/libc/stdlib/wcstod.c @@ -26,7 +26,7 @@ INDEX INDEX _wcstof_r -ANSI_SYNOPSIS +SYNOPSIS #include double wcstod(const wchar_t *__restrict <[str]>, wchar_t **__restrict <[tail]>); @@ -49,26 +49,6 @@ ANSI_SYNOPSIS float _wcstof_r(void *<[reent]>, const wchar_t *<[str]>, wchar_t **<[tail]>); -TRAD_SYNOPSIS - #include - double wcstod(<[str]>,<[tail]>) - wchar_t *__restrict <[str]>; - wchar_t **__restrict <[tail]>; - - float wcstof(<[str]>,<[tail]>) - wchar_t *__restrict <[str]>; - wchar_t **__restrict <[tail]>; - - double _wcstod_r(<[reent]>,<[str]>,<[tail]>) - wchar_t *<[reent]>; - wchar_t *<[str]>; - wchar_t **<[tail]>; - - float _wcstof_r(<[reent]>,<[str]>,<[tail]>) - wchar_t *<[reent]>; - wchar_t *<[str]>; - wchar_t **<[tail]>; - DESCRIPTION <>, <>, <> parse the wide-character string <[str]>, producing a substring which can be converted to a double, @@ -208,6 +188,7 @@ _wcstod_l (struct _reent *ptr, const wchar_t *nptr, wchar_t **endptr, * corresponding position in the wide char string. */ if (endptr != NULL) { + const char *decimal_point = __get_numeric_locale(loc)->decimal_point; /* The only valid multibyte char in a float converted by strtod/wcstod is the radix char. What we do here is, figure out if the radix char was in the valid leading @@ -218,10 +199,9 @@ _wcstod_l (struct _reent *ptr, const wchar_t *nptr, wchar_t **endptr, just one byte long. The resulting difference (end - buf) is then equivalent to the number of valid wide characters in the input string. */ - len = strlen (__localeconv_l (loc)->decimal_point); + len = strlen (decimal_point); if (len > 1) { - char *d = strstr (buf, - __localeconv_l (loc)->decimal_point); + char *d = strstr (buf, decimal_point); if (d && d < end) end -= len - 1; } @@ -234,23 +214,21 @@ _wcstod_l (struct _reent *ptr, const wchar_t *nptr, wchar_t **endptr, } double -_DEFUN (_wcstod_r, (ptr, nptr, endptr), - struct _reent *ptr _AND - _CONST wchar_t *nptr _AND +_wcstod_r (struct _reent *ptr, + const wchar_t *nptr, wchar_t **endptr) { return _wcstod_l (ptr, nptr, endptr, __get_current_locale ()); } float -_DEFUN (_wcstof_r, (ptr, nptr, endptr), - struct _reent *ptr _AND - _CONST wchar_t *nptr _AND +_wcstof_r (struct _reent *ptr, + const wchar_t *nptr, wchar_t **endptr) { double retval = _wcstod_l (ptr, nptr, endptr, __get_current_locale ()); if (isnan (retval)) - return nanf (NULL); + return nanf (""); return (float)retval; } @@ -264,8 +242,7 @@ wcstod_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, } double -_DEFUN (wcstod, (nptr, endptr), - _CONST wchar_t *__restrict nptr _AND wchar_t **__restrict endptr) +wcstod (const wchar_t *__restrict nptr, wchar_t **__restrict endptr) { return _wcstod_l (_REENT, nptr, endptr, __get_current_locale ()); } @@ -276,7 +253,7 @@ wcstof_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, { double val = _wcstod_l (_REENT, nptr, endptr, loc); if (isnan (val)) - return nanf (NULL); + return nanf (""); float retval = (float) val; #ifndef NO_ERRNO if (isinf (retval) && !isinf (val)) @@ -286,13 +263,12 @@ wcstof_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, } float -_DEFUN (wcstof, (nptr, endptr), - _CONST wchar_t *__restrict nptr _AND +wcstof (const wchar_t *__restrict nptr, wchar_t **__restrict endptr) { double val = _wcstod_l (_REENT, nptr, endptr, __get_current_locale ()); if (isnan (val)) - return nanf (NULL); + return nanf (""); float retval = (float) val; #ifndef NO_ERRNO if (isinf (retval) && !isinf (val)) diff --git a/newlib/libc/stdlib/wcstol.c b/newlib/libc/stdlib/wcstol.c index 4c7480594..023a9c45e 100644 --- a/newlib/libc/stdlib/wcstol.c +++ b/newlib/libc/stdlib/wcstol.c @@ -11,7 +11,7 @@ INDEX INDEX _wcstol_r -ANSI_SYNOPSIS +SYNOPSIS #include long wcstol(const wchar_t *__restrict <[s]>, wchar_t **__restrict <[ptr]>, int <[base]>); @@ -24,19 +24,6 @@ ANSI_SYNOPSIS long _wcstol_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - long wcstol (<[s]>, <[ptr]>, <[base]>) - wchar_t *__restrict <[s]>; - wchar_t **__restrict <[ptr]>; - int <[base]>; - - long _wcstol_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) - struct _reent *<[reent]>; - wchar_t *<[s]>; - wchar_t **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the wide string <<*<[s]>>> to a <>. First, it breaks down the string into three parts: @@ -226,10 +213,9 @@ _wcstol_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr, } long -_DEFUN (_wcstol_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST wchar_t *nptr _AND - wchar_t **endptr _AND +_wcstol_r (struct _reent *rptr, + const wchar_t *nptr, + wchar_t **endptr, int base) { return _wcstol_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -245,9 +231,8 @@ wcstol_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base, } long -_DEFUN (wcstol, (s, ptr, base), - _CONST wchar_t *__restrict s _AND - wchar_t **__restrict ptr _AND +wcstol (const wchar_t *__restrict s, + wchar_t **__restrict ptr, int base) { return _wcstol_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/wcstold.c b/newlib/libc/stdlib/wcstold.c index 4876e119b..673d92811 100644 --- a/newlib/libc/stdlib/wcstold.c +++ b/newlib/libc/stdlib/wcstold.c @@ -83,6 +83,7 @@ wcstold_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, if (endptr != NULL) { + const char *decimal_point = __get_numeric_locale(loc)->decimal_point; /* The only valid multibyte char in a float converted by strtold/wcstold is the radix char. What we do here is, figure out if the radix char was in the valid leading @@ -93,10 +94,10 @@ wcstold_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, just one byte long. The resulting difference (end - buf) is then equivalent to the number of valid wide characters in the input string. */ - len = strlen (__localeconv_l (loc)->decimal_point); + len = strlen (decimal_point); if (len > 1) { - char *d = strstr (buf, __localeconv_l (loc)->decimal_point); + char *d = strstr (buf, decimal_point); if (d && d < end) end -= len - 1; diff --git a/newlib/libc/stdlib/wcstoll.c b/newlib/libc/stdlib/wcstoll.c index 2996b11a6..5fe0b2976 100644 --- a/newlib/libc/stdlib/wcstoll.c +++ b/newlib/libc/stdlib/wcstoll.c @@ -11,7 +11,7 @@ INDEX INDEX _wcstoll_r -ANSI_SYNOPSIS +SYNOPSIS #include long long wcstoll(const wchar_t *__restrict <[s]>, wchar_t **__restrict <[ptr]>,int <[base]>); @@ -24,19 +24,6 @@ ANSI_SYNOPSIS long long _wcstoll_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - long long wcstoll (<[s]>, <[ptr]>, <[base]>) - const wchar_t *__restrict <[s]>; - wchar_t **__restrict <[ptr]>; - int <[base]>; - - long long _wcstoll_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) - wchar_t *<[reent]>; - const wchar_t *<[s]>; - wchar_t **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the wide string <<*<[s]>>> to a <>. First, it breaks down the string into three parts: @@ -226,10 +213,9 @@ _wcstoll_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr, } long long -_DEFUN (_wcstoll_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST wchar_t *nptr _AND - wchar_t **endptr _AND +_wcstoll_r (struct _reent *rptr, + const wchar_t *nptr, + wchar_t **endptr, int base) { return _wcstoll_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -245,9 +231,8 @@ wcstoll_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base, } long long -_DEFUN (wcstoll, (s, ptr, base), - _CONST wchar_t *__restrict s _AND - wchar_t **__restrict ptr _AND +wcstoll (const wchar_t *__restrict s, + wchar_t **__restrict ptr, int base) { return _wcstoll_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/wcstombs.c b/newlib/libc/stdlib/wcstombs.c index b0123a313..42be54055 100644 --- a/newlib/libc/stdlib/wcstombs.c +++ b/newlib/libc/stdlib/wcstombs.c @@ -5,17 +5,10 @@ FUNCTION INDEX wcstombs -ANSI_SYNOPSIS +SYNOPSIS #include size_t wcstombs(char *restrict <[s]>, const wchar_t *restrict <[pwc]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - size_t wcstombs(<[s]>, <[pwc]>, <[n]>) - char *<[s]>; - const wchar_t *<[pwc]>; - size_t <[n]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <>. In this case, @@ -55,9 +48,8 @@ effects vary with the locale. #include size_t -_DEFUN (wcstombs, (s, pwcs, n), - char *__restrict s _AND - const wchar_t *__restrict pwcs _AND +wcstombs (char *__restrict s, + const wchar_t *__restrict pwcs, size_t n) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/wcstombs_r.c b/newlib/libc/stdlib/wcstombs_r.c index 0680cd783..c6a06a39a 100644 --- a/newlib/libc/stdlib/wcstombs_r.c +++ b/newlib/libc/stdlib/wcstombs_r.c @@ -3,11 +3,10 @@ #include "local.h" size_t -_DEFUN (_wcstombs_r, (reent, s, pwcs, n, state), - struct _reent *r _AND - char *__restrict s _AND - const wchar_t *__restrict pwcs _AND - size_t n _AND +_wcstombs_r (struct _reent *r, + char *__restrict s, + const wchar_t *__restrict pwcs, + size_t n, mbstate_t *state) { char *ptr = s; diff --git a/newlib/libc/stdlib/wcstoul.c b/newlib/libc/stdlib/wcstoul.c index e87b2ecc9..8e2796587 100644 --- a/newlib/libc/stdlib/wcstoul.c +++ b/newlib/libc/stdlib/wcstoul.c @@ -11,7 +11,7 @@ INDEX INDEX _wcstoul_r -ANSI_SYNOPSIS +SYNOPSIS #include unsigned long wcstoul(const wchar_t *__restrict <[s]>, wchar_t **__restrict <[ptr]>, int <[base]>); @@ -24,19 +24,6 @@ ANSI_SYNOPSIS unsigned long _wcstoul_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - unsigned long wcstoul(<[s]>, <[ptr]>, <[base]>) - wchar_t *__restrict <[s]>; - wchar_t **__restrict <[ptr]>; - int <[base]>; - - unsigned long _wcstoul_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) - wchar_t *<[reent]>; - wchar_t *<[s]>; - wchar_t **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the wide string <<*<[s]>>> to an <>. First, it breaks down the string into three parts: @@ -205,10 +192,9 @@ _wcstoul_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr, } unsigned long -_DEFUN (_wcstoul_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST wchar_t *nptr _AND - wchar_t **endptr _AND +_wcstoul_r (struct _reent *rptr, + const wchar_t *nptr, + wchar_t **endptr, int base) { return _wcstoul_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -224,9 +210,8 @@ wcstoul_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base, } unsigned long -_DEFUN (wcstoul, (s, ptr, base), - _CONST wchar_t *__restrict s _AND - wchar_t **__restrict ptr _AND +wcstoul (const wchar_t *__restrict s, + wchar_t **__restrict ptr, int base) { return _wcstoul_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/wcstoull.c b/newlib/libc/stdlib/wcstoull.c index 131a83795..5a37473e0 100644 --- a/newlib/libc/stdlib/wcstoull.c +++ b/newlib/libc/stdlib/wcstoull.c @@ -11,7 +11,7 @@ INDEX INDEX _wcstoull_r -ANSI_SYNOPSIS +SYNOPSIS #include unsigned long long wcstoull(const wchar_t *__restrict <[s]>, wchar_t **__restrict <[ptr]>, @@ -26,19 +26,6 @@ ANSI_SYNOPSIS unsigned long long _wcstoull_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); -TRAD_SYNOPSIS - #include - unsigned long long wcstoull(<[s]>, <[ptr]>, <[base]>) - wchar_t *__restrict <[s]>; - wchar_t **__restrict <[ptr]>; - int <[base]>; - - unsigned long long _wcstoull_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) - wchar_t *<[reent]>; - wchar_t *<[s]>; - wchar_t **<[ptr]>; - int <[base]>; - DESCRIPTION The function <> converts the wide string <<*<[s]>>> to an <>. First, it breaks down the string into three parts: @@ -221,10 +208,9 @@ _wcstoull_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr, } unsigned long long -_DEFUN (_wcstoull_r, (rptr, nptr, endptr, base), - struct _reent *rptr _AND - _CONST wchar_t *nptr _AND - wchar_t **endptr _AND +_wcstoull_r (struct _reent *rptr, + const wchar_t *nptr, + wchar_t **endptr, int base) { return _wcstoull_l (rptr, nptr, endptr, base, __get_current_locale ()); @@ -240,9 +226,8 @@ wcstoull_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base, } unsigned long long -_DEFUN (wcstoull, (s, ptr, base), - _CONST wchar_t *__restrict s _AND - wchar_t **__restrict ptr _AND +wcstoull (const wchar_t *__restrict s, + wchar_t **__restrict ptr, int base) { return _wcstoull_l (_REENT, s, ptr, base, __get_current_locale ()); diff --git a/newlib/libc/stdlib/wctomb.c b/newlib/libc/stdlib/wctomb.c index 13892ffa4..e908d22c2 100644 --- a/newlib/libc/stdlib/wctomb.c +++ b/newlib/libc/stdlib/wctomb.c @@ -5,16 +5,10 @@ FUNCTION INDEX wctomb -ANSI_SYNOPSIS +SYNOPSIS #include int wctomb(char *<[s]>, wchar_t <[wchar]>); -TRAD_SYNOPSIS - #include - int wctomb(<[s]>, <[wchar]>) - char *<[s]>; - wchar_t <[wchar]>; - DESCRIPTION When _MB_CAPABLE is not defined, this is a minimal ANSI-conforming implementation of <>. The @@ -52,8 +46,7 @@ effects vary with the locale. #include "local.h" int -_DEFUN (wctomb, (s, wchar), - char *s _AND +wctomb (char *s, wchar_t wchar) { #ifdef _MB_CAPABLE diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 2c018f916..b4799341e 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -7,20 +7,18 @@ #include "local.h" int -_DEFUN (_wctomb_r, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +_wctomb_r (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { return __WCTOMB (r, s, _wchar, state); } int -_DEFUN (__ascii_wctomb, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +__ascii_wctomb (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { /* Avoids compiler warnings about comparisons that are always false @@ -50,10 +48,9 @@ _DEFUN (__ascii_wctomb, (r, s, wchar, state), #define __state __count int -_DEFUN (__utf8_wctomb, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +__utf8_wctomb (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { wint_t wchar = _wchar; @@ -144,10 +141,9 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, state), because the underlying OS requires wchar_t == UTF-16. */ #ifndef __CYGWIN__ int -_DEFUN (__sjis_wctomb, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +__sjis_wctomb (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { wint_t wchar = _wchar; @@ -178,10 +174,9 @@ _DEFUN (__sjis_wctomb, (r, s, wchar, state), } int -_DEFUN (__eucjp_wctomb, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +__eucjp_wctomb (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { wint_t wchar = _wchar; @@ -218,10 +213,9 @@ _DEFUN (__eucjp_wctomb, (r, s, wchar, state), } int -_DEFUN (__jis_wctomb, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t _wchar _AND +__jis_wctomb (struct _reent *r, + char *s, + wchar_t _wchar, mbstate_t *state) { wint_t wchar = _wchar; diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am index e62f28627..49de080e1 100644 --- a/newlib/libc/string/Makefile.am +++ b/newlib/libc/string/Makefile.am @@ -40,6 +40,7 @@ GENERAL_SOURCES = \ strncmp.c \ strncpy.c \ strnlen.c \ + strnstr.c \ strpbrk.c \ strrchr.c \ strsep.c \ @@ -124,7 +125,8 @@ ELIX_4_SOURCES = \ wcscoll_l.c \ wcsncasecmp.c \ wcsncasecmp_l.c \ - wcsxfrm_l.c + wcsxfrm_l.c \ + wmempcpy.c endif !ELIX_LEVEL_3 endif !ELIX_LEVEL_2 endif !ELIX_LEVEL_1 @@ -163,6 +165,6 @@ wmemcmp.def wmemcpy.def wmemmove.def wmemset.def \ memmem.def memrchr.def rawmemchr.def strchrnul.def \ strcasecmp_l.def strcoll_l.def strncasecmp_l.def strxfrm_l.def \ wcscasecmp_l.def wcscoll_l.def wcsncasecmp_l.def wcsxfrm_l.def \ -strverscmp.def +strverscmp.def strnstr.def wmempcpy.def CHAPTERS = strings.tex wcstrings.tex diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in index 63681d070..eb8fafc6b 100644 --- a/newlib/libc/string/Makefile.in +++ b/newlib/libc/string/Makefile.in @@ -89,12 +89,13 @@ am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \ lib_a-strlwr.$(OBJEXT) lib_a-strncasecmp.$(OBJEXT) \ lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \ lib_a-strncpy.$(OBJEXT) lib_a-strnlen.$(OBJEXT) \ - lib_a-strpbrk.$(OBJEXT) lib_a-strrchr.$(OBJEXT) \ - lib_a-strsep.$(OBJEXT) lib_a-strsignal.$(OBJEXT) \ - lib_a-strspn.$(OBJEXT) lib_a-strtok.$(OBJEXT) \ - lib_a-strtok_r.$(OBJEXT) lib_a-strupr.$(OBJEXT) \ - lib_a-strxfrm.$(OBJEXT) lib_a-strstr.$(OBJEXT) \ - lib_a-swab.$(OBJEXT) lib_a-timingsafe_bcmp.$(OBJEXT) \ + lib_a-strnstr.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \ + lib_a-strrchr.$(OBJEXT) lib_a-strsep.$(OBJEXT) \ + lib_a-strsignal.$(OBJEXT) lib_a-strspn.$(OBJEXT) \ + lib_a-strtok.$(OBJEXT) lib_a-strtok_r.$(OBJEXT) \ + lib_a-strupr.$(OBJEXT) lib_a-strxfrm.$(OBJEXT) \ + lib_a-strstr.$(OBJEXT) lib_a-swab.$(OBJEXT) \ + lib_a-timingsafe_bcmp.$(OBJEXT) \ lib_a-timingsafe_memcmp.$(OBJEXT) lib_a-u_strerr.$(OBJEXT) \ lib_a-wcscat.$(OBJEXT) lib_a-wcschr.$(OBJEXT) \ lib_a-wcscmp.$(OBJEXT) lib_a-wcscoll.$(OBJEXT) \ @@ -136,7 +137,8 @@ am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcscoll_l.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcsncasecmp.$(OBJEXT) \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcsncasecmp_l.$(OBJEXT) \ -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcsxfrm_l.$(OBJEXT) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcsxfrm_l.$(OBJEXT) \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wmempcpy.$(OBJEXT) @USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \ @USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_3) lib_a_OBJECTS = $(am_lib_a_OBJECTS) @@ -148,9 +150,9 @@ am__objects_4 = bcopy.lo bzero.lo explicit_bzero.lo ffsl.lo ffsll.lo \ strchr.lo strcmp.lo strcoll.lo strcpy.lo strcspn.lo strdup.lo \ strdup_r.lo strerror.lo strerror_r.lo strlcat.lo strlcpy.lo \ strlen.lo strlwr.lo strncasecmp.lo strncat.lo strncmp.lo \ - strncpy.lo strnlen.lo strpbrk.lo strrchr.lo strsep.lo \ - strsignal.lo strspn.lo strtok.lo strtok_r.lo strupr.lo \ - strxfrm.lo strstr.lo swab.lo timingsafe_bcmp.lo \ + strncpy.lo strnlen.lo strnstr.lo strpbrk.lo strrchr.lo \ + strsep.lo strsignal.lo strspn.lo strtok.lo strtok_r.lo \ + strupr.lo strxfrm.lo strstr.lo swab.lo timingsafe_bcmp.lo \ timingsafe_memcmp.lo u_strerr.lo wcscat.lo wcschr.lo wcscmp.lo \ wcscoll.lo wcscpy.lo wcscspn.lo wcslcat.lo wcslcpy.lo \ wcslen.lo wcsncat.lo wcsncmp.lo wcsncpy.lo wcsnlen.lo \ @@ -175,7 +177,8 @@ am__objects_4 = bcopy.lo bzero.lo explicit_bzero.lo ffsl.lo ffsll.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcscoll_l.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp.lo \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp_l.lo \ -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsxfrm_l.lo +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsxfrm_l.lo \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wmempcpy.lo @USE_LIBTOOL_TRUE@am_libstring_la_OBJECTS = $(am__objects_4) \ @USE_LIBTOOL_TRUE@ $(am__objects_5) $(am__objects_6) libstring_la_OBJECTS = $(am_libstring_la_OBJECTS) @@ -386,6 +389,7 @@ GENERAL_SOURCES = \ strncmp.c \ strncpy.c \ strnlen.c \ + strnstr.c \ strpbrk.c \ strrchr.c \ strsep.c \ @@ -458,7 +462,8 @@ GENERAL_SOURCES = \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcscoll_l.c \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp.c \ @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp_l.c \ -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsxfrm_l.c +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsxfrm_l.c \ +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wmempcpy.c @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_4_SOURCES = @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_4_SOURCES = @@ -480,7 +485,7 @@ CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml) DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml) -CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES) +CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES) CHEWOUT_FILES = \ bcmp.def memcpy.def strcmp.def strncat.def strstr.def \ bcopy.def memmove.def strcoll.def strncmp.def strtok.def \ @@ -500,7 +505,7 @@ wmemcmp.def wmemcpy.def wmemmove.def wmemset.def \ memmem.def memrchr.def rawmemchr.def strchrnul.def \ strcasecmp_l.def strcoll_l.def strncasecmp_l.def strxfrm_l.def \ wcscasecmp_l.def wcscoll_l.def wcsncasecmp_l.def wcsxfrm_l.def \ -strverscmp.def +strverscmp.def strnstr.def wmempcpy.def CHAPTERS = strings.tex wcstrings.tex all: all-am @@ -782,6 +787,12 @@ lib_a-strnlen.o: strnlen.c lib_a-strnlen.obj: strnlen.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnlen.obj `if test -f 'strnlen.c'; then $(CYGPATH_W) 'strnlen.c'; else $(CYGPATH_W) '$(srcdir)/strnlen.c'; fi` +lib_a-strnstr.o: strnstr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnstr.o `test -f 'strnstr.c' || echo '$(srcdir)/'`strnstr.c + +lib_a-strnstr.obj: strnstr.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnstr.obj `if test -f 'strnstr.c'; then $(CYGPATH_W) 'strnstr.c'; else $(CYGPATH_W) '$(srcdir)/strnstr.c'; fi` + lib_a-strpbrk.o: strpbrk.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strpbrk.o `test -f 'strpbrk.c' || echo '$(srcdir)/'`strpbrk.c @@ -1190,6 +1201,12 @@ lib_a-wcsxfrm_l.o: wcsxfrm_l.c lib_a-wcsxfrm_l.obj: wcsxfrm_l.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm_l.obj `if test -f 'wcsxfrm_l.c'; then $(CYGPATH_W) 'wcsxfrm_l.c'; else $(CYGPATH_W) '$(srcdir)/wcsxfrm_l.c'; fi` +lib_a-wmempcpy.o: wmempcpy.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmempcpy.o `test -f 'wmempcpy.c' || echo '$(srcdir)/'`wmempcpy.c + +lib_a-wmempcpy.obj: wmempcpy.c + $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmempcpy.obj `if test -f 'wmempcpy.c'; then $(CYGPATH_W) 'wmempcpy.c'; else $(CYGPATH_W) '$(srcdir)/wmempcpy.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1375,8 +1392,8 @@ objectlist.awk.in: $(noinst_LTLIBRARIES) done .c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def + $(CHEW) < $< > $*.def || ( rm $*.def && false ) + @touch stmp-def TARGETDOC ?= ../tmp.texi diff --git a/newlib/libc/string/WIDTH-A b/newlib/libc/string/WIDTH-A new file mode 100644 index 000000000..51e8f2339 --- /dev/null +++ b/newlib/libc/string/WIDTH-A @@ -0,0 +1,569 @@ +# UAX #11: East Asian Ambiguous + +# Plane 00 +# Rows Positions (Cells) + + 00 A1 A4 A7-A8 AA AD-AE B0-B4 B6-BA BC-BF C6 D0 D7-D8 DE-E1 E6 E8-EA + 00 EC-ED F0 F2-F3 F7-FA FC FE + 01 01 11 13 1B 26-27 2B 31-33 38 3F-42 44 48-4B 4D 52-53 66-67 6B + 01 CE D0 D2 D4 D6 D8 DA DC + 02 51 61 C4 C7 C9-CB CD D0 D8-DB DD DF + 03 00-6F 91-A1 A3-A9 B1-C1 C3-C9 + 04 01 10-4F 51 + 20 10 13-16 18-19 1C-1D 20-22 24-27 30 32-33 35 3B 3E 74 7F 81-84 + 20 AC + 21 03 05 09 13 16 21-22 26 2B 53-54 5B-5E 60-6B 70-79 89 90-99 B8-B9 + 21 D2 D4 E7 + 22 00 02-03 07-08 0B 0F 11 15 1A 1D-20 23 25 27-2C 2E 34-37 3C-3D + 22 48 4C 52 60-61 64-67 6A-6B 6E-6F 82-83 86-87 95 99 A5 BF + 23 12 + 24 60-E9 EB-FF + 25 00-4B 50-73 80-8F 92-95 A0-A1 A3-A9 B2-B3 B6-B7 BC-BD C0-C1 C6-C8 + 25 CB CE-D1 E2-E5 EF + 26 05-06 09 0E-0F 1C 1E 40 42 60-61 63-65 67-6A 6C-6D 6F 9E-9F BF + 26 C6-CD CF-D3 D5-E1 E3 E8-E9 EB-F1 F4 F6-F9 FB-FC FE-FF + 27 3D 76-7F + 2B 56-59 + 32 48-4F + E0 00-FF + E1 00-FF + E2 00-FF + E3 00-FF + E4 00-FF + E5 00-FF + E6 00-FF + E7 00-FF + E8 00-FF + E9 00-FF + EA 00-FF + EB 00-FF + EC 00-FF + ED 00-FF + EE 00-FF + EF 00-FF + F0 00-FF + F1 00-FF + F2 00-FF + F3 00-FF + F4 00-FF + F5 00-FF + F6 00-FF + F7 00-FF + F8 00-FF + FE 00-0F + FF FD + 1F1 00-0A 10-2D 30-69 70-8D 8F-90 9B-AC + E01 00-EF + F00 00-FF + F01 00-FF + F02 00-FF + F03 00-FF + F04 00-FF + F05 00-FF + F06 00-FF + F07 00-FF + F08 00-FF + F09 00-FF + F0A 00-FF + F0B 00-FF + F0C 00-FF + F0D 00-FF + F0E 00-FF + F0F 00-FF + F10 00-FF + F11 00-FF + F12 00-FF + F13 00-FF + F14 00-FF + F15 00-FF + F16 00-FF + F17 00-FF + F18 00-FF + F19 00-FF + F1A 00-FF + F1B 00-FF + F1C 00-FF + F1D 00-FF + F1E 00-FF + F1F 00-FF + F20 00-FF + F21 00-FF + F22 00-FF + F23 00-FF + F24 00-FF + F25 00-FF + F26 00-FF + F27 00-FF + F28 00-FF + F29 00-FF + F2A 00-FF + F2B 00-FF + F2C 00-FF + F2D 00-FF + F2E 00-FF + F2F 00-FF + F30 00-FF + F31 00-FF + F32 00-FF + F33 00-FF + F34 00-FF + F35 00-FF + F36 00-FF + F37 00-FF + F38 00-FF + F39 00-FF + F3A 00-FF + F3B 00-FF + F3C 00-FF + F3D 00-FF + F3E 00-FF + F3F 00-FF + F40 00-FF + F41 00-FF + F42 00-FF + F43 00-FF + F44 00-FF + F45 00-FF + F46 00-FF + F47 00-FF + F48 00-FF + F49 00-FF + F4A 00-FF + F4B 00-FF + F4C 00-FF + F4D 00-FF + F4E 00-FF + F4F 00-FF + F50 00-FF + F51 00-FF + F52 00-FF + F53 00-FF + F54 00-FF + F55 00-FF + F56 00-FF + F57 00-FF + F58 00-FF + F59 00-FF + F5A 00-FF + F5B 00-FF + F5C 00-FF + F5D 00-FF + F5E 00-FF + F5F 00-FF + F60 00-FF + F61 00-FF + F62 00-FF + F63 00-FF + F64 00-FF + F65 00-FF + F66 00-FF + F67 00-FF + F68 00-FF + F69 00-FF + F6A 00-FF + F6B 00-FF + F6C 00-FF + F6D 00-FF + F6E 00-FF + F6F 00-FF + F70 00-FF + F71 00-FF + F72 00-FF + F73 00-FF + F74 00-FF + F75 00-FF + F76 00-FF + F77 00-FF + F78 00-FF + F79 00-FF + F7A 00-FF + F7B 00-FF + F7C 00-FF + F7D 00-FF + F7E 00-FF + F7F 00-FF + F80 00-FF + F81 00-FF + F82 00-FF + F83 00-FF + F84 00-FF + F85 00-FF + F86 00-FF + F87 00-FF + F88 00-FF + F89 00-FF + F8A 00-FF + F8B 00-FF + F8C 00-FF + F8D 00-FF + F8E 00-FF + F8F 00-FF + F90 00-FF + F91 00-FF + F92 00-FF + F93 00-FF + F94 00-FF + F95 00-FF + F96 00-FF + F97 00-FF + F98 00-FF + F99 00-FF + F9A 00-FF + F9B 00-FF + F9C 00-FF + F9D 00-FF + F9E 00-FF + F9F 00-FF + FA0 00-FF + FA1 00-FF + FA2 00-FF + FA3 00-FF + FA4 00-FF + FA5 00-FF + FA6 00-FF + FA7 00-FF + FA8 00-FF + FA9 00-FF + FAA 00-FF + FAB 00-FF + FAC 00-FF + FAD 00-FF + FAE 00-FF + FAF 00-FF + FB0 00-FF + FB1 00-FF + FB2 00-FF + FB3 00-FF + FB4 00-FF + FB5 00-FF + FB6 00-FF + FB7 00-FF + FB8 00-FF + FB9 00-FF + FBA 00-FF + FBB 00-FF + FBC 00-FF + FBD 00-FF + FBE 00-FF + FBF 00-FF + FC0 00-FF + FC1 00-FF + FC2 00-FF + FC3 00-FF + FC4 00-FF + FC5 00-FF + FC6 00-FF + FC7 00-FF + FC8 00-FF + FC9 00-FF + FCA 00-FF + FCB 00-FF + FCC 00-FF + FCD 00-FF + FCE 00-FF + FCF 00-FF + FD0 00-FF + FD1 00-FF + FD2 00-FF + FD3 00-FF + FD4 00-FF + FD5 00-FF + FD6 00-FF + FD7 00-FF + FD8 00-FF + FD9 00-FF + FDA 00-FF + FDB 00-FF + FDC 00-FF + FDD 00-FF + FDE 00-FF + FDF 00-FF + FE0 00-FF + FE1 00-FF + FE2 00-FF + FE3 00-FF + FE4 00-FF + FE5 00-FF + FE6 00-FF + FE7 00-FF + FE8 00-FF + FE9 00-FF + FEA 00-FF + FEB 00-FF + FEC 00-FF + FED 00-FF + FEE 00-FF + FEF 00-FF + FF0 00-FF + FF1 00-FF + FF2 00-FF + FF3 00-FF + FF4 00-FF + FF5 00-FF + FF6 00-FF + FF7 00-FF + FF8 00-FF + FF9 00-FF + FFA 00-FF + FFB 00-FF + FFC 00-FF + FFD 00-FF + FFE 00-FF + FFF 00-FD + 1000 00-FF + 1001 00-FF + 1002 00-FF + 1003 00-FF + 1004 00-FF + 1005 00-FF + 1006 00-FF + 1007 00-FF + 1008 00-FF + 1009 00-FF + 100A 00-FF + 100B 00-FF + 100C 00-FF + 100D 00-FF + 100E 00-FF + 100F 00-FF + 1010 00-FF + 1011 00-FF + 1012 00-FF + 1013 00-FF + 1014 00-FF + 1015 00-FF + 1016 00-FF + 1017 00-FF + 1018 00-FF + 1019 00-FF + 101A 00-FF + 101B 00-FF + 101C 00-FF + 101D 00-FF + 101E 00-FF + 101F 00-FF + 1020 00-FF + 1021 00-FF + 1022 00-FF + 1023 00-FF + 1024 00-FF + 1025 00-FF + 1026 00-FF + 1027 00-FF + 1028 00-FF + 1029 00-FF + 102A 00-FF + 102B 00-FF + 102C 00-FF + 102D 00-FF + 102E 00-FF + 102F 00-FF + 1030 00-FF + 1031 00-FF + 1032 00-FF + 1033 00-FF + 1034 00-FF + 1035 00-FF + 1036 00-FF + 1037 00-FF + 1038 00-FF + 1039 00-FF + 103A 00-FF + 103B 00-FF + 103C 00-FF + 103D 00-FF + 103E 00-FF + 103F 00-FF + 1040 00-FF + 1041 00-FF + 1042 00-FF + 1043 00-FF + 1044 00-FF + 1045 00-FF + 1046 00-FF + 1047 00-FF + 1048 00-FF + 1049 00-FF + 104A 00-FF + 104B 00-FF + 104C 00-FF + 104D 00-FF + 104E 00-FF + 104F 00-FF + 1050 00-FF + 1051 00-FF + 1052 00-FF + 1053 00-FF + 1054 00-FF + 1055 00-FF + 1056 00-FF + 1057 00-FF + 1058 00-FF + 1059 00-FF + 105A 00-FF + 105B 00-FF + 105C 00-FF + 105D 00-FF + 105E 00-FF + 105F 00-FF + 1060 00-FF + 1061 00-FF + 1062 00-FF + 1063 00-FF + 1064 00-FF + 1065 00-FF + 1066 00-FF + 1067 00-FF + 1068 00-FF + 1069 00-FF + 106A 00-FF + 106B 00-FF + 106C 00-FF + 106D 00-FF + 106E 00-FF + 106F 00-FF + 1070 00-FF + 1071 00-FF + 1072 00-FF + 1073 00-FF + 1074 00-FF + 1075 00-FF + 1076 00-FF + 1077 00-FF + 1078 00-FF + 1079 00-FF + 107A 00-FF + 107B 00-FF + 107C 00-FF + 107D 00-FF + 107E 00-FF + 107F 00-FF + 1080 00-FF + 1081 00-FF + 1082 00-FF + 1083 00-FF + 1084 00-FF + 1085 00-FF + 1086 00-FF + 1087 00-FF + 1088 00-FF + 1089 00-FF + 108A 00-FF + 108B 00-FF + 108C 00-FF + 108D 00-FF + 108E 00-FF + 108F 00-FF + 1090 00-FF + 1091 00-FF + 1092 00-FF + 1093 00-FF + 1094 00-FF + 1095 00-FF + 1096 00-FF + 1097 00-FF + 1098 00-FF + 1099 00-FF + 109A 00-FF + 109B 00-FF + 109C 00-FF + 109D 00-FF + 109E 00-FF + 109F 00-FF + 10A0 00-FF + 10A1 00-FF + 10A2 00-FF + 10A3 00-FF + 10A4 00-FF + 10A5 00-FF + 10A6 00-FF + 10A7 00-FF + 10A8 00-FF + 10A9 00-FF + 10AA 00-FF + 10AB 00-FF + 10AC 00-FF + 10AD 00-FF + 10AE 00-FF + 10AF 00-FF + 10B0 00-FF + 10B1 00-FF + 10B2 00-FF + 10B3 00-FF + 10B4 00-FF + 10B5 00-FF + 10B6 00-FF + 10B7 00-FF + 10B8 00-FF + 10B9 00-FF + 10BA 00-FF + 10BB 00-FF + 10BC 00-FF + 10BD 00-FF + 10BE 00-FF + 10BF 00-FF + 10C0 00-FF + 10C1 00-FF + 10C2 00-FF + 10C3 00-FF + 10C4 00-FF + 10C5 00-FF + 10C6 00-FF + 10C7 00-FF + 10C8 00-FF + 10C9 00-FF + 10CA 00-FF + 10CB 00-FF + 10CC 00-FF + 10CD 00-FF + 10CE 00-FF + 10CF 00-FF + 10D0 00-FF + 10D1 00-FF + 10D2 00-FF + 10D3 00-FF + 10D4 00-FF + 10D5 00-FF + 10D6 00-FF + 10D7 00-FF + 10D8 00-FF + 10D9 00-FF + 10DA 00-FF + 10DB 00-FF + 10DC 00-FF + 10DD 00-FF + 10DE 00-FF + 10DF 00-FF + 10E0 00-FF + 10E1 00-FF + 10E2 00-FF + 10E3 00-FF + 10E4 00-FF + 10E5 00-FF + 10E6 00-FF + 10E7 00-FF + 10E8 00-FF + 10E9 00-FF + 10EA 00-FF + 10EB 00-FF + 10EC 00-FF + 10ED 00-FF + 10EE 00-FF + 10EF 00-FF + 10F0 00-FF + 10F1 00-FF + 10F2 00-FF + 10F3 00-FF + 10F4 00-FF + 10F5 00-FF + 10F6 00-FF + 10F7 00-FF + 10F8 00-FF + 10F9 00-FF + 10FA 00-FF + 10FB 00-FF + 10FC 00-FF + 10FD 00-FF + 10FE 00-FF + 10FF 00-FD + diff --git a/newlib/libc/string/ambiguous.t b/newlib/libc/string/ambiguous.t new file mode 100644 index 000000000..f8b78428e --- /dev/null +++ b/newlib/libc/string/ambiguous.t @@ -0,0 +1,61 @@ +{ + { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, + { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, + { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, + { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, + { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, + { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, + { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, + { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, + { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, + { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, + { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, + { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, + { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, + { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, + { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, + { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, + { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, + { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, + { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, + { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, + { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, + { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, + { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, + { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, + { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, + { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, + { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, + { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, + { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, + { 0x2189, 0x2189 }, { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, + { 0x21D2, 0x21D2 }, { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, + { 0x2200, 0x2200 }, { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, + { 0x220B, 0x220B }, { 0x220F, 0x220F }, { 0x2211, 0x2211 }, + { 0x2215, 0x2215 }, { 0x221A, 0x221A }, { 0x221D, 0x2220 }, + { 0x2223, 0x2223 }, { 0x2225, 0x2225 }, { 0x2227, 0x222C }, + { 0x222E, 0x222E }, { 0x2234, 0x2237 }, { 0x223C, 0x223D }, + { 0x2248, 0x2248 }, { 0x224C, 0x224C }, { 0x2252, 0x2252 }, + { 0x2260, 0x2261 }, { 0x2264, 0x2267 }, { 0x226A, 0x226B }, + { 0x226E, 0x226F }, { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, + { 0x2295, 0x2295 }, { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, + { 0x22BF, 0x22BF }, { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, + { 0x24EB, 0x254B }, { 0x2550, 0x2573 }, { 0x2580, 0x258F }, + { 0x2592, 0x2595 }, { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, + { 0x25B2, 0x25B3 }, { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, + { 0x25C0, 0x25C1 }, { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, + { 0x25CE, 0x25D1 }, { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, + { 0x2605, 0x2606 }, { 0x2609, 0x2609 }, { 0x260E, 0x260F }, + { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, + { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, + { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, + { 0x269E, 0x269F }, { 0x26BF, 0x26BF }, { 0x26C6, 0x26CD }, + { 0x26CF, 0x26D3 }, { 0x26D5, 0x26E1 }, { 0x26E3, 0x26E3 }, + { 0x26E8, 0x26E9 }, { 0x26EB, 0x26F1 }, { 0x26F4, 0x26F4 }, + { 0x26F6, 0x26F9 }, { 0x26FB, 0x26FC }, { 0x26FE, 0x26FF }, + { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0x2B56, 0x2B59 }, + { 0x3248, 0x324F }, { 0xE000, 0xF8FF }, { 0xFFFD, 0xFFFD }, + { 0x1F100, 0x1F10A }, { 0x1F110, 0x1F12D }, { 0x1F130, 0x1F169 }, + { 0x1F170, 0x1F18D }, { 0x1F18F, 0x1F190 }, { 0x1F19B, 0x1F1AC }, + { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } +}; diff --git a/newlib/libc/string/bcmp.c b/newlib/libc/string/bcmp.c index 8d6e12ffb..747f8af51 100644 --- a/newlib/libc/string/bcmp.c +++ b/newlib/libc/string/bcmp.c @@ -5,17 +5,10 @@ FUNCTION INDEX bcmp -ANSI_SYNOPSIS +SYNOPSIS #include int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - int bcmp(<[s1]>, <[s2]>, <[n]>) - const void *<[s1]>; - const void *<[s2]>; - size_t <[n]>; - DESCRIPTION This function compares not more than <[n]> bytes of the object pointed to by <[s1]> with the object pointed to by <[s2]>. @@ -39,9 +32,8 @@ QUICKREF #include int -_DEFUN (bcmp, (m1, m2, n), - _CONST void *m1 _AND - _CONST void *m2 _AND +bcmp (const void *m1, + const void *m2, size_t n) { diff --git a/newlib/libc/string/bcopy.c b/newlib/libc/string/bcopy.c index 2881fd92c..d8bdeb57f 100644 --- a/newlib/libc/string/bcopy.c +++ b/newlib/libc/string/bcopy.c @@ -2,16 +2,10 @@ FUNCTION <>---copy memory regions -ANSI_SYNOPSIS +SYNOPSIS #include void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>); -TRAD_SYNOPSIS - void bcopy(<[in]>, <[out]>, <[n]> - const void *<[in]>; - void *<[out]>; - size_t <[n]>; - DESCRIPTION This function copies <[n]> bytes from the memory region pointed to by <[in]> to the memory region pointed to by @@ -30,9 +24,8 @@ QUICKREF #include void -_DEFUN (bcopy, (b1, b2, length), - _CONST void *b1 _AND - void *b2 _AND +bcopy (const void *b1, + void *b2, size_t length) { memmove (b2, b1, length); diff --git a/newlib/libc/string/bzero.c b/newlib/libc/string/bzero.c index e99529af6..dc52170c5 100644 --- a/newlib/libc/string/bzero.c +++ b/newlib/libc/string/bzero.c @@ -5,16 +5,10 @@ FUNCTION INDEX bzero -ANSI_SYNOPSIS +SYNOPSIS #include void bzero(void *<[b]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - void bzero(<[b]>, <[length]>) - void *<[b]>; - size_t <[length]>; - DESCRIPTION <> initializes <[length]> bytes of memory, starting at address <[b]>, to zero. diff --git a/newlib/libc/string/combining.t b/newlib/libc/string/combining.t new file mode 100644 index 000000000..629d8f891 --- /dev/null +++ b/newlib/libc/string/combining.t @@ -0,0 +1,107 @@ +{ + { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD }, + { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, + { 0x05C7, 0x05C7 }, { 0x0600, 0x0605 }, { 0x0610, 0x061A }, + { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06DD }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 }, + { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 }, + { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, + { 0x0816, 0x0819 }, { 0x081B, 0x0823 }, { 0x0825, 0x0827 }, + { 0x0829, 0x082D }, { 0x0859, 0x085B }, { 0x08D4, 0x0902 }, + { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, + { 0x094D, 0x094D }, { 0x0951, 0x0957 }, { 0x0962, 0x0963 }, + { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, + { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, + { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, + { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A70, 0x0A71 }, + { 0x0A75, 0x0A75 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0AFA, 0x0AFF }, { 0x0B01, 0x0B01 }, + { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B44 }, + { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B62, 0x0B63 }, + { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, + { 0x0C00, 0x0C00 }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 }, + { 0x0C81, 0x0C81 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, + { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 }, + { 0x0D00, 0x0D01 }, { 0x0D3B, 0x0D3C }, { 0x0D41, 0x0D44 }, + { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0DCA, 0x0DCA }, + { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, + { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, + { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, + { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, + { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, + { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, + { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 }, + { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 }, + { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 }, + { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D }, + { 0x1160, 0x11FF }, { 0x135D, 0x135F }, { 0x1712, 0x1714 }, + { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, + { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, + { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180E }, + { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1A1B, 0x1A1B }, { 0x1A56, 0x1A56 }, + { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 }, + { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F }, + { 0x1AB0, 0x1ABE }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1B80, 0x1B81 }, { 0x1BA2, 0x1BA5 }, + { 0x1BA8, 0x1BA9 }, { 0x1BAB, 0x1BAD }, { 0x1BE6, 0x1BE6 }, + { 0x1BE8, 0x1BE9 }, { 0x1BED, 0x1BED }, { 0x1BEF, 0x1BF1 }, + { 0x1C2C, 0x1C33 }, { 0x1C36, 0x1C37 }, { 0x1CD0, 0x1CD2 }, + { 0x1CD4, 0x1CE0 }, { 0x1CE2, 0x1CE8 }, { 0x1CED, 0x1CED }, + { 0x1CF4, 0x1CF4 }, { 0x1CF8, 0x1CF9 }, { 0x1DC0, 0x1DF9 }, + { 0x1DFB, 0x1DFF }, { 0x200B, 0x200F }, { 0x202A, 0x202E }, + { 0x2060, 0x2064 }, { 0x2066, 0x206F }, { 0x20D0, 0x20F0 }, + { 0x2CEF, 0x2CF1 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2DFF }, + { 0x302A, 0x302D }, { 0x3099, 0x309A }, { 0xA66F, 0xA672 }, + { 0xA674, 0xA67D }, { 0xA69E, 0xA69F }, { 0xA6F0, 0xA6F1 }, + { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xA8C4, 0xA8C5 }, { 0xA8E0, 0xA8F1 }, + { 0xA926, 0xA92D }, { 0xA947, 0xA951 }, { 0xA980, 0xA982 }, + { 0xA9B3, 0xA9B3 }, { 0xA9B6, 0xA9B9 }, { 0xA9BC, 0xA9BC }, + { 0xA9E5, 0xA9E5 }, { 0xAA29, 0xAA2E }, { 0xAA31, 0xAA32 }, + { 0xAA35, 0xAA36 }, { 0xAA43, 0xAA43 }, { 0xAA4C, 0xAA4C }, + { 0xAA7C, 0xAA7C }, { 0xAAB0, 0xAAB0 }, { 0xAAB2, 0xAAB4 }, + { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, + { 0xAAEC, 0xAAED }, { 0xAAF6, 0xAAF6 }, { 0xABE5, 0xABE5 }, + { 0xABE8, 0xABE8 }, { 0xABED, 0xABED }, { 0xD7B0, 0xD7C6 }, + { 0xD7CB, 0xD7FB }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x101FD, 0x101FD }, { 0x102E0, 0x102E0 }, { 0x10376, 0x1037A }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x10AE5, 0x10AE6 }, + { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x1107F, 0x11081 }, + { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x110BD, 0x110BD }, + { 0x11100, 0x11102 }, { 0x11127, 0x1112B }, { 0x1112D, 0x11134 }, + { 0x11173, 0x11173 }, { 0x11180, 0x11181 }, { 0x111B6, 0x111BE }, + { 0x111CA, 0x111CC }, { 0x1122F, 0x11231 }, { 0x11234, 0x11234 }, + { 0x11236, 0x11237 }, { 0x1123E, 0x1123E }, { 0x112DF, 0x112DF }, + { 0x112E3, 0x112EA }, { 0x11300, 0x11301 }, { 0x1133C, 0x1133C }, + { 0x11340, 0x11340 }, { 0x11366, 0x1136C }, { 0x11370, 0x11374 }, + { 0x11438, 0x1143F }, { 0x11442, 0x11444 }, { 0x11446, 0x11446 }, + { 0x114B3, 0x114B8 }, { 0x114BA, 0x114BA }, { 0x114BF, 0x114C0 }, + { 0x114C2, 0x114C3 }, { 0x115B2, 0x115B5 }, { 0x115BC, 0x115BD }, + { 0x115BF, 0x115C0 }, { 0x115DC, 0x115DD }, { 0x11633, 0x1163A }, + { 0x1163D, 0x1163D }, { 0x1163F, 0x11640 }, { 0x116AB, 0x116AB }, + { 0x116AD, 0x116AD }, { 0x116B0, 0x116B5 }, { 0x116B7, 0x116B7 }, + { 0x1171D, 0x1171F }, { 0x11722, 0x11725 }, { 0x11727, 0x1172B }, + { 0x11A01, 0x11A06 }, { 0x11A09, 0x11A0A }, { 0x11A33, 0x11A38 }, + { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, { 0x11A51, 0x11A56 }, + { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, { 0x11A98, 0x11A99 }, + { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, { 0x11C3F, 0x11C3F }, + { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, { 0x11CB2, 0x11CB3 }, + { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A }, + { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 }, + { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 }, { 0x16F8F, 0x16F92 }, + { 0x1BC9D, 0x1BC9E }, { 0x1BCA0, 0x1BCA3 }, { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 }, { 0x1DA3B, 0x1DA6C }, + { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 }, { 0x1DA9B, 0x1DA9F }, + { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 }, { 0x1E008, 0x1E018 }, + { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 }, { 0x1E026, 0x1E02A }, + { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A }, { 0xE0001, 0xE0001 }, + { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF } +}; diff --git a/newlib/libc/string/gnu_basename.c b/newlib/libc/string/gnu_basename.c index 90e22ccdf..c43542599 100644 --- a/newlib/libc/string/gnu_basename.c +++ b/newlib/libc/string/gnu_basename.c @@ -14,8 +14,7 @@ #include char * -_DEFUN (__gnu_basename, (path), - const char *path) +__gnu_basename (const char *path) { char *p; if ((p = strrchr (path, '/'))) diff --git a/newlib/libc/string/index.c b/newlib/libc/string/index.c index ec241ffa8..4a6788512 100644 --- a/newlib/libc/string/index.c +++ b/newlib/libc/string/index.c @@ -5,16 +5,10 @@ FUNCTION INDEX index -ANSI_SYNOPSIS +SYNOPSIS #include char * index(const char *<[string]>, int <[c]>); -TRAD_SYNOPSIS - #include - char * index(<[string]>, <[c]>); - char *<[string]>; - int *<[c]>; - DESCRIPTION This function finds the first occurence of <[c]> (converted to a char) in the string pointed to by <[string]> (including the @@ -37,8 +31,7 @@ QUICKREF #include char * -_DEFUN (index, (s, c), - _CONST char *s _AND +index (const char *s, int c) { return strchr (s, c); diff --git a/newlib/libc/string/local.h b/newlib/libc/string/local.h index afef7e34a..8d364fdaa 100644 --- a/newlib/libc/string/local.h +++ b/newlib/libc/string/local.h @@ -2,7 +2,7 @@ #include <../ctype/local.h> /* internal function to compute width of wide char. */ -int _EXFUN (__wcwidth, (wint_t)); +int __wcwidth (wint_t); /* Taken from glibc: diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c index 332ed4660..1f5f55c50 100644 --- a/newlib/libc/string/memccpy.c +++ b/newlib/libc/string/memccpy.c @@ -2,18 +2,11 @@ FUNCTION <>---copy memory regions with end-token check -ANSI_SYNOPSIS +SYNOPSIS #include void* memccpy(void *restrict <[out]>, const void *restrict <[in]>, int <[endchar]>, size_t <[n]>); -TRAD_SYNOPSIS - void *memccpy(<[out]>, <[in]>, <[endchar]>, <[n]> - void *<[out]>; - void *<[in]>; - int <[endchar]>; - size_t <[n]>; - DESCRIPTION This function copies up to <[n]> bytes from the memory region pointed to by <[in]> to the memory region pointed to by @@ -62,16 +55,15 @@ PORTABILITY #endif -_PTR -_DEFUN (memccpy, (dst0, src0, endchar, len0), - _PTR __restrict dst0 _AND - _CONST _PTR __restrict src0 _AND - int endchar0 _AND +void * +memccpy (void *__restrict dst0, + const void *__restrict src0, + int endchar0, size_t len0) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) - _PTR ptr = NULL; + void *ptr = NULL; char *dst = (char *) dst0; char *src = (char *) src0; char endchar = endchar0 & 0xff; @@ -87,11 +79,11 @@ _DEFUN (memccpy, (dst0, src0, endchar, len0), return ptr; #else - _PTR ptr = NULL; + void *ptr = NULL; char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; char endchar = endchar0 & 0xff; /* If the size is small, or either SRC or DST is unaligned, diff --git a/newlib/libc/string/memchr.c b/newlib/libc/string/memchr.c index db0af7cd7..21bc4d879 100644 --- a/newlib/libc/string/memchr.c +++ b/newlib/libc/string/memchr.c @@ -5,17 +5,10 @@ FUNCTION INDEX memchr -ANSI_SYNOPSIS +SYNOPSIS #include void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - void *memchr(<[src]>, <[c]>, <[length]>) - void *<[src]>; - void *<[c]>; - size_t <[length]>; - DESCRIPTION This function searches memory starting at <<*<[src]>>> for the character <[c]>. The search only ends with the first @@ -68,13 +61,12 @@ QUICKREF to fill (long)MASK. */ #define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) -_PTR -_DEFUN (memchr, (src_void, c, length), - _CONST _PTR src_void _AND - int c _AND +void * +memchr (const void *src_void, + int c, size_t length) { - _CONST unsigned char *src = (_CONST unsigned char *) src_void; + const unsigned char *src = (const unsigned char *) src_void; unsigned char d = c; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/memcmp.c b/newlib/libc/string/memcmp.c index 4a871fa60..342fb9fbc 100644 --- a/newlib/libc/string/memcmp.c +++ b/newlib/libc/string/memcmp.c @@ -5,17 +5,10 @@ FUNCTION INDEX memcmp -ANSI_SYNOPSIS +SYNOPSIS #include int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - int memcmp(<[s1]>, <[s2]>, <[n]>) - void *<[s1]>; - void *<[s2]>; - size_t <[n]>; - DESCRIPTION This function compares not more than <[n]> characters of the object pointed to by <[s1]> with the object pointed to by <[s2]>. @@ -50,9 +43,8 @@ QUICKREF #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) int -_DEFUN (memcmp, (m1, m2, n), - _CONST _PTR m1 _AND - _CONST _PTR m2 _AND +memcmp (const void *m1, + const void *m2, size_t n) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/memcpy.c b/newlib/libc/string/memcpy.c index 5f27bca72..52f716b92 100644 --- a/newlib/libc/string/memcpy.c +++ b/newlib/libc/string/memcpy.c @@ -2,18 +2,11 @@ FUNCTION <>---copy memory regions -ANSI_SYNOPSIS +SYNOPSIS #include void* memcpy(void *restrict <[out]>, const void *restrict <[in]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - void *memcpy(<[out]>, <[in]>, <[n]> - void *<[out]>; - void *<[in]>; - size_t <[n]>; - DESCRIPTION This function copies <[n]> bytes from the memory region pointed to by <[in]> to the memory region pointed to by @@ -36,6 +29,7 @@ QUICKREF #include <_ansi.h> #include +#include "local.h" /* Nonzero if either X or Y is not aligned on a "long" boundary. */ #define UNALIGNED(X, Y) \ @@ -50,17 +44,17 @@ QUICKREF /* Threshhold for punting to the byte copier. */ #define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) -_PTR -_DEFUN (memcpy, (dst0, src0, len0), - _PTR __restrict dst0 _AND - _CONST _PTR __restrict src0 _AND +void * +__inhibit_loop_to_libcall +memcpy (void *__restrict dst0, + const void *__restrict src0, size_t len0) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) char *dst = (char *) dst0; char *src = (char *) src0; - _PTR save = dst0; + void *save = dst0; while (len0--) { @@ -70,9 +64,9 @@ _DEFUN (memcpy, (dst0, src0, len0), return save; #else char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */ diff --git a/newlib/libc/string/memmem.c b/newlib/libc/string/memmem.c index 25704e467..5c57eff9c 100644 --- a/newlib/libc/string/memmem.c +++ b/newlib/libc/string/memmem.c @@ -11,7 +11,7 @@ FUNCTION INDEX memmem -ANSI_SYNOPSIS +SYNOPSIS #include char *memmem(const void *<[s1]>, size_t <[l1]>, const void *<[s2]>, size_t <[l2]>); @@ -46,10 +46,9 @@ QUICKREF #endif void * -_DEFUN (memmem, (haystack_start, haystack_len, needle_start, needle_len), - const void *haystack_start _AND - size_t haystack_len _AND - const void *needle_start _AND +memmem (const void *haystack_start, + size_t haystack_len, + const void *needle_start, size_t needle_len) { /* Abstract memory is considered to be an array of 'unsigned char' values, diff --git a/newlib/libc/string/memmove.c b/newlib/libc/string/memmove.c index a037c7c2f..da5dfdbdd 100644 --- a/newlib/libc/string/memmove.c +++ b/newlib/libc/string/memmove.c @@ -5,17 +5,10 @@ FUNCTION INDEX memmove -ANSI_SYNOPSIS +SYNOPSIS #include void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - void *memmove(<[dst]>, <[src]>, <[length]>) - void *<[dst]>; - void *<[src]>; - size_t <[length]>; - DESCRIPTION This function moves <[length]> characters from the block of memory starting at <<*<[src]>>> to the memory starting at @@ -55,16 +48,15 @@ QUICKREF #define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) /*SUPPRESS 20*/ -_PTR +void * __inhibit_loop_to_libcall -_DEFUN (memmove, (dst_void, src_void, length), - _PTR dst_void _AND - _CONST _PTR src_void _AND +memmove (void *dst_void, + const void *src_void, size_t length) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) char *dst = dst_void; - _CONST char *src = src_void; + const char *src = src_void; if (src < dst && dst < src + length) { @@ -87,9 +79,9 @@ _DEFUN (memmove, (dst_void, src_void, length), return dst_void; #else char *dst = dst_void; - _CONST char *src = src_void; + const char *src = src_void; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; if (src < dst && dst < src + length) { diff --git a/newlib/libc/string/mempcpy.c b/newlib/libc/string/mempcpy.c index 5c6738f22..129165603 100644 --- a/newlib/libc/string/mempcpy.c +++ b/newlib/libc/string/mempcpy.c @@ -2,16 +2,10 @@ FUNCTION <>---copy memory regions and return end pointer -ANSI_SYNOPSIS +SYNOPSIS #include void* mempcpy(void *<[out]>, const void *<[in]>, size_t <[n]>); -TRAD_SYNOPSIS - void *mempcpy(<[out]>, <[in]>, <[n]> - void *<[out]>; - void *<[in]>; - size_t <[n]>; - DESCRIPTION This function copies <[n]> bytes from the memory region pointed to by <[in]> to the memory region pointed to by @@ -48,10 +42,9 @@ PORTABILITY /* Threshhold for punting to the byte copier. */ #define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE) -_PTR -_DEFUN (mempcpy, (dst0, src0, len0), - _PTR dst0 _AND - _CONST _PTR src0 _AND +void * +mempcpy (void *dst0, + const void *src0, size_t len0) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) @@ -66,9 +59,9 @@ _DEFUN (mempcpy, (dst0, src0, len0), return dst; #else char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */ diff --git a/newlib/libc/string/memrchr.c b/newlib/libc/string/memrchr.c index 60dee42ed..652efb359 100644 --- a/newlib/libc/string/memrchr.c +++ b/newlib/libc/string/memrchr.c @@ -5,17 +5,10 @@ FUNCTION INDEX memrchr -ANSI_SYNOPSIS +SYNOPSIS #include void *memrchr(const void *<[src]>, int <[c]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - void *memrchr(<[src]>, <[c]>, <[length]>) - void *<[src]>; - void *<[c]>; - size_t <[length]>; - DESCRIPTION This function searches memory starting at <[length]> bytes beyond <<*<[src]>>> backwards for the character <[c]>. @@ -68,13 +61,12 @@ QUICKREF to fill (long)MASK. */ #define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) -_PTR -_DEFUN (memrchr, (src_void, c, length), - _CONST _PTR src_void _AND - int c _AND +void * +memrchr (const void *src_void, + int c, size_t length) { - _CONST unsigned char *src = (_CONST unsigned char *) src_void + length - 1; + const unsigned char *src = (const unsigned char *) src_void + length - 1; unsigned char d = c; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/memset.c b/newlib/libc/string/memset.c index b84e155f7..e8e667a24 100644 --- a/newlib/libc/string/memset.c +++ b/newlib/libc/string/memset.c @@ -5,17 +5,10 @@ FUNCTION INDEX memset -ANSI_SYNOPSIS +SYNOPSIS #include void *memset(void *<[dst]>, int <[c]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - void *memset(<[dst]>, <[c]>, <[length]>) - void *<[dst]>; - int <[c]>; - size_t <[length]>; - DESCRIPTION This function converts the argument <[c]> into an unsigned char and fills the first <[length]> characters of the array @@ -40,11 +33,10 @@ QUICKREF #define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1)) #define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE) -_PTR +void * __inhibit_loop_to_libcall -_DEFUN (memset, (m, c, n), - _PTR m _AND - int c _AND +memset (void *m, + int c, size_t n) { char *s = (char *) m; diff --git a/newlib/libc/string/mkunidata b/newlib/libc/string/mkunidata new file mode 100755 index 000000000..7ebebeb07 --- /dev/null +++ b/newlib/libc/string/mkunidata @@ -0,0 +1,71 @@ +#! /bin/sh + +echo Generating Unicode width data for newlib/libc/string/wcwidth.c + +cd `dirname $0` +PATH="$PATH":. # ensure access to uniset tool + +############################################################################# +# checks and (with option -u) downloads + +case "$1" in +-h) echo "Usage: $0 [-h|-u|-i]" + echo "Generate width data tables ambiguous.t, combining.t, wide.t" + echo "from local Unicode files UnicodeData.txt, Blocks.txt, EastAsianWidth.txt." + echo "" + echo "Options:" + echo " -u download files from unicode.org first, download uniset tool" + echo " -i copy files from /usr/share/unicode/ucd first" + echo " -h show this" + exit + ;; +-u) + wget () { + curl -R -O --connect-timeout 55 -z "`basename $1`" "$1" + } + + echo downloading uniset tool + wget http://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz + gzip -dc uniset.tar.gz | tar xvf - uniset + + echo downloading data from unicode.org + for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt + do wget http://unicode.org/Public/UNIDATA/$data + done + ;; +-i) + echo copying data from /usr/share/unicode/ucd + for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt + do cp /usr/share/unicode/ucd/$data . + done + ;; +esac + +echo checking uniset tool +type uniset || exit 9 + +echo checking Unicode data files +for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt +do if [ -r $data ] + then true + else echo $data not available, skipping table generation + exit + fi +done + +echo generating from Unicode version `sed -e 's,[^.0-9],,g' -e 1q Blocks.txt` + +############################################################################# +# table generation + +echo generating combining characters table +uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B +D7B0-D7C6 +D7CB-D7FB c > combining.t + +echo generating ambiguous width characters table +sh ./mkwidthA && uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c > ambiguous.t + +echo generating wide characters table +sh ./mkwide + +############################################################################# +# end diff --git a/newlib/libc/string/mkwide b/newlib/libc/string/mkwide new file mode 100755 index 000000000..55a0bab43 --- /dev/null +++ b/newlib/libc/string/mkwide @@ -0,0 +1,49 @@ +#! /bin/sh + +# generate list of wide characters, with convex closure + +skipcheck=false + +if [ ! -r EastAsianWidth.txt ] +then ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1 +fi +if [ ! -r UnicodeData.txt ] +then ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1 +fi +if [ ! -r Blocks.txt ] +then ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1 +fi + +sed -e "s,^\([^;]*\);[NAH],\1," -e t -e d EastAsianWidth.txt > wide.na +sed -e "s,^\([^;]*\);[WF],\1," -e t -e d EastAsianWidth.txt > wide.fw + +PATH="$PATH:." # for uniset + +nrfw=`uniset +wide.fw nr | sed -e 's,.*:,,'` +echo FW $nrfw +nrna=`uniset +wide.na nr | sed -e 's,.*:,,'` +echo NAH $nrna + +extrablocks="2E80-303E" + +# check all blocks +includes () { + nr=`uniset +wide.$2 -$1 nr | sed -e 's,.*:,,'` + test $nr != $3 +} +echo "adding compact closure of wide ranges, this may take ~10min" +for b in $extrablocks `sed -e 's,^\([0-9A-F]*\)\.\.\([0-9A-F]*\).*,\1-\2,' -e t -e d Blocks.txt` +do range=$b + echo checking $range $* >&2 + if includes $range fw $nrfw && ! includes $range na $nrna + then echo $range + fi +done > wide.blocks + +( +sed -e "s,^,//," -e 1q EastAsianWidth.txt +sed -e "s,^,//," -e 1q Blocks.txt +uniset `sed -e 's,^,+,' wide.blocks` +wide.fw c +) > wide.t + +rm -f wide.na wide.fw wide.blocks diff --git a/newlib/libc/string/mkwidthA b/newlib/libc/string/mkwidthA new file mode 100755 index 000000000..343ab4016 --- /dev/null +++ b/newlib/libc/string/mkwidthA @@ -0,0 +1,20 @@ +#! /bin/sh + +# generate WIDTH-A file, listing Unicode characters with width property +# Ambiguous, from EastAsianWidth.txt + +if [ ! -r EastAsianWidth.txt ] +then ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1 +fi +if [ ! -r UnicodeData.txt ] +then ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1 +fi +if [ ! -r Blocks.txt ] +then ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1 +fi + +sed -e "s,^\([^;]*\);A,\1," -e t -e d EastAsianWidth.txt > width-a-new +rm -f WIDTH-A +echo "# UAX #11: East Asian Ambiguous" > WIDTH-A +PATH="$PATH:." uniset +width-a-new compact >> WIDTH-A +rm -f width-a-new diff --git a/newlib/libc/string/rawmemchr.c b/newlib/libc/string/rawmemchr.c index 4b5a4cdeb..56e2b5e2d 100644 --- a/newlib/libc/string/rawmemchr.c +++ b/newlib/libc/string/rawmemchr.c @@ -5,16 +5,10 @@ FUNCTION INDEX rawmemchr -ANSI_SYNOPSIS +SYNOPSIS #include void *rawmemchr(const void *<[src]>, int <[c]>); -TRAD_SYNOPSIS - #include - void *rawmemchr(<[src]>, <[c]>) - void *<[src]>; - void *<[c]>; - DESCRIPTION This function searches memory starting at <<*<[src]>>> for the character <[c]>. The search only ends with the first occurrence @@ -66,12 +60,11 @@ QUICKREF to fill (long)MASK. */ #define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) -_PTR -_DEFUN (rawmemchr, (src_void, c), - _CONST _PTR src_void _AND +void * +rawmemchr (const void *src_void, int c) { - _CONST unsigned char *src = (_CONST unsigned char *) src_void; + const unsigned char *src = (const unsigned char *) src_void; unsigned char d = c; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/rindex.c b/newlib/libc/string/rindex.c index daa1c5237..39e5aa2da 100644 --- a/newlib/libc/string/rindex.c +++ b/newlib/libc/string/rindex.c @@ -5,16 +5,10 @@ FUNCTION INDEX rindex -ANSI_SYNOPSIS +SYNOPSIS #include char * rindex(const char *<[string]>, int <[c]>); -TRAD_SYNOPSIS - #include - char * rindex(<[string]>, <[c]>); - char *<[string]>; - int *<[c]>; - DESCRIPTION This function finds the last occurence of <[c]> (converted to a char) in the string pointed to by <[string]> (including the @@ -37,8 +31,7 @@ QUICKREF #include char * -_DEFUN (rindex, (s, c), - _CONST char *s _AND +rindex (const char *s, int c) { return strrchr (s, c); diff --git a/newlib/libc/string/stpcpy.c b/newlib/libc/string/stpcpy.c index bc58f4771..4e2ae9fe0 100644 --- a/newlib/libc/string/stpcpy.c +++ b/newlib/libc/string/stpcpy.c @@ -5,16 +5,10 @@ FUNCTION INDEX stpcpy -ANSI_SYNOPSIS +SYNOPSIS #include char *stpcpy(char *restrict <[dst]>, const char *restrict <[src]>); -TRAD_SYNOPSIS - #include - char *stpcpy(<[dst]>, <[src]>) - char *<[dst]>; - char *<[src]>; - DESCRIPTION <> copies the string pointed to by <[src]> (including the terminating null character) to the array @@ -59,13 +53,12 @@ QUICKREF #endif char* -_DEFUN (stpcpy, (dst, src), - char *__restrict dst _AND - _CONST char *__restrict src) +stpcpy (char *__restrict dst, + const char *__restrict src) { #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If SRC or DEST is unaligned, then copy bytes. */ if (!UNALIGNED (src, dst)) diff --git a/newlib/libc/string/stpncpy.c b/newlib/libc/string/stpncpy.c index abd9bbdbf..87fe268cf 100644 --- a/newlib/libc/string/stpncpy.c +++ b/newlib/libc/string/stpncpy.c @@ -5,18 +5,11 @@ FUNCTION INDEX stpncpy -ANSI_SYNOPSIS +SYNOPSIS #include char *stpncpy(char *restrict <[dst]>, const char *restrict <[src]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - char *stpncpy(<[dst]>, <[src]>, <[length]>) - char *<[dst]>; - char *<[src]>; - size_t <[length]>; - DESCRIPTION <> copies not more than <[length]> characters from the the string pointed to by <[src]> (including the terminating @@ -68,16 +61,15 @@ QUICKREF #define TOO_SMALL(LEN) ((LEN) < sizeof (long)) char * -_DEFUN (stpncpy, (dst, src), - char *__restrict dst _AND - _CONST char *__restrict src _AND +stpncpy (char *__restrict dst, + const char *__restrict src, size_t count) { char *ret = NULL; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If SRC and DEST is aligned and count large enough, then copy words. */ if (!UNALIGNED (src, dst) && !TOO_SMALL (count)) diff --git a/newlib/libc/string/strcasecmp.c b/newlib/libc/string/strcasecmp.c index df8510b13..c75a3e20d 100644 --- a/newlib/libc/string/strcasecmp.c +++ b/newlib/libc/string/strcasecmp.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcasecmp -ANSI_SYNOPSIS +SYNOPSIS #include int strcasecmp(const char *<[a]>, const char *<[b]>); -TRAD_SYNOPSIS - #include - int strcasecmp(<[a]>, <[b]>) - char *<[a]>; - char *<[b]>; - DESCRIPTION <> compares the string at <[a]> to the string at <[b]> in a case-insensitive manner. @@ -42,15 +36,14 @@ QUICKREF #include int -_DEFUN (strcasecmp, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strcasecmp (const char *s1, + const char *s2) { int d = 0; for ( ; ; ) { - _CONST int c1 = tolower(*s1++); - _CONST int c2 = tolower(*s2++); + const int c1 = tolower(*s1++); + const int c2 = tolower(*s2++); if (((d = c1 - c2) != 0) || (c2 == '\0')) break; } diff --git a/newlib/libc/string/strcasecmp_l.c b/newlib/libc/string/strcasecmp_l.c index f87039d91..587f56ee1 100644 --- a/newlib/libc/string/strcasecmp_l.c +++ b/newlib/libc/string/strcasecmp_l.c @@ -5,7 +5,7 @@ FUNCTION INDEX strcasecmp_l -ANSI_SYNOPSIS +SYNOPSIS #include int strcasecmp_l(const char *<[a]>, const char *<[b]>, locale_t <[locale]>); diff --git a/newlib/libc/string/strcasestr.c b/newlib/libc/string/strcasestr.c index 8fff00b00..36e183986 100644 --- a/newlib/libc/string/strcasestr.c +++ b/newlib/libc/string/strcasestr.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcasestr -ANSI_SYNOPSIS +SYNOPSIS #include char *strcasestr(const char *<[s]>, const char *<[find]>); -TRAD_SYNOPSIS - #include - int strcasecmp(<[s]>, <[find]>) - char *<[s]>; - char *<[find]>; - DESCRIPTION <> searchs the string <[s]> for the first occurrence of the sequence <[find]>. <> @@ -96,9 +90,8 @@ QUICKREF * Find the first occurrence of find in s, ignore case. */ char * -_DEFUN (strcasestr, (s, find), - _CONST char *s _AND - _CONST char *find) +strcasestr (const char *s, + const char *find) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/strcat.c b/newlib/libc/string/strcat.c index 1e4614991..92313c492 100644 --- a/newlib/libc/string/strcat.c +++ b/newlib/libc/string/strcat.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcat -ANSI_SYNOPSIS +SYNOPSIS #include char *strcat(char *restrict <[dst]>, const char *restrict <[src]>); -TRAD_SYNOPSIS - #include - char *strcat(<[dst]>, <[src]>) - char *<[dst]>; - char *<[src]>; - DESCRIPTION <> appends a copy of the string pointed to by <[src]> (including the terminating null character) to the end of the @@ -60,9 +54,8 @@ QUICKREF /*SUPPRESS 530*/ char * -_DEFUN (strcat, (s1, s2), - char *__restrict s1 _AND - _CONST char *__restrict s2) +strcat (char *__restrict s1, + const char *__restrict s2) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) char *s = s1; diff --git a/newlib/libc/string/strchr.c b/newlib/libc/string/strchr.c index e921b5db7..96f30be04 100644 --- a/newlib/libc/string/strchr.c +++ b/newlib/libc/string/strchr.c @@ -5,16 +5,10 @@ FUNCTION INDEX strchr -ANSI_SYNOPSIS +SYNOPSIS #include char * strchr(const char *<[string]>, int <[c]>); -TRAD_SYNOPSIS - #include - char * strchr(<[string]>, <[c]>); - const char *<[string]>; - int <[c]>; - DESCRIPTION This function finds the first occurence of <[c]> (converted to a char) in the string pointed to by <[string]> (including the @@ -58,11 +52,10 @@ QUICKREF #define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK)) char * -_DEFUN (strchr, (s1, i), - _CONST char *s1 _AND +strchr (const char *s1, int i) { - _CONST unsigned char *s = (_CONST unsigned char *)s1; + const unsigned char *s = (const unsigned char *)s1; unsigned char c = i; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/strchrnul.c b/newlib/libc/string/strchrnul.c index afeef434e..f5c3eb25d 100644 --- a/newlib/libc/string/strchrnul.c +++ b/newlib/libc/string/strchrnul.c @@ -5,16 +5,10 @@ FUNCTION INDEX strchrnul -ANSI_SYNOPSIS +SYNOPSIS #include char * strchrnul(const char *<[string]>, int <[c]>); -TRAD_SYNOPSIS - #include - char * strchrnul(<[string]>, <[c]>); - const char *<[string]>; - int <[c]>; - DESCRIPTION This function finds the first occurence of <[c]> (converted to a char) in the string pointed to by <[string]> (including the @@ -37,8 +31,7 @@ QUICKREF #include char * -_DEFUN (strchrnul, (s1, i), - _CONST char *s1 _AND +strchrnul (const char *s1, int i) { char *s = strchr(s1, i); diff --git a/newlib/libc/string/strcmp.c b/newlib/libc/string/strcmp.c index 81d65272e..894424a69 100644 --- a/newlib/libc/string/strcmp.c +++ b/newlib/libc/string/strcmp.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcmp -ANSI_SYNOPSIS +SYNOPSIS #include int strcmp(const char *<[a]>, const char *<[b]>); -TRAD_SYNOPSIS - #include - int strcmp(<[a]>, <[b]>) - char *<[a]>; - char *<[b]>; - DESCRIPTION <> compares the string at <[a]> to the string at <[b]>. @@ -58,9 +52,8 @@ QUICKREF #endif int -_DEFUN (strcmp, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strcmp (const char *s1, + const char *s2) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) while (*s1 != '\0' && *s1 == *s2) diff --git a/newlib/libc/string/strcoll.c b/newlib/libc/string/strcoll.c index a6bb31a4e..7fa8d1373 100644 --- a/newlib/libc/string/strcoll.c +++ b/newlib/libc/string/strcoll.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcoll -ANSI_SYNOPSIS +SYNOPSIS #include int strcoll(const char *<[stra]>, const char * <[strb]>); -TRAD_SYNOPSIS - #include - int strcoll(<[stra]>, <[strb]>) - char *<[stra]>; - char *<[strb]>; - DESCRIPTION <> compares the string pointed to by <[stra]> to the string pointed to by <[strb]>, using an interpretation @@ -42,9 +36,8 @@ QUICKREF #include int -_DEFUN (strcoll, (a, b), - _CONST char *a _AND - _CONST char *b) +strcoll (const char *a, + const char *b) { return strcmp (a, b); diff --git a/newlib/libc/string/strcoll_l.c b/newlib/libc/string/strcoll_l.c index 5032f8439..89a7d0535 100644 --- a/newlib/libc/string/strcoll_l.c +++ b/newlib/libc/string/strcoll_l.c @@ -5,7 +5,7 @@ FUNCTION INDEX strcoll_l -ANSI_SYNOPSIS +SYNOPSIS #include int strcoll_l(const char *<[stra]>, const char * <[strb]>, locale_t <[locale]>); diff --git a/newlib/libc/string/strcpy.c b/newlib/libc/string/strcpy.c index 3dc3c33f6..94e16b512 100644 --- a/newlib/libc/string/strcpy.c +++ b/newlib/libc/string/strcpy.c @@ -5,16 +5,10 @@ FUNCTION INDEX strcpy -ANSI_SYNOPSIS +SYNOPSIS #include char *strcpy(char *<[dst]>, const char *<[src]>); -TRAD_SYNOPSIS - #include - char *strcpy(<[dst]>, <[src]>) - char *<[dst]>; - char *<[src]>; - DESCRIPTION <> copies the string pointed to by <[src]> (including the terminating null character) to the array @@ -58,9 +52,8 @@ QUICKREF #endif char* -_DEFUN (strcpy, (dst0, src0), - char *dst0 _AND - _CONST char *src0) +strcpy (char *dst0, + const char *src0) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) char *s = dst0; @@ -71,9 +64,9 @@ _DEFUN (strcpy, (dst0, src0), return s; #else char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If SRC or DEST is unaligned, then copy bytes. */ if (!UNALIGNED (src, dst)) diff --git a/newlib/libc/string/strcspn.c b/newlib/libc/string/strcspn.c index 403330c94..abaa93ad6 100644 --- a/newlib/libc/string/strcspn.c +++ b/newlib/libc/string/strcspn.c @@ -5,14 +5,9 @@ FUNCTION INDEX strcspn -ANSI_SYNOPSIS +SYNOPSIS size_t strcspn(const char *<[s1]>, const char *<[s2]>); -TRAD_SYNOPSIS - size_t strcspn(<[s1]>, <[s2]>) - char *<[s1]>; - char *<[s2]>; - DESCRIPTION This function computes the length of the initial part of the string pointed to by <[s1]> which consists entirely of @@ -31,12 +26,11 @@ PORTABILITY #include size_t -_DEFUN (strcspn, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strcspn (const char *s1, + const char *s2) { - _CONST char *s = s1; - _CONST char *c; + const char *s = s1; + const char *c; while (*s1) { diff --git a/newlib/libc/string/strdup.c b/newlib/libc/string/strdup.c index dbb069264..3f2a0264c 100644 --- a/newlib/libc/string/strdup.c +++ b/newlib/libc/string/strdup.c @@ -5,7 +5,7 @@ #include char * -_DEFUN (strdup, (str), _CONST char *str) +strdup (const char *str) { return _strdup_r (_REENT, str); } diff --git a/newlib/libc/string/strdup_r.c b/newlib/libc/string/strdup_r.c index ef77a58eb..14c80f73f 100644 --- a/newlib/libc/string/strdup_r.c +++ b/newlib/libc/string/strdup_r.c @@ -3,9 +3,8 @@ #include char * -_DEFUN (_strdup_r, (reent_ptr, str), - struct _reent *reent_ptr _AND - _CONST char *str) +_strdup_r (struct _reent *reent_ptr, + const char *str) { size_t len = strlen (str) + 1; char *copy = _malloc_r (reent_ptr, len); diff --git a/newlib/libc/string/strerror.c b/newlib/libc/string/strerror.c index d5f0a3ec9..c1b934696 100644 --- a/newlib/libc/string/strerror.c +++ b/newlib/libc/string/strerror.c @@ -15,18 +15,13 @@ INDEX INDEX strerror_l -ANSI_SYNOPSIS +SYNOPSIS #include char *strerror(int <[errnum]>); char *strerror_l(int <[errnum]>, locale_t <[locale]>); char *_strerror_r(struct _reent <[ptr]>, int <[errnum]>, int <[internal]>, int *<[error]>); -TRAD_SYNOPSIS - #include - char *strerror(<[errnum]>) - int <[errnum]>; - DESCRIPTION <> converts the error number <[errnum]> into a string. The value of <[errnum]> is usually a copy of <>. @@ -390,14 +385,13 @@ QUICKREF #include char * -_DEFUN (_strerror_r, (ptr, errnum, internal, errptr), - struct _reent *ptr _AND - int errnum _AND - int internal _AND +_strerror_r (struct _reent *ptr, + int errnum, + int internal, int *errptr) { char *error; - extern char *_user_strerror _PARAMS ((int, int, int *)); + extern char *_user_strerror (int, int, int *); switch (errnum) { @@ -898,8 +892,7 @@ _DEFUN (_strerror_r, (ptr, errnum, internal, errptr), } char * -_DEFUN(strerror, (int), - int errnum) +strerror (int errnum) { return _strerror_r (_REENT, errnum, 0, NULL); } diff --git a/newlib/libc/string/strerror_r.c b/newlib/libc/string/strerror_r.c index d26a412a5..660fee869 100644 --- a/newlib/libc/string/strerror_r.c +++ b/newlib/libc/string/strerror_r.c @@ -6,7 +6,7 @@ FUNCTION INDEX strerror_r -ANSI_SYNOPSIS +SYNOPSIS #include #ifdef _GNU_SOURCE char *strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>); @@ -14,13 +14,6 @@ ANSI_SYNOPSIS int strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>); #endif -TRAD_SYNOPSIS - #include - char *strerror_r(<[errnum]>, <[buffer]>, <[n]>) - int <[errnum]>; - char *<[buffer]>; - size_t <[n]>; - DESCRIPTION <> converts the error number <[errnum]> into a string and copies the result into the supplied <[buffer]> for @@ -72,9 +65,8 @@ a non-empty alternate string without assigning into its third argument. /* For backwards-compatible linking, this must be the GNU signature; see xpg_strerror_r.c for the POSIX version. */ char * -_DEFUN (strerror_r, (errnum, buffer, n), - int errnum _AND - char *buffer _AND +strerror_r (int errnum, + char *buffer, size_t n) { char *error = _strerror_r (_REENT, errnum, 1, NULL); diff --git a/newlib/libc/string/strings.tex b/newlib/libc/string/strings.tex index c619886b5..6aec5fe0e 100644 --- a/newlib/libc/string/strings.tex +++ b/newlib/libc/string/strings.tex @@ -40,6 +40,7 @@ managing areas of memory. The corresponding declarations are in * strncat:: Concatenate strings * strncmp:: Character string compare * strncpy:: Counted copy string +* strnstr:: Find string segment * strnlen:: Character string length * strpbrk:: Find chars in string * strrchr:: Reverse search for character in string @@ -158,6 +159,9 @@ managing areas of memory. The corresponding declarations are in @page @include string/strncpy.def +@page +@include string/strnstr.def + @page @include string/strnlen.def diff --git a/newlib/libc/string/strlcat.c b/newlib/libc/string/strlcat.c index 0c47bd527..a91c297c5 100644 --- a/newlib/libc/string/strlcat.c +++ b/newlib/libc/string/strlcat.c @@ -42,9 +42,8 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp * If retval >= siz, truncation occurred. */ size_t -_DEFUN (strlcat, (dst, src, siz), - char *dst _AND - _CONST char *src _AND +strlcat (char *dst, + const char *src, size_t siz) { register char *d = dst; diff --git a/newlib/libc/string/strlcpy.c b/newlib/libc/string/strlcpy.c index c31001642..63ba31ce9 100644 --- a/newlib/libc/string/strlcpy.c +++ b/newlib/libc/string/strlcpy.c @@ -40,9 +40,8 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -_DEFUN (strlcpy, (dst, src, siz), - char *dst _AND - _CONST char *src _AND +strlcpy (char *dst, + const char *src, size_t siz) { register char *d = dst; diff --git a/newlib/libc/string/strlen.c b/newlib/libc/string/strlen.c index a796d2738..acffa49e1 100644 --- a/newlib/libc/string/strlen.c +++ b/newlib/libc/string/strlen.c @@ -5,15 +5,10 @@ FUNCTION INDEX strlen -ANSI_SYNOPSIS +SYNOPSIS #include size_t strlen(const char *<[str]>); -TRAD_SYNOPSIS - #include - size_t strlen(<[str]>) - char *<[src]>; - DESCRIPTION The <> function works out the length of the string starting at <<*<[str]>>> by counting chararacters until it @@ -54,10 +49,9 @@ QUICKREF #endif size_t -_DEFUN (strlen, (str), - _CONST char *str) +strlen (const char *str) { - _CONST char *start = str; + const char *start = str; #if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) unsigned long *aligned_addr; diff --git a/newlib/libc/string/strlwr.c b/newlib/libc/string/strlwr.c index 3b73dba4b..7211c5917 100644 --- a/newlib/libc/string/strlwr.c +++ b/newlib/libc/string/strlwr.c @@ -5,15 +5,10 @@ FUNCTION INDEX strlwr -ANSI_SYNOPSIS +SYNOPSIS #include char *strlwr(char *<[a]>); -TRAD_SYNOPSIS - #include - char *strlwr(<[a]>) - char *<[a]>; - DESCRIPTION <> converts each character in the string at <[a]> to lowercase. @@ -34,8 +29,7 @@ QUICKREF #include char * -_DEFUN (strlwr, (s), - char *s) +strlwr (char *s) { unsigned char *ucs = (unsigned char *) s; for ( ; *ucs != '\0'; ucs++) diff --git a/newlib/libc/string/strncasecmp.c b/newlib/libc/string/strncasecmp.c index 828f30bf9..09dd98bf5 100644 --- a/newlib/libc/string/strncasecmp.c +++ b/newlib/libc/string/strncasecmp.c @@ -5,17 +5,10 @@ FUNCTION INDEX strncasecmp -ANSI_SYNOPSIS +SYNOPSIS #include int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - int strncasecmp(<[a]>, <[b]>, <[length]>) - char *<[a]>; - char *<[b]>; - size_t <[length]> - DESCRIPTION <> compares up to <[length]> characters from the string at <[a]> to the string at <[b]> in a @@ -44,16 +37,15 @@ QUICKREF #include int -_DEFUN (strncasecmp, (s1, s2, n), - _CONST char *s1 _AND - _CONST char *s2 _AND +strncasecmp (const char *s1, + const char *s2, size_t n) { int d = 0; for ( ; n != 0; n--) { - _CONST int c1 = tolower(*s1++); - _CONST int c2 = tolower(*s2++); + const int c1 = tolower(*s1++); + const int c2 = tolower(*s2++); if (((d = c1 - c2) != 0) || (c2 == '\0')) break; } diff --git a/newlib/libc/string/strncasecmp_l.c b/newlib/libc/string/strncasecmp_l.c index 41ae58265..b15c6c545 100644 --- a/newlib/libc/string/strncasecmp_l.c +++ b/newlib/libc/string/strncasecmp_l.c @@ -5,7 +5,7 @@ FUNCTION INDEX strncasecmp_l -ANSI_SYNOPSIS +SYNOPSIS #include int strncasecmp_l(const char *<[a]>, const char * <[b]>, size_t <[length]>, locale_t <[locale]>); diff --git a/newlib/libc/string/strncat.c b/newlib/libc/string/strncat.c index 2f5a061bf..7351913f9 100644 --- a/newlib/libc/string/strncat.c +++ b/newlib/libc/string/strncat.c @@ -5,18 +5,11 @@ FUNCTION INDEX strncat -ANSI_SYNOPSIS +SYNOPSIS #include char *strncat(char *restrict <[dst]>, const char *restrict <[src]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - char *strncat(<[dst]>, <[src]>, <[length]>) - char *<[dst]>; - char *<[src]>; - size_t <[length]>; - DESCRIPTION <> appends not more than <[length]> characters from the string pointed to by <[src]> (including the terminating @@ -65,9 +58,8 @@ QUICKREF #endif char * -_DEFUN (strncat, (s1, s2, n), - char *__restrict s1 _AND - _CONST char *__restrict s2 _AND +strncat (char *__restrict s1, + const char *__restrict s2, size_t n) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/strncmp.c b/newlib/libc/string/strncmp.c index 9801b7d92..16f8a7729 100644 --- a/newlib/libc/string/strncmp.c +++ b/newlib/libc/string/strncmp.c @@ -5,17 +5,10 @@ FUNCTION INDEX strncmp -ANSI_SYNOPSIS +SYNOPSIS #include int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - int strncmp(<[a]>, <[b]>, <[length]>) - char *<[a]>; - char *<[b]>; - size_t <[length]> - DESCRIPTION <> compares up to <[length]> characters from the string at <[a]> to the string at <[b]>. @@ -59,9 +52,8 @@ QUICKREF #endif int -_DEFUN (strncmp, (s1, s2, n), - _CONST char *s1 _AND - _CONST char *s2 _AND +strncmp (const char *s1, + const char *s2, size_t n) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) diff --git a/newlib/libc/string/strncpy.c b/newlib/libc/string/strncpy.c index ff5d0d409..e7eb34d72 100644 --- a/newlib/libc/string/strncpy.c +++ b/newlib/libc/string/strncpy.c @@ -5,18 +5,11 @@ FUNCTION INDEX strncpy -ANSI_SYNOPSIS +SYNOPSIS #include char *strncpy(char *restrict <[dst]>, const char *restrict <[src]>, size_t <[length]>); -TRAD_SYNOPSIS - #include - char *strncpy(<[dst]>, <[src]>, <[length]>) - char *<[dst]>; - char *<[src]>; - size_t <[length]>; - DESCRIPTION <> copies not more than <[length]> characters from the the string pointed to by <[src]> (including the terminating @@ -66,14 +59,13 @@ QUICKREF #define TOO_SMALL(LEN) ((LEN) < sizeof (long)) char * -_DEFUN (strncpy, (dst0, src0), - char *__restrict dst0 _AND - _CONST char *__restrict src0 _AND +strncpy (char *__restrict dst0, + const char *__restrict src0, size_t count) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) char *dscan; - _CONST char *sscan; + const char *sscan; dscan = dst0; sscan = src0; @@ -89,9 +81,9 @@ _DEFUN (strncpy, (dst0, src0), return dst0; #else char *dst = dst0; - _CONST char *src = src0; + const char *src = src0; long *aligned_dst; - _CONST long *aligned_src; + const long *aligned_src; /* If SRC and DEST is aligned and count large enough, then copy words. */ if (!UNALIGNED (src, dst) && !TOO_SMALL (count)) diff --git a/newlib/libc/string/strndup.c b/newlib/libc/string/strndup.c index caa1b68b7..3ac890a8c 100644 --- a/newlib/libc/string/strndup.c +++ b/newlib/libc/string/strndup.c @@ -6,8 +6,7 @@ #include char * -_DEFUN (strndup, (str, n), - _CONST char *str _AND +strndup (const char *str, size_t n) { return _strndup_r (_REENT, str, n); diff --git a/newlib/libc/string/strndup_r.c b/newlib/libc/string/strndup_r.c index 2acf63dec..1b6cf84e5 100644 --- a/newlib/libc/string/strndup_r.c +++ b/newlib/libc/string/strndup_r.c @@ -3,12 +3,11 @@ #include char * -_DEFUN (_strndup_r, (reent_ptr, str, n), - struct _reent *reent_ptr _AND - _CONST char *str _AND +_strndup_r (struct _reent *reent_ptr, + const char *str, size_t n) { - _CONST char *ptr = str; + const char *ptr = str; size_t len; char *copy; diff --git a/newlib/libc/string/strnlen.c b/newlib/libc/string/strnlen.c index ed60e9371..3ee18d1c0 100644 --- a/newlib/libc/string/strnlen.c +++ b/newlib/libc/string/strnlen.c @@ -5,16 +5,10 @@ FUNCTION INDEX strnlen -ANSI_SYNOPSIS +SYNOPSIS #include size_t strnlen(const char *<[str]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - size_t strnlen(<[str]>, <[n]>) - char *<[src]>; - size_t <[n]>; - DESCRIPTION The <> function works out the length of the string starting at <<*<[str]>>> by counting chararacters until it @@ -36,11 +30,10 @@ PORTABILITY #include size_t -_DEFUN (strnlen, (str, n), - _CONST char *str _AND +strnlen (const char *str, size_t n) { - _CONST char *start = str; + const char *start = str; while (n-- > 0 && *str) str++; diff --git a/newlib/libc/string/strnstr.c b/newlib/libc/string/strnstr.c new file mode 100644 index 000000000..cb5f71914 --- /dev/null +++ b/newlib/libc/string/strnstr.c @@ -0,0 +1,51 @@ +/* +FUNCTION + <>---find string segment + +INDEX + strnstr + +SYNOPSIS + #include + size_t strnstr(const char *<[s1]>, const char *<[s2]>, size_t <[n]>); + +DESCRIPTION + Locates the first occurrence in the string pointed to by <[s1]> of + the sequence of limited to the <[n]> characters in the string + pointed to by <[s2]> + +RETURNS + Returns a pointer to the located string segment, or a null + pointer if the string <[s2]> is not found. If <[s2]> points to + a string with zero length, <[s1]> is returned. + + +PORTABILITY +<> is a BSD extension. + +<> requires no supporting OS subroutines. + +QUICKREF + strnstr pure + +*/ + +#define _GNU_SOURCE +#include + +/* + * Find the first occurrence of find in s, where the search is limited to the + * first slen characters of s. + */ +char * +strnstr(const char *haystack, const char *needle, size_t haystack_len) +{ + size_t needle_len = strnlen(needle, haystack_len); + + if (needle_len < haystack_len || !needle[needle_len]) { + char *x = memmem(haystack, haystack_len, needle, needle_len); + if (x && !memchr(haystack, 0, x - haystack)) + return x; + } + return NULL; +} diff --git a/newlib/libc/string/strpbrk.c b/newlib/libc/string/strpbrk.c index 5668db395..774db1e6d 100644 --- a/newlib/libc/string/strpbrk.c +++ b/newlib/libc/string/strpbrk.c @@ -5,16 +5,10 @@ FUNCTION INDEX strpbrk -ANSI_SYNOPSIS +SYNOPSIS #include char *strpbrk(const char *<[s1]>, const char *<[s2]>); -TRAD_SYNOPSIS - #include - char *strpbrk(<[s1]>, <[s2]>) - char *<[s1]>; - char *<[s2]>; - DESCRIPTION This function locates the first occurence in the string pointed to by <[s1]> of any character in string pointed to by @@ -31,11 +25,10 @@ PORTABILITY #include char * -_DEFUN (strpbrk, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strpbrk (const char *s1, + const char *s2) { - _CONST char *c = s2; + const char *c = s2; if (!*s1) return (char *) NULL; diff --git a/newlib/libc/string/strrchr.c b/newlib/libc/string/strrchr.c index 4f903afe2..04897e162 100644 --- a/newlib/libc/string/strrchr.c +++ b/newlib/libc/string/strrchr.c @@ -5,16 +5,10 @@ FUNCTION INDEX strrchr -ANSI_SYNOPSIS +SYNOPSIS #include char * strrchr(const char *<[string]>, int <[c]>); -TRAD_SYNOPSIS - #include - char * strrchr(<[string]>, <[c]>); - char *<[string]>; - int *<[c]>; - DESCRIPTION This function finds the last occurence of <[c]> (converted to a char) in the string pointed to by <[string]> (including the @@ -36,11 +30,10 @@ QUICKREF #include char * -_DEFUN (strrchr, (s, i), - _CONST char *s _AND +strrchr (const char *s, int i) { - _CONST char *last = NULL; + const char *last = NULL; if (i) { diff --git a/newlib/libc/string/strsep.c b/newlib/libc/string/strsep.c index d3d0ad0a9..e1262ac37 100644 --- a/newlib/libc/string/strsep.c +++ b/newlib/libc/string/strsep.c @@ -11,8 +11,7 @@ extern char *__strtok_r (char *, const char *, char **, int); char * -_DEFUN (strsep, (source_ptr, delim), - register char **source_ptr _AND +strsep (register char **source_ptr, register const char *delim) { return __strtok_r (*source_ptr, delim, source_ptr, 0); diff --git a/newlib/libc/string/strsignal.c b/newlib/libc/string/strsignal.c index e32c9a7be..544857b14 100644 --- a/newlib/libc/string/strsignal.c +++ b/newlib/libc/string/strsignal.c @@ -5,15 +5,10 @@ FUNCTION INDEX strsignal -ANSI_SYNOPSIS +SYNOPSIS #include char *strsignal(int <[signal]>); -TRAD_SYNOPSIS - #include - char *strsignal(<[signal]>) - int <[signal]>; - DESCRIPTION <> converts the signal number <[signal]> into a string. If <[signal]> is not a known signal number, the result @@ -58,8 +53,7 @@ QUICKREF #include char * -_DEFUN (strsignal, (signal), - int signal) +strsignal (int signal) { char *buffer; struct _reent *ptr; diff --git a/newlib/libc/string/strspn.c b/newlib/libc/string/strspn.c index 32b921b10..baf239947 100644 --- a/newlib/libc/string/strspn.c +++ b/newlib/libc/string/strspn.c @@ -5,16 +5,10 @@ FUNCTION INDEX strspn -ANSI_SYNOPSIS +SYNOPSIS #include size_t strspn(const char *<[s1]>, const char *<[s2]>); -TRAD_SYNOPSIS - #include - size_t strspn(<[s1]>, <[s2]>) - char *<[s1]>; - char *<[s2]>; - DESCRIPTION This function computes the length of the initial segment of the string pointed to by <[s1]> which consists entirely of @@ -36,12 +30,11 @@ QUICKREF #include size_t -_DEFUN (strspn, (s1, s2), - _CONST char *s1 _AND - _CONST char *s2) +strspn (const char *s1, + const char *s2) { - _CONST char *s = s1; - _CONST char *c; + const char *s = s1; + const char *c; while (*s1) { diff --git a/newlib/libc/string/strstr.c b/newlib/libc/string/strstr.c index 0480bce0a..0256c1aa6 100644 --- a/newlib/libc/string/strstr.c +++ b/newlib/libc/string/strstr.c @@ -1,3 +1,31 @@ +/* Optimized strstr function. + Copyright (c) 2018 Arm Ltd. All rights reserved. + + SPDX-License-Identifier: BSD-3-Clause + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the company may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + /* FUNCTION <>---find string segment @@ -5,16 +33,10 @@ FUNCTION INDEX strstr -ANSI_SYNOPSIS +SYNOPSIS #include char *strstr(const char *<[s1]>, const char *<[s2]>); -TRAD_SYNOPSIS - #include - char *strstr(<[s1]>, <[s2]>) - char *<[s1]>; - char *<[s2]>; - DESCRIPTION Locates the first occurrence in the string pointed to by <[s1]> of the sequence of characters in the string pointed to by <[s2]> @@ -35,87 +57,144 @@ QUICKREF */ #include +#include -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) -# define RETURN_TYPE char * -# define AVAILABLE(h, h_l, j, n_l) \ - (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \ - && ((h_l) = (j) + (n_l))) -# include "str-two-way.h" -#endif +#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) \ + || CHAR_BIT > 8 +/* Small and efficient strstr implementation. */ char * -_DEFUN (strstr, (searchee, lookfor), - _CONST char *searchee _AND - _CONST char *lookfor) +strstr (const char *hs, const char *ne) { -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) + size_t i; + int c = ne[0]; - /* Less code size, but quadratic performance in the worst case. */ - if (*searchee == 0) + if (c == 0) + return (char*)hs; + + for ( ; hs[0] != '\0'; hs++) { - if (*lookfor) - return (char *) NULL; - return (char *) searchee; + if (hs[0] != c) + continue; + for (i = 1; ne[i] != 0; i++) + if (hs[i] != ne[i]) + break; + if (ne[i] == '\0') + return (char*)hs; } - while (*searchee) - { - size_t i; - i = 0; - - while (1) - { - if (lookfor[i] == 0) - { - return (char *) searchee; - } - - if (lookfor[i] != searchee[i]) - { - break; - } - i++; - } - searchee++; - } - - return (char *) NULL; + return NULL; +} #else /* compilation for speed */ - /* Larger code size, but guaranteed linear performance. */ - const char *haystack = searchee; - const char *needle = lookfor; - size_t needle_len; /* Length of NEEDLE. */ - size_t haystack_len; /* Known minimum length of HAYSTACK. */ - int ok = 1; /* True if NEEDLE is prefix of HAYSTACK. */ +# define RETURN_TYPE char * +# define AVAILABLE(h, h_l, j, n_l) (((j) <= (h_l) - (n_l)) \ + || ((h_l) += strnlen ((h) + (h_l), (n_l) | 2048), ((j) <= (h_l) - (n_l)))) - /* Determine length of NEEDLE, and in the process, make sure - HAYSTACK is at least as long (no point processing all of a long - NEEDLE if HAYSTACK is too short). */ - while (*haystack && *needle) - ok &= *haystack++ == *needle++; - if (*needle) - return NULL; - if (ok) - return (char *) searchee; +# include "str-two-way.h" - /* Reduce the size of haystack using strchr, since it has a smaller - linear coefficient than the Two-Way algorithm. */ - needle_len = needle - lookfor; - haystack = strchr (searchee + 1, *lookfor); - if (!haystack || needle_len == 1) - return (char *) haystack; - haystack_len = (haystack > searchee + needle_len ? 1 - : needle_len + searchee - haystack); +/* Number of bits used to index shift table. */ +#define SHIFT_TABLE_BITS 6 - /* Perform the search. */ - if (needle_len < LONG_NEEDLE_THRESHOLD) - return two_way_short_needle ((const unsigned char *) haystack, - haystack_len, - (const unsigned char *) lookfor, needle_len); - return two_way_long_needle ((const unsigned char *) haystack, haystack_len, - (const unsigned char *) lookfor, needle_len); -#endif /* compilation for speed */ +static inline char * +strstr2 (const unsigned char *hs, const unsigned char *ne) +{ + uint32_t h1 = (ne[0] << 16) | ne[1]; + uint32_t h2 = 0; + for (int c = hs[0]; h1 != h2 && c != 0; c = *++hs) + h2 = (h2 << 16) | c; + return h1 == h2 ? (char *)hs - 2 : NULL; } + +static inline char * +strstr3 (const unsigned char *hs, const unsigned char *ne) +{ + uint32_t h1 = (ne[0] << 24) | (ne[1] << 16) | (ne[2] << 8); + uint32_t h2 = 0; + for (int c = hs[0]; h1 != h2 && c != 0; c = *++hs) + h2 = (h2 | c) << 8; + return h1 == h2 ? (char *)hs - 3 : NULL; +} + +static inline char * +strstr4 (const unsigned char *hs, const unsigned char *ne) +{ + uint32_t h1 = (ne[0] << 24) | (ne[1] << 16) | (ne[2] << 8) | ne[3]; + uint32_t h2 = 0; + for (int c = hs[0]; c != 0 && h1 != h2; c = *++hs) + h2 = (h2 << 8) | c; + return h1 == h2 ? (char *)hs - 4 : NULL; +} + +/* Extremely fast strstr algorithm with guaranteed linear-time performance. + Small needles up to size 4 use a dedicated linear search. Longer needles + up to size 254 use Sunday's Quick-Search algorithm. Due to its simplicity + it has the best average performance of string matching algorithms on almost + all inputs. It uses a bad-character shift table to skip past mismatches. + By limiting the needle length to 254, the shift table can be reduced to 8 + bits per entry, lowering preprocessing overhead and minimizing cache effects. + The limit also implies the worst-case performance is linear. + Even larger needles are processed by the linear-time Two-Way algorithm. +*/ +char * +strstr (const char *haystack, const char *needle) +{ + const unsigned char *hs = (const unsigned char *) haystack; + const unsigned char *ne = (const unsigned char *) needle; + + /* Handle short needle special cases first. */ + if (ne[0] == '\0') + return (char *) hs; + if (ne[1] == '\0') + return (char*)strchr (hs, ne[0]); + if (ne[2] == '\0') + return strstr2 (hs, ne); + if (ne[3] == '\0') + return strstr3 (hs, ne); + if (ne[4] == '\0') + return strstr4 (hs, ne); + + size_t ne_len = strlen (ne); + size_t hs_len = strnlen (hs, ne_len | 512); + + /* Ensure haystack length is >= needle length. */ + if (hs_len < ne_len) + return NULL; + + /* Use the Quick-Search algorithm for needle lengths less than 255. */ + if (__builtin_expect (ne_len < 255, 1)) + { + uint8_t shift[1 << SHIFT_TABLE_BITS]; + const unsigned char *end = hs + hs_len - ne_len; + + /* Initialize bad character shift hash table. */ + memset (shift, ne_len + 1, sizeof (shift)); + for (int i = 0; i < ne_len; i++) + shift[ne[i] % sizeof (shift)] = ne_len - i; + + do + { + hs--; + + /* Search by skipping past bad characters. */ + size_t tmp = shift[hs[ne_len] % sizeof (shift)]; + for (hs += tmp; hs <= end; hs += tmp) + { + tmp = shift[hs[ne_len] % sizeof (shift)]; + if (memcmp (hs, ne, ne_len) == 0) + return (char*) hs; + } + if (end[ne_len] == 0) + return NULL; + end += strnlen (end + ne_len, 2048); + } + while (hs <= end); + + return NULL; + } + + /* Use Two-Way algorithm for very long needles. */ + return two_way_long_needle (hs, hs_len, ne, ne_len); +} +#endif /* compilation for speed */ diff --git a/newlib/libc/string/strtok.c b/newlib/libc/string/strtok.c index 8d07ab387..801f51aca 100644 --- a/newlib/libc/string/strtok.c +++ b/newlib/libc/string/strtok.c @@ -11,7 +11,7 @@ INDEX INDEX strsep -ANSI_SYNOPSIS +SYNOPSIS #include char *strtok(char *restrict <[source]>, const char *restrict <[delimiters]>); @@ -20,21 +20,6 @@ ANSI_SYNOPSIS char **<[lasts]>); char *strsep(char **<[source_ptr]>, const char *<[delimiters]>); -TRAD_SYNOPSIS - #include - char *strtok(<[source]>, <[delimiters]>); - char *<[source]>; - char *<[delimiters]>; - - char *strtok_r(<[source]>, <[delimiters]>, <[lasts]>); - char *<[source]>; - char *<[delimiters]>; - char **<[lasts]>; - - char *strsep(<[source_ptr]>, <[delimiters]>); - char **<[source_ptr]>; - char *<[delimiters]>; - DESCRIPTION The <> function is used to isolate sequential tokens in a null-terminated string, <<*<[source]>>>. These tokens are delimited @@ -94,8 +79,7 @@ QUICKREF extern char *__strtok_r (char *, const char *, char **, int); char * -_DEFUN (strtok, (s, delim), - register char *__restrict s _AND +strtok (register char *__restrict s, register const char *__restrict delim) { struct _reent *reent = _REENT; diff --git a/newlib/libc/string/strtok_r.c b/newlib/libc/string/strtok_r.c index 6ace7008b..d17fd693d 100644 --- a/newlib/libc/string/strtok_r.c +++ b/newlib/libc/string/strtok_r.c @@ -30,10 +30,9 @@ #include char * -_DEFUN (__strtok_r, (s, delim, lasts, skip_leading_delim), - register char *s _AND - register const char *delim _AND - char **lasts _AND +__strtok_r (register char *s, + register const char *delim, + char **lasts, int skip_leading_delim) { register char *spanp; @@ -90,9 +89,8 @@ cont: } char * -_DEFUN (strtok_r, (s, delim, lasts), - register char *__restrict s _AND - register const char *__restrict delim _AND +strtok_r (register char *__restrict s, + register const char *__restrict delim, char **__restrict lasts) { return __strtok_r (s, delim, lasts, 1); diff --git a/newlib/libc/string/strupr.c b/newlib/libc/string/strupr.c index 350618e78..a175d5c57 100644 --- a/newlib/libc/string/strupr.c +++ b/newlib/libc/string/strupr.c @@ -5,15 +5,10 @@ FUNCTION INDEX strupr -ANSI_SYNOPSIS +SYNOPSIS #include char *strupr(char *<[a]>); -TRAD_SYNOPSIS - #include - char *strupr(<[a]>) - char *<[a]>; - DESCRIPTION <> converts each character in the string at <[a]> to uppercase. @@ -34,8 +29,7 @@ QUICKREF #include char * -_DEFUN (strupr, (s), - char *s) +strupr (char *s) { unsigned char *ucs = (unsigned char *) s; for ( ; *ucs != '\0'; ucs++) diff --git a/newlib/libc/string/strverscmp.c b/newlib/libc/string/strverscmp.c index 83f053222..04aa7213a 100644 --- a/newlib/libc/string/strverscmp.c +++ b/newlib/libc/string/strverscmp.c @@ -5,18 +5,11 @@ FUNCTION INDEX strverscmp -ANSI_SYNOPSIS +SYNOPSIS #define _GNU_SOURCE #include int strverscmp(const char *<[a]>, const char *<[b]>); -TRAD_SYNOPSIS - #define _GNU_SOURCE - #include - int strverscmp(<[a]>, <[b]>) - char *<[a]>; - char *<[b]>; - DESCRIPTION <> compares the string at <[a]> to the string at <[b]> in a version-logical order. diff --git a/newlib/libc/string/strxfrm.c b/newlib/libc/string/strxfrm.c index edc1272de..c5df0bcd5 100644 --- a/newlib/libc/string/strxfrm.c +++ b/newlib/libc/string/strxfrm.c @@ -5,18 +5,11 @@ FUNCTION INDEX strxfrm -ANSI_SYNOPSIS +SYNOPSIS #include size_t strxfrm(char *restrict <[s1]>, const char *restrict <[s2]>, size_t <[n]>); -TRAD_SYNOPSIS - #include - size_t strxfrm(<[s1]>, <[s2]>, <[n]>); - char *<[s1]>; - char *<[s2]>; - size_t <[n]>; - DESCRIPTION This function transforms the string pointed to by <[s2]> and places the resulting string into the array pointed to by @@ -53,9 +46,8 @@ QUICKREF #include size_t -_DEFUN (strxfrm, (s1, s2, n), - char *__restrict s1 _AND - _CONST char *__restrict s2 _AND +strxfrm (char *__restrict s1, + const char *__restrict s2, size_t n) { size_t res; diff --git a/newlib/libc/string/strxfrm_l.c b/newlib/libc/string/strxfrm_l.c index a1f4fe295..0ac52432c 100644 --- a/newlib/libc/string/strxfrm_l.c +++ b/newlib/libc/string/strxfrm_l.c @@ -5,7 +5,7 @@ FUNCTION INDEX strxfrm_l -ANSI_SYNOPSIS +SYNOPSIS #include size_t strxfrm_l(char *restrict <[s1]>, const char *restrict <[s2]>, size_t <[n]>, locale_t <[locale]>); diff --git a/newlib/libc/string/swab.c b/newlib/libc/string/swab.c index aee076319..28ab978bd 100644 --- a/newlib/libc/string/swab.c +++ b/newlib/libc/string/swab.c @@ -2,16 +2,10 @@ FUNCTION <>---swap adjacent bytes -ANSI_SYNOPSIS +SYNOPSIS #include void swab(const void *<[in]>, void *<[out]>, ssize_t <[n]>); -TRAD_SYNOPSIS - void swab(<[in]>, <[out]>, <[n]> - void *<[in]>; - void *<[out]>; - ssize_t <[n]>; - DESCRIPTION This function copies <[n]> bytes from the memory region pointed to by <[in]> to the memory region pointed to by @@ -24,9 +18,8 @@ PORTABILITY #include void -_DEFUN (swab, (b1, b2, length), - _CONST void *b1 _AND - void *b2 _AND +swab (const void *b1, + void *b2, ssize_t length) { const char *from = b1; diff --git a/newlib/libc/string/u_strerr.c b/newlib/libc/string/u_strerr.c index 2978df0cf..cde05adb2 100644 --- a/newlib/libc/string/u_strerr.c +++ b/newlib/libc/string/u_strerr.c @@ -1,15 +1,14 @@ #include <_ansi.h> char * -_DEFUN(_user_strerror, (errnum, internal, errptr), - int errnum _AND - int internal _AND +_user_strerror (int errnum, + int internal, int *errptr) { /* prevent warning about unused parameters */ - _CAST_VOID errnum; - _CAST_VOID internal; - _CAST_VOID errptr; + (void) errnum; + (void) internal; + (void) errptr; return 0; } diff --git a/newlib/libc/string/uniset b/newlib/libc/string/uniset new file mode 100755 index 000000000..85d3b2a6f --- /dev/null +++ b/newlib/libc/string/uniset @@ -0,0 +1,696 @@ +#!/usr/bin/perl +# Uniset -- Unicode subset manager -- Markus Kuhn +# http://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz + +require 5.008; +use open ':utf8'; +use FindBin qw($RealBin); # to find directory where this file is located + +binmode(STDOUT, ":utf8"); +binmode(STDIN, ":utf8"); + +my (%name, %invname, %category, %comment); + +print <. + +yyyy yyyy (optionally prefixed with 0x) is a Unicode character + belonging to the specified subset. + +yyyy-yyyy a range of Unicode characters belonging to +yyyy..yyyy the specified subset. + +xx yy yy yy-yy yy xx denotes a row (high-byte) and the yy specify + corresponding low bytes or with a hyphen also ranges of + low bytes in the Unicode values that belong to this + subset. This is also the format that is generated by + the compact command. +End +exit 1 if $#ARGV < 0; + + +# Subroutine to identify whether the ISO 10646/Unicode character code +# ucs belongs into the East Asian Wide (W) or East Asian FullWidth +# (F) category as defined in Unicode Technical Report #11. + +sub iswide ($) { + my $ucs = shift(@_); + + return ($ucs >= 0x1100 && + ($ucs <= 0x115f || # Hangul Jamo + $ucs == 0x2329 || $ucs == 0x232a || + ($ucs >= 0x2e80 && $ucs <= 0xa4cf && + $ucs != 0x303f) || # CJK .. Yi + ($ucs >= 0xac00 && $ucs <= 0xd7a3) || # Hangul Syllables + ($ucs >= 0xf900 && $ucs <= 0xfaff) || # CJK Comp. Ideographs + ($ucs >= 0xfe30 && $ucs <= 0xfe6f) || # CJK Comp. Forms + ($ucs >= 0xff00 && $ucs <= 0xff60) || # Fullwidth Forms + ($ucs >= 0xffe0 && $ucs <= 0xffe6) || + ($ucs >= 0x20000 && $ucs <= 0x2fffd) || + ($ucs >= 0x30000 && $ucs <= 0x3fffd))); +} + +# Return the Unicode name that belongs to a given character code + +# Jamo short names, see Unicode 3.0, table 4-4, page 86 + +my @lname = ('G', 'GG', 'N', 'D', 'DD', 'R', 'M', 'B', 'BB', 'S', 'SS', '', + 'J', 'JJ', 'C', 'K', 'T', 'P', 'H'); # 1100..1112 +my @vname = ('A', 'AE', 'YA', 'YAE', 'EO', 'E', 'YEO', 'YE', 'O', + 'WA', 'WAE', 'OE', 'YO', 'U', 'WEO', 'WE', 'WI', 'YU', + 'EU', 'YI', 'I'); # 1161..1175 +my @tname = ('G', 'GG', 'GS', 'N', 'NJ', 'NH', 'D', 'L', 'LG', 'LM', + 'LB', 'LS', 'LT', 'LP', 'LH', 'M', 'B', 'BS', 'S', 'SS', + 'NG', 'J', 'C', 'K', 'T', 'P', 'H'); # 11a8..11c2 + +sub name { + my $ucs = shift(@_); + + # The intervals used here reflect Unicode Version 3.2 + if (($ucs >= 0x3400 && $ucs <= 0x4db5) || + ($ucs >= 0x4e00 && $ucs <= 0x9fa5) || + ($ucs >= 0x20000 && $ucs <= 0x2a6d6)) { + return "CJK UNIFIED IDEOGRAPH-" . sprintf("%04X", $ucs); + } + + if ($ucs >= 0xac00 && $ucs <= 0xd7a3) { + my $s = $ucs - 0xac00; + my $l = 0x1100 + int($s / (21 * 28)); + my $v = 0x1161 + int(($s % (21 * 28)) / 28); + my $t = 0x11a7 + $s % 28; + return "HANGUL SYLLABLE " . + ($lname[int($s / (21 * 28))] . + $vname[int(($s % (21 * 28)) / 28)] . + $tname[$s % 28 - 1]); + } + + return $name{$ucs}; +} + +sub is_unicode { + my $ucs = shift(@_); + + # The intervals used here reflect Unicode Version 3.2 + if (($ucs >= 0x3400 && $ucs <= 0x4db5) || + ($ucs >= 0x4e00 && $ucs <= 0x9fa5) || + ($ucs >= 0xac00 && $ucs <= 0xd7a3) || + ($ucs >= 0x20000 && $ucs <= 0x2a6d6)) { + return 1; + } + + return exists $name{$ucs}; +} + +my @search_path; +push @search_path, "$ENV{HOME}/local/share/uniset" + if -d "$ENV{HOME}/local/share/uniset"; +push @search_path, "/usr/share/uniset" if -d "/usr/share/uniset"; +push @search_path, $RealBin unless $RealBin =~ m|^/usr/bin|; + +sub search_open { + my ($mode, $fn) = @_; + my $file; + return $file if open($file, $mode, $fn); + return undef if $fn =~ m|/|; + for my $path (@search_path) { + return $file if open($file, $mode, "$path/$fn"); + } + return undef; +} + +my $html = 0; +my $image = 0; +my $adducs = 0; +my $unicodedata = "UnicodeData.txt"; +my $blockdata = "Blocks.txt"; + +# read list of all Unicode names +my $data = search_open('<', $unicodedata); +unless ($data) { + die ("Can't open Unicode database '$unicodedata':\n$!\n\n" . + "Please make sure that you have downloaded the file\n" . + "http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\n"); +} +while (<$data>) { + if (/^([0-9,A-F]{4,8});([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)$/) { + next if $2 ne '' && substr($2, 0, 1) eq '<'; + $ucs = hex($1); + $name{$ucs} = $2; + $invname{$2} = $ucs; + $category{$ucs} = $3; + $comment{$ucs} = $12; + } else { + die("Syntax error in line '$_' in file '$unicodedata'"); + } +} +close($data); + +# read list of all Unicode blocks +$data = search_open('<', $blockdata); +unless ($data) { + die ("Can't open Unicode blockname list '$blockdata':\n$!\n\n" . + "Please make sure that you have downloaded the file\n" . + "http://www.unicode.org/Public/UNIDATA/Blocks.txt\n"); +} +my $blocks = 0; +my (@blockstart, @blockend, @blockname); +while (<$data>) { + if (/^\s*([0-9,A-F]{4,8})\s*\.\.\s*([0-9,A-F]{4,8})\s*;\s*(.*)$/) { + $blockstart[$blocks] = hex($1); + $blockend [$blocks] = hex($2); + $blockname [$blocks] = $3; + $blocks++; + } elsif (/^\s*\#/ || /^\s*$/) { + # ignore comments and empty lines + } else { + die("Syntax error in line '$_' in file '$blockdata'"); + } +} +close($data); +if ($blockend[$blocks-1] < 0x110000) { + $blockstart[$blocks] = 0x110000; + $blockend [$blocks] = 0x7FFFFFFF; + $blockname [$blocks] = "Beyond Plane 16"; + $blocks++; +} + +# process command line arguments +while ($_ = shift(@ARGV)) { + if (/^html$/) { + $html = 1; + } elsif (/^ucs$/) { + $adducs = 1; + } elsif (/^img$/) { + $html = 1; + $image = 1; + } elsif (/^template$/) { + $template = shift(@ARGV); + open(TEMPLATE, $template) || die("Can't open template file '$template': '$!'"); + while (