Project import generated by Copybara. GitOrigin-RevId: 4842f32639f47ab481d2e3e13c4ca4f5c4146d6c
diff --git a/README b/README index 83e9aae..878e853 100755 --- a/README +++ b/README
@@ -5,15 +5,15 @@ set -o errtrace trap 'echo Fatal error: script $0 aborting at line $LINENO, command \"$BASH_COMMAND\" returned $?; exit 1' ERR -snapshot="2021.01.07.200850" +snapshot="2022.03.12.131524" snapshot_year=`echo $snapshot | cut -d . -f 1` snapshot_month=`echo $snapshot | cut -d . -f 2` snapshot_day=`echo $snapshot | cut -d . -f 3` snapshot_time=`echo $snapshot | cut -d . -f 4` -glibc_version=2.27-r20 +glibc_version=2.33-r16 -# Upgrade CrOS toolchain to GCC 4.9.x ${snapshot} +# Upgrade CrOS toolchain to GCC 10.2.0 ${snapshot} function build_toolchain_arm_none_eabi { pushd ${SCRIPT_DIR} @@ -21,14 +21,14 @@ # 1. Obtain {toolchain,glibc} prebuilts from Chrome OS. gsutil.py cp gs://chromiumos-sdk/${snapshot_year}/${snapshot_month}/arm-none-eabi-${snapshot}.tar.xz . - gsutil.py cp gs://chromeos-prebuilt/host/amd64/amd64-host/chroot-${snapshot}/packages/cross-arm-none-eabi/newlib-2.2.0.tbz2 . + gsutil.py cp gs://chromeos-prebuilt/host/amd64/amd64-host/chroot-${snapshot}/packages/cross-arm-none-eabi/newlib-4.1.0.tbz2 . # 2. Extract downloaded toolchain (overwrite armv7a contents) rm -rf arm mkdir arm tar -C arm -xf arm-none-eabi-${snapshot}.tar.xz - tar -C arm -xf newlib-2.2.0.tbz2 - rm arm-none-eabi-${snapshot}.tar.xz newlib-2.2.0.tbz2 + tar -C arm -xf newlib-4.1.0.tbz2 + rm arm-none-eabi-${snapshot}.tar.xz newlib-4.1.0.tbz2 # 3. Make copies of libgcc_s.so.1 to fit with chromecast build system. @@ -44,7 +44,7 @@ popd # ${SCRIPT_DIR} } -# Upgrade CrOS toolchain to GCC 4.9.x ${snapshot} +# Upgrade CrOS toolchain to GCC 10.2.0 ${snapshot} function build_toolchain { pushd ${SCRIPT_DIR} @@ -55,8 +55,8 @@ rm -rf ${arch} # 1. Obtain {toolchain,glibc} prebuilts from Chrome OS. - gsutil cp gs://chromiumos-sdk/${snapshot_year}/${snapshot_month}/${arch}-cros-linux-${abi}-${snapshot}.tar.xz . - gsutil cp gs://chromeos-prebuilt/host/amd64/amd64-host/chroot-${snapshot}/packages/cross-${arch}-cros-linux-${abi}/glibc-${glibc_version}.tbz2 . + gsutil.py cp gs://chromiumos-sdk/${snapshot_year}/${snapshot_month}/${arch}-cros-linux-${abi}-${snapshot}.tar.xz . + gsutil.py cp gs://chromeos-prebuilt/host/amd64/amd64-host/chroot-${snapshot}/packages/cross-${arch}-cros-linux-${abi}/glibc-${glibc_version}.tbz2 . # 2. Extract downloaded toolchain (overwrite armv7a contents) rm -rf ${arch} @@ -66,8 +66,7 @@ rm ${arch}-cros-linux-${abi}-${snapshot}.tar.xz glibc-${glibc_version}.tbz2 # 3. Make copies of libgcc_s.so.1 to fit with chromecast build system. - cp ${arch}/usr/lib/gcc/${arch}-cros-linux-${abi}/4.9.x/libgcc_s.so.1 ${arch}/lib/ - cp ${arch}/usr/lib/gcc/${arch}-cros-linux-${abi}/4.9.x/libgcc_s.so.1 ${arch}/usr/${arch}-cros-linux-${abi}/lib/ + cp ${arch}/usr/lib/gcc/${arch}-cros-linux-${abi}/10.2.0/libgcc_s.so.1 ${arch}/usr/${arch}-cros-linux-${abi}/lib/ # 4. Add NOTICE files. curl -L https://www.gnu.org/licenses/lgpl-2.1.txt > ${arch}/usr/${arch}-cros-linux-${abi}/NOTICE-eglibc
diff --git a/README_gdbserver b/README_gdbserver index ebc34af..fe5c035 100755 --- a/README_gdbserver +++ b/README_gdbserver
@@ -19,8 +19,14 @@ # 5. Install gdbserver ${gdbserver_version} wget https://ftp.gnu.org/gnu/gdb/gdb-${gdbserver_version}.tar.gz tar -xf gdb-${gdbserver_version}.tar.gz + + # patch the gdb-8.0.1 to pass compilation w/ glibc 2.32 + pushd gdb-${gdbserver_version} + patch -p1 < ../fix_gdb-8.0.1_glibc-2.32.patch + popd + pushd gdb-${gdbserver_version}/gdb/gdbserver - PATH=$PATH:`pwd`/../../../${arch}/usr/x86_64-pc-linux-gnu/${name}/gcc-bin/4.9.x/ ; ./configure --host=${name} \ + PATH=`pwd`/../../../${arch}/usr/bin/:$PATH ; ./configure --host=${name} \ CC=${name}-clang CXX=${name}-clang++ CFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++ --rtlib=compiler-rt" make -j50 popd
diff --git a/aarch64/bin/FileCheck b/aarch64/bin/FileCheck index 3086c50..0e6b2f5 100755 --- a/aarch64/bin/FileCheck +++ b/aarch64/bin/FileCheck
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/FileCheck" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/FileCheck" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/FileCheck.elf b/aarch64/bin/FileCheck.elf index 1050a38..fc3e37e 100755 --- a/aarch64/bin/FileCheck.elf +++ b/aarch64/bin/FileCheck.elf Binary files differ
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-addr2line b/aarch64/bin/aarch64-cros-linux-gnu-addr2line index 3d93f11..984197c 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-addr2line +++ b/aarch64/bin/aarch64-cros-linux-gnu-addr2line
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/addr2line" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/addr2line" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-addr2line.elf b/aarch64/bin/aarch64-cros-linux-gnu-addr2line.elf new file mode 100755 index 0000000..2ff42cc --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-addr2line.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/addr2line.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ar b/aarch64/bin/aarch64-cros-linux-gnu-ar index 97f1113..dc18d4c 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-ar +++ b/aarch64/bin/aarch64-cros-linux-gnu-ar
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/ar" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ar" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ar.elf b/aarch64/bin/aarch64-cros-linux-gnu-ar.elf new file mode 100755 index 0000000..839935a --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-ar.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ar.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-as b/aarch64/bin/aarch64-cros-linux-gnu-as index ee72500..669eb19 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-as +++ b/aarch64/bin/aarch64-cros-linux-gnu-as
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/as" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/as" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-as.elf b/aarch64/bin/aarch64-cros-linux-gnu-as.elf new file mode 100755 index 0000000..e8217e0 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-as.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/as.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-c++ b/aarch64/bin/aarch64-cros-linux-gnu-c++ index 5713edc..28a13c9 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-c++ +++ b/aarch64/bin/aarch64-cros-linux-gnu-c++
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-c++" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-c++" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-c++-10.2.0 b/aarch64/bin/aarch64-cros-linux-gnu-c++-10.2.0 new file mode 120000 index 0000000..b5eb719 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-c++-10.2.0
@@ -0,0 +1 @@ +../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-c++ \ No newline at end of file
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-c++-4.9.x b/aarch64/bin/aarch64-cros-linux-gnu-c++-4.9.x deleted file mode 100755 index 648bb36..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-c++-4.9.x +++ /dev/null
@@ -1,4 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/sysroot_wrapper.hardened.ccache" "$@" -exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-c++filt b/aarch64/bin/aarch64-cros-linux-gnu-c++filt index b3ecc34..2902820 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-c++filt +++ b/aarch64/bin/aarch64-cros-linux-gnu-c++filt
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/c++filt" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/c++filt" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-c++filt.elf b/aarch64/bin/aarch64-cros-linux-gnu-c++filt.elf new file mode 100755 index 0000000..3fd199b --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-c++filt.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/c++filt.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-clang b/aarch64/bin/aarch64-cros-linux-gnu-clang index 3f7cb17..d19b012 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-clang +++ b/aarch64/bin/aarch64-cros-linux-gnu-clang
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-clang" "$@" +"${basedir}/../usr/bin/aarch64-cros-linux-gnu-clang" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-clang++ b/aarch64/bin/aarch64-cros-linux-gnu-clang++ index 56fded2..ef8e125 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-clang++ +++ b/aarch64/bin/aarch64-cros-linux-gnu-clang++
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-clang++" "$@" +"${basedir}/../usr/bin/aarch64-cros-linux-gnu-clang++" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-cpp b/aarch64/bin/aarch64-cros-linux-gnu-cpp index ac357b5..c329d82 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-cpp +++ b/aarch64/bin/aarch64-cros-linux-gnu-cpp
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-cpp" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-cpp" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-cpp-10.2.0 b/aarch64/bin/aarch64-cros-linux-gnu-cpp-10.2.0 new file mode 100755 index 0000000..c329d82 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-cpp-10.2.0
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-cpp" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-cpp-4.9.x b/aarch64/bin/aarch64-cros-linux-gnu-cpp-4.9.x deleted file mode 100755 index ac357b5..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-cpp-4.9.x +++ /dev/null
@@ -1,4 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-cpp" "$@" -exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-dwp b/aarch64/bin/aarch64-cros-linux-gnu-dwp index b43a30a..39c1d5d 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-dwp +++ b/aarch64/bin/aarch64-cros-linux-gnu-dwp
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/dwp" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/dwp" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-dwp.elf b/aarch64/bin/aarch64-cros-linux-gnu-dwp.elf new file mode 100755 index 0000000..53759c9 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-dwp.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/dwp.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-elfedit b/aarch64/bin/aarch64-cros-linux-gnu-elfedit index 388811a..1c4d326 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-elfedit +++ b/aarch64/bin/aarch64-cros-linux-gnu-elfedit
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/elfedit" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/elfedit" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-elfedit.elf b/aarch64/bin/aarch64-cros-linux-gnu-elfedit.elf new file mode 100755 index 0000000..e099966 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-elfedit.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/elfedit.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-g++ b/aarch64/bin/aarch64-cros-linux-gnu-g++ index e73c9d6..b64dab1 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-g++ +++ b/aarch64/bin/aarch64-cros-linux-gnu-g++
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-g++" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-g++" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-g++-10.2.0 b/aarch64/bin/aarch64-cros-linux-gnu-g++-10.2.0 new file mode 100755 index 0000000..701dfa9 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-g++-10.2.0
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/sysroot_wrapper.hardened.ccache" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-g++-4.9.x b/aarch64/bin/aarch64-cros-linux-gnu-g++-4.9.x deleted file mode 120000 index 7d9e90f..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-g++-4.9.x +++ /dev/null
@@ -1 +0,0 @@ -../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-g++ \ No newline at end of file
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc b/aarch64/bin/aarch64-cros-linux-gnu-gcc index 1c34c42..794141f 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcc +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcc
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcc" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcc" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc-10.2.0 b/aarch64/bin/aarch64-cros-linux-gnu-gcc-10.2.0 new file mode 100755 index 0000000..a04eee8 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcc-10.2.0
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcc-10.2.0" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc-4.9.x b/aarch64/bin/aarch64-cros-linux-gnu-gcc-4.9.x deleted file mode 100755 index dce4b09..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcc-4.9.x +++ /dev/null
@@ -1,4 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcc-4.9.x" "$@" -exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc-ar b/aarch64/bin/aarch64-cros-linux-gnu-gcc-ar index 203b9ff..d40793e 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcc-ar +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcc-ar
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcc-ar" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcc-ar" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc-nm b/aarch64/bin/aarch64-cros-linux-gnu-gcc-nm index 7d0b623..1c2ed6f 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcc-nm +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcc-nm
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcc-nm" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcc-nm" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcc-ranlib b/aarch64/bin/aarch64-cros-linux-gnu-gcc-ranlib index 8762bcb..1125b70 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcc-ranlib +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcc-ranlib
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcc-ranlib" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcc-ranlib" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcov b/aarch64/bin/aarch64-cros-linux-gnu-gcov index 0e3831b..deb8fca 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcov +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcov
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcov" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcov" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcov-10.2.0 b/aarch64/bin/aarch64-cros-linux-gnu-gcov-10.2.0 new file mode 100755 index 0000000..deb8fca --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcov-10.2.0
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcov" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcov-4.9.x b/aarch64/bin/aarch64-cros-linux-gnu-gcov-4.9.x deleted file mode 100755 index 0e3831b..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcov-4.9.x +++ /dev/null
@@ -1,4 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcov" "$@" -exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcov-dump b/aarch64/bin/aarch64-cros-linux-gnu-gcov-dump new file mode 100755 index 0000000..4bf0a0a --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcov-dump
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcov-dump" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gcov-tool b/aarch64/bin/aarch64-cros-linux-gnu-gcov-tool index 673002c..234a969 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gcov-tool +++ b/aarch64/bin/aarch64-cros-linux-gnu-gcov-tool
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/4.9.x/aarch64-cros-linux-gnu-gcov-tool" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-gcov-tool" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gdb b/aarch64/bin/aarch64-cros-linux-gnu-gdb index 5a338b9..d2ac4bd 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gdb +++ b/aarch64/bin/aarch64-cros-linux-gnu-gdb
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/aarch64-cros-linux-gnu-gdb" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/aarch64-cros-linux-gnu-gdb" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gdb.elf b/aarch64/bin/aarch64-cros-linux-gnu-gdb.elf index 35a7967..a2c1ca7 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gdb.elf +++ b/aarch64/bin/aarch64-cros-linux-gnu-gdb.elf Binary files differ
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gprof b/aarch64/bin/aarch64-cros-linux-gnu-gprof index dd0d5ea..04b0b4c 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-gprof +++ b/aarch64/bin/aarch64-cros-linux-gnu-gprof
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/gprof" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/gprof" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-gprof.elf b/aarch64/bin/aarch64-cros-linux-gnu-gprof.elf new file mode 100755 index 0000000..9e9fd50 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-gprof.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/gprof.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ld b/aarch64/bin/aarch64-cros-linux-gnu-ld index 611509a..7095060 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-ld +++ b/aarch64/bin/aarch64-cros-linux-gnu-ld
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/ld" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ld" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd b/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd index ef81294..c4e510d 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd +++ b/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/ld.bfd" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ld.bfd" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd.real.elf b/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd.real.elf new file mode 100755 index 0000000..e4e9118 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-ld.bfd.real.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ld.bfd.real.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ld.gold b/aarch64/bin/aarch64-cros-linux-gnu-ld.gold deleted file mode 100755 index 8cc1f06..0000000 --- a/aarch64/bin/aarch64-cros-linux-gnu-ld.gold +++ /dev/null
@@ -1,4 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/ld.gold" "$@" -exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ld.lld b/aarch64/bin/aarch64-cros-linux-gnu-ld.lld index f240615..8f94dfa 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-ld.lld +++ b/aarch64/bin/aarch64-cros-linux-gnu-ld.lld
@@ -6,4 +6,4 @@ # This files wraps lld. # Enable smallpie, now, relro and hash-style=gnu to match gold wrapper. # Enable norosegment to match gold wrapper, for symbolization. b/140622025 -exec "$(dirname "$(readlink -f "$0")")"/ld.lld --pack-dyn-relocs=relr -z now -z relro --no-rosegment --hash-style=gnu "$@" +exec "$(dirname "$(readlink -f "$0")")"/ld.lld --pack-dyn-relocs=relr -z now -z relro --no-rosegment --hash-style=gnu -z nostart-stop-gc "$@"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-lto-dump b/aarch64/bin/aarch64-cros-linux-gnu-lto-dump new file mode 100755 index 0000000..6678e89 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-lto-dump
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/gcc-bin/10.2.0/aarch64-cros-linux-gnu-lto-dump" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-nm b/aarch64/bin/aarch64-cros-linux-gnu-nm index 33db217..9d35a5c 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-nm +++ b/aarch64/bin/aarch64-cros-linux-gnu-nm
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/nm" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/nm" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-nm.elf b/aarch64/bin/aarch64-cros-linux-gnu-nm.elf new file mode 100755 index 0000000..045f225 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-nm.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/nm.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-objcopy b/aarch64/bin/aarch64-cros-linux-gnu-objcopy index 10a6e0a..211611f 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-objcopy +++ b/aarch64/bin/aarch64-cros-linux-gnu-objcopy
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/objcopy" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/objcopy" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-objcopy.elf b/aarch64/bin/aarch64-cros-linux-gnu-objcopy.elf new file mode 100755 index 0000000..fece6ee --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-objcopy.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/objcopy.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-objdump b/aarch64/bin/aarch64-cros-linux-gnu-objdump index 391aec6..4f6b5c0 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-objdump +++ b/aarch64/bin/aarch64-cros-linux-gnu-objdump
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/objdump" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/objdump" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-objdump.elf b/aarch64/bin/aarch64-cros-linux-gnu-objdump.elf new file mode 100755 index 0000000..a0583f9 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-objdump.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/objdump.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ranlib b/aarch64/bin/aarch64-cros-linux-gnu-ranlib index 9033e1e..0ef1787 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-ranlib +++ b/aarch64/bin/aarch64-cros-linux-gnu-ranlib
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/ranlib" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ranlib" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-ranlib.elf b/aarch64/bin/aarch64-cros-linux-gnu-ranlib.elf new file mode 100755 index 0000000..ec1f11e --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-ranlib.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/ranlib.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-readelf b/aarch64/bin/aarch64-cros-linux-gnu-readelf index 51cb7a5..9caca3f 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-readelf +++ b/aarch64/bin/aarch64-cros-linux-gnu-readelf
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/readelf" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/readelf" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-readelf.elf b/aarch64/bin/aarch64-cros-linux-gnu-readelf.elf new file mode 100755 index 0000000..44f9f61 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-readelf.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/readelf.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-run b/aarch64/bin/aarch64-cros-linux-gnu-run index 88724e3..43e5c09 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-run +++ b/aarch64/bin/aarch64-cros-linux-gnu-run
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/aarch64-cros-linux-gnu-run" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/aarch64-cros-linux-gnu-run" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-run.elf b/aarch64/bin/aarch64-cros-linux-gnu-run.elf index 8777bbb..cdb65e0 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-run.elf +++ b/aarch64/bin/aarch64-cros-linux-gnu-run.elf Binary files differ
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-size b/aarch64/bin/aarch64-cros-linux-gnu-size index d45842a..6256a37 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-size +++ b/aarch64/bin/aarch64-cros-linux-gnu-size
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/size" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/size" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-size.elf b/aarch64/bin/aarch64-cros-linux-gnu-size.elf new file mode 100755 index 0000000..dc75652 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-size.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/size.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-strings b/aarch64/bin/aarch64-cros-linux-gnu-strings index 510852f..6f5c761 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-strings +++ b/aarch64/bin/aarch64-cros-linux-gnu-strings
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/strings" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/strings" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-strings.elf b/aarch64/bin/aarch64-cros-linux-gnu-strings.elf new file mode 100755 index 0000000..6c681ff --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-strings.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/strings.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-strip b/aarch64/bin/aarch64-cros-linux-gnu-strip index 7929e37..18b4d5d 100755 --- a/aarch64/bin/aarch64-cros-linux-gnu-strip +++ b/aarch64/bin/aarch64-cros-linux-gnu-strip
@@ -1,4 +1,4 @@ #!/bin/sh basedir=$(dirname "$0") -"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0-gold/strip" "$@" +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/strip" "$@" exit "$?"
diff --git a/aarch64/bin/aarch64-cros-linux-gnu-strip.elf b/aarch64/bin/aarch64-cros-linux-gnu-strip.elf new file mode 100755 index 0000000..3b273c7 --- /dev/null +++ b/aarch64/bin/aarch64-cros-linux-gnu-strip.elf
@@ -0,0 +1,4 @@ +#!/bin/sh +basedir=$(dirname "$0") +"${basedir}/../usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.36.1/strip.elf" "$@" +exit "$?"
diff --git a/aarch64/bin/analyze-build b/aarch64/bin/analyze-build new file mode 100755 index 0000000..b3f6142 --- /dev/null +++ b/aarch64/bin/analyze-build
@@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import multiprocessing +import sys +import os.path +this_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(os.path.dirname(this_dir), 'lib')) + +from libscanbuild.analyze import analyze_build + +if __name__ == '__main__': + multiprocessing.freeze_support() + sys.exit(analyze_build())
diff --git a/aarch64/bin/asan_symbolize.py b/aarch64/bin/asan_symbolize.py index 5c4001a..ab04b1c 100755 --- a/aarch64/bin/asan_symbolize.py +++ b/aarch64/bin/asan_symbolize.py
@@ -208,7 +208,7 @@ # EPIPE happens if addr2line exits early (which some implementations do # if an invalid file is passed). if e.errno == errno.EPIPE: - logging.debug("addr2line exited early (broken pipe), returncode=%d" % self.pipe.poll()) + logging.debug(f"addr2line exited early (broken pipe) returncode={self.pipe.poll()}") else: logging.debug("unexpected I/O exception communicating with addr2line", exc_info=e) lines.append(('??', '??:0'))
diff --git a/aarch64/bin/bugpoint b/aarch64/bin/bugpoint index edaf98a..5ff3448 100755 --- a/aarch64/bin/bugpoint +++ b/aarch64/bin/bugpoint
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/bugpoint" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/bugpoint" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/bugpoint.elf b/aarch64/bin/bugpoint.elf index f09d663..f837688 100755 --- a/aarch64/bin/bugpoint.elf +++ b/aarch64/bin/bugpoint.elf Binary files differ
diff --git a/aarch64/bin/c-index-test b/aarch64/bin/c-index-test index 4039b91..50cec88 100755 --- a/aarch64/bin/c-index-test +++ b/aarch64/bin/c-index-test
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/c-index-test" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/c-index-test" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/c-index-test.elf b/aarch64/bin/c-index-test.elf index df41318..2d129e8 100755 --- a/aarch64/bin/c-index-test.elf +++ b/aarch64/bin/c-index-test.elf Binary files differ
diff --git a/aarch64/bin/clippy-driver b/aarch64/bin/clippy-driver index 0802c6e..7852c38 100755 --- a/aarch64/bin/clippy-driver +++ b/aarch64/bin/clippy-driver
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/clippy-driver" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib:${basedir}/../usr/lib64/rust/rustlib/x86_64-unknown-linux-gnu/lib:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/clippy-driver" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib:${basedir}/../usr/lib64/rust/rustlib/x86_64-unknown-linux-gnu/lib:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/clippy-driver.elf b/aarch64/bin/clippy-driver.elf index 3660332..a795106 100755 --- a/aarch64/bin/clippy-driver.elf +++ b/aarch64/bin/clippy-driver.elf Binary files differ
diff --git a/aarch64/bin/count b/aarch64/bin/count index d1562a4..8e08470 100755 --- a/aarch64/bin/count +++ b/aarch64/bin/count
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/count" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/count" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/count.elf b/aarch64/bin/count.elf index e4e756e..91c98cb 100755 --- a/aarch64/bin/count.elf +++ b/aarch64/bin/count.elf Binary files differ
diff --git a/aarch64/bin/diagtool b/aarch64/bin/diagtool index 975527f..e66971d 100755 --- a/aarch64/bin/diagtool +++ b/aarch64/bin/diagtool
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/diagtool" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/diagtool" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/diagtool.elf b/aarch64/bin/diagtool.elf index f8bfdeb..1bfa7af 100755 --- a/aarch64/bin/diagtool.elf +++ b/aarch64/bin/diagtool.elf Binary files differ
diff --git a/aarch64/bin/dsymutil b/aarch64/bin/dsymutil index 13be5a2..bd48395 100755 --- a/aarch64/bin/dsymutil +++ b/aarch64/bin/dsymutil
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/dsymutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/dsymutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/dsymutil.elf b/aarch64/bin/dsymutil.elf index fb22153..312f18e 100755 --- a/aarch64/bin/dsymutil.elf +++ b/aarch64/bin/dsymutil.elf Binary files differ
diff --git a/aarch64/bin/eu-addr2line b/aarch64/bin/eu-addr2line index 7f03eed..d9aeb63 100755 --- a/aarch64/bin/eu-addr2line +++ b/aarch64/bin/eu-addr2line
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-addr2line" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-addr2line" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-addr2line.elf b/aarch64/bin/eu-addr2line.elf index 74822f3..77d56ec 100755 --- a/aarch64/bin/eu-addr2line.elf +++ b/aarch64/bin/eu-addr2line.elf Binary files differ
diff --git a/aarch64/bin/eu-ar b/aarch64/bin/eu-ar index 3dbc757..eb2d5a7 100755 --- a/aarch64/bin/eu-ar +++ b/aarch64/bin/eu-ar
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-ar" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-ar" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-ar.elf b/aarch64/bin/eu-ar.elf index d56755d..87f2b7c 100755 --- a/aarch64/bin/eu-ar.elf +++ b/aarch64/bin/eu-ar.elf Binary files differ
diff --git a/aarch64/bin/eu-elfclassify b/aarch64/bin/eu-elfclassify index 7fba23b..eb0c830 100755 --- a/aarch64/bin/eu-elfclassify +++ b/aarch64/bin/eu-elfclassify
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-elfclassify" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-elfclassify" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-elfclassify.elf b/aarch64/bin/eu-elfclassify.elf index 01a563d..fae5790 100755 --- a/aarch64/bin/eu-elfclassify.elf +++ b/aarch64/bin/eu-elfclassify.elf Binary files differ
diff --git a/aarch64/bin/eu-elfcmp b/aarch64/bin/eu-elfcmp index ec7be79..0c71dc9 100755 --- a/aarch64/bin/eu-elfcmp +++ b/aarch64/bin/eu-elfcmp
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-elfcmp" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-elfcmp" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-elfcmp.elf b/aarch64/bin/eu-elfcmp.elf index 84e42d6..20032d4 100755 --- a/aarch64/bin/eu-elfcmp.elf +++ b/aarch64/bin/eu-elfcmp.elf Binary files differ
diff --git a/aarch64/bin/eu-elfcompress b/aarch64/bin/eu-elfcompress index d6b161d..0125c18 100755 --- a/aarch64/bin/eu-elfcompress +++ b/aarch64/bin/eu-elfcompress
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-elfcompress" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-elfcompress" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-elfcompress.elf b/aarch64/bin/eu-elfcompress.elf index a2b2186..f427be2 100755 --- a/aarch64/bin/eu-elfcompress.elf +++ b/aarch64/bin/eu-elfcompress.elf Binary files differ
diff --git a/aarch64/bin/eu-elflint b/aarch64/bin/eu-elflint index bd35ff2..2ac99de 100755 --- a/aarch64/bin/eu-elflint +++ b/aarch64/bin/eu-elflint
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-elflint" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-elflint" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-elflint.elf b/aarch64/bin/eu-elflint.elf index 10f52b2..dd940f7 100755 --- a/aarch64/bin/eu-elflint.elf +++ b/aarch64/bin/eu-elflint.elf Binary files differ
diff --git a/aarch64/bin/eu-findtextrel b/aarch64/bin/eu-findtextrel index a9a0959..6541a08 100755 --- a/aarch64/bin/eu-findtextrel +++ b/aarch64/bin/eu-findtextrel
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-findtextrel" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-findtextrel" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-findtextrel.elf b/aarch64/bin/eu-findtextrel.elf index c4b9d25..082f8e3 100755 --- a/aarch64/bin/eu-findtextrel.elf +++ b/aarch64/bin/eu-findtextrel.elf Binary files differ
diff --git a/aarch64/bin/eu-make-debug-archive b/aarch64/bin/eu-make-debug-archive index b798e75..7439a31 100755 --- a/aarch64/bin/eu-make-debug-archive +++ b/aarch64/bin/eu-make-debug-archive
@@ -45,7 +45,7 @@ script_version() { - echo "`basename $0` (elfutils) 0.177" + echo "`basename $0` (elfutils) 0.185" echo "Copyright (C) 2007 Red Hat, Inc." echo "This is free software; see the source for copying conditions." echo "There is NO warranty; not even for MERCHANTABILITY or"
diff --git a/aarch64/bin/eu-nm b/aarch64/bin/eu-nm index b6f3f28..ad460e1 100755 --- a/aarch64/bin/eu-nm +++ b/aarch64/bin/eu-nm
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-nm" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-nm" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-nm.elf b/aarch64/bin/eu-nm.elf index e9af74c..f541d1b 100755 --- a/aarch64/bin/eu-nm.elf +++ b/aarch64/bin/eu-nm.elf Binary files differ
diff --git a/aarch64/bin/eu-objdump b/aarch64/bin/eu-objdump index 02d0014..980d2dd 100755 --- a/aarch64/bin/eu-objdump +++ b/aarch64/bin/eu-objdump
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-objdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-objdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-objdump.elf b/aarch64/bin/eu-objdump.elf index e15cade..cc87020 100755 --- a/aarch64/bin/eu-objdump.elf +++ b/aarch64/bin/eu-objdump.elf Binary files differ
diff --git a/aarch64/bin/eu-ranlib b/aarch64/bin/eu-ranlib index a53fa7e..a2d0e4e 100755 --- a/aarch64/bin/eu-ranlib +++ b/aarch64/bin/eu-ranlib
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-ranlib" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-ranlib" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-ranlib.elf b/aarch64/bin/eu-ranlib.elf index bb54485..b80e1cf 100755 --- a/aarch64/bin/eu-ranlib.elf +++ b/aarch64/bin/eu-ranlib.elf Binary files differ
diff --git a/aarch64/bin/eu-readelf b/aarch64/bin/eu-readelf index 1cd8230..867bb6d 100755 --- a/aarch64/bin/eu-readelf +++ b/aarch64/bin/eu-readelf
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-readelf" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-readelf" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-readelf.elf b/aarch64/bin/eu-readelf.elf index 8fb67e7..3db5e4a 100755 --- a/aarch64/bin/eu-readelf.elf +++ b/aarch64/bin/eu-readelf.elf Binary files differ
diff --git a/aarch64/bin/eu-size b/aarch64/bin/eu-size index 26ebc59..da31068 100755 --- a/aarch64/bin/eu-size +++ b/aarch64/bin/eu-size
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-size" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-size" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-size.elf b/aarch64/bin/eu-size.elf index b64e1b1..49b308b 100755 --- a/aarch64/bin/eu-size.elf +++ b/aarch64/bin/eu-size.elf Binary files differ
diff --git a/aarch64/bin/eu-stack b/aarch64/bin/eu-stack index 7df09d7..d849807 100755 --- a/aarch64/bin/eu-stack +++ b/aarch64/bin/eu-stack
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-stack" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-stack" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-stack.elf b/aarch64/bin/eu-stack.elf index d0af395..fe197db 100755 --- a/aarch64/bin/eu-stack.elf +++ b/aarch64/bin/eu-stack.elf Binary files differ
diff --git a/aarch64/bin/eu-strings b/aarch64/bin/eu-strings index e90b197..129fc70 100755 --- a/aarch64/bin/eu-strings +++ b/aarch64/bin/eu-strings
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-strings" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-strings" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-strings.elf b/aarch64/bin/eu-strings.elf index 1f0d6a2..11d567b 100755 --- a/aarch64/bin/eu-strings.elf +++ b/aarch64/bin/eu-strings.elf Binary files differ
diff --git a/aarch64/bin/eu-strip b/aarch64/bin/eu-strip index 976842b..423ff5d 100755 --- a/aarch64/bin/eu-strip +++ b/aarch64/bin/eu-strip
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-strip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-strip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-strip.elf b/aarch64/bin/eu-strip.elf index b9c27a2..e0eb6e8 100755 --- a/aarch64/bin/eu-strip.elf +++ b/aarch64/bin/eu-strip.elf Binary files differ
diff --git a/aarch64/bin/eu-unstrip b/aarch64/bin/eu-unstrip index b7581fa..f00eff2 100755 --- a/aarch64/bin/eu-unstrip +++ b/aarch64/bin/eu-unstrip
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/eu-unstrip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/eu-unstrip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/eu-unstrip.elf b/aarch64/bin/eu-unstrip.elf index 7d2c5ca..d1a4921 100755 --- a/aarch64/bin/eu-unstrip.elf +++ b/aarch64/bin/eu-unstrip.elf Binary files differ
diff --git a/aarch64/bin/find-all-symbols b/aarch64/bin/find-all-symbols index 0e58599..2b11eb5 100755 --- a/aarch64/bin/find-all-symbols +++ b/aarch64/bin/find-all-symbols
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/find-all-symbols" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/find-all-symbols" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/find-all-symbols.elf b/aarch64/bin/find-all-symbols.elf index 932098a..2f91149 100755 --- a/aarch64/bin/find-all-symbols.elf +++ b/aarch64/bin/find-all-symbols.elf Binary files differ
diff --git a/aarch64/bin/hmaptool b/aarch64/bin/hmaptool index 58baab2..7949002 100755 --- a/aarch64/bin/hmaptool +++ b/aarch64/bin/hmaptool
@@ -1,6 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import, division, print_function +from ctypes import ArgumentError import json import optparse import os @@ -9,8 +10,8 @@ ### -k_header_magic_LE = 'pamh' -k_header_magic_BE = 'hmap' +k_header_magic_LE = b'pamh' +k_header_magic_BE = b'hmap' def hmap_hash(str): """hash(str) -> int @@ -43,7 +44,7 @@ path,)) (version, reserved, strtable_offset, num_entries, - num_buckets, max_value_len) = struct.unpack(header_fmt, data) + num_buckets) = struct.unpack(header_fmt, data) if version != 1: raise SystemExit("error: %s: unknown headermap version: %r" % ( @@ -83,7 +84,7 @@ if len(strtable) != strtable_size: raise SystemExit("error: %s: unable to read complete string table"%( path,)) - if strtable[-1] != '\0': + if strtable[-1] != 0: raise SystemExit("error: %s: invalid string table in headermap" % ( path,)) @@ -97,8 +98,8 @@ def get_string(self, idx): if idx >= len(self.strtable): raise SystemExit("error: %s: invalid string index" % ( - path,)) - end_idx = self.strtable.index('\0', idx) + idx,)) + end_idx = self.strtable.index(0, idx) return self.strtable[idx:end_idx] @property @@ -147,7 +148,7 @@ suffix = hmap.get_string(suffix_idx) print (" bucket[%d]: %r -> (%r, %r) -- %d" % ( - i, key, prefix, suffix, (hmap_hash(key) & (num_buckets - 1)))) + i, key, prefix, suffix, (hmap_hash(key) & (len(hmap.buckets) - 1)))) else: mappings = sorted(hmap.mappings) for key,value in mappings: @@ -220,7 +221,7 @@ # Write out the headermap. with open(output_path, 'wb') as f: - f.write(magic.encode()) + f.write(magic) f.write(struct.pack(header_fmt, *header)) for bucket in table: f.write(struct.pack(bucket_fmt, *bucket))
diff --git a/aarch64/bin/intercept-build b/aarch64/bin/intercept-build new file mode 100755 index 0000000..9ecde39 --- /dev/null +++ b/aarch64/bin/intercept-build
@@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import multiprocessing +import sys +import os.path +this_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(os.path.dirname(this_dir), 'lib')) + +from libscanbuild.intercept import intercept_build + +if __name__ == '__main__': + multiprocessing.freeze_support() + sys.exit(intercept_build())
diff --git a/aarch64/bin/ld64.lld.darwinnew b/aarch64/bin/ld64.lld.darwinnew new file mode 120000 index 0000000..02416ac --- /dev/null +++ b/aarch64/bin/ld64.lld.darwinnew
@@ -0,0 +1 @@ +lld \ No newline at end of file
diff --git a/aarch64/bin/ld64.lld.darwinold b/aarch64/bin/ld64.lld.darwinold new file mode 120000 index 0000000..02416ac --- /dev/null +++ b/aarch64/bin/ld64.lld.darwinold
@@ -0,0 +1 @@ +lld \ No newline at end of file
diff --git a/aarch64/bin/llc b/aarch64/bin/llc index 6dce27b..abbf13e 100755 --- a/aarch64/bin/llc +++ b/aarch64/bin/llc
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llc.elf b/aarch64/bin/llc.elf index 8517d01..0704899 100755 --- a/aarch64/bin/llc.elf +++ b/aarch64/bin/llc.elf Binary files differ
diff --git a/aarch64/bin/lld b/aarch64/bin/lld index 0c4a6ab..7d9f14b 100755 --- a/aarch64/bin/lld +++ b/aarch64/bin/lld
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/lld" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/lld" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lld.elf b/aarch64/bin/lld.elf index 4f24da7..3e12ab1 100755 --- a/aarch64/bin/lld.elf +++ b/aarch64/bin/lld.elf Binary files differ
diff --git a/aarch64/bin/lldb b/aarch64/bin/lldb new file mode 100755 index 0000000..8fe7a23 --- /dev/null +++ b/aarch64/bin/lldb
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/lldb" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lldb-argdumper b/aarch64/bin/lldb-argdumper new file mode 100755 index 0000000..396d49c --- /dev/null +++ b/aarch64/bin/lldb-argdumper
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/lldb-argdumper" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lldb-argdumper.elf b/aarch64/bin/lldb-argdumper.elf new file mode 100755 index 0000000..aba4dd8 --- /dev/null +++ b/aarch64/bin/lldb-argdumper.elf Binary files differ
diff --git a/aarch64/bin/lldb-instr b/aarch64/bin/lldb-instr new file mode 100755 index 0000000..c6cb78b --- /dev/null +++ b/aarch64/bin/lldb-instr
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/lldb-instr" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lldb-instr.elf b/aarch64/bin/lldb-instr.elf new file mode 100755 index 0000000..26682bb --- /dev/null +++ b/aarch64/bin/lldb-instr.elf Binary files differ
diff --git a/aarch64/bin/lldb-server b/aarch64/bin/lldb-server new file mode 100755 index 0000000..1dad366 --- /dev/null +++ b/aarch64/bin/lldb-server
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/lldb-server" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lldb-server.elf b/aarch64/bin/lldb-server.elf new file mode 100755 index 0000000..e02790d --- /dev/null +++ b/aarch64/bin/lldb-server.elf Binary files differ
diff --git a/aarch64/bin/lldb-vscode b/aarch64/bin/lldb-vscode new file mode 100755 index 0000000..7f3118e --- /dev/null +++ b/aarch64/bin/lldb-vscode
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/lldb-vscode" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lldb-vscode.elf b/aarch64/bin/lldb-vscode.elf new file mode 100755 index 0000000..a34d905 --- /dev/null +++ b/aarch64/bin/lldb-vscode.elf Binary files differ
diff --git a/aarch64/bin/lldb.elf b/aarch64/bin/lldb.elf new file mode 100755 index 0000000..7b69520 --- /dev/null +++ b/aarch64/bin/lldb.elf Binary files differ
diff --git a/aarch64/bin/lli b/aarch64/bin/lli index fec696f..3c9d160 100755 --- a/aarch64/bin/lli +++ b/aarch64/bin/lli
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/lli" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/lli" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lli-child-target b/aarch64/bin/lli-child-target index 2b54b19..86fcd7a 100755 --- a/aarch64/bin/lli-child-target +++ b/aarch64/bin/lli-child-target
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/lli-child-target" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/lli-child-target" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/lli-child-target.elf b/aarch64/bin/lli-child-target.elf index c75d93c..7c8190d 100755 --- a/aarch64/bin/lli-child-target.elf +++ b/aarch64/bin/lli-child-target.elf Binary files differ
diff --git a/aarch64/bin/lli.elf b/aarch64/bin/lli.elf index 90063ad..94d0c80 100755 --- a/aarch64/bin/lli.elf +++ b/aarch64/bin/lli.elf Binary files differ
diff --git a/aarch64/bin/llvm-PerfectShuffle b/aarch64/bin/llvm-PerfectShuffle index b5da558..b6429e3 100755 --- a/aarch64/bin/llvm-PerfectShuffle +++ b/aarch64/bin/llvm-PerfectShuffle
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-PerfectShuffle" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-PerfectShuffle" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-PerfectShuffle.elf b/aarch64/bin/llvm-PerfectShuffle.elf index 8b3f05e..79e64c8 100755 --- a/aarch64/bin/llvm-PerfectShuffle.elf +++ b/aarch64/bin/llvm-PerfectShuffle.elf Binary files differ
diff --git a/aarch64/bin/llvm-ar b/aarch64/bin/llvm-ar index 75cdca9..093f33c 100755 --- a/aarch64/bin/llvm-ar +++ b/aarch64/bin/llvm-ar
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-ar" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-ar" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-ar.elf b/aarch64/bin/llvm-ar.elf index 36210d8..93dde07 100755 --- a/aarch64/bin/llvm-ar.elf +++ b/aarch64/bin/llvm-ar.elf Binary files differ
diff --git a/aarch64/bin/llvm-as b/aarch64/bin/llvm-as index b31c269..0629fda 100755 --- a/aarch64/bin/llvm-as +++ b/aarch64/bin/llvm-as
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-as" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-as" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-as.elf b/aarch64/bin/llvm-as.elf index afea3bf..6395787 100755 --- a/aarch64/bin/llvm-as.elf +++ b/aarch64/bin/llvm-as.elf Binary files differ
diff --git a/aarch64/bin/llvm-bcanalyzer b/aarch64/bin/llvm-bcanalyzer index 4ddbebf..3d10099 100755 --- a/aarch64/bin/llvm-bcanalyzer +++ b/aarch64/bin/llvm-bcanalyzer
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-bcanalyzer" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-bcanalyzer" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-bcanalyzer.elf b/aarch64/bin/llvm-bcanalyzer.elf index ff23986..c710ebc 100755 --- a/aarch64/bin/llvm-bcanalyzer.elf +++ b/aarch64/bin/llvm-bcanalyzer.elf Binary files differ
diff --git a/aarch64/bin/llvm-c-test b/aarch64/bin/llvm-c-test index 7927297..c4f4a32 100755 --- a/aarch64/bin/llvm-c-test +++ b/aarch64/bin/llvm-c-test
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-c-test" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-c-test" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-c-test.elf b/aarch64/bin/llvm-c-test.elf index 527ef7c..af1b1f6 100755 --- a/aarch64/bin/llvm-c-test.elf +++ b/aarch64/bin/llvm-c-test.elf Binary files differ
diff --git a/aarch64/bin/llvm-cat b/aarch64/bin/llvm-cat index 56ee863..d8243cb 100755 --- a/aarch64/bin/llvm-cat +++ b/aarch64/bin/llvm-cat
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cat" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cat" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cat.elf b/aarch64/bin/llvm-cat.elf index 19de1e0..78fb4fd 100755 --- a/aarch64/bin/llvm-cat.elf +++ b/aarch64/bin/llvm-cat.elf Binary files differ
diff --git a/aarch64/bin/llvm-cfi-verify b/aarch64/bin/llvm-cfi-verify index d81f16a..3663f91 100755 --- a/aarch64/bin/llvm-cfi-verify +++ b/aarch64/bin/llvm-cfi-verify
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cfi-verify" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cfi-verify" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cfi-verify.elf b/aarch64/bin/llvm-cfi-verify.elf index 63350a8..135e5fe 100755 --- a/aarch64/bin/llvm-cfi-verify.elf +++ b/aarch64/bin/llvm-cfi-verify.elf Binary files differ
diff --git a/aarch64/bin/llvm-cov b/aarch64/bin/llvm-cov index 9f85452..0143403 100755 --- a/aarch64/bin/llvm-cov +++ b/aarch64/bin/llvm-cov
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cov" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cov" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cov.elf b/aarch64/bin/llvm-cov.elf index 6588222..fa74ab1 100755 --- a/aarch64/bin/llvm-cov.elf +++ b/aarch64/bin/llvm-cov.elf Binary files differ
diff --git a/aarch64/bin/llvm-cvtres b/aarch64/bin/llvm-cvtres index f428f87..20f7884 100755 --- a/aarch64/bin/llvm-cvtres +++ b/aarch64/bin/llvm-cvtres
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cvtres" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cvtres" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cvtres.elf b/aarch64/bin/llvm-cvtres.elf index fa386b8..d82e3f9 100755 --- a/aarch64/bin/llvm-cvtres.elf +++ b/aarch64/bin/llvm-cvtres.elf Binary files differ
diff --git a/aarch64/bin/llvm-cxxdump b/aarch64/bin/llvm-cxxdump index 19b4ed7..b63f036 100755 --- a/aarch64/bin/llvm-cxxdump +++ b/aarch64/bin/llvm-cxxdump
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cxxdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cxxdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cxxdump.elf b/aarch64/bin/llvm-cxxdump.elf index b978a4e..edf6d94 100755 --- a/aarch64/bin/llvm-cxxdump.elf +++ b/aarch64/bin/llvm-cxxdump.elf Binary files differ
diff --git a/aarch64/bin/llvm-cxxfilt b/aarch64/bin/llvm-cxxfilt index 4e61a15..ae2edc6 100755 --- a/aarch64/bin/llvm-cxxfilt +++ b/aarch64/bin/llvm-cxxfilt
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cxxfilt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cxxfilt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cxxfilt.elf b/aarch64/bin/llvm-cxxfilt.elf index a169b94..3671971 100755 --- a/aarch64/bin/llvm-cxxfilt.elf +++ b/aarch64/bin/llvm-cxxfilt.elf Binary files differ
diff --git a/aarch64/bin/llvm-cxxmap b/aarch64/bin/llvm-cxxmap index d462e14..ec8b71f 100755 --- a/aarch64/bin/llvm-cxxmap +++ b/aarch64/bin/llvm-cxxmap
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-cxxmap" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-cxxmap" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-cxxmap.elf b/aarch64/bin/llvm-cxxmap.elf index a02ca55..40b7a86 100755 --- a/aarch64/bin/llvm-cxxmap.elf +++ b/aarch64/bin/llvm-cxxmap.elf Binary files differ
diff --git a/aarch64/bin/llvm-diff b/aarch64/bin/llvm-diff index 0d8d9fd..f2bffb7 100755 --- a/aarch64/bin/llvm-diff +++ b/aarch64/bin/llvm-diff
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-diff" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-diff" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-diff.elf b/aarch64/bin/llvm-diff.elf index 1cd82ad..f4c980f 100755 --- a/aarch64/bin/llvm-diff.elf +++ b/aarch64/bin/llvm-diff.elf Binary files differ
diff --git a/aarch64/bin/llvm-dis b/aarch64/bin/llvm-dis index 9cc35ce..d77a6c7 100755 --- a/aarch64/bin/llvm-dis +++ b/aarch64/bin/llvm-dis
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-dis" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-dis" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-dis.elf b/aarch64/bin/llvm-dis.elf index 14e5f77..d5a3dbb 100755 --- a/aarch64/bin/llvm-dis.elf +++ b/aarch64/bin/llvm-dis.elf Binary files differ
diff --git a/aarch64/bin/llvm-dwarfdump b/aarch64/bin/llvm-dwarfdump index 6c78ba1..f996d44 100755 --- a/aarch64/bin/llvm-dwarfdump +++ b/aarch64/bin/llvm-dwarfdump
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-dwarfdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-dwarfdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-dwarfdump.elf b/aarch64/bin/llvm-dwarfdump.elf index 3abe6e6..19290da 100755 --- a/aarch64/bin/llvm-dwarfdump.elf +++ b/aarch64/bin/llvm-dwarfdump.elf Binary files differ
diff --git a/aarch64/bin/llvm-dwp b/aarch64/bin/llvm-dwp index 3a0a3d8..81a4dc4 100755 --- a/aarch64/bin/llvm-dwp +++ b/aarch64/bin/llvm-dwp
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-dwp" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-dwp" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-dwp.elf b/aarch64/bin/llvm-dwp.elf index c86722a..60f3ca0 100755 --- a/aarch64/bin/llvm-dwp.elf +++ b/aarch64/bin/llvm-dwp.elf Binary files differ
diff --git a/aarch64/bin/llvm-elfabi b/aarch64/bin/llvm-elfabi deleted file mode 100755 index 2ae9028..0000000 --- a/aarch64/bin/llvm-elfabi +++ /dev/null
@@ -1,16 +0,0 @@ -#!/bin/sh -if base=$(readlink "$0" 2>/dev/null); then - case $base in - /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. - *) base=$(dirname "$0")/"${base}";; - esac -else - case $0 in - /*) base=$0;; - *) base=${PWD:-`pwd`}/$0;; - esac -fi -basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-elfabi" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-elfabi.elf b/aarch64/bin/llvm-elfabi.elf deleted file mode 100755 index 946dce7..0000000 --- a/aarch64/bin/llvm-elfabi.elf +++ /dev/null Binary files differ
diff --git a/aarch64/bin/llvm-exegesis b/aarch64/bin/llvm-exegesis index fcf157e..48f0773 100755 --- a/aarch64/bin/llvm-exegesis +++ b/aarch64/bin/llvm-exegesis
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-exegesis" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-exegesis" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-exegesis.elf b/aarch64/bin/llvm-exegesis.elf index 992dea6..d7916f3 100755 --- a/aarch64/bin/llvm-exegesis.elf +++ b/aarch64/bin/llvm-exegesis.elf Binary files differ
diff --git a/aarch64/bin/llvm-extract b/aarch64/bin/llvm-extract index b36dca4..fc8cf6c 100755 --- a/aarch64/bin/llvm-extract +++ b/aarch64/bin/llvm-extract
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-extract" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-extract" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-extract.elf b/aarch64/bin/llvm-extract.elf index 89197f0..fe8c3d1 100755 --- a/aarch64/bin/llvm-extract.elf +++ b/aarch64/bin/llvm-extract.elf Binary files differ
diff --git a/aarch64/bin/llvm-gsymutil b/aarch64/bin/llvm-gsymutil index a987c2f..aa8d08b 100755 --- a/aarch64/bin/llvm-gsymutil +++ b/aarch64/bin/llvm-gsymutil
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-gsymutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-gsymutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-gsymutil.elf b/aarch64/bin/llvm-gsymutil.elf index baa2b7d..a11f029 100755 --- a/aarch64/bin/llvm-gsymutil.elf +++ b/aarch64/bin/llvm-gsymutil.elf Binary files differ
diff --git a/aarch64/bin/llvm-ifs b/aarch64/bin/llvm-ifs index 7f5ed08..84e6426 100755 --- a/aarch64/bin/llvm-ifs +++ b/aarch64/bin/llvm-ifs
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-ifs" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-ifs" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-ifs.elf b/aarch64/bin/llvm-ifs.elf index b494abc..a350f0b 100755 --- a/aarch64/bin/llvm-ifs.elf +++ b/aarch64/bin/llvm-ifs.elf Binary files differ
diff --git a/aarch64/bin/llvm-jitlink b/aarch64/bin/llvm-jitlink index ce108f1..b94e72d 100755 --- a/aarch64/bin/llvm-jitlink +++ b/aarch64/bin/llvm-jitlink
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-jitlink" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-jitlink" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-jitlink-executor b/aarch64/bin/llvm-jitlink-executor new file mode 100755 index 0000000..9838dfe --- /dev/null +++ b/aarch64/bin/llvm-jitlink-executor
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/llvm-jitlink-executor" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-jitlink-executor.elf b/aarch64/bin/llvm-jitlink-executor.elf new file mode 100755 index 0000000..17b834f --- /dev/null +++ b/aarch64/bin/llvm-jitlink-executor.elf Binary files differ
diff --git a/aarch64/bin/llvm-jitlink.elf b/aarch64/bin/llvm-jitlink.elf index 39430a2..a6b0bb3 100755 --- a/aarch64/bin/llvm-jitlink.elf +++ b/aarch64/bin/llvm-jitlink.elf Binary files differ
diff --git a/aarch64/bin/llvm-libtool-darwin b/aarch64/bin/llvm-libtool-darwin index 0bf1c38..0700cba 100755 --- a/aarch64/bin/llvm-libtool-darwin +++ b/aarch64/bin/llvm-libtool-darwin
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-libtool-darwin" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-libtool-darwin" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-libtool-darwin.elf b/aarch64/bin/llvm-libtool-darwin.elf index 6863806..8fd95ba 100755 --- a/aarch64/bin/llvm-libtool-darwin.elf +++ b/aarch64/bin/llvm-libtool-darwin.elf Binary files differ
diff --git a/aarch64/bin/llvm-link b/aarch64/bin/llvm-link index 14e62e3..d43355b 100755 --- a/aarch64/bin/llvm-link +++ b/aarch64/bin/llvm-link
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-link" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-link" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-link.elf b/aarch64/bin/llvm-link.elf index 33adfb9..333dd66 100755 --- a/aarch64/bin/llvm-link.elf +++ b/aarch64/bin/llvm-link.elf Binary files differ
diff --git a/aarch64/bin/llvm-lipo b/aarch64/bin/llvm-lipo index 97a4454..b9d5c86 100755 --- a/aarch64/bin/llvm-lipo +++ b/aarch64/bin/llvm-lipo
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-lipo" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-lipo" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-lipo.elf b/aarch64/bin/llvm-lipo.elf index 77c852d..01122da 100755 --- a/aarch64/bin/llvm-lipo.elf +++ b/aarch64/bin/llvm-lipo.elf Binary files differ
diff --git a/aarch64/bin/llvm-lto b/aarch64/bin/llvm-lto index 5c0b6eb..bb70806 100755 --- a/aarch64/bin/llvm-lto +++ b/aarch64/bin/llvm-lto
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-lto" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-lto" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-lto.elf b/aarch64/bin/llvm-lto.elf index 3818536..7707618 100755 --- a/aarch64/bin/llvm-lto.elf +++ b/aarch64/bin/llvm-lto.elf Binary files differ
diff --git a/aarch64/bin/llvm-lto2 b/aarch64/bin/llvm-lto2 index 806eed6..b7a1634 100755 --- a/aarch64/bin/llvm-lto2 +++ b/aarch64/bin/llvm-lto2
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-lto2" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-lto2" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-lto2.elf b/aarch64/bin/llvm-lto2.elf index 5cec785..7b8d6d6 100755 --- a/aarch64/bin/llvm-lto2.elf +++ b/aarch64/bin/llvm-lto2.elf Binary files differ
diff --git a/aarch64/bin/llvm-mc b/aarch64/bin/llvm-mc index c67296b..61a5f19 100755 --- a/aarch64/bin/llvm-mc +++ b/aarch64/bin/llvm-mc
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-mc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-mc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-mc.elf b/aarch64/bin/llvm-mc.elf index a1c5053..d44b0ac 100755 --- a/aarch64/bin/llvm-mc.elf +++ b/aarch64/bin/llvm-mc.elf Binary files differ
diff --git a/aarch64/bin/llvm-mca b/aarch64/bin/llvm-mca index d9ccab9..e4b60bc 100755 --- a/aarch64/bin/llvm-mca +++ b/aarch64/bin/llvm-mca
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-mca" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-mca" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-mca.elf b/aarch64/bin/llvm-mca.elf index 9014355..0d3fe6c 100755 --- a/aarch64/bin/llvm-mca.elf +++ b/aarch64/bin/llvm-mca.elf Binary files differ
diff --git a/aarch64/bin/llvm-ml b/aarch64/bin/llvm-ml index d1dc41b..a22bfd5 100755 --- a/aarch64/bin/llvm-ml +++ b/aarch64/bin/llvm-ml
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-ml" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-ml" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-ml.elf b/aarch64/bin/llvm-ml.elf index 9af4b25..91c553f 100755 --- a/aarch64/bin/llvm-ml.elf +++ b/aarch64/bin/llvm-ml.elf Binary files differ
diff --git a/aarch64/bin/llvm-modextract b/aarch64/bin/llvm-modextract index 87e4a0f..a66716a 100755 --- a/aarch64/bin/llvm-modextract +++ b/aarch64/bin/llvm-modextract
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-modextract" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-modextract" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-modextract.elf b/aarch64/bin/llvm-modextract.elf index f294c3f..0ff1efe 100755 --- a/aarch64/bin/llvm-modextract.elf +++ b/aarch64/bin/llvm-modextract.elf Binary files differ
diff --git a/aarch64/bin/llvm-mt b/aarch64/bin/llvm-mt index b404d1e..4618038 100755 --- a/aarch64/bin/llvm-mt +++ b/aarch64/bin/llvm-mt
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-mt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-mt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-mt.elf b/aarch64/bin/llvm-mt.elf index 9b54c63..7a0aaa6 100755 --- a/aarch64/bin/llvm-mt.elf +++ b/aarch64/bin/llvm-mt.elf Binary files differ
diff --git a/aarch64/bin/llvm-nm b/aarch64/bin/llvm-nm index d084032..6bd36c6 100755 --- a/aarch64/bin/llvm-nm +++ b/aarch64/bin/llvm-nm
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-nm" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-nm" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-nm.elf b/aarch64/bin/llvm-nm.elf index 3f19982..c869342 100755 --- a/aarch64/bin/llvm-nm.elf +++ b/aarch64/bin/llvm-nm.elf Binary files differ
diff --git a/aarch64/bin/llvm-objcopy b/aarch64/bin/llvm-objcopy index ef46ddd..7297bf2 100755 --- a/aarch64/bin/llvm-objcopy +++ b/aarch64/bin/llvm-objcopy
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-objcopy" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-objcopy" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-objcopy.elf b/aarch64/bin/llvm-objcopy.elf index 05133aa..788833b 100755 --- a/aarch64/bin/llvm-objcopy.elf +++ b/aarch64/bin/llvm-objcopy.elf Binary files differ
diff --git a/aarch64/bin/llvm-objdump b/aarch64/bin/llvm-objdump index 3123e01..b1029cd 100755 --- a/aarch64/bin/llvm-objdump +++ b/aarch64/bin/llvm-objdump
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-objdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-objdump" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-objdump.elf b/aarch64/bin/llvm-objdump.elf index cc581cd..41e9156 100755 --- a/aarch64/bin/llvm-objdump.elf +++ b/aarch64/bin/llvm-objdump.elf Binary files differ
diff --git a/aarch64/bin/llvm-opt-report b/aarch64/bin/llvm-opt-report index 6f77aa0..d85c99c 100755 --- a/aarch64/bin/llvm-opt-report +++ b/aarch64/bin/llvm-opt-report
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-opt-report" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-opt-report" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-opt-report.elf b/aarch64/bin/llvm-opt-report.elf index fb7620b..e22230e 100755 --- a/aarch64/bin/llvm-opt-report.elf +++ b/aarch64/bin/llvm-opt-report.elf Binary files differ
diff --git a/aarch64/bin/llvm-otool b/aarch64/bin/llvm-otool new file mode 120000 index 0000000..8e4dc01 --- /dev/null +++ b/aarch64/bin/llvm-otool
@@ -0,0 +1 @@ +llvm-objdump \ No newline at end of file
diff --git a/aarch64/bin/llvm-pdbutil b/aarch64/bin/llvm-pdbutil index 518e616..6150e3a 100755 --- a/aarch64/bin/llvm-pdbutil +++ b/aarch64/bin/llvm-pdbutil
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-pdbutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-pdbutil" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-pdbutil.elf b/aarch64/bin/llvm-pdbutil.elf index 8a1facd..8e55f17 100755 --- a/aarch64/bin/llvm-pdbutil.elf +++ b/aarch64/bin/llvm-pdbutil.elf Binary files differ
diff --git a/aarch64/bin/llvm-profdata b/aarch64/bin/llvm-profdata index 40835f1..9a80be7 100755 --- a/aarch64/bin/llvm-profdata +++ b/aarch64/bin/llvm-profdata
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-profdata" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-profdata" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-profdata.elf b/aarch64/bin/llvm-profdata.elf index 9e19196..f3e440b 100755 --- a/aarch64/bin/llvm-profdata.elf +++ b/aarch64/bin/llvm-profdata.elf Binary files differ
diff --git a/aarch64/bin/llvm-profgen b/aarch64/bin/llvm-profgen new file mode 100755 index 0000000..6f65a4b --- /dev/null +++ b/aarch64/bin/llvm-profgen
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/llvm-profgen" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-profgen.elf b/aarch64/bin/llvm-profgen.elf new file mode 100755 index 0000000..c1b2d2f --- /dev/null +++ b/aarch64/bin/llvm-profgen.elf Binary files differ
diff --git a/aarch64/bin/llvm-rc b/aarch64/bin/llvm-rc index 08d23a9..a0cc465 100755 --- a/aarch64/bin/llvm-rc +++ b/aarch64/bin/llvm-rc
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-rc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-rc" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-rc.elf b/aarch64/bin/llvm-rc.elf index 460d0bf..a08adef 100755 --- a/aarch64/bin/llvm-rc.elf +++ b/aarch64/bin/llvm-rc.elf Binary files differ
diff --git a/aarch64/bin/llvm-readobj b/aarch64/bin/llvm-readobj index 2257e61..edcb8e1 100755 --- a/aarch64/bin/llvm-readobj +++ b/aarch64/bin/llvm-readobj
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-readobj" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-readobj" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-readobj.elf b/aarch64/bin/llvm-readobj.elf index 800f2b1..35e84ef 100755 --- a/aarch64/bin/llvm-readobj.elf +++ b/aarch64/bin/llvm-readobj.elf Binary files differ
diff --git a/aarch64/bin/llvm-reduce b/aarch64/bin/llvm-reduce index b0f4b1e..ff91325 100755 --- a/aarch64/bin/llvm-reduce +++ b/aarch64/bin/llvm-reduce
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-reduce" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-reduce" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-reduce.elf b/aarch64/bin/llvm-reduce.elf index 313d326..6db06ee 100755 --- a/aarch64/bin/llvm-reduce.elf +++ b/aarch64/bin/llvm-reduce.elf Binary files differ
diff --git a/aarch64/bin/llvm-rtdyld b/aarch64/bin/llvm-rtdyld index fdcd578..2b58302 100755 --- a/aarch64/bin/llvm-rtdyld +++ b/aarch64/bin/llvm-rtdyld
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-rtdyld" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-rtdyld" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-rtdyld.elf b/aarch64/bin/llvm-rtdyld.elf index 7c188e8..f81cacc 100755 --- a/aarch64/bin/llvm-rtdyld.elf +++ b/aarch64/bin/llvm-rtdyld.elf Binary files differ
diff --git a/aarch64/bin/llvm-sim b/aarch64/bin/llvm-sim new file mode 100755 index 0000000..0ae0a50 --- /dev/null +++ b/aarch64/bin/llvm-sim
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/llvm-sim" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-sim.elf b/aarch64/bin/llvm-sim.elf new file mode 100755 index 0000000..6ee757e --- /dev/null +++ b/aarch64/bin/llvm-sim.elf Binary files differ
diff --git a/aarch64/bin/llvm-size b/aarch64/bin/llvm-size index 769d525..dbd9e15 100755 --- a/aarch64/bin/llvm-size +++ b/aarch64/bin/llvm-size
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-size" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-size" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-size.elf b/aarch64/bin/llvm-size.elf index de75ac0..2279b02 100755 --- a/aarch64/bin/llvm-size.elf +++ b/aarch64/bin/llvm-size.elf Binary files differ
diff --git a/aarch64/bin/llvm-split b/aarch64/bin/llvm-split index 5d0c7d7..022cd9a 100755 --- a/aarch64/bin/llvm-split +++ b/aarch64/bin/llvm-split
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-split" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-split" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-split.elf b/aarch64/bin/llvm-split.elf index c2f678c..a436c57 100755 --- a/aarch64/bin/llvm-split.elf +++ b/aarch64/bin/llvm-split.elf Binary files differ
diff --git a/aarch64/bin/llvm-stress b/aarch64/bin/llvm-stress index e2a0412..d41af7f 100755 --- a/aarch64/bin/llvm-stress +++ b/aarch64/bin/llvm-stress
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-stress" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-stress" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-stress.elf b/aarch64/bin/llvm-stress.elf index 309a771..45d5701 100755 --- a/aarch64/bin/llvm-stress.elf +++ b/aarch64/bin/llvm-stress.elf Binary files differ
diff --git a/aarch64/bin/llvm-strings b/aarch64/bin/llvm-strings index 37932bc..c40f59b 100755 --- a/aarch64/bin/llvm-strings +++ b/aarch64/bin/llvm-strings
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-strings" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-strings" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-strings.elf b/aarch64/bin/llvm-strings.elf index 96b1cdd..5543be4 100755 --- a/aarch64/bin/llvm-strings.elf +++ b/aarch64/bin/llvm-strings.elf Binary files differ
diff --git a/aarch64/bin/llvm-strip b/aarch64/bin/llvm-strip index 73f150f..e4c8d12 100755 --- a/aarch64/bin/llvm-strip +++ b/aarch64/bin/llvm-strip
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-strip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-strip" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-strip.elf b/aarch64/bin/llvm-strip.elf index 05133aa..788833b 100755 --- a/aarch64/bin/llvm-strip.elf +++ b/aarch64/bin/llvm-strip.elf Binary files differ
diff --git a/aarch64/bin/llvm-symbolizer b/aarch64/bin/llvm-symbolizer index 1c330db..06ee946 100755 --- a/aarch64/bin/llvm-symbolizer +++ b/aarch64/bin/llvm-symbolizer
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-symbolizer" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-symbolizer" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-symbolizer.elf b/aarch64/bin/llvm-symbolizer.elf index 5dd083e..6f2553b 100755 --- a/aarch64/bin/llvm-symbolizer.elf +++ b/aarch64/bin/llvm-symbolizer.elf Binary files differ
diff --git a/aarch64/bin/llvm-tapi-diff b/aarch64/bin/llvm-tapi-diff new file mode 100755 index 0000000..676b6ce --- /dev/null +++ b/aarch64/bin/llvm-tapi-diff
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/llvm-tapi-diff" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-tapi-diff.elf b/aarch64/bin/llvm-tapi-diff.elf new file mode 100755 index 0000000..feb77a1 --- /dev/null +++ b/aarch64/bin/llvm-tapi-diff.elf Binary files differ
diff --git a/aarch64/bin/llvm-tblgen b/aarch64/bin/llvm-tblgen index 3b3133f..0fa5712 100755 --- a/aarch64/bin/llvm-tblgen +++ b/aarch64/bin/llvm-tblgen
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-tblgen" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-tblgen" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-tblgen.elf b/aarch64/bin/llvm-tblgen.elf index d0a07d0..96d8cd5 100755 --- a/aarch64/bin/llvm-tblgen.elf +++ b/aarch64/bin/llvm-tblgen.elf Binary files differ
diff --git a/aarch64/bin/llvm-tli-checker b/aarch64/bin/llvm-tli-checker new file mode 100755 index 0000000..97f00a8 --- /dev/null +++ b/aarch64/bin/llvm-tli-checker
@@ -0,0 +1,14 @@ +#!/bin/sh +if base=$(readlink "$0" 2>/dev/null); then + case $base in + /*) base=$(readlink -f "$0" 2>/dev/null);; # if $0 is abspath symlink, make symlink fully resolved. + *) base=$(dirname "$0")/"${base}";; + esac +else + case $0 in + /*) base=$0;; + *) base=${PWD:-`pwd`}/$0;; + esac +fi +basedir=${base%/*} +LD_ARGV0_REL="../bin/llvm-tli-checker" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-tli-checker.elf b/aarch64/bin/llvm-tli-checker.elf new file mode 100755 index 0000000..7040a31 --- /dev/null +++ b/aarch64/bin/llvm-tli-checker.elf Binary files differ
diff --git a/aarch64/bin/llvm-undname b/aarch64/bin/llvm-undname index df6049b..aff7095 100755 --- a/aarch64/bin/llvm-undname +++ b/aarch64/bin/llvm-undname
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-undname" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-undname" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-undname.elf b/aarch64/bin/llvm-undname.elf index 7e729dc..05fd9fb 100755 --- a/aarch64/bin/llvm-undname.elf +++ b/aarch64/bin/llvm-undname.elf Binary files differ
diff --git a/aarch64/bin/llvm-windres b/aarch64/bin/llvm-windres new file mode 120000 index 0000000..8a596fa --- /dev/null +++ b/aarch64/bin/llvm-windres
@@ -0,0 +1 @@ +llvm-rc \ No newline at end of file
diff --git a/aarch64/bin/llvm-xray b/aarch64/bin/llvm-xray index 76ecf0e..b87a78c 100755 --- a/aarch64/bin/llvm-xray +++ b/aarch64/bin/llvm-xray
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/llvm-xray" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/llvm-xray" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/llvm-xray.elf b/aarch64/bin/llvm-xray.elf index 4402d47..0c99ac1 100755 --- a/aarch64/bin/llvm-xray.elf +++ b/aarch64/bin/llvm-xray.elf Binary files differ
diff --git a/aarch64/bin/modularize b/aarch64/bin/modularize index 2040310..bf80b18 100755 --- a/aarch64/bin/modularize +++ b/aarch64/bin/modularize
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/modularize" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/modularize" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/modularize.elf b/aarch64/bin/modularize.elf index 9706050..f9813a0 100755 --- a/aarch64/bin/modularize.elf +++ b/aarch64/bin/modularize.elf Binary files differ
diff --git a/aarch64/bin/not b/aarch64/bin/not index 52369b3..cc87d60 100755 --- a/aarch64/bin/not +++ b/aarch64/bin/not
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/not" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/not" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/not.elf b/aarch64/bin/not.elf index 201e4f4..c43a344 100755 --- a/aarch64/bin/not.elf +++ b/aarch64/bin/not.elf Binary files differ
diff --git a/aarch64/bin/obj2yaml b/aarch64/bin/obj2yaml index 35d71fb..3092247 100755 --- a/aarch64/bin/obj2yaml +++ b/aarch64/bin/obj2yaml
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/obj2yaml" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/obj2yaml" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/obj2yaml.elf b/aarch64/bin/obj2yaml.elf index 6d03d4a..cfd43f1 100755 --- a/aarch64/bin/obj2yaml.elf +++ b/aarch64/bin/obj2yaml.elf Binary files differ
diff --git a/aarch64/bin/opt b/aarch64/bin/opt index bf7d6f1..20c1c3d 100755 --- a/aarch64/bin/opt +++ b/aarch64/bin/opt
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/opt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/opt" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/opt.elf b/aarch64/bin/opt.elf index 547fc61..5ca6e71 100755 --- a/aarch64/bin/opt.elf +++ b/aarch64/bin/opt.elf Binary files differ
diff --git a/aarch64/bin/pp-trace b/aarch64/bin/pp-trace index 5d46f47..9daf0a0 100755 --- a/aarch64/bin/pp-trace +++ b/aarch64/bin/pp-trace
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/pp-trace" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/pp-trace" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/pp-trace.elf b/aarch64/bin/pp-trace.elf index f2098b5..ae4f2a8 100755 --- a/aarch64/bin/pp-trace.elf +++ b/aarch64/bin/pp-trace.elf Binary files differ
diff --git a/aarch64/bin/sancov b/aarch64/bin/sancov index 895c53a..e9ac715 100755 --- a/aarch64/bin/sancov +++ b/aarch64/bin/sancov
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/sancov" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/sancov" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/sancov.elf b/aarch64/bin/sancov.elf index 3ec771e..5a1dab4 100755 --- a/aarch64/bin/sancov.elf +++ b/aarch64/bin/sancov.elf Binary files differ
diff --git a/aarch64/bin/sanstats b/aarch64/bin/sanstats index 3ed5f19..bbce527 100755 --- a/aarch64/bin/sanstats +++ b/aarch64/bin/sanstats
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/sanstats" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/sanstats" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/sanstats.elf b/aarch64/bin/sanstats.elf index 4392b9f..24b307b 100755 --- a/aarch64/bin/sanstats.elf +++ b/aarch64/bin/sanstats.elf Binary files differ
diff --git a/aarch64/bin/scan-build b/aarch64/bin/scan-build index aed8c41..71e7ced 100755 --- a/aarch64/bin/scan-build +++ b/aarch64/bin/scan-build
@@ -14,7 +14,6 @@ use strict; use warnings; use FindBin qw($RealBin); -use Digest::MD5; use File::Basename; use File::Find; use File::Copy qw(copy); @@ -269,27 +268,6 @@ } ##----------------------------------------------------------------------------## -# ComputeDigest - Compute a digest of the specified file. -##----------------------------------------------------------------------------## - -sub ComputeDigest { - my $FName = shift; - DieDiag("Cannot read $FName to compute Digest.\n") if (! -r $FName); - - # Use Digest::MD5. We don't have to be cryptographically secure. We're - # just looking for duplicate files that come from a non-malicious source. - # We use Digest::MD5 because it is a standard Perl module that should - # come bundled on most systems. - open(FILE, $FName) or DieDiag("Cannot open $FName when computing Digest.\n"); - binmode FILE; - my $Result = Digest::MD5->new->addfile(*FILE)->hexdigest; - close(FILE); - - # Return the digest. - return $Result; -} - -##----------------------------------------------------------------------------## # UpdatePrefix - Compute the common prefix of files. ##----------------------------------------------------------------------------## @@ -374,8 +352,6 @@ # Sometimes a source file is scanned more than once, and thus produces # multiple error reports. We use a cache to solve this problem. -my %AlreadyScanned; - sub ScanFile { my $Index = shift; @@ -383,19 +359,6 @@ my $FName = shift; my $Stats = shift; - # Compute a digest for the report file. Determine if we have already - # scanned a file that looks just like it. - - my $digest = ComputeDigest("$Dir/$FName"); - - if (defined $AlreadyScanned{$digest}) { - # Redundant file. Remove it. - unlink("$Dir/$FName"); - return; - } - - $AlreadyScanned{$digest} = 1; - # At this point the report file is not world readable. Make it happen. chmod(0644, "$Dir/$FName"); @@ -1925,7 +1888,7 @@ $ClangCXX =~ s/.exe$/++.exe/; } else { - $ClangCXX =~ s/\-\d+\.\d+$//; + $ClangCXX =~ s/\-\d+(\.\d+)?$//; $ClangCXX .= "++"; } }
diff --git a/aarch64/bin/scan-build-py b/aarch64/bin/scan-build-py new file mode 100755 index 0000000..a341751 --- /dev/null +++ b/aarch64/bin/scan-build-py
@@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +import multiprocessing +import sys +import os.path +this_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(os.path.dirname(this_dir), 'lib')) + +from libscanbuild.analyze import scan_build + +if __name__ == '__main__': + multiprocessing.freeze_support() + sys.exit(scan_build())
diff --git a/aarch64/bin/split-file b/aarch64/bin/split-file index 34ed71d..51fe9f0 100755 --- a/aarch64/bin/split-file +++ b/aarch64/bin/split-file
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/split-file" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/split-file" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/split-file.elf b/aarch64/bin/split-file.elf index e468a71..23ef930 100755 --- a/aarch64/bin/split-file.elf +++ b/aarch64/bin/split-file.elf Binary files differ
diff --git a/aarch64/bin/verify-uselistorder b/aarch64/bin/verify-uselistorder index a587a2e..d3b19a8 100755 --- a/aarch64/bin/verify-uselistorder +++ b/aarch64/bin/verify-uselistorder
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/verify-uselistorder" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/verify-uselistorder" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/verify-uselistorder.elf b/aarch64/bin/verify-uselistorder.elf index a4188a7..8fc2a48 100755 --- a/aarch64/bin/verify-uselistorder.elf +++ b/aarch64/bin/verify-uselistorder.elf Binary files differ
diff --git a/aarch64/bin/x86_64-pc-linux-gnu-llvm-config b/aarch64/bin/x86_64-pc-linux-gnu-llvm-config index dc99abf..f0fee6d 100755 --- a/aarch64/bin/x86_64-pc-linux-gnu-llvm-config +++ b/aarch64/bin/x86_64-pc-linux-gnu-llvm-config
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/x86_64-pc-linux-gnu-llvm-config" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/x86_64-pc-linux-gnu-llvm-config" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/x86_64-pc-linux-gnu-llvm-config.elf b/aarch64/bin/x86_64-pc-linux-gnu-llvm-config.elf index ff62958..cb89854 100755 --- a/aarch64/bin/x86_64-pc-linux-gnu-llvm-config.elf +++ b/aarch64/bin/x86_64-pc-linux-gnu-llvm-config.elf Binary files differ
diff --git a/aarch64/bin/yaml-bench b/aarch64/bin/yaml-bench index 5cd2643..2770bc7 100755 --- a/aarch64/bin/yaml-bench +++ b/aarch64/bin/yaml-bench
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/yaml-bench" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/yaml-bench" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/yaml-bench.elf b/aarch64/bin/yaml-bench.elf index 8cfb860..a86dde0 100755 --- a/aarch64/bin/yaml-bench.elf +++ b/aarch64/bin/yaml-bench.elf Binary files differ
diff --git a/aarch64/bin/yaml2obj b/aarch64/bin/yaml2obj index e60e0c0..3cca463 100755 --- a/aarch64/bin/yaml2obj +++ b/aarch64/bin/yaml2obj
@@ -11,6 +11,4 @@ esac fi basedir=${base%/*} -# TODO(crbug/1003841): Remove LD_ARGV0 once -# ld.so supports forwarding the binary name. -LD_ARGV0="$0" LD_ARGV0_REL="../bin/yaml2obj" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@" +LD_ARGV0_REL="../bin/yaml2obj" exec "${basedir}/../lib/ld-linux-x86-64.so.2" --argv0 "$0" --library-path "${basedir}/../usr/lib64:${basedir}/../lib" --inhibit-rpath '' "${base}.elf" "$@"
diff --git a/aarch64/bin/yaml2obj.elf b/aarch64/bin/yaml2obj.elf index 265eaa8..3a37a57 100755 --- a/aarch64/bin/yaml2obj.elf +++ b/aarch64/bin/yaml2obj.elf Binary files differ
diff --git a/aarch64/lib/ld-linux-x86-64.so.2 b/aarch64/lib/ld-linux-x86-64.so.2 index 1936b1b..a7e7ab8 100755 --- a/aarch64/lib/ld-linux-x86-64.so.2 +++ b/aarch64/lib/ld-linux-x86-64.so.2 Binary files differ
diff --git a/aarch64/lib/libasm.so.1 b/aarch64/lib/libasm.so.1 index 91a20ec..078df71 100755 --- a/aarch64/lib/libasm.so.1 +++ b/aarch64/lib/libasm.so.1 Binary files differ
diff --git a/aarch64/lib/libbfd-2.27.0.20170315.so b/aarch64/lib/libbfd-2.27.0.20170315.so deleted file mode 100755 index 0be059d..0000000 --- a/aarch64/lib/libbfd-2.27.0.20170315.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libbfd-2.36.1.so b/aarch64/lib/libbfd-2.36.1.so new file mode 100755 index 0000000..eb75688 --- /dev/null +++ b/aarch64/lib/libbfd-2.36.1.so Binary files differ
diff --git a/aarch64/lib/libbz2.so.1 b/aarch64/lib/libbz2.so.1 index 9bf7682..626f891 100755 --- a/aarch64/lib/libbz2.so.1 +++ b/aarch64/lib/libbz2.so.1 Binary files differ
diff --git a/aarch64/lib/libc++.so.1 b/aarch64/lib/libc++.so.1 index fc10349..f37c614 100755 --- a/aarch64/lib/libc++.so.1 +++ b/aarch64/lib/libc++.so.1 Binary files differ
diff --git a/aarch64/lib/libc++abi.so.1 b/aarch64/lib/libc++abi.so.1 index cb8e7e9..befe6cc 100755 --- a/aarch64/lib/libc++abi.so.1 +++ b/aarch64/lib/libc++abi.so.1 Binary files differ
diff --git a/aarch64/lib/libc.so.6 b/aarch64/lib/libc.so.6 index f1f8fbd..3185b63 100755 --- a/aarch64/lib/libc.so.6 +++ b/aarch64/lib/libc.so.6 Binary files differ
diff --git a/aarch64/lib/libclang.so.12git b/aarch64/lib/libclang.so.12git deleted file mode 100755 index 9859a76..0000000 --- a/aarch64/lib/libclang.so.12git +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libclang.so.13 b/aarch64/lib/libclang.so.13 new file mode 100755 index 0000000..4608f0d --- /dev/null +++ b/aarch64/lib/libclang.so.13 Binary files differ
diff --git a/aarch64/lib/libcrypto.so.1.1 b/aarch64/lib/libcrypto.so.1.1 index b329cc6..76b2a95 100755 --- a/aarch64/lib/libcrypto.so.1.1 +++ b/aarch64/lib/libcrypto.so.1.1 Binary files differ
diff --git a/aarch64/lib/libctf-nobfd.so.0 b/aarch64/lib/libctf-nobfd.so.0 new file mode 100755 index 0000000..2df7543 --- /dev/null +++ b/aarch64/lib/libctf-nobfd.so.0 Binary files differ
diff --git a/aarch64/lib/libctf.so.0 b/aarch64/lib/libctf.so.0 new file mode 100755 index 0000000..c140710 --- /dev/null +++ b/aarch64/lib/libctf.so.0 Binary files differ
diff --git a/aarch64/lib/libcurl.so.4 b/aarch64/lib/libcurl.so.4 index 92e6550..d25ec1e 100755 --- a/aarch64/lib/libcurl.so.4 +++ b/aarch64/lib/libcurl.so.4 Binary files differ
diff --git a/aarch64/lib/libdl.so.2 b/aarch64/lib/libdl.so.2 index 07fff0e..762428b 100755 --- a/aarch64/lib/libdl.so.2 +++ b/aarch64/lib/libdl.so.2 Binary files differ
diff --git a/aarch64/lib/libdw.so.1 b/aarch64/lib/libdw.so.1 index 221c9a8..d2b3321 100755 --- a/aarch64/lib/libdw.so.1 +++ b/aarch64/lib/libdw.so.1 Binary files differ
diff --git a/aarch64/lib/libelf.so.1 b/aarch64/lib/libelf.so.1 index 2491434..d6c0c0a 100755 --- a/aarch64/lib/libelf.so.1 +++ b/aarch64/lib/libelf.so.1 Binary files differ
diff --git a/aarch64/lib/libexpat.so.1 b/aarch64/lib/libexpat.so.1 index 70ae4b9..64f3724 100755 --- a/aarch64/lib/libexpat.so.1 +++ b/aarch64/lib/libexpat.so.1 Binary files differ
diff --git a/aarch64/lib/libffi.so.6 b/aarch64/lib/libffi.so.6 index 1527521..0af0184 100755 --- a/aarch64/lib/libffi.so.6 +++ b/aarch64/lib/libffi.so.6 Binary files differ
diff --git a/aarch64/lib/libgcc_s.so.1 b/aarch64/lib/libgcc_s.so.1 old mode 100644 new mode 100755 index 2afa482..f1e3e44 --- a/aarch64/lib/libgcc_s.so.1 +++ b/aarch64/lib/libgcc_s.so.1 Binary files differ
diff --git a/aarch64/lib/libgmp.so.10 b/aarch64/lib/libgmp.so.10 index eb96bbc..e16d06a 100755 --- a/aarch64/lib/libgmp.so.10 +++ b/aarch64/lib/libgmp.so.10 Binary files differ
diff --git a/aarch64/lib/liblldb.so.14git b/aarch64/lib/liblldb.so.14git new file mode 100755 index 0000000..442d366 --- /dev/null +++ b/aarch64/lib/liblldb.so.14git Binary files differ
diff --git a/aarch64/lib/liblzma.so.5 b/aarch64/lib/liblzma.so.5 new file mode 100755 index 0000000..85e81b9 --- /dev/null +++ b/aarch64/lib/liblzma.so.5 Binary files differ
diff --git a/aarch64/lib/libm.so.6 b/aarch64/lib/libm.so.6 index 4de47db..d78d6e5 100755 --- a/aarch64/lib/libm.so.6 +++ b/aarch64/lib/libm.so.6 Binary files differ
diff --git a/aarch64/lib/libmpc.so.3 b/aarch64/lib/libmpc.so.3 index 58667ec..726cfcd 100755 --- a/aarch64/lib/libmpc.so.3 +++ b/aarch64/lib/libmpc.so.3 Binary files differ
diff --git a/aarch64/lib/libmpfr.so.4 b/aarch64/lib/libmpfr.so.4 index 1c90931..5b852c6 100755 --- a/aarch64/lib/libmpfr.so.4 +++ b/aarch64/lib/libmpfr.so.4 Binary files differ
diff --git a/aarch64/lib/libncurses.so.5 b/aarch64/lib/libncurses.so.5 new file mode 100755 index 0000000..220ccd9 --- /dev/null +++ b/aarch64/lib/libncurses.so.5 Binary files differ
diff --git a/aarch64/lib/libncursesw.so.5 b/aarch64/lib/libncursesw.so.5 index 251b493..3971e55 100755 --- a/aarch64/lib/libncursesw.so.5 +++ b/aarch64/lib/libncursesw.so.5 Binary files differ
diff --git a/aarch64/lib/libnghttp2.so.14 b/aarch64/lib/libnghttp2.so.14 index d6b21da..676d39e 100755 --- a/aarch64/lib/libnghttp2.so.14 +++ b/aarch64/lib/libnghttp2.so.14 Binary files differ
diff --git a/aarch64/lib/libopcodes-2.27.0.20170315.so b/aarch64/lib/libopcodes-2.27.0.20170315.so deleted file mode 100755 index 0b80a1e..0000000 --- a/aarch64/lib/libopcodes-2.27.0.20170315.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libopcodes-2.36.1.so b/aarch64/lib/libopcodes-2.36.1.so new file mode 100755 index 0000000..33181ee --- /dev/null +++ b/aarch64/lib/libopcodes-2.36.1.so Binary files differ
diff --git a/aarch64/lib/libpanel.so.5 b/aarch64/lib/libpanel.so.5 new file mode 100755 index 0000000..0b332a8 --- /dev/null +++ b/aarch64/lib/libpanel.so.5 Binary files differ
diff --git a/aarch64/lib/libpthread.so.0 b/aarch64/lib/libpthread.so.0 index 7b0e314..c05b67a 100755 --- a/aarch64/lib/libpthread.so.0 +++ b/aarch64/lib/libpthread.so.0 Binary files differ
diff --git a/aarch64/lib/libpython3.6m.so.1.0 b/aarch64/lib/libpython3.6m.so.1.0 index 82e4c60..1279471 100755 --- a/aarch64/lib/libpython3.6m.so.1.0 +++ b/aarch64/lib/libpython3.6m.so.1.0 Binary files differ
diff --git a/aarch64/lib/libreadline.so.8 b/aarch64/lib/libreadline.so.8 index cd406df..d5d96b5 100755 --- a/aarch64/lib/libreadline.so.8 +++ b/aarch64/lib/libreadline.so.8 Binary files differ
diff --git a/aarch64/lib/librt.so.1 b/aarch64/lib/librt.so.1 deleted file mode 100755 index ef40c0e..0000000 --- a/aarch64/lib/librt.so.1 +++ /dev/null Binary files differ
diff --git a/aarch64/lib/librustc_driver-c9271175117188a9.so b/aarch64/lib/librustc_driver-c9271175117188a9.so new file mode 100755 index 0000000..543f8f9 --- /dev/null +++ b/aarch64/lib/librustc_driver-c9271175117188a9.so Binary files differ
diff --git a/aarch64/lib/librustc_driver-e3920dca5d5acac3.so b/aarch64/lib/librustc_driver-e3920dca5d5acac3.so deleted file mode 100755 index 3ea79b2..0000000 --- a/aarch64/lib/librustc_driver-e3920dca5d5acac3.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libssl.so.1.1 b/aarch64/lib/libssl.so.1.1 index e491735..f00bf4f 100755 --- a/aarch64/lib/libssl.so.1.1 +++ b/aarch64/lib/libssl.so.1.1 Binary files differ
diff --git a/aarch64/lib/libstd-1962cc37bfbc6a4b.so b/aarch64/lib/libstd-1962cc37bfbc6a4b.so deleted file mode 100644 index 7883349..0000000 --- a/aarch64/lib/libstd-1962cc37bfbc6a4b.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libstd-2ed0c51f104da396.so b/aarch64/lib/libstd-2ed0c51f104da396.so deleted file mode 100644 index edad76e..0000000 --- a/aarch64/lib/libstd-2ed0c51f104da396.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libstd-7e6c3b81e76f89be.so b/aarch64/lib/libstd-7e6c3b81e76f89be.so new file mode 100644 index 0000000..9c03c20 --- /dev/null +++ b/aarch64/lib/libstd-7e6c3b81e76f89be.so Binary files differ
diff --git a/aarch64/lib/libstd-a3edd9f4530e2dd9.so b/aarch64/lib/libstd-a3edd9f4530e2dd9.so new file mode 100644 index 0000000..fd6b0c4 --- /dev/null +++ b/aarch64/lib/libstd-a3edd9f4530e2dd9.so Binary files differ
diff --git a/aarch64/lib/libstd-c67bcafeb381150c.so b/aarch64/lib/libstd-c67bcafeb381150c.so deleted file mode 100644 index ee6d9b3..0000000 --- a/aarch64/lib/libstd-c67bcafeb381150c.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libstd-ed739b04b73866c1.so b/aarch64/lib/libstd-ed739b04b73866c1.so new file mode 100644 index 0000000..b0dda68 --- /dev/null +++ b/aarch64/lib/libstd-ed739b04b73866c1.so Binary files differ
diff --git a/aarch64/lib/libstdc++.so.6 b/aarch64/lib/libstdc++.so.6 index 20b1a4d..fa19fd3 100755 --- a/aarch64/lib/libstdc++.so.6 +++ b/aarch64/lib/libstdc++.so.6 Binary files differ
diff --git a/aarch64/lib/libtest-323fd96e86abe6d2.so b/aarch64/lib/libtest-323fd96e86abe6d2.so deleted file mode 100755 index 0881d66..0000000 --- a/aarch64/lib/libtest-323fd96e86abe6d2.so +++ /dev/null Binary files differ
diff --git a/aarch64/lib/libtest-4a32b55909f72754.so b/aarch64/lib/libtest-4a32b55909f72754.so new file mode 100755 index 0000000..fd07e57 --- /dev/null +++ b/aarch64/lib/libtest-4a32b55909f72754.so Binary files differ
diff --git a/aarch64/lib/libtinfo.so.5 b/aarch64/lib/libtinfo.so.5 index d79781b..369ec97 100755 --- a/aarch64/lib/libtinfo.so.5 +++ b/aarch64/lib/libtinfo.so.5 Binary files differ
diff --git a/aarch64/lib/libtinfow.so.5 b/aarch64/lib/libtinfow.so.5 index 7a2e19f..36ce8e0 100755 --- a/aarch64/lib/libtinfow.so.5 +++ b/aarch64/lib/libtinfow.so.5 Binary files differ
diff --git a/aarch64/lib/libutil.so.1 b/aarch64/lib/libutil.so.1 index e8d666c..4c4d9b4 100755 --- a/aarch64/lib/libutil.so.1 +++ b/aarch64/lib/libutil.so.1 Binary files differ
diff --git a/aarch64/lib/libxml2.so.2 b/aarch64/lib/libxml2.so.2 index 23eb8f3..2b48af5 100755 --- a/aarch64/lib/libxml2.so.2 +++ b/aarch64/lib/libxml2.so.2 Binary files differ
diff --git a/aarch64/lib/libz.so.1 b/aarch64/lib/libz.so.1 index 03f57e5..71e0849 100755 --- a/aarch64/lib/libz.so.1 +++ b/aarch64/lib/libz.so.1 Binary files differ
diff --git a/aarch64/lib/libzstd.so.1 b/aarch64/lib/libzstd.so.1 new file mode 100755 index 0000000..e54e4dc --- /dev/null +++ b/aarch64/lib/libzstd.so.1 Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib/libgcc_s.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib/libgcc_s.so.1 index 2afa482..854a5fb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib/libgcc_s.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib/libgcc_s.so.1 Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.27.so deleted file mode 100755 index 165a1f1..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.33.so new file mode 100755 index 0000000..398c3cb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-linux-aarch64.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-linux-aarch64.so.1 index 2ffc93b..32ac5fb 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-linux-aarch64.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/ld-linux-aarch64.so.1
@@ -1 +1 @@ -ld-2.27.so \ No newline at end of file +ld-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.27.so deleted file mode 100755 index 4e4b2ec..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.33.so new file mode 100755 index 0000000..9c1fd8a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale.so.1 index d0efb54..70f4e3b 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libBrokenLocale.so.1
@@ -1 +1 @@ -libBrokenLocale-2.27.so \ No newline at end of file +libBrokenLocale-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libSegFault.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libSegFault.so index 37248dd..db6a2f7 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libSegFault.so +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libSegFault.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.27.so deleted file mode 100755 index 4ce4803..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.33.so new file mode 100755 index 0000000..b030e3c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl.so.1 index ea60727..22a63c5 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libanl.so.1
@@ -1 +1 @@ -libanl-2.27.so \ No newline at end of file +libanl-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.27.so deleted file mode 100755 index 80c0d4f..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.33.so new file mode 100755 index 0000000..4def19b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc.so.6 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc.so.6 index aa8ad7a..3b28802 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc.so.6 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libc.so.6
@@ -1 +1 @@ -libc-2.27.so \ No newline at end of file +libc-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn-2.27.so deleted file mode 100755 index 4a1c196..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn.so.1 deleted file mode 120000 index ae5e122..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcidn.so.1 +++ /dev/null
@@ -1 +0,0 @@ -libcidn-2.27.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.27.so deleted file mode 100755 index 4b6804f..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.33.so new file mode 100755 index 0000000..e17ba57 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt.so.1 index e527bb4..181ca8d 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libcrypt.so.1
@@ -1 +1 @@ -libcrypt-2.27.so \ No newline at end of file +libcrypt-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.27.so deleted file mode 100755 index 5c41cfe..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.33.so new file mode 100755 index 0000000..100e84b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl.so.2 index f607f6a..663ede7 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libdl.so.2
@@ -1 +1 @@ -libdl-2.27.so \ No newline at end of file +libdl-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.27.so deleted file mode 100755 index b59c467..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.33.so new file mode 100755 index 0000000..23999f4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm.so.6 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm.so.6 index 8ca96af..dd1ae3e 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm.so.6 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libm.so.6
@@ -1 +1 @@ -libm-2.27.so \ No newline at end of file +libm-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libmemusage.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libmemusage.so index 526f09a..de6393e 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libmemusage.so +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libmemusage.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.27.so deleted file mode 100755 index 41e0ee6..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.33.so new file mode 100755 index 0000000..7750640 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl.so.1 index 0fc9683..8ce2801 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnsl.so.1
@@ -1 +1 @@ -libnsl-2.27.so \ No newline at end of file +libnsl-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.27.so deleted file mode 100755 index c3a9eff..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.33.so new file mode 100755 index 0000000..c516b4b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat.so.2 index 5b1cfc2..0ee4d94 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_compat.so.2
@@ -1 +1 @@ -libnss_compat-2.27.so \ No newline at end of file +libnss_compat-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.27.so deleted file mode 100755 index 76cc8b6..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.33.so new file mode 100755 index 0000000..55554e4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db.so.2 index c108269..cc3dfae 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_db.so.2
@@ -1 +1 @@ -libnss_db-2.27.so \ No newline at end of file +libnss_db-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.27.so deleted file mode 100755 index 7b7d42e..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.33.so new file mode 100755 index 0000000..16776e0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns.so.2 index 812f3be..d3a756c 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_dns.so.2
@@ -1 +1 @@ -libnss_dns-2.27.so \ No newline at end of file +libnss_dns-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.27.so deleted file mode 100755 index 62cfb46..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.33.so new file mode 100755 index 0000000..970be11 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files.so.2 index ba3fbd8..968bb00 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_files.so.2
@@ -1 +1 @@ -libnss_files-2.27.so \ No newline at end of file +libnss_files-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.27.so deleted file mode 100755 index 374347c..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.33.so new file mode 100755 index 0000000..493cc86 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod.so.2 index bb380d6..888b31b 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libnss_hesiod.so.2
@@ -1 +1 @@ -libnss_hesiod-2.27.so \ No newline at end of file +libnss_hesiod-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpcprofile.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpcprofile.so index 1b96eaf..fd6bfaf 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpcprofile.so +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpcprofile.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.27.so deleted file mode 100755 index 37fdf3c..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.33.so new file mode 100755 index 0000000..ff870d8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread.so.0 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread.so.0 index 3c60c17..ff0d3c6 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread.so.0 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libpthread.so.0
@@ -1 +1 @@ -libpthread-2.27.so \ No newline at end of file +libpthread-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.27.so deleted file mode 100755 index c5544d4..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.33.so new file mode 100755 index 0000000..ffeaa6d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv.so.2 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv.so.2 index d1f7cfc..3b652a5 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv.so.2 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libresolv.so.2
@@ -1 +1 @@ -libresolv-2.27.so \ No newline at end of file +libresolv-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.27.so deleted file mode 100755 index 6083ee6..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.33.so new file mode 100755 index 0000000..372ed98 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt.so.1 index 1a707c1..2033113 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/librt.so.1
@@ -1 +1 @@ -librt-2.27.so \ No newline at end of file +librt-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libthread_db-1.0.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libthread_db-1.0.so index d6aa4c9..278649f 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libthread_db-1.0.so +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libthread_db-1.0.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.27.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.27.so deleted file mode 100755 index 2916629..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.27.so +++ /dev/null Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.33.so b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.33.so new file mode 100755 index 0000000..0380bc2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil-2.33.so Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil.so.1 b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil.so.1 index 554fe8f..032fa09 120000 --- a/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil.so.1 +++ b/aarch64/usr/aarch64-cros-linux-gnu/lib64/libutil.so.1
@@ -1 +1 @@ -libutil-2.27.so \ No newline at end of file +libutil-2.33.so \ No newline at end of file
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/sbin/ldconfig b/aarch64/usr/aarch64-cros-linux-gnu/sbin/ldconfig index 7d502ee..d605ac6 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/sbin/ldconfig +++ b/aarch64/usr/aarch64-cros-linux-gnu/sbin/ldconfig Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/gdbserver b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/gdbserver index bf0ea7b..70ae35b 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/gdbserver +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/gdbserver Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/getent b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/getent index 7093f19..4fc913f 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/getent +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/getent Binary files differ
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/ldd b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/ldd index 65d5798..e1fed7c 100755 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/ldd +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/bin/ldd
@@ -1,5 +1,5 @@ #! /bin/bash -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Lesser General Public # License along with the GNU C Library; if not, see -# <http://www.gnu.org/licenses/>. +# <https://www.gnu.org/licenses/>. # This is the `ldd' command, which lists what shared libraries are @@ -34,11 +34,11 @@ while test $# -gt 0; do case "$1" in --vers | --versi | --versio | --version) - echo 'ldd (Gentoo 2.27-r20 p3) 2.27' + echo 'ldd (Gentoo 2.33-r16 p9) 2.33' printf $"Copyright (C) %s 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. -" "2018" +" "2021" printf $"Written by %s and %s. " "Roland McGrath" "Ulrich Drepper" exit 0 @@ -167,7 +167,7 @@ 1) # This can be a non-ELF binary or no binary at all. nonelf "$file" || { - echo $" not a dynamic executable" + echo $" not a dynamic executable" >&2 result=1 } ;;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/_G_config.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/_G_config.h deleted file mode 100644 index 68de2fc..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/_G_config.h +++ /dev/null
@@ -1,25 +0,0 @@ -/* Copyright (C) 2017-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _G_CONFIG_H -#define _G_CONFIG_H 1 - -#warning "<_G_config.h> is deprecated; use <stdio.h> instead." - -#include <bits/_G_config.h> - -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/__libunwind_config.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/__libunwind_config.h index 71d77ca..221980a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/__libunwind_config.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/__libunwind_config.h
@@ -1,4 +1,4 @@ -//===------------------------- __libunwind_config.h -----------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -25,8 +25,12 @@ #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64 +#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143 #if defined(_LIBUNWIND_IS_NATIVE_ONLY) +# if defined(__linux__) +# define _LIBUNWIND_TARGET_LINUX 1 +# endif # if defined(__i386__) # define _LIBUNWIND_TARGET_I386 # define _LIBUNWIND_CONTEXT_SIZE 8 @@ -127,14 +131,26 @@ #define _LIBUNWIND_CONTEXT_SIZE 16 #define _LIBUNWIND_CURSOR_SIZE 23 # elif defined(__riscv) -# if __riscv_xlen == 64 -# define _LIBUNWIND_TARGET_RISCV 1 -# define _LIBUNWIND_CONTEXT_SIZE 64 -# define _LIBUNWIND_CURSOR_SIZE 76 +# define _LIBUNWIND_TARGET_RISCV 1 +# if defined(__riscv_flen) +# define RISCV_FLEN __riscv_flen # else -# error "Unsupported RISC-V ABI" +# define RISCV_FLEN 0 +# endif +# define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64) +# if __riscv_xlen == 32 +# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7) +# elif __riscv_xlen == 64 +# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12) +# else +# error "Unsupported RISC-V ABI" # endif # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV +# elif defined(__ve__) +# define _LIBUNWIND_TARGET_VE 1 +# define _LIBUNWIND_CONTEXT_SIZE 67 +# define _LIBUNWIND_CURSOR_SIZE 79 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE # else # error "Unsupported architecture." # endif @@ -151,6 +167,7 @@ # define _LIBUNWIND_TARGET_SPARC 1 # define _LIBUNWIND_TARGET_HEXAGON 1 # define _LIBUNWIND_TARGET_RISCV 1 +# define _LIBUNWIND_TARGET_VE 1 # define _LIBUNWIND_CONTEXT_SIZE 167 # define _LIBUNWIND_CURSOR_SIZE 179 # define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/a.out.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/a.out.h index e3f4bdd..79df485 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/a.out.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/a.out.h
@@ -64,8 +64,8 @@ && N_MAGIC(x) != ZMAGIC && N_MAGIC(x) != QMAGIC) #define _N_HDROFF(x) (1024 - sizeof (struct exec)) #define N_TXTOFF(x) \ - (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \ - (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) + (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) \ + : (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec))) #define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) #define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) #define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aio.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aio.h index c3a1f4b..3a107b2 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aio.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aio.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * ISO/IEC 9945-1:1996 6.7: Asynchronous Input and Output @@ -33,7 +33,7 @@ /* Asynchronous I/O control block. */ struct aiocb { - int aio_fildes; /* File desriptor. */ + int aio_fildes; /* File descriptor. */ int aio_lio_opcode; /* Operation to be performed. */ int aio_reqprio; /* Request priority offset. */ volatile void *aio_buf; /* Location of buffer. */ @@ -61,7 +61,7 @@ #ifdef __USE_LARGEFILE64 struct aiocb64 { - int aio_fildes; /* File desriptor. */ + int aio_fildes; /* File descriptor. */ int aio_lio_opcode; /* Operation to be performed. */ int aio_reqprio; /* Request priority offset. */ volatile void *aio_buf; /* Location of buffer. */ @@ -82,12 +82,11 @@ #ifdef __USE_GNU -/* To customize the implementation one can use the following struct. - This implementation follows the one in Irix. */ +/* To optimize the implementation one can use the following struct. */ struct aioinit { - int aio_threads; /* Maximal number of threads. */ - int aio_num; /* Number of expected simultanious requests. */ + int aio_threads; /* Maximum number of threads. */ + int aio_num; /* Number of expected simultaneous requests. */ int aio_locks; /* Not used. */ int aio_usedba; /* Not used. */ int aio_debug; /* Not used. */ @@ -99,7 +98,7 @@ #endif -/* Return values of cancelation function. */ +/* Return values of the aio_cancel function. */ enum { AIO_CANCELED,
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aliases.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aliases.h index ec44284..07514c4 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aliases.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/aliases.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ALIASES_H #define _ALIASES_H 1 @@ -25,7 +25,7 @@ __BEGIN_DECLS -/* Structure to represent one entry of the alias data base. */ +/* Structure to represent one entry of the alias database. */ struct aliasent { char *alias_name; @@ -38,13 +38,13 @@ /* Open alias data base files. */ extern void setaliasent (void) __THROW; -/* Close alias data base files. */ +/* Close alias database files. */ extern void endaliasent (void) __THROW; -/* Get the next entry from the alias data base. */ +/* Get the next entry from the alias database. */ extern struct aliasent *getaliasent (void) __THROW; -/* Get the next entry from the alias data base and put it in RESULT_BUF. */ +/* Get the next entry from the alias database and put it in RESULT_BUF. */ extern int getaliasent_r (struct aliasent *__restrict __result_buf, char *__restrict __buffer, size_t __buflen, struct aliasent **__restrict __result) __THROW;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/alloca.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/alloca.h index c195adc..cd2a9e0 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/alloca.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/alloca.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ALLOCA_H #define _ALLOCA_H 1 @@ -25,7 +25,7 @@ __BEGIN_DECLS -/* Remove any previous definitions. */ +/* Remove any previous definition. */ #undef alloca /* Allocate a block that will be freed when the calling function exits. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/ar.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/ar.h index 25a9a63..ce51926 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/ar.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/ar.h
@@ -1,5 +1,5 @@ /* Header describing `ar' archive file format. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _AR_H #define _AR_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argp.h index 0f25833..5dd3828 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argp.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argp.h
@@ -1,5 +1,5 @@ -/* Hierarchial argument parsing, layered over getopt. - Copyright (C) 1995-2018 Free Software Foundation, Inc. +/* Hierarchical argument parsing, layered over getopt. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader <miles@gnu.ai.mit.edu>. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ARGP_H #define _ARGP_H @@ -233,7 +233,7 @@ }; /* Possible KEY arguments to a help filter function. */ -#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */ +#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceding options. */ #define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */ #define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */ #define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation; @@ -447,7 +447,7 @@ parsing routine (thus taking an argp_state structure as the first argument). They may or may not print an error message and exit, depending on the flags in STATE -- in any case, the caller should be prepared for - them *not* to exit, and should return an appropiate error after calling + them *not* to exit, and should return an appropriate error after calling them. [argp_usage & argp_error should probably be called argp_state_..., but they're used often enough that they should be short] */ @@ -554,6 +554,11 @@ # endif #endif /* Use extern inlines. */ +#include <bits/floatn.h> +#if defined __LDBL_COMPAT || __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# include <bits/argp-ldbl.h> +#endif + __END_DECLS #endif /* argp.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argz.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argz.h index 9c496f5..c2f78f5 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argz.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/argz.h
@@ -1,5 +1,5 @@ /* Routines for dealing with '\0' separated arg vectors. - Copyright (C) 1995-2018 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ARGZ_H #define _ARGZ_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/arpa/inet.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/arpa/inet.h index 731f1c5..3a99dbf 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/arpa/inet.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/arpa/inet.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ARPA_INET_H #define _ARPA_INET_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/asm-generic/unistd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/asm-generic/unistd.h index a8cb3bb..e1c762e 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/asm-generic/unistd.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/asm-generic/unistd.h
@@ -732,13 +732,60 @@ __SYSCALL(__NR_pkey_free, sys_pkey_free) #define __NR_statx 291 __SYSCALL(__NR_statx, sys_statx) +/* 292 through 402 are unassigned to sync up with generic numbers, don't use */ +#if __BITS_PER_LONG == 32 +#define __NR_clock_gettime64 403 +__SYSCALL(__NR_clock_gettime64, sys_clock_gettime) +#define __NR_clock_settime64 404 +__SYSCALL(__NR_clock_settime64, sys_clock_settime) +#define __NR_clock_adjtime64 405 +__SYSCALL(__NR_clock_adjtime64, sys_clock_adjtime) +#define __NR_clock_getres_time64 406 +__SYSCALL(__NR_clock_getres_time64, sys_clock_getres) +#define __NR_clock_nanosleep_time64 407 +__SYSCALL(__NR_clock_nanosleep_time64, sys_clock_nanosleep) +#define __NR_timer_gettime64 408 +__SYSCALL(__NR_timer_gettime64, sys_timer_gettime) +#define __NR_timer_settime64 409 +__SYSCALL(__NR_timer_settime64, sys_timer_settime) +#define __NR_timerfd_gettime64 410 +__SYSCALL(__NR_timerfd_gettime64, sys_timerfd_gettime) +#define __NR_timerfd_settime64 411 +__SYSCALL(__NR_timerfd_settime64, sys_timerfd_settime) +#define __NR_utimensat_time64 412 +__SYSCALL(__NR_utimensat_time64, sys_utimensat) +#define __NR_pselect6_time64 413 +__SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) +#define __NR_ppoll_time64 414 +__SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64) +#define __NR_io_pgetevents_time64 416 +__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents) +#define __NR_recvmmsg_time64 417 +__SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64) +#define __NR_mq_timedsend_time64 418 +__SYSCALL(__NR_mq_timedsend_time64, sys_mq_timedsend) +#define __NR_mq_timedreceive_time64 419 +__SYSCALL(__NR_mq_timedreceive_time64, sys_mq_timedreceive) +#define __NR_semtimedop_time64 420 +__SYSCALL(__NR_semtimedop_time64, sys_semtimedop) +#define __NR_rt_sigtimedwait_time64 421 +__SC_COMP(__NR_rt_sigtimedwait_time64, sys_rt_sigtimedwait, compat_sys_rt_sigtimedwait_time64) +#define __NR_futex_time64 422 +__SYSCALL(__NR_futex_time64, sys_futex) +#define __NR_sched_rr_get_interval_time64 423 +__SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval) +#endif +/* 424 is unused */ #define __NR_io_uring_setup 425 __SYSCALL(__NR_io_uring_setup, sys_io_uring_setup) #define __NR_io_uring_enter 426 __SYSCALL(__NR_io_uring_enter, sys_io_uring_enter) +#define __NR_faccessat2 439 +__SYSCALL(__NR_faccessat2, sys_faccessat2) + #undef __NR_syscalls -#define __NR_syscalls 427 +#define __NR_syscalls 440 /* * All syscalls below here should go away really,
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/assert.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/assert.h index 5468c16..2894908 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/assert.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/assert.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.2 Diagnostics <assert.h>
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/_G_config.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/_G_config.h deleted file mode 100644 index 9994869..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/_G_config.h +++ /dev/null
@@ -1,63 +0,0 @@ -/* This file is needed by libio to define various configuration parameters. - These are always the same in the GNU C library. */ - -#ifndef _BITS_G_CONFIG_H -#define _BITS_G_CONFIG_H 1 - -#if !defined _BITS_LIBIO_H && !defined _G_CONFIG_H -# error "Never include <bits/_G_config.h> directly; use <stdio.h> instead." -#endif - -/* Define types for libio in terms of the standard internal type names. */ - -#include <bits/types.h> -#define __need_size_t -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -# define __need_wchar_t -#endif -#define __need_NULL -#include <stddef.h> - -#include <bits/types/__mbstate_t.h> -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -# include <bits/types/wint_t.h> -#endif - -typedef struct -{ - __off_t __pos; - __mbstate_t __state; -} _G_fpos_t; -typedef struct -{ - __off64_t __pos; - __mbstate_t __state; -} _G_fpos64_t; -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -# include <gconv.h> -typedef union -{ - struct __gconv_info __cd; - struct - { - struct __gconv_info __cd; - struct __gconv_step_data __data; - } __combined; -} _G_iconv_t; -#endif - - -/* These library features are always available in the GNU C library. */ -#define _G_va_list __gnuc_va_list - -#define _G_HAVE_MMAP 1 -#define _G_HAVE_MREMAP 1 - -#define _G_IO_IO_FILE_VERSION 0x20001 - -/* This is defined by <bits/stat.h> if `st_blksize' exists. */ -#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE) - -#define _G_BUFSIZ 8192 - -#endif /* bits/_G_config.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/argp-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/argp-ldbl.h new file mode 100644 index 0000000..903b06f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/argp-ldbl.h
@@ -0,0 +1,24 @@ +/* Redirections for argp functions for -mlong-double-64. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _ARGP_H +# error "Never include <bits/argp-ldbl.h> directly; use <argp.h> instead." +#endif + +__LDBL_REDIR_DECL (argp_error) +__LDBL_REDIR_DECL (argp_failure)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap-16.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap-16.h deleted file mode 100644 index 0fbd8d6..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap-16.h +++ /dev/null
@@ -1,34 +0,0 @@ -/* Macros to swap the order of bytes in 16-bit integer values. - Copyright (C) 2012-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _BITS_BYTESWAP_H -# error "Never use <bits/byteswap-16.h> directly; include <byteswap.h> instead." -#endif - -#ifdef __GNUC__ -# define __bswap_16(x) \ - (__extension__ \ - ({ unsigned short int __bsx = (unsigned short int) (x); \ - __bswap_constant_16 (__bsx); })) -#else -static __inline unsigned short int -__bswap_16 (unsigned short int __bsx) -{ - return __bswap_constant_16 (__bsx); -} -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap.h index f99a6a4..6438a8b 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/byteswap.h
@@ -1,5 +1,5 @@ -/* Macros to swap the order of bytes in integer values. - Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Macros and inline functions to swap the order of bytes in integer values. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead." @@ -26,87 +26,54 @@ #include <features.h> #include <bits/types.h> -/* Swap bytes in 16 bit value. */ -#define __bswap_constant_16(x) \ - ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) +/* Swap bytes in 16-bit value. */ +#define __bswap_constant_16(x) \ + ((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))) -/* Get __bswap_16. */ -#include <bits/byteswap-16.h> - -/* Swap bytes in 32 bit value. */ -#define __bswap_constant_32(x) \ - ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) | \ - (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) - -#ifdef __GNUC__ -# if __GNUC_PREREQ (4, 3) -static __inline unsigned int -__bswap_32 (unsigned int __bsx) +static __inline __uint16_t +__bswap_16 (__uint16_t __bsx) { +#if __GNUC_PREREQ (4, 8) + return __builtin_bswap16 (__bsx); +#else + return __bswap_constant_16 (__bsx); +#endif +} + +/* Swap bytes in 32-bit value. */ +#define __bswap_constant_32(x) \ + ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ + | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) + +static __inline __uint32_t +__bswap_32 (__uint32_t __bsx) +{ +#if __GNUC_PREREQ (4, 3) return __builtin_bswap32 (__bsx); -} -# else -# define __bswap_32(x) \ - (__extension__ \ - ({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); })) -# endif #else -static __inline unsigned int -__bswap_32 (unsigned int __bsx) -{ return __bswap_constant_32 (__bsx); -} #endif +} -/* Swap bytes in 64 bit value. */ -#if __GNUC_PREREQ (2, 0) -# define __bswap_constant_64(x) \ - (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56))) +/* Swap bytes in 64-bit value. */ +#define __bswap_constant_64(x) \ + ((((x) & 0xff00000000000000ull) >> 56) \ + | (((x) & 0x00ff000000000000ull) >> 40) \ + | (((x) & 0x0000ff0000000000ull) >> 24) \ + | (((x) & 0x000000ff00000000ull) >> 8) \ + | (((x) & 0x00000000ff000000ull) << 8) \ + | (((x) & 0x0000000000ff0000ull) << 24) \ + | (((x) & 0x000000000000ff00ull) << 40) \ + | (((x) & 0x00000000000000ffull) << 56)) -# if __GNUC_PREREQ (4, 3) -static __inline __uint64_t +__extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { +#if __GNUC_PREREQ (4, 3) return __builtin_bswap64 (__bsx); -} -# else -# define __bswap_64(x) \ - (__extension__ \ - ({ union { __extension__ __uint64_t __ll; \ - unsigned int __l[2]; } __w, __r; \ - if (__builtin_constant_p (x)) \ - __r.__ll = __bswap_constant_64 (x); \ - else \ - { \ - __w.__ll = (x); \ - __r.__l[0] = __bswap_32 (__w.__l[1]); \ - __r.__l[1] = __bswap_32 (__w.__l[0]); \ - } \ - __r.__ll; })) -# endif #else -# define __bswap_constant_64(x) \ - ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56)) - -static __inline __uint64_t -__bswap_64 (__uint64_t __bsx) -{ return __bswap_constant_64 (__bsx); -} #endif +} #endif /* _BITS_BYTESWAP_H */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cmathcalls.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cmathcalls.h index e22b804..20a65b5 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cmathcalls.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cmathcalls.h
@@ -1,6 +1,6 @@ /* Prototype declarations for complex math functions; helper file for <complex.h>. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* NOTE: Because of the special way this file is used by <complex.h>, this file must NOT be protected from multiple inclusion as header files
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/confname.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/confname.h index 59d3172..8068bda 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/confname.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/confname.h
@@ -1,5 +1,5 @@ /* `sysconf', `pathconf', and `confstr' NAME values. Generic version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never use <bits/confname.h> directly; include <unistd.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cpu-set.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cpu-set.h index c5e919e..9a7e559 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cpu-set.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/cpu-set.h
@@ -1,6 +1,6 @@ /* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_CPU_SET_H #define _BITS_CPU_SET_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent.h index 2ed7919..88c86de 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _DIRENT_H # error "Never use <bits/dirent.h> directly; include <dirent.h> instead." @@ -54,4 +54,6 @@ #if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T /* Inform libc code that these two types are effectively identical. */ # define _DIRENT_MATCHES_DIRENT64 1 +#else +# define _DIRENT_MATCHES_DIRENT64 0 #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent_ext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent_ext.h new file mode 100644 index 0000000..83cebc5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dirent_ext.h
@@ -0,0 +1,33 @@ +/* System-specific extensions of <dirent.h>. Linux version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _DIRENT_H +# error "Never include <bits/dirent_ext.h> directly; use <dirent.h> instead." +#endif + +__BEGIN_DECLS + +#ifdef __USE_GNU +/* Read from the directory descriptor FD into LENGTH bytes at BUFFER. + Return the number of bytes read on success (0 for end of + directory), and -1 for failure. */ +extern __ssize_t getdents64 (int __fd, void *__buffer, size_t __length) + __THROW __nonnull ((2)); +#endif + +__END_DECLS
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dlfcn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dlfcn.h index b0b129b..f3bc63e 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dlfcn.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/dlfcn.h
@@ -1,5 +1,5 @@ /* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _DLFCN_H # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endian.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endian.h index 1f18733..6372c6f 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endian.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endian.h
@@ -1,11 +1,11 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. - +/* Endian macros for string.h functions + Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,18 +13,37 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef _ENDIAN_H -# error "Never use <bits/endian.h> directly; include <endian.h> instead." +#ifndef _BITS_ENDIAN_H +#define _BITS_ENDIAN_H 1 + +/* Definitions for byte order, according to significance of bytes, + from low addresses to high addresses. The value is what you get by + putting '4' in the most significant byte, '3' in the second most + significant byte, '2' in the second least significant byte, and '1' + in the least significant byte, and then writing down one digit for + each byte, starting with the byte at the lowest address at the left, + and proceeding to the byte with the highest address at the right. */ + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#define __PDP_ENDIAN 3412 + +/* This file defines `__BYTE_ORDER' for the particular machine. */ +#include <bits/endianness.h> + +/* Some machines may need to use a different endianness for floating point + values. */ +#ifndef __FLOAT_WORD_ORDER +# define __FLOAT_WORD_ORDER __BYTE_ORDER #endif -/* AArch64 can be either big or little endian. */ -#ifdef __AARCH64EB__ -# define __BYTE_ORDER __BIG_ENDIAN -#else -# define __BYTE_ORDER __LITTLE_ENDIAN +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) LO, HI +#elif __BYTE_ORDER == __BIG_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) HI, LO #endif -#define __FLOAT_WORD_ORDER __BYTE_ORDER +#endif /* bits/endian.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endianness.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endianness.h new file mode 100644 index 0000000..300ebc8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/endianness.h
@@ -0,0 +1,15 @@ +#ifndef _BITS_ENDIANNESS_H +#define _BITS_ENDIANNESS_H 1 + +#ifndef _BITS_ENDIAN_H +# error "Never use <bits/endianness.h> directly; include <endian.h> instead." +#endif + +/* AArch64 has selectable endianness. */ +#ifdef __AARCH64EB__ +# define __BYTE_ORDER __BIG_ENDIAN +#else +# define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +#endif /* bits/endianness.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/environments.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/environments.h index 22ea9f0..7049784 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/environments.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/environments.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2018 Free Software Foundation, Inc. +/* Copyright (C) 1999-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never include this file directly. Use <unistd.h> instead"
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/epoll.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/epoll.h index d4aea32..5810ad6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/epoll.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/epoll.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2018 Free Software Foundation, Inc. +/* Copyright (C) 2002-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_EPOLL_H # error "Never use <bits/epoll.h> directly; include <sys/epoll.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/err-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/err-ldbl.h new file mode 100644 index 0000000..330e7dd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/err-ldbl.h
@@ -0,0 +1,30 @@ +/* Redirections for err.h functions for -mlong-double-64. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _ERR_H +# error "Never include <bits/err-ldbl.h> directly; use <err.h> instead." +#endif + +__LDBL_REDIR_DECL (warn) +__LDBL_REDIR_DECL (vwarn) +__LDBL_REDIR_DECL (warnx) +__LDBL_REDIR_DECL (vwarnx) +__LDBL_REDIR_DECL (err) +__LDBL_REDIR_DECL (verr) +__LDBL_REDIR_DECL (errx) +__LDBL_REDIR_DECL (verrx)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/errno.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/errno.h index e0f7f0b..230cee0 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/errno.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/errno.h
@@ -1,5 +1,5 @@ /* Error constants. Linux specific version. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_ERRNO_H #define _BITS_ERRNO_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error-ldbl.h new file mode 100644 index 0000000..da46f7c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error-ldbl.h
@@ -0,0 +1,24 @@ +/* Redirections for error.h functions for -mlong-double-64. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _ERROR_H +# error "Never include <bits/error-ldbl.h> directly; use <error.h> instead." +#endif + +__LDBL_REDIR_DECL (error) +__LDBL_REDIR_DECL (error_at_line)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error.h index 682cf20..14735eb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/error.h
@@ -1,5 +1,5 @@ /* Specializations for error functions. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _ERROR_H # error "Never include <bits/error.h> directly; use <error.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/eventfd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/eventfd.h index 5941174..6ff6b03 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/eventfd.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/eventfd.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2018 Free Software Foundation, Inc. +/* Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_EVENTFD_H # error "Never use <bits/eventfd.h> directly; include <sys/eventfd.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl-linux.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl-linux.h index 2694942..20ad78c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl-linux.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl-linux.h
@@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for Linux. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never use <bits/fcntl-linux.h> directly; include <fcntl.h> instead." @@ -284,11 +284,14 @@ # define F_SEAL_SHRINK 0x0002 /* Prevent file from shrinking. */ # define F_SEAL_GROW 0x0004 /* Prevent file from growing. */ # define F_SEAL_WRITE 0x0008 /* Prevent writes. */ +# define F_SEAL_FUTURE_WRITE 0x0010 /* Prevent future writes while + mapped. */ #endif #ifdef __USE_GNU /* Hint values for F_{GET,SET}_RW_HINT. */ -# define RWF_WRITE_LIFE_NOT_SET 0 +# define RWH_WRITE_LIFE_NOT_SET 0 +# define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET # define RWH_WRITE_LIFE_NONE 1 # define RWH_WRITE_LIFE_SHORT 2 # define RWH_WRITE_LIFE_MEDIUM 3 @@ -332,6 +335,11 @@ # define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in the range after performing the write. */ +/* SYNC_FILE_RANGE_WRITE_AND_WAIT ensures all pages in the range are + written to disk before returning. */ +# define SYNC_FILE_RANGE_WRITE_AND_WAIT (SYNC_FILE_RANGE_WRITE \ + | SYNC_FILE_RANGE_WAIT_BEFORE \ + | SYNC_FILE_RANGE_WAIT_AFTER) /* Flags for SPLICE and VMSPLICE. */ # define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl.h index e09ff41..a89db6a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl.h
@@ -1,5 +1,5 @@ /* O_*, F_*, FD_* bit values for the AArch64 Linux ABI. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl2.h index 1aaaf9a..24efb22 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fcntl2.h
@@ -1,5 +1,5 @@ /* Checking macros for fcntl functions. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never include <bits/fcntl2.h> directly; use <fcntl.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenv.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenv.h index 8a0f481..2f95478 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenv.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenv.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2018 Free Software Foundation, Inc. +/* Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _FENV_H # error "Never use <bits/fenv.h> directly; include <fenv.h> instead." @@ -73,7 +73,7 @@ # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) /* Type representing floating-point control modes. */ typedef unsigned int femode_t;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenvinline.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenvinline.h deleted file mode 100644 index 42f77b5..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fenvinline.h +++ /dev/null
@@ -1,8 +0,0 @@ -/* This file provides inline versions of floating-pint environment - handling functions. If there were any. */ - -#ifndef __NO_MATH_INLINES - -/* Here is where the code would go. */ - -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn-common.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn-common.h index 070cdd0..b43c953 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn-common.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn-common.h
@@ -1,6 +1,6 @@ /* Macros to control TS 18661-3 glibc features where the same definitions are appropriate for all platforms. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_FLOATN_COMMON_H #define _BITS_FLOATN_COMMON_H @@ -56,6 +56,13 @@ #define __HAVE_DISTINCT_FLOAT64X 0 #define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X +/* Defined to 1 if the corresponding _FloatN type is not binary compatible + with the corresponding ISO C type in the current compilation unit as + opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built + in glibc. */ +#define __HAVE_FLOAT128_UNLIKE_LDBL (__HAVE_DISTINCT_FLOAT128 \ + && __LDBL_MANT_DIG__ != 113) + /* Defined to 1 if any _FloatN or _FloatNx types that are not ABI-distinct are however distinct types at the C language level (so for the purposes of __builtin_types_compatible_p and _Generic). */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn.h index 1d21cce..da50ae7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/floatn.h
@@ -1,5 +1,5 @@ /* Macros to control TS 18661-3 glibc features on ldbl-128 platforms. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_FLOATN_H #define _BITS_FLOATN_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/flt-eval-method.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/flt-eval-method.h index 7eed671..615e14c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/flt-eval-method.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/flt-eval-method.h
@@ -1,5 +1,5 @@ /* Define __GLIBC_FLT_EVAL_METHOD. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/flt-eval-method.h> directly; include <math.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-fast.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-fast.h index 3ce1221..c689f41 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-fast.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-fast.h
@@ -1,5 +1,5 @@ /* Define FP_FAST_* macros. AArch64 version. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/fp-fast.h> directly; include <math.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-logb.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-logb.h index 8b70a10..cd8b431 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-logb.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/fp-logb.h
@@ -1,5 +1,5 @@ /* Define __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/fp-logb.h> directly; include <math.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_core.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_core.h index a13838f..1751a20 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_core.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_core.h
@@ -1,5 +1,5 @@ /* Declarations for getopt (basic, portable features only). - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _GETOPT_CORE_H #define _GETOPT_CORE_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_ext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_ext.h index b4c68f1..d48069e 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_ext.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_ext.h
@@ -1,5 +1,5 @@ /* Declarations for getopt (GNU extensions). - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _GETOPT_EXT_H #define _GETOPT_EXT_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_posix.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_posix.h index 1f90e84..f49e1f3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_posix.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/getopt_posix.h
@@ -1,5 +1,5 @@ /* Declarations for getopt (POSIX compatibility shim). - Copyright (C) 1989-2018 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. Unlike the bulk of the getopt implementation, this file is NOT part of gnulib. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _GETOPT_POSIX_H #define _GETOPT_POSIX_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/hwcap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/hwcap.h index 569eb07..30fda0a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/hwcap.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/hwcap.h
@@ -1,5 +1,5 @@ /* Defines for bits in AT_HWCAP. AArch64 Linux version. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,13 +14,14 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined (_SYS_AUXV_H) # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead." #endif -/* The following must match the kernel's <asm/hwcap.h>. */ +/* The following must match the kernel's <asm/hwcap.h> and update the + list together with sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c. */ #define HWCAP_FP (1 << 0) #define HWCAP_ASIMD (1 << 1) #define HWCAP_EVTSTRM (1 << 2) @@ -44,3 +45,32 @@ #define HWCAP_ASIMDDP (1 << 20) #define HWCAP_SHA512 (1 << 21) #define HWCAP_SVE (1 << 22) +#define HWCAP_ASIMDFHM (1 << 23) +#define HWCAP_DIT (1 << 24) +#define HWCAP_USCAT (1 << 25) +#define HWCAP_ILRCPC (1 << 26) +#define HWCAP_FLAGM (1 << 27) +#define HWCAP_SSBS (1 << 28) +#define HWCAP_SB (1 << 29) +#define HWCAP_PACA (1 << 30) +#define HWCAP_PACG (1UL << 31) + +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) +#define HWCAP2_MTE (1 << 18)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/in.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/in.h index fb64f1b..4c3c5ac 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/in.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/in.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* Linux version. */ @@ -102,6 +102,7 @@ #define IP_CHECKSUM 23 #define IP_BIND_ADDRESS_NO_PORT 24 #define IP_RECVFRAGSIZE 25 +#define IP_RECVERR_RFC4884 26 /* IP_MTU_DISCOVER arguments. */ #define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ @@ -191,6 +192,9 @@ #define IPV6_V6ONLY 26 #define IPV6_JOIN_ANYCAST 27 #define IPV6_LEAVE_ANYCAST 28 +#define IPV6_MULTICAST_ALL 29 +#define IPV6_ROUTER_ALERT_ISOLATE 30 +#define IPV6_RECVERR_RFC4884 31 #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 #define IPV6_HDRINCL 36 @@ -228,6 +232,7 @@ #define IPV6_TRANSPARENT 75 #define IPV6_UNICAST_IF 76 #define IPV6_RECVFRAGSIZE 77 +#define IPV6_FREEBIND 78 /* Obsolete synonyms for the above. */ #if !__USE_KERNEL_IPV6_DEFS
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/indirect-return.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/indirect-return.h new file mode 100644 index 0000000..5240a0a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/indirect-return.h
@@ -0,0 +1,25 @@ +/* Definition of __INDIRECT_RETURN. Generic version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _UCONTEXT_H +# error "Never include <bits/indirect-return.h> directly; use <ucontext.h> instead." +#endif + +/* __INDIRECT_RETURN is used on swapcontext to indicate if it requires + special compiler treatment. */ +#define __INDIRECT_RETURN
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/inotify.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/inotify.h index d160876..5eee3cc 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/inotify.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/inotify.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2018 Free Software Foundation, Inc. +/* Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_INOTIFY_H # error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctl-types.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctl-types.h index 28fd1db..508a0c3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctl-types.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctl-types.h
@@ -1,5 +1,5 @@ /* Structure types for pre-termios terminal ioctls. Linux version. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_IOCTL_H # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctls.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctls.h index b719f6e..0e53bc7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctls.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ioctls.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_IOCTL_H # error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc-perm.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc-perm.h new file mode 100644 index 0000000..17f81c4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc-perm.h
@@ -0,0 +1,40 @@ +/* struct ipc_perm definition. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _SYS_IPC_H +# error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead." +#endif + +/* Data structure used to pass permission information to IPC operations. + It follows the kernel ipc64_perm size so the syscall can be made directly + without temporary buffer copy. However, since glibc defines the MODE + field as mode_t per POSIX definition (BZ#18231), it omits the __PAD1 field + (since glibc does not export mode_t as 16-bit for any architecture). */ +struct ipc_perm +{ + __key_t __key; /* Key. */ + __uid_t uid; /* Owner's user ID. */ + __gid_t gid; /* Owner's group ID. */ + __uid_t cuid; /* Creator's user ID. */ + __gid_t cgid; /* Creator's group ID. */ + __mode_t mode; /* Read/write permission. */ + unsigned short int __seq; /* Sequence number. */ + unsigned short int __pad2; + __syscall_ulong_t __glibc_reserved1; + __syscall_ulong_t __glibc_reserved2; +};
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc.h index d66cf44..5a0e2fc 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipc.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_IPC_H # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead." @@ -37,18 +37,4 @@ /* Special key values. */ #define IPC_PRIVATE ((__key_t) 0) /* Private key. */ - -/* Data structure used to pass permission information to IPC operations. */ -struct ipc_perm - { - __key_t __key; /* Key. */ - __uid_t uid; /* Owner's user ID. */ - __gid_t gid; /* Owner's group ID. */ - __uid_t cuid; /* Creator's user ID. */ - __gid_t cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ - unsigned short int __pad1; - __syscall_ulong_t __glibc_reserved1; - __syscall_ulong_t __glibc_reserved2; - }; +#include <bits/ipc-perm.h>
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipctypes.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipctypes.h index 1238801..454a1fd 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipctypes.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ipctypes.h
@@ -1,5 +1,5 @@ /* bits/ipctypes.h -- Define some types used by SysV IPC/MSG/SHM. Generic. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include <bits/ipctypes.h> directly.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/iscanonical.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/iscanonical.h index 56934af..189dea3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/iscanonical.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/iscanonical.h
@@ -1,5 +1,5 @@ /* Define iscanonical macro. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libc-header-start.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libc-header-start.h index b4a429b..296e1ce 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libc-header-start.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libc-header-start.h
@@ -1,5 +1,5 @@ /* Handle feature test macros at the start of a header. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* This header is internal to glibc and should not be included outside of glibc headers. Headers including it must define @@ -43,22 +43,38 @@ #endif /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ - macro. */ + macro. Most but not all symbols enabled by that macro in TS + 18661-1 are enabled unconditionally in C2X; the symbols in Annex F + still require that macro in C2X. */ #undef __GLIBC_USE_IEC_60559_BFP_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_BFP_EXT__ # define __GLIBC_USE_IEC_60559_BFP_EXT 1 #else # define __GLIBC_USE_IEC_60559_BFP_EXT 0 #endif +#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X +#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X) +# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1 +#else +# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 +#endif /* ISO/IEC TS 18661-4:2015 defines the - __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ + __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction + functions, the symbols from this TS are enabled unconditionally in + C2X. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X) +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 +#endif /* ISO/IEC TS 18661-3:2015 defines the __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio-ldbl.h deleted file mode 100644 index aa39353..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio-ldbl.h +++ /dev/null
@@ -1,29 +0,0 @@ -/* -mlong-double-64 compatibility mode for libio functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _BITS_LIBIO_LDBL_H -#define _BITS_LIBIO_LDBL_H 1 - -#ifndef _BITS_LIBIO_H -# error "Never include <bits/libio-ldbl.h> directly; use <libio.h> instead." -#endif - -__LDBL_REDIR_DECL (_IO_vfscanf) -__LDBL_REDIR_DECL (_IO_vfprintf) - -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio.h deleted file mode 100644 index fae5b93..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libio.h +++ /dev/null
@@ -1,527 +0,0 @@ -/* Copyright (C) 1991-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Written by Per Bothner <bothner@cygnus.com>. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. - - As a special exception, if you link the code in this file with - files compiled with a GNU compiler to produce an executable, - that does not cause the resulting executable to be covered by - the GNU Lesser General Public License. This exception does not - however invalidate any other reasons why the executable file - might be covered by the GNU Lesser General Public License. - This exception applies to code released by its copyright holders - in files containing the exception. */ - -#ifndef _BITS_LIBIO_H -#define _BITS_LIBIO_H 1 - -#if !defined _STDIO_H && !defined _LIBIO_H -# error "Never include <bits/libio.h> directly; use <stdio.h> instead." -#endif - -#include <bits/_G_config.h> -/* ALL of these should be defined in _G_config.h */ -#define _IO_fpos_t _G_fpos_t -#define _IO_fpos64_t _G_fpos64_t -#define _IO_size_t size_t -#define _IO_ssize_t __ssize_t -#define _IO_off_t __off_t -#define _IO_off64_t __off64_t -#define _IO_pid_t __pid_t -#define _IO_uid_t __uid_t -#define _IO_iconv_t _G_iconv_t -#define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE -#define _IO_BUFSIZ _G_BUFSIZ -#define _IO_va_list _G_va_list -#define _IO_wint_t wint_t - -/* This define avoids name pollution if we're using GNU stdarg.h */ -#define __need___va_list -#include <stdarg.h> -#ifdef __GNUC_VA_LIST -# undef _IO_va_list -# define _IO_va_list __gnuc_va_list -#endif /* __GNUC_VA_LIST */ - -#ifndef __P -# include <sys/cdefs.h> -#endif /*!__P*/ - -#define _IO_UNIFIED_JUMPTABLES 1 - -#ifndef EOF -# define EOF (-1) -#endif -#ifndef NULL -# if defined __GNUG__ && \ - (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) -# define NULL (__null) -# else -# if !defined(__cplusplus) -# define NULL ((void*)0) -# else -# define NULL (0) -# endif -# endif -#endif - -#define _IOS_INPUT 1 -#define _IOS_OUTPUT 2 -#define _IOS_ATEND 4 -#define _IOS_APPEND 8 -#define _IOS_TRUNC 16 -#define _IOS_NOCREATE 32 -#define _IOS_NOREPLACE 64 -#define _IOS_BIN 128 - -/* Magic numbers and bits for the _flags field. - The magic numbers use the high-order bits of _flags; - the remaining bits are available for variable flags. - Note: The magic numbers must all be negative if stdio - emulation is desired. */ - -#define _IO_MAGIC 0xFBAD0000 /* Magic number */ -#define _OLD_STDIO_MAGIC 0xFABC0000 /* Emulate old stdio. */ -#define _IO_MAGIC_MASK 0xFFFF0000 -#define _IO_USER_BUF 1 /* User owns buffer; don't delete it on close. */ -#define _IO_UNBUFFERED 2 -#define _IO_NO_READS 4 /* Reading not allowed */ -#define _IO_NO_WRITES 8 /* Writing not allowd */ -#define _IO_EOF_SEEN 0x10 -#define _IO_ERR_SEEN 0x20 -#define _IO_DELETE_DONT_CLOSE 0x40 /* Don't call close(_fileno) on cleanup. */ -#define _IO_LINKED 0x80 /* Set if linked (using _chain) to streambuf::_list_all.*/ -#define _IO_IN_BACKUP 0x100 -#define _IO_LINE_BUF 0x200 -#define _IO_TIED_PUT_GET 0x400 /* Set if put and get pointer logicly tied. */ -#define _IO_CURRENTLY_PUTTING 0x800 -#define _IO_IS_APPENDING 0x1000 -#define _IO_IS_FILEBUF 0x2000 -#define _IO_BAD_SEEN 0x4000 -#define _IO_USER_LOCK 0x8000 - -#define _IO_FLAGS2_MMAP 1 -#define _IO_FLAGS2_NOTCANCEL 2 -#ifdef _LIBC -# define _IO_FLAGS2_FORTIFY 4 -#endif -#define _IO_FLAGS2_USER_WBUF 8 -#ifdef _LIBC -# define _IO_FLAGS2_SCANF_STD 16 -# define _IO_FLAGS2_NOCLOSE 32 -# define _IO_FLAGS2_CLOEXEC 64 -# define _IO_FLAGS2_NEED_LOCK 128 -#endif - -/* These are "formatting flags" matching the iostream fmtflags enum values. */ -#define _IO_SKIPWS 01 -#define _IO_LEFT 02 -#define _IO_RIGHT 04 -#define _IO_INTERNAL 010 -#define _IO_DEC 020 -#define _IO_OCT 040 -#define _IO_HEX 0100 -#define _IO_SHOWBASE 0200 -#define _IO_SHOWPOINT 0400 -#define _IO_UPPERCASE 01000 -#define _IO_SHOWPOS 02000 -#define _IO_SCIENTIFIC 04000 -#define _IO_FIXED 010000 -#define _IO_UNITBUF 020000 -#define _IO_STDIO 040000 -#define _IO_DONT_CLOSE 0100000 -#define _IO_BOOLALPHA 0200000 - - -struct _IO_jump_t; struct _IO_FILE; - -/* During the build of glibc itself, _IO_lock_t will already have been - defined by internal headers. */ -#ifndef _IO_lock_t_defined -typedef void _IO_lock_t; -#endif - - -/* A streammarker remembers a position in a buffer. */ - -struct _IO_marker { - struct _IO_marker *_next; - struct _IO_FILE *_sbuf; - /* If _pos >= 0 - it points to _buf->Gbase()+_pos. FIXME comment */ - /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */ - int _pos; -#if 0 - void set_streampos(streampos sp) { _spos = sp; } - void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); } - public: - streammarker(streambuf *sb); - ~streammarker(); - int saving() { return _spos == -2; } - int delta(streammarker&); - int delta(); -#endif -}; - -/* This is the structure from the libstdc++ codecvt class. */ -enum __codecvt_result -{ - __codecvt_ok, - __codecvt_partial, - __codecvt_error, - __codecvt_noconv -}; - -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -/* The order of the elements in the following struct must match the order - of the virtual functions in the libstdc++ codecvt class. */ -struct _IO_codecvt -{ - void (*__codecvt_destr) (struct _IO_codecvt *); - enum __codecvt_result (*__codecvt_do_out) (struct _IO_codecvt *, - __mbstate_t *, - const wchar_t *, - const wchar_t *, - const wchar_t **, char *, - char *, char **); - enum __codecvt_result (*__codecvt_do_unshift) (struct _IO_codecvt *, - __mbstate_t *, char *, - char *, char **); - enum __codecvt_result (*__codecvt_do_in) (struct _IO_codecvt *, - __mbstate_t *, - const char *, const char *, - const char **, wchar_t *, - wchar_t *, wchar_t **); - int (*__codecvt_do_encoding) (struct _IO_codecvt *); - int (*__codecvt_do_always_noconv) (struct _IO_codecvt *); - int (*__codecvt_do_length) (struct _IO_codecvt *, __mbstate_t *, - const char *, const char *, _IO_size_t); - int (*__codecvt_do_max_length) (struct _IO_codecvt *); - - _IO_iconv_t __cd_in; - _IO_iconv_t __cd_out; -}; - -/* Extra data for wide character streams. */ -struct _IO_wide_data -{ - wchar_t *_IO_read_ptr; /* Current read pointer */ - wchar_t *_IO_read_end; /* End of get area. */ - wchar_t *_IO_read_base; /* Start of putback+get area. */ - wchar_t *_IO_write_base; /* Start of put area. */ - wchar_t *_IO_write_ptr; /* Current put pointer. */ - wchar_t *_IO_write_end; /* End of put area. */ - wchar_t *_IO_buf_base; /* Start of reserve area. */ - wchar_t *_IO_buf_end; /* End of reserve area. */ - /* The following fields are used to support backing up and undo. */ - wchar_t *_IO_save_base; /* Pointer to start of non-current get area. */ - wchar_t *_IO_backup_base; /* Pointer to first valid character of - backup area */ - wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */ - - __mbstate_t _IO_state; - __mbstate_t _IO_last_state; - struct _IO_codecvt _codecvt; - - wchar_t _shortbuf[1]; - - const struct _IO_jump_t *_wide_vtable; -}; -#endif - -struct _IO_FILE { - int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ -#define _IO_file_flags _flags - - /* The following pointers correspond to the C++ streambuf protocol. */ - /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */ - char* _IO_read_ptr; /* Current read pointer */ - char* _IO_read_end; /* End of get area. */ - char* _IO_read_base; /* Start of putback+get area. */ - char* _IO_write_base; /* Start of put area. */ - char* _IO_write_ptr; /* Current put pointer. */ - char* _IO_write_end; /* End of put area. */ - char* _IO_buf_base; /* Start of reserve area. */ - char* _IO_buf_end; /* End of reserve area. */ - /* The following fields are used to support backing up and undo. */ - char *_IO_save_base; /* Pointer to start of non-current get area. */ - char *_IO_backup_base; /* Pointer to first valid character of backup area */ - char *_IO_save_end; /* Pointer to end of non-current get area. */ - - struct _IO_marker *_markers; - - struct _IO_FILE *_chain; - - int _fileno; -#if 0 - int _blksize; -#else - int _flags2; -#endif - _IO_off_t _old_offset; /* This used to be _offset but it's too small. */ - -#define __HAVE_COLUMN /* temporary */ - /* 1+column number of pbase(); 0 is unknown. */ - unsigned short _cur_column; - signed char _vtable_offset; - char _shortbuf[1]; - - /* char* _save_gptr; char* _save_egptr; */ - - _IO_lock_t *_lock; -#ifdef _IO_USE_OLD_IO_FILE -}; - -struct _IO_FILE_complete -{ - struct _IO_FILE _file; -#endif -#if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001 - _IO_off64_t _offset; -# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T - /* Wide character stream stuff. */ - struct _IO_codecvt *_codecvt; - struct _IO_wide_data *_wide_data; - struct _IO_FILE *_freeres_list; - void *_freeres_buf; -# else - void *__pad1; - void *__pad2; - void *__pad3; - void *__pad4; -# endif - size_t __pad5; - int _mode; - /* Make sure we don't get into trouble again. */ - char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; -#endif -}; - -#ifndef __cplusplus -typedef struct _IO_FILE _IO_FILE; -#endif - -struct _IO_FILE_plus; - -extern struct _IO_FILE_plus _IO_2_1_stdin_; -extern struct _IO_FILE_plus _IO_2_1_stdout_; -extern struct _IO_FILE_plus _IO_2_1_stderr_; -#ifndef _LIBC -#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_)) -#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_)) -#define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_)) -#else -extern _IO_FILE *_IO_stdin attribute_hidden; -extern _IO_FILE *_IO_stdout attribute_hidden; -extern _IO_FILE *_IO_stderr attribute_hidden; -#endif - - -/* Functions to do I/O and file management for a stream. */ - -/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. - Return number of bytes read. */ -typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); - -/* Write N bytes pointed to by BUF to COOKIE. Write all N bytes - unless there is an error. Return number of bytes written. If - there is an error, return 0 and do not write anything. If the file - has been opened for append (__mode.__append set), then set the file - pointer to the end of the file and then do the write; if not, just - write at the current file pointer. */ -typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf, - size_t __n); - -/* Move COOKIE's file position to *POS bytes from the - beginning of the file (if W is SEEK_SET), - the current position (if W is SEEK_CUR), - or the end of the file (if W is SEEK_END). - Set *POS to the new file position. - Returns zero if successful, nonzero if not. */ -typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w); - -/* Close COOKIE. */ -typedef int __io_close_fn (void *__cookie); - - -#ifdef __USE_GNU -/* User-visible names for the above. */ -typedef __io_read_fn cookie_read_function_t; -typedef __io_write_fn cookie_write_function_t; -typedef __io_seek_fn cookie_seek_function_t; -typedef __io_close_fn cookie_close_function_t; - -/* The structure with the cookie function pointers. */ -typedef struct -{ - __io_read_fn *read; /* Read bytes. */ - __io_write_fn *write; /* Write bytes. */ - __io_seek_fn *seek; /* Seek/tell file position. */ - __io_close_fn *close; /* Close file. */ -} _IO_cookie_io_functions_t; -typedef _IO_cookie_io_functions_t cookie_io_functions_t; - -struct _IO_cookie_file; - -/* Initialize one of those. */ -extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, - void *__cookie, _IO_cookie_io_functions_t __fns); -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -extern int __underflow (_IO_FILE *); -extern int __uflow (_IO_FILE *); -extern int __overflow (_IO_FILE *, int); -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -extern _IO_wint_t __wunderflow (_IO_FILE *); -extern _IO_wint_t __wuflow (_IO_FILE *); -extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t); -#endif - -#if __GNUC__ >= 3 -# define _IO_BE(expr, res) __builtin_expect ((expr), res) -#else -# define _IO_BE(expr, res) (expr) -#endif - -#define _IO_getc_unlocked(_fp) \ - (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ - ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) -#define _IO_peekc_unlocked(_fp) \ - (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \ - && __underflow (_fp) == EOF ? EOF \ - : *(unsigned char *) (_fp)->_IO_read_ptr) -#define _IO_putc_unlocked(_ch, _fp) \ - (_IO_BE ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end, 0) \ - ? __overflow (_fp, (unsigned char) (_ch)) \ - : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) - -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -# define _IO_getwc_unlocked(_fp) \ - (_IO_BE ((_fp)->_wide_data == NULL \ - || ((_fp)->_wide_data->_IO_read_ptr \ - >= (_fp)->_wide_data->_IO_read_end), 0) \ - ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++) -# define _IO_putwc_unlocked(_wch, _fp) \ - (_IO_BE ((_fp)->_wide_data == NULL \ - || ((_fp)->_wide_data->_IO_write_ptr \ - >= (_fp)->_wide_data->_IO_write_end), 0) \ - ? __woverflow (_fp, _wch) \ - : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch))) -#endif - -#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) -#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) - -extern int _IO_getc (_IO_FILE *__fp); -extern int _IO_putc (int __c, _IO_FILE *__fp); -extern int _IO_feof (_IO_FILE *__fp) __THROW; -extern int _IO_ferror (_IO_FILE *__fp) __THROW; - -extern int _IO_peekc_locked (_IO_FILE *__fp); - -/* This one is for Emacs. */ -#define _IO_PENDING_OUTPUT_COUNT(_fp) \ - ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) - -extern void _IO_flockfile (_IO_FILE *) __THROW; -extern void _IO_funlockfile (_IO_FILE *) __THROW; -extern int _IO_ftrylockfile (_IO_FILE *) __THROW; - -#define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) -#define _IO_flockfile(_fp) /**/ -#define _IO_funlockfile(_fp) /**/ -#define _IO_ftrylockfile(_fp) /**/ -#ifndef _IO_cleanup_region_start -#define _IO_cleanup_region_start(_fct, _fp) /**/ -#endif -#ifndef _IO_cleanup_region_end -#define _IO_cleanup_region_end(_Doit) /**/ -#endif - -#define _IO_need_lock(_fp) \ - (((_fp)->_flags2 & _IO_FLAGS2_NEED_LOCK) != 0) - -extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, - _IO_va_list, int *__restrict); -extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, - _IO_va_list); -extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t); -extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t); - -extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int); -extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int); - -extern void _IO_free_backup_area (_IO_FILE *) __THROW; - -#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T -extern _IO_wint_t _IO_getwc (_IO_FILE *__fp); -extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp); -extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW; -# if __GNUC__ >= 2 -/* While compiling glibc we have to handle compatibility with very old - versions. */ -# if defined _LIBC && defined SHARED -# include <shlib-compat.h> -# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) -# define _IO_fwide_maybe_incompatible \ - (__builtin_expect (&_IO_stdin_used == NULL, 0)) -extern const int _IO_stdin_used; -weak_extern (_IO_stdin_used); -# endif -# endif -# ifndef _IO_fwide_maybe_incompatible -# define _IO_fwide_maybe_incompatible (0) -# endif -/* A special optimized version of the function above. It optimizes the - case of initializing an unoriented byte stream. */ -# define _IO_fwide(__fp, __mode) \ - ({ int __result = (__mode); \ - if (__result < 0 && ! _IO_fwide_maybe_incompatible) \ - { \ - if ((__fp)->_mode == 0) \ - /* We know that all we have to do is to set the flag. */ \ - (__fp)->_mode = -1; \ - __result = (__fp)->_mode; \ - } \ - else if (__builtin_constant_p (__mode) && (__mode) == 0) \ - __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode; \ - else \ - __result = _IO_fwide (__fp, __result); \ - __result; }) -# endif - -extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict, - _IO_va_list, int *__restrict); -extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict, - _IO_va_list); -extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t); -extern void _IO_free_wbackup_area (_IO_FILE *) __THROW; -#endif - -#ifdef __LDBL_COMPAT -# include <bits/libio-ldbl.h> -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _BITS_LIBIO_H */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libm-simd-decl-stubs.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libm-simd-decl-stubs.h index 520b4bb..b80ff33 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libm-simd-decl-stubs.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/libm-simd-decl-stubs.h
@@ -1,5 +1,5 @@ /* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h. - Copyright (C) 2014-2018 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never include <bits/libm-simd-decl-stubs.h> directly;\
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/link.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/link.h index 5a7fc1c..774bbe5 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/link.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/link.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2005-2018 Free Software Foundation, Inc. +/* Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _LINK_H # error "Never include <bits/link.h> directly; use <link.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/local_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/local_lim.h index 37aab9a..0652bf4 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/local_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/local_lim.h
@@ -1,5 +1,5 @@ /* Minimum guaranteed maximum values for system limits. Linux version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* The kernel header pollutes the namespace with the NR_OPEN symbol and defines LINK_MAX although filesystems have different maxima. A
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/locale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/locale.h index 3a3d921..cc8e980 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/locale.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/locale.h
@@ -1,5 +1,5 @@ /* Definition of locale category symbol values. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use <bits/locale.h> directly; include <locale.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/long-double.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/long-double.h index 3d6e113..55d2009 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/long-double.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/long-double.h
@@ -1,5 +1,5 @@ /* Properties of long double type. ldbl-128 version. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,8 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* long double is distinct from double, so there is nothing to define here. */ +#define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-finite.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-finite.h deleted file mode 100644 index 0799fe7..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-finite.h +++ /dev/null
@@ -1,197 +0,0 @@ -/* Entry points to finite-math-only compiler runs. - Copyright (C) 2011-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _MATH_H -# error "Never use <bits/math-finite.h> directly; include <math.h> instead." -#endif - -#define __REDIRFROM(...) __REDIRFROM_X(__VA_ARGS__) - -#define __REDIRTO(...) __REDIRTO_X(__VA_ARGS__) - -#define __MATH_REDIRCALL_X(from, args, to) \ - extern _Mdouble_ __REDIRECT_NTH (from, args, to) -#define __MATH_REDIRCALL(function, reentrant, args) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (function, reentrant), args, \ - __REDIRTO (function, reentrant)) -#define __MATH_REDIRCALL_2(from, reentrant, args, to) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (from, reentrant), args, \ - __REDIRTO (to, reentrant)) - -#define __MATH_REDIRCALL_INTERNAL(function, reentrant, args) \ - __MATH_REDIRCALL_X \ - (__REDIRFROM (__CONCAT (__, function), \ - __CONCAT (reentrant, _finite)), \ - args, __REDIRTO (function, _r)) - - -/* acos. */ -__MATH_REDIRCALL (acos, , (_Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* acosh. */ -__MATH_REDIRCALL (acosh, , (_Mdouble_)); -#endif - -/* asin. */ -__MATH_REDIRCALL (asin, , (_Mdouble_)); - -/* atan2. */ -__MATH_REDIRCALL (atan2, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* atanh. */ -__MATH_REDIRCALL (atanh, , (_Mdouble_)); -#endif - -/* cosh. */ -__MATH_REDIRCALL (cosh, , (_Mdouble_)); - -/* exp. */ -__MATH_REDIRCALL (exp, , (_Mdouble_)); - -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) -/* exp10. */ -__MATH_REDIRCALL (exp10, , (_Mdouble_)); -#endif - -#ifdef __USE_ISOC99 -/* exp2. */ -__MATH_REDIRCALL (exp2, , (_Mdouble_)); -#endif - -/* fmod. */ -__MATH_REDIRCALL (fmod, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN || defined __USE_ISOC99 -/* hypot. */ -__MATH_REDIRCALL (hypot, , (_Mdouble_, _Mdouble_)); -#endif - -#if (__MATH_DECLARING_DOUBLE && (defined __USE_MISC || defined __USE_XOPEN)) \ - || (!__MATH_DECLARING_DOUBLE && defined __USE_MISC) -/* j0. */ -__MATH_REDIRCALL (j0, , (_Mdouble_)); - -/* y0. */ -__MATH_REDIRCALL (y0, , (_Mdouble_)); - -/* j1. */ -__MATH_REDIRCALL (j1, , (_Mdouble_)); - -/* y1. */ -__MATH_REDIRCALL (y1, , (_Mdouble_)); - -/* jn. */ -__MATH_REDIRCALL (jn, , (int, _Mdouble_)); - -/* yn. */ -__MATH_REDIRCALL (yn, , (int, _Mdouble_)); -#endif - -#ifdef __USE_MISC -/* lgamma_r. */ -__MATH_REDIRCALL (lgamma, _r, (_Mdouble_, int *)); -#endif - -/* Redirect __lgammal_r_finite to __lgamma_r_finite when __NO_LONG_DOUBLE_MATH - is set and to itself otherwise. It also redirects __lgamma_r_finite and - __lgammaf_r_finite to themselves. */ -__MATH_REDIRCALL_INTERNAL (lgamma, _r, (_Mdouble_, int *)); - -#if ((defined __USE_XOPEN || defined __USE_ISOC99) \ - && defined __extern_always_inline) -/* lgamma. */ -__extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (lgamma, ) (_Mdouble_ __d)) -{ -# if defined __USE_MISC || defined __USE_XOPEN - return __REDIRTO (lgamma, _r) (__d, &signgam); -# else - int __local_signgam = 0; - return __REDIRTO (lgamma, _r) (__d, &__local_signgam); -# endif -} -#endif - -#if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \ - && defined __extern_always_inline) && !__MATH_DECLARING_FLOATN -/* gamma. */ -__extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (gamma, ) (_Mdouble_ __d)) -{ - return __REDIRTO (lgamma, _r) (__d, &signgam); -} -#endif - -/* log. */ -__MATH_REDIRCALL (log, , (_Mdouble_)); - -/* log10. */ -__MATH_REDIRCALL (log10, , (_Mdouble_)); - -#ifdef __USE_ISOC99 -/* log2. */ -__MATH_REDIRCALL (log2, , (_Mdouble_)); -#endif - -/* pow. */ -__MATH_REDIRCALL (pow, , (_Mdouble_, _Mdouble_)); - -#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 -/* remainder. */ -__MATH_REDIRCALL (remainder, , (_Mdouble_, _Mdouble_)); -#endif - -#if ((__MATH_DECLARING_DOUBLE \ - && (defined __USE_MISC \ - || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))) \ - || (!defined __MATH_DECLARE_LDOUBLE && defined __USE_MISC)) \ - && !__MATH_DECLARING_FLOATN -/* scalb. */ -__MATH_REDIRCALL (scalb, , (_Mdouble_, _Mdouble_)); -#endif - -/* sinh. */ -__MATH_REDIRCALL (sinh, , (_Mdouble_)); - -/* sqrt. */ -__MATH_REDIRCALL (sqrt, , (_Mdouble_)); - -#if defined __USE_ISOC99 && defined __extern_always_inline -/* tgamma. */ -extern _Mdouble_ -__REDIRFROM (__gamma, _r_finite) (_Mdouble_, int *); - -__extern_always_inline _Mdouble_ -__NTH (__REDIRFROM (tgamma, ) (_Mdouble_ __d)) -{ - int __local_signgam = 0; - _Mdouble_ __res = __REDIRTO (gamma, _r) (__d, &__local_signgam); - return __local_signgam < 0 ? -__res : __res; -} -#endif - -#undef __REDIRFROM -#undef __REDIRTO -#undef __MATH_REDIRCALL -#undef __MATH_REDIRCALL_2 -#undef __MATH_REDIRCALL_INTERNAL -#undef __MATH_REDIRCALL_X
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-vector.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-vector.h index 318d3eb..5f964ab 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-vector.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/math-vector.h
@@ -1,5 +1,5 @@ /* Platform-specific SIMD declarations of math functions. - Copyright (C) 2014-2018 Free Software Foundation, Inc. + Copyright (C) 2014-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MATH_H # error "Never include <bits/math-vector.h> directly;\
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-helper-functions.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-helper-functions.h index ac3115b..3c44c78 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-helper-functions.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-helper-functions.h
@@ -1,5 +1,5 @@ /* Prototype declarations for math classification macros helpers. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,30 +14,32 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - + <https://www.gnu.org/licenses/>. */ /* Classify given number. */ -__MATHDECL_1 (int, __fpclassify,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __fpclassify,, (_Mdouble_ __value), fpclassify) __attribute__ ((__const__)); /* Test for negative number. */ -__MATHDECL_1 (int, __signbit,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __signbit,, (_Mdouble_ __value), signbit) __attribute__ ((__const__)); /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int, __isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); /* Return nonzero if VALUE is finite and not NaN. Used by isfinite macro. */ -__MATHDECL_1 (int, __finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int, __isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int, __isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); /* Test equality. */ -__MATHDECL_1 (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y)); +__MATHDECL_ALIAS (int, __iseqsig,, (_Mdouble_ __x, _Mdouble_ __y), iseqsig); /* Test for signaling NaN. */ -__MATHDECL_1 (int, __issignaling,, (_Mdouble_ __value)) +__MATHDECL_ALIAS (int, __issignaling,, (_Mdouble_ __value), issignaling) __attribute__ ((__const__));
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-narrow.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-narrow.h new file mode 100644 index 0000000..4f28f41 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls-narrow.h
@@ -0,0 +1,33 @@ +/* Declare functions returning a narrower type. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _MATH_H +# error "Never include <bits/mathcalls-narrow.h> directly; include <math.h> instead." +#endif + +/* Add. */ +__MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2); + +/* Divide. */ +__MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2); + +/* Multiply. */ +__MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2); + +/* Subtract. */ +__MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2);
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls.h index 9200363..2361dd3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathcalls.h
@@ -1,5 +1,5 @@ /* Prototype declarations for math functions; helper file for <math.h>. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* NOTE: Because of the special way this file is used by <math.h>, this file must NOT be protected from multiple inclusion as header files @@ -109,7 +109,7 @@ /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) /* Compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); #endif @@ -174,12 +174,14 @@ && !__MATH_DECLARING_FLOATN /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ -__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) + __attribute__ ((__const__)); # endif # if !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is finite and not NaN. */ -__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,finite,, (_Mdouble_ __value), finite) + __attribute__ ((__const__)); /* Return the remainder of X/Y. */ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); @@ -198,7 +200,7 @@ #ifdef __USE_ISOC99 /* Return representation of qNaN for double type. */ -__MATHCALLX (nan,, (const char *__tagb), (__const__)); +__MATHCALL (nan,, (const char *__tagb)); #endif @@ -208,7 +210,8 @@ || __MATH_DECLARING_DOUBLE == 0)) /* isnanf or isnanl don't. */ \ && !__MATH_DECLARING_FLOATN /* Return nonzero if VALUE is not a number. */ -__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); +__MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) + __attribute__ ((__const__)); # endif #endif @@ -261,7 +264,7 @@ __MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y)); # endif -# if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN +# if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN /* Return X - epsilon. */ __MATHCALL (nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ @@ -280,7 +283,7 @@ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN /* Like ilogb, but returning long int. */ __MATHDECL (long int, llogb,, (_Mdouble_ __x)); #endif @@ -335,7 +338,7 @@ __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN /* Round X to nearest integer value, rounding halfway cases to even. */ __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__)); @@ -367,16 +370,20 @@ /* Return value with minimum magnitude. */ __MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); -/* Total order operation. */ -__MATHDECL_1 (int, totalorder,, (_Mdouble_ __x, _Mdouble_ __y)) - __attribute__ ((__const__)); - -/* Total order operation on absolute values. */ -__MATHDECL_1 (int, totalordermag,, (_Mdouble_ __x, _Mdouble_ __y)) - __attribute__ ((__const__)); - /* Canonicalize floating-point representation. */ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); +#endif + +#if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN +/* Total order operation. */ +__MATHDECL_1 (int, totalorder,, (const _Mdouble_ *__x, + const _Mdouble_ *__y)) + __attribute_pure__; + +/* Total order operation on absolute values. */ +__MATHDECL_1 (int, totalordermag,, (const _Mdouble_ *__x, + const _Mdouble_ *__y)) + __attribute_pure__; /* Get NaN payload. */ __MATHCALL (getpayload,, (const _Mdouble_ *__x));
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathdef.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathdef.h index 8fbf7e6..765b002 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathdef.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathdef.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _COMPLEX_H # error "Never use <bits/mathdef.h> directly; include <complex.h> instead"
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathinline.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathinline.h deleted file mode 100644 index 02ec21b..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mathinline.h +++ /dev/null
@@ -1,12 +0,0 @@ -/* This file should provide inline versions of math functions. - - Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'. - - This file should define __MATH_INLINES if functions are actually defined as - inlines. */ - -#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__ - -/* Here goes the real code. */ - -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-linux.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-linux.h index e61212a..3b1ae41 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-linux.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-linux.h
@@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux generic version. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman-linux.h> directly; include <sys/mman.h> instead." @@ -42,6 +42,8 @@ #define MAP_SHARED 0x01 /* Share changes. */ #define MAP_PRIVATE 0x02 /* Changes are private. */ #ifdef __USE_MISC +# define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate + extension flags. */ # define MAP_TYPE 0x0f /* Mask for type of mapping. */ #endif @@ -65,12 +67,6 @@ #define MS_SYNC 4 /* Synchronous memory sync. */ #define MS_INVALIDATE 2 /* Invalidate the caches. */ -/* Flags for `mremap'. */ -#ifdef __USE_GNU -# define MREMAP_MAYMOVE 1 -# define MREMAP_FIXED 2 -#endif - /* Advice to `madvise'. */ #ifdef __USE_MISC # define MADV_NORMAL 0 /* No further special treatment. */ @@ -91,6 +87,8 @@ # define MADV_DODUMP 17 /* Clear the MADV_DONTDUMP flag. */ # define MADV_WIPEONFORK 18 /* Zero memory on fork, child only. */ # define MADV_KEEPONFORK 19 /* Undo MADV_WIPEONFORK. */ +# define MADV_COLD 20 /* Deactivate these pages. */ +# define MADV_PAGEOUT 21 /* Reclaim these pages. */ # define MADV_HWPOISON 100 /* Poison a page for testing. */ #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-map-flags-generic.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-map-flags-generic.h new file mode 100644 index 0000000..cadf2d1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-map-flags-generic.h
@@ -0,0 +1,42 @@ +/* Definitions for POSIX memory map interface. Linux/generic version. + Copyright (C) 1997-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MMAN_H +# error "Never use <bits/mman-map-flags-generic.h> directly; include <sys/mman.h> instead." +#endif + +/* These definitions are appropriate for architectures that, in the + Linux kernel, either have no uapi/asm/mman.h, or have one that + includes asm-generic/mman.h without any changes to the values of + the MAP_* flags defined in that header. */ + +#ifdef __USE_MISC +# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ +# define MAP_DENYWRITE 0x00800 /* ETXTBSY. */ +# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ +# define MAP_LOCKED 0x02000 /* Lock the mapping. */ +# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ +# define MAP_STACK 0x20000 /* Allocation is for a stack. */ +# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ +# define MAP_SYNC 0x80000 /* Perform synchronous page + faults for the mapping. */ +# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap + underlying mapping. */ +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-shared.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-shared.h index d15ba95..f336db0 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-shared.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman-shared.h
@@ -1,5 +1,5 @@ /* Memory-mapping-related declarations/definitions, not architecture-specific. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,13 +14,18 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman-shared.h> directly; include <sys/mman.h> instead." #endif #ifdef __USE_GNU +/* Flags for mremap. */ +# define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 +# define MREMAP_DONTUNMAP 4 + /* Flags for memfd_create. */ # ifndef MFD_CLOEXEC # define MFD_CLOEXEC 1U
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman.h index 83ff48c..fe54885 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mman.h
@@ -1,7 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/AArch64 version. - - Copyright (C) 1997-2018 Free Software Foundation, Inc. - + Copyright (C) 2020-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,30 +13,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_MMAN_H # error "Never use <bits/mman.h> directly; include <sys/mman.h> instead." #endif -/* The following definitions basically come from the kernel headers. - But the kernel header is not namespace clean. */ +/* AArch64 specific definitions, should be in sync with + arch/arm64/include/uapi/asm/mman.h. */ -/* These are Linux-specific. */ -#ifdef __USE_MISC -# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */ -# define MAP_DENYWRITE 0x00800 /* ETXTBSY */ -# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */ -# define MAP_LOCKED 0x02000 /* Lock the mapping. */ -# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */ -# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */ -# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ -# define MAP_STACK 0x20000 /* Allocation is for a stack. */ -# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */ -#endif +#define PROT_BTI 0x10 +#define PROT_MTE 0x20 - +#include <bits/mman-map-flags-generic.h> /* Include generic Linux declarations. */ #include <bits/mman-linux.h>
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/monetary-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/monetary-ldbl.h index 8d86782..46629a3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/monetary-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/monetary-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for monetary functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MONETARY_H # error "Never include <bits/monetary-ldbl.h> directly; use <monetary.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue.h index 321e1c3..c64be90 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2018 Free Software Foundation, Inc. +/* Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _MQUEUE_H # error "Never use <bits/mqueue.h> directly; include <mqueue.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue2.h index 95bf8d2..4039443 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/mqueue2.h
@@ -1,5 +1,5 @@ /* Checking macros for mq functions. - Copyright (C) 2007-2018 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _FCNTL_H # error "Never include <bits/mqueue2.h> directly; use <mqueue.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/msq.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/msq.h index 1f57065..3313b69 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/msq.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/msq.h
@@ -1,6 +1,5 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,15 +12,20 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_MSG_H # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." #endif #include <bits/types.h> -#include <bits/wordsize.h> + +/* Types used in the MSQID_DS structure definition. */ +typedef __syscall_ulong_t msgqnum_t; +typedef __syscall_ulong_t msglen_t; + +#include <bits/types/struct_msqid_ds.h> /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ @@ -30,36 +34,6 @@ # define MSG_COPY 040000 /* copy (not remove) all queue messages */ #endif -/* Types used in the structure definition. */ -typedef unsigned long int msgqnum_t; -typedef unsigned long int msglen_t; - -/* Structure of record for one message inside the kernel. - The type `struct msg' is opaque. */ -struct msqid_ds -{ - struct ipc_perm msg_perm; /* structure describing operation permission */ - __time_t msg_stime; /* time of last msgsnd command */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved1; -#endif - __time_t msg_rtime; /* time of last msgrcv command */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved2; -#endif - __time_t msg_ctime; /* time of last change */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved3; -#endif - unsigned long int __msg_cbytes; /* current number of bytes on queue */ - msgqnum_t msg_qnum; /* number of messages currently on queue */ - msglen_t msg_qbytes; /* max number of bytes allowed on queue */ - __pid_t msg_lspid; /* pid of last msgsnd() */ - __pid_t msg_lrpid; /* pid of last msgrcv() */ - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; -}; - #ifdef __USE_MISC # define msg_cbytes __msg_cbytes @@ -67,6 +41,7 @@ /* ipcs ctl commands */ # define MSG_STAT 11 # define MSG_INFO 12 +# define MSG_STAT_ANY 13 /* buffer for msgctl calls IPC_INFO, MSG_INFO */ struct msginfo
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/netdb.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/netdb.h index dcac854..ecabaaa 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/netdb.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/netdb.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _NETDB_H # error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/param.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/param.h index 03486c1..9408786 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/param.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/param.h
@@ -1,5 +1,5 @@ /* Old-style Unix parameters and limits. Linux version. - Copyright (C) 1995-2018 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_PARAM_H # error "Never use <bits/param.h> directly; include <sys/param.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll.h index 4bd9db6..8442d50 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_POLL_H # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll2.h index cc420df..d7320e8 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/poll2.h
@@ -1,5 +1,5 @@ /* Checking macros for poll functions. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_POLL_H # error "Never include <bits/poll2.h> directly; use <sys/poll.h> instead." @@ -36,8 +36,8 @@ sizeof (*__fds), "poll called with fds buffer too small") { - if (__FORTIFY_CALL_CHK && __bos (__fds) != (__SIZE_TYPE__) -1) - return __poll_chk (__fds, __nfds, __timeout, __bos (__fds)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__fds) != (__SIZE_TYPE__) -1) + return __poll_chk (__fds, __nfds, __timeout, __glibc_objsize (__fds)); return __poll_alias (__fds, __nfds, __timeout); } __FORTIFY_FUNCTION_END @@ -59,8 +59,9 @@ "ppoll called with fds buffer too " "small file nfds entries") { - if (__FORTIFY_CALL_CHK && __bos (__fds) != (__SIZE_TYPE__) -1) - return __ppoll_chk (__fds, __nfds, __timeout, __ss, __bos (__fds)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__fds) != (__SIZE_TYPE__) -1) + return __ppoll_chk (__fds, __nfds, __timeout, __ss, + __glibc_objsize (__fds)); return __ppoll_alias (__fds, __nfds, __timeout, __ss); } __FORTIFY_FUNCTION_END
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix1_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix1_lim.h index 90066ff..c645847 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix1_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix1_lim.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h> @@ -24,6 +24,7 @@ #ifndef _BITS_POSIX1_LIM_H #define _BITS_POSIX1_LIM_H 1 +#include <bits/wordsize.h> /* These are the standard-mandated minimum values. */ @@ -161,7 +162,14 @@ #ifndef SSIZE_MAX -# define SSIZE_MAX LONG_MAX +/* ssize_t is not formally required to be the signed type + corresponding to size_t, but it is for all configurations supported + by glibc. */ +# if __WORDSIZE == 64 || __WORDSIZE32_SIZE_ULONG +# define SSIZE_MAX LONG_MAX +# else +# define SSIZE_MAX INT_MAX +# endif #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix2_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix2_lim.h index c460ea2..7ac13cb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix2_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix2_lim.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2018 Free Software Foundation, Inc. +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include this file directly; include <limits.h> instead.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix_opt.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix_opt.h index 2339d4a..4d7d634 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix_opt.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/posix_opt.h
@@ -1,5 +1,5 @@ /* Define POSIX options for Linux. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If - not, see <http://www.gnu.org/licenses/>. */ + not, see <https://www.gnu.org/licenses/>. */ #ifndef _BITS_POSIX_OPT_H #define _BITS_POSIX_OPT_H 1 @@ -25,7 +25,10 @@ /* Processes have a saved set-user-ID and a saved set-group-ID. */ #define _POSIX_SAVED_IDS 1 -/* Priority scheduling is supported. */ +/* Priority scheduling is not supported with the correct semantics, + but GNU/Linux applications expect that the corresponding interfaces + are available, even though the semantics do not meet the POSIX + requirements. See glibc bug 14829. */ #define _POSIX_PRIORITY_SCHEDULING 200809L /* Synchronizing file data is supported. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/printf-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/printf-ldbl.h index d61a682..b4719f3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/printf-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/printf-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for <printf.h> functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _PRINTF_H # error "Never include <bits/printf-ldbl.h> directly; use <printf.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-extra.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-extra.h new file mode 100644 index 0000000..f33b0bb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-extra.h
@@ -0,0 +1,22 @@ +/* Extra sys/procfs.h definitions. Generic Linux version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# error "Never include <bits/procfs-extra.h> directly; use <sys/procfs.h> instead." +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-id.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-id.h new file mode 100644 index 0000000..fd09f2b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-id.h
@@ -0,0 +1,25 @@ +/* Types of pr_uid and pr_gid in struct elf_prpsinfo. Generic Linux version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# error "Never include <bits/procfs-id.h> directly; use <sys/procfs.h> instead." +#endif + +typedef unsigned int __pr_uid_t; +typedef unsigned int __pr_gid_t;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-prregset.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-prregset.h new file mode 100644 index 0000000..f0409f6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs-prregset.h
@@ -0,0 +1,25 @@ +/* Types of prgregset_t and prfpregset_t. Generic Linux version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# error "Never include <bits/procfs-prregset.h> directly; use <sys/procfs.h> instead." +#endif + +typedef elf_gregset_t __prgregset_t; +typedef elf_fpregset_t __prfpregset_t;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs.h new file mode 100644 index 0000000..6b60289 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/procfs.h
@@ -0,0 +1,35 @@ +/* Types for registers for sys/procfs.h. AArch64 version. + Copyright (C) 1996-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_PROCFS_H +# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead." +#endif + +/* Type for a general-purpose register. */ +typedef __uint64_t elf_greg_t; + +/* And the whole bunch of them. We could have used `struct + pt_regs' directly in the typedef, but tradition says that + the register set is an array, which does have some peculiar + semantics, so leave it that way. */ +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof (elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +/* Register set for the floating-point registers. */ +typedef struct user_fpsimd_struct elf_fpregset_t;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes-arch.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes-arch.h index 008aa7e..a0a3077 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes-arch.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes-arch.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2018 Free Software Foundation, Inc. +/* Copyright (C) 2002-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -14,12 +14,12 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_PTHREADTYPES_ARCH_H #define _BITS_PTHREADTYPES_ARCH_H 1 -#include <endian.h> +#include <bits/endian.h> #ifdef __ILP32__ # define __SIZEOF_PTHREAD_ATTR_T 32 @@ -41,31 +41,7 @@ #define __SIZEOF_PTHREAD_COND_T 48 #define __SIZEOF_PTHREAD_RWLOCKATTR_T 8 -/* Definitions for internal mutex struct. */ -#define __PTHREAD_COMPAT_PADDING_MID -#define __PTHREAD_COMPAT_PADDING_END -#define __PTHREAD_MUTEX_LOCK_ELISION 0 -#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 -#define __PTHREAD_MUTEX_USE_UNION 0 - #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT -struct __pthread_rwlock_arch_t -{ - unsigned int __readers; - unsigned int __writers; - unsigned int __wrphase_futex; - unsigned int __writers_futex; - unsigned int __pad3; - unsigned int __pad4; - int __cur_writer; - int __shared; - unsigned long int __pad1; - unsigned long int __pad2; - unsigned int __flags; -}; - -#define __PTHREAD_RWLOCK_ELISION_EXTRA 0 - #endif /* bits/pthreadtypes.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes.h index 70ce0a0..4d4a255 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/pthreadtypes.h
@@ -1,5 +1,5 @@ /* Declaration of common pthread types for all architectures. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_PTHREADTYPES_COMMON_H # define _BITS_PTHREADTYPES_COMMON_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ptrace-shared.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ptrace-shared.h index 03a7791..7d40634 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ptrace-shared.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ptrace-shared.h
@@ -1,6 +1,6 @@ /* `ptrace' debugger support interface. Linux version, not architecture-specific. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_PTRACE_H # error "Never use <bits/ptrace-shared.h> directly; include <sys/ptrace.h> instead." @@ -52,6 +52,15 @@ PTRACE_EVENT_STOP = 128 }; +/* Type of stop for PTRACE_GET_SYSCALL_INFO. */ +enum __ptrace_get_syscall_info_op +{ + PTRACE_SYSCALL_INFO_NONE = 0, + PTRACE_SYSCALL_INFO_ENTRY = 1, + PTRACE_SYSCALL_INFO_EXIT = 2, + PTRACE_SYSCALL_INFO_SECCOMP = 3 +}; + /* Arguments for PTRACE_PEEKSIGINFO. */ struct __ptrace_peeksiginfo_args { @@ -73,6 +82,44 @@ __uint64_t flags; /* Output: filter's flags. */ }; +/* Results of PTRACE_GET_SYSCALL_INFO. */ +struct __ptrace_syscall_info +{ + __uint8_t op; /* One of the enum + __ptrace_get_syscall_info_op + values. */ + __uint32_t arch __attribute__ ((__aligned__ (4))); /* AUDIT_ARCH_* + value. */ + __uint64_t instruction_pointer; /* Instruction pointer. */ + __uint64_t stack_pointer; /* Stack pointer. */ + union + { + /* System call number and arguments, for + PTRACE_SYSCALL_INFO_ENTRY. */ + struct + { + __uint64_t nr; + __uint64_t args[6]; + } entry; + /* System call return value and error flag, for + PTRACE_SYSCALL_INFO_EXIT. */ + struct + { + __int64_t rval; + __uint8_t is_error; + } exit; + /* System call number, arguments and SECCOMP_RET_DATA portion of + SECCOMP_RET_TRACE return value, for + PTRACE_SYSCALL_INFO_SECCOMP. */ + struct + { + __uint64_t nr; + __uint64_t args[6]; + __uint32_t ret_data; + } seccomp; + }; +}; + /* Perform process tracing functions. REQUEST is one of the values above, and determines the action to be taken. For all requests except PTRACE_TRACEME, PID specifies the process to be
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/resource.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/resource.h index fafbadf..6b92df8 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/resource.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/resource.h
@@ -1,5 +1,5 @@ /* Bit values & structures for resource limits. Linux version. - Copyright (C) 1994-2018 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_RESOURCE_H # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." @@ -98,7 +98,7 @@ __RLIMIT_RTPRIO = 14, #define RLIMIT_RTPRIO __RLIMIT_RTPRIO - /* Maximum CPU time in µs that a process scheduled under a real-time + /* Maximum CPU time in microseconds that a process scheduled under a real-time scheduling policy may consume without making a blocking system call before being forcibly descheduled. */ __RLIMIT_RTTIME = 15,
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sched.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sched.h index 24159c5..cd450fd 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sched.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sched.h
@@ -1,6 +1,6 @@ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SCHED_H #define _BITS_SCHED_H 1 @@ -44,6 +44,8 @@ # define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ # define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ # define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ +# define CLONE_PIDFD 0x00001000 /* Set if a pidfd should be placed + in parent. */ # define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ # define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to wake it up on mm_release. */ @@ -71,11 +73,7 @@ # define CLONE_IO 0x80000000 /* Clone I/O context. */ #endif -/* Data structure to describe a process' schedulability. */ -struct sched_param -{ - int sched_priority; -}; +#include <bits/types/struct_sched_param.h> __BEGIN_DECLS @@ -90,6 +88,9 @@ /* Get index of currently used CPU. */ extern int sched_getcpu (void) __THROW; +/* Get currently used CPU and NUMA node. */ +extern int getcpu (unsigned int *, unsigned int *) __THROW; + /* Switch process to namespace of type NSTYPE indicated by FD. */ extern int setns (int __fd, int __nstype) __THROW; #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select.h index 371c5c1..8204bbd 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SELECT_H # error "Never use <bits/select.h> directly; include <sys/select.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select2.h index 7194148..a6dfe68 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/select2.h
@@ -1,5 +1,5 @@ /* Checking macros for select functions. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SELECT_H # error "Never include <bits/select2.h> directly; use <sys/select.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sem.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sem.h index 3d65872..ad13287 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sem.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sem.h
@@ -1,6 +1,5 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,15 +12,16 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SEM_H # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead." #endif #include <sys/types.h> -#include <bits/wordsize.h> +#include <bits/timesize.h> +#include <bits/types/struct_semid_ds.h> /* Flags for `semop'. */ #define SEM_UNDO 0x1000 /* undo the operation on exit */ @@ -35,24 +35,6 @@ #define SETVAL 16 /* set semval */ #define SETALL 17 /* set all semval's */ - -/* Data structure describing a set of semaphores. */ -struct semid_ds -{ - struct ipc_perm sem_perm; /* operation permission struct */ - __time_t sem_otime; /* last semop() time */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved1; -#endif - __time_t sem_ctime; /* last time changed by semctl() */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved2; -#endif - unsigned long int sem_nsems; /* number of semaphores in set */ - unsigned long int __glibc_reserved3; - unsigned long int __glibc_reserved4; -}; - /* The user should define a union like the following to use it for arguments for `semctl'. @@ -74,8 +56,9 @@ /* ipcs ctl cmds */ # define SEM_STAT 18 # define SEM_INFO 19 +# define SEM_STAT_ANY 20 -struct seminfo +struct seminfo { int semmap; int semmni;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/semaphore.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/semaphore.h index 18f8aae..d008e08 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/semaphore.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/semaphore.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2018 Free Software Foundation, Inc. +/* Copyright (C) 2002-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SEMAPHORE_H # error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp.h index 1685f10..008c61a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SETJMP_H #define _BITS_SETJMP_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp2.h index e6e9966..f883f35 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/setjmp2.h
@@ -1,5 +1,5 @@ /* Checking macros for setjmp functions. - Copyright (C) 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SETJMP_H # error "Never include <bits/setjmp2.h> directly; use <setjmp.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shm.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shm.h index ba5174c..a50c79d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shm.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shm.h
@@ -1,6 +1,5 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,8 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SHM_H # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead." @@ -22,6 +21,7 @@ #include <bits/types.h> #include <bits/wordsize.h> +#include <bits/shmlba.h> /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */ @@ -39,43 +39,17 @@ __BEGIN_DECLS -/* Segment low boundary address multiple. */ -#define SHMLBA (__getpagesize ()) -extern int __getpagesize (void) __THROW __attribute__ ((__const__)); - - /* Type to count number of attaches. */ -typedef unsigned long int shmatt_t; +typedef __syscall_ulong_t shmatt_t; -/* Data structure describing a shared memory segment. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __time_t shm_atime; /* time of last shmat() */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved1; -#endif - __time_t shm_dtime; /* time of last shmdt() */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved2; -#endif - __time_t shm_ctime; /* time of last change by shmctl() */ -#if __WORDSIZE == 32 - unsigned long int __glibc_reserved3; -#endif - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - unsigned long int __glibc_reserved4; - unsigned long int __glibc_reserved5; - }; +#include <bits/types/struct_shmid_ds.h> #ifdef __USE_MISC /* ipcs ctl commands */ # define SHM_STAT 13 # define SHM_INFO 14 +# define SHM_STAT_ANY 15 /* shm_mode upper byte flags */ # define SHM_DEST 01000 /* segment will be destroyed on last detach */ @@ -85,25 +59,25 @@ struct shminfo { - unsigned long int shmmax; - unsigned long int shmmin; - unsigned long int shmmni; - unsigned long int shmseg; - unsigned long int shmall; - unsigned long int __glibc_reserved1; - unsigned long int __glibc_reserved2; - unsigned long int __glibc_reserved3; - unsigned long int __glibc_reserved4; + __syscall_ulong_t shmmax; + __syscall_ulong_t shmmin; + __syscall_ulong_t shmmni; + __syscall_ulong_t shmseg; + __syscall_ulong_t shmall; + __syscall_ulong_t __glibc_reserved1; + __syscall_ulong_t __glibc_reserved2; + __syscall_ulong_t __glibc_reserved3; + __syscall_ulong_t __glibc_reserved4; }; struct shm_info { int used_ids; - unsigned long int shm_tot; /* total allocated shm */ - unsigned long int shm_rss; /* total resident shm */ - unsigned long int shm_swp; /* total swapped shm */ - unsigned long int swap_attempts; - unsigned long int swap_successes; + __syscall_ulong_t shm_tot; /* total allocated shm */ + __syscall_ulong_t shm_rss; /* total resident shm */ + __syscall_ulong_t shm_swp; /* total swapped shm */ + __syscall_ulong_t swap_attempts; + __syscall_ulong_t swap_successes; }; #endif /* __USE_MISC */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shmlba.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shmlba.h new file mode 100644 index 0000000..1c682a4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/shmlba.h
@@ -0,0 +1,29 @@ +/* Define SHMLBA. Generic version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead." +#endif + +__BEGIN_DECLS + +/* Segment low boundary address multiple. */ +#define SHMLBA (__getpagesize ()) +extern int __getpagesize (void) __THROW __attribute__ ((__const__)); + +__END_DECLS
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigaction.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigaction.h index fd29373..19c1d87 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigaction.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigaction.h
@@ -1,5 +1,5 @@ /* The proper definitions for Linux's sigaction. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,10 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SIGACTION_H +#define _BITS_SIGACTION_H 1 #ifndef _SIGNAL_H # error "Never include <bits/sigaction.h> directly; use <signal.h> instead." @@ -76,3 +79,5 @@ #define SIG_BLOCK 0 /* Block signals. */ #define SIG_UNBLOCK 1 /* Unblock signals. */ #define SIG_SETMASK 2 /* Set the set of blocked signals. */ + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigcontext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigcontext.h index 4828d59..b153a3c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigcontext.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigcontext.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGCONTEXT_H #define _BITS_SIGCONTEXT_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigevent-consts.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigevent-consts.h index 897b7d2..28589fc 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigevent-consts.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigevent-consts.h
@@ -1,5 +1,5 @@ /* sigevent constants. Linux version. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGEVENT_CONSTS_H #define _BITS_SIGEVENT_CONSTS_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/siginfo-consts.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/siginfo-consts.h index 193bd9c..4803327 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/siginfo-consts.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/siginfo-consts.h
@@ -1,5 +1,5 @@ /* siginfo constants. Linux version. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGINFO_CONSTS_H #define _BITS_SIGINFO_CONSTS_H 1 @@ -35,7 +35,9 @@ enum { SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ - SI_TKILL = -6, /* Sent by tkill. */ + SI_DETHREAD = -7, /* Sent by execve killing subsidiary + threads. */ + SI_TKILL, /* Sent by tkill. */ SI_SIGIO, /* Sent by queued SIGIO. */ #if __SI_ASYNCIO_AFTER_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ @@ -51,6 +53,7 @@ SI_KERNEL = 0x80 /* Send by kernel. */ #define SI_ASYNCNL SI_ASYNCNL +#define SI_DETHREAD SI_DETHREAD #define SI_TKILL SI_TKILL #define SI_SIGIO SI_SIGIO #define SI_ASYNCIO SI_ASYNCIO @@ -81,8 +84,10 @@ # define ILL_PRVREG ILL_PRVREG ILL_COPROC, /* Coprocessor error. */ # define ILL_COPROC ILL_COPROC - ILL_BADSTK /* Internal stack error. */ + ILL_BADSTK, /* Internal stack error. */ # define ILL_BADSTK ILL_BADSTK + ILL_BADIADDR /* Unimplemented instruction address. */ +# define ILL_BADIADDR ILL_BADIADDR }; /* `si_code' values for SIGFPE signal. */ @@ -102,8 +107,12 @@ # define FPE_FLTRES FPE_FLTRES FPE_FLTINV, /* Floating point invalid operation. */ # define FPE_FLTINV FPE_FLTINV - FPE_FLTSUB /* Subscript out of range. */ + FPE_FLTSUB, /* Subscript out of range. */ # define FPE_FLTSUB FPE_FLTSUB + FPE_FLTUNK = 14, /* Undiagnosed floating-point exception. */ +# define FPE_FLTUNK FPE_FLTUNK + FPE_CONDTRAP /* Trap on condition. */ +# define FPE_CONDTRAP FPE_CONDTRAP }; /* `si_code' values for SIGSEGV signal. */ @@ -115,8 +124,18 @@ # define SEGV_ACCERR SEGV_ACCERR SEGV_BNDERR, /* Bounds checking failure. */ # define SEGV_BNDERR SEGV_BNDERR - SEGV_PKUERR /* Protection key checking failure. */ + SEGV_PKUERR, /* Protection key checking failure. */ # define SEGV_PKUERR SEGV_PKUERR + SEGV_ACCADI, /* ADI not enabled for mapped object. */ +# define SEGV_ACCADI SEGV_ACCADI + SEGV_ADIDERR, /* Disrupting MCD error. */ +# define SEGV_ADIDERR SEGV_ADIDERR + SEGV_ADIPERR, /* Precise MCD exception. */ +# define SEGV_ADIPERR SEGV_ADIPERR + SEGV_MTEAERR, /* Asynchronous ARM MTE error. */ +# define SEGV_MTEAERR SEGV_MTEAERR + SEGV_MTESERR /* Synchronous ARM MTE exception. */ +# define SEGV_MTESERR SEGV_MTESERR }; /* `si_code' values for SIGBUS signal. */ @@ -141,8 +160,14 @@ { TRAP_BRKPT = 1, /* Process breakpoint. */ # define TRAP_BRKPT TRAP_BRKPT - TRAP_TRACE /* Process trace trap. */ + TRAP_TRACE, /* Process trace trap. */ # define TRAP_TRACE TRAP_TRACE + TRAP_BRANCH, /* Process taken branch trap. */ +# define TRAP_BRANCH TRAP_BRANCH + TRAP_HWBKPT, /* Hardware breakpoint/watchpoint. */ +# define TRAP_HWBKPT TRAP_HWBKPT + TRAP_UNK /* Undiagnosed trap. */ +# define TRAP_UNK TRAP_UNK }; # endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signal_ext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signal_ext.h new file mode 100644 index 0000000..ca31214 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signal_ext.h
@@ -0,0 +1,31 @@ +/* System-specific extensions of <signal.h>, Linux version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include <bits/signal_ext.h> directly; use <signal.h> instead." +#endif + +#ifdef __USE_GNU + +/* Send SIGNAL to the thread TID in the thread group (process) + identified by TGID. This function behaves like kill, but also + fails with ESRCH if the specified TID does not belong to the + specified thread group. */ +extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal); + +#endif /* __USE_GNU */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signalfd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signalfd.h index 9e5271e..0b81ea1 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signalfd.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signalfd.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2018 Free Software Foundation, Inc. +/* Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SIGNALFD_H # error "Never use <bits/signalfd.h> directly; include <sys/signalfd.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-arch.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-arch.h new file mode 100644 index 0000000..302294c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-arch.h
@@ -0,0 +1,64 @@ +/* Signal number definitions. Linux version. + Copyright (C) 1995-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_SIGNUM_ARCH_H +#define _BITS_SIGNUM_ARCH_H 1 + +#ifndef _SIGNAL_H +#error "Never include <bits/signum-arch.h> directly; use <signal.h> instead." +#endif + +/* Adjustments and additions to the signal number constants for + most Linux systems. */ + +#define SIGSTKFLT 16 /* Stack fault (obsolete). */ +#define SIGPWR 30 /* Power failure imminent. */ + +/* Historical signals specified by POSIX. */ +#define SIGBUS 7 /* Bus error. */ +#define SIGSYS 31 /* Bad system call. */ + +/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ +#define SIGURG 23 /* Urgent data is available at a socket. */ +#define SIGSTOP 19 /* Stop, unblockable. */ +#define SIGTSTP 20 /* Keyboard stop. */ +#define SIGCONT 18 /* Continue. */ +#define SIGCHLD 17 /* Child terminated or stopped. */ +#define SIGTTIN 21 /* Background read from control terminal. */ +#define SIGTTOU 22 /* Background write to control terminal. */ +#define SIGPOLL 29 /* Pollable event occurred (System V). */ +#define SIGXFSZ 25 /* File size limit exceeded. */ +#define SIGXCPU 24 /* CPU time limit exceeded. */ +#define SIGVTALRM 26 /* Virtual timer expired. */ +#define SIGPROF 27 /* Profiling timer expired. */ +#define SIGUSR1 10 /* User-defined signal 1. */ +#define SIGUSR2 12 /* User-defined signal 2. */ + +/* Nonstandard signals found in all modern POSIX systems + (including both BSD and Linux). */ +#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ + +/* Archaic names for compatibility. */ +#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ +#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ +#define SIGCLD SIGCHLD /* Old System V name */ + +#define __SIGRTMIN 32 +#define __SIGRTMAX 64 + +#endif /* <signal.h> included. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-generic.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-generic.h index 8f1044a..4e481c1 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-generic.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum-generic.h
@@ -1,5 +1,5 @@ /* Signal number constants. Generic template. - Copyright (C) 1991-2018 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGNUM_GENERIC_H #define _BITS_SIGNUM_GENERIC_H 1 @@ -57,31 +57,9 @@ #define SIGQUIT 3 /* Quit. */ #define SIGTRAP 5 /* Trace/breakpoint trap. */ #define SIGKILL 9 /* Killed. */ -#define SIGBUS 10 /* Bus error. */ -#define SIGSYS 12 /* Bad system call. */ #define SIGPIPE 13 /* Broken pipe. */ #define SIGALRM 14 /* Alarm clock. */ -/* New(er) POSIX signals (1003.1-2008, 1003.1-2013). */ -#define SIGURG 16 /* Urgent data is available at a socket. */ -#define SIGSTOP 17 /* Stop, unblockable. */ -#define SIGTSTP 18 /* Keyboard stop. */ -#define SIGCONT 19 /* Continue. */ -#define SIGCHLD 20 /* Child terminated or stopped. */ -#define SIGTTIN 21 /* Background read from control terminal. */ -#define SIGTTOU 22 /* Background write to control terminal. */ -#define SIGPOLL 23 /* Pollable event occurred (System V). */ -#define SIGXCPU 24 /* CPU time limit exceeded. */ -#define SIGXFSZ 25 /* File size limit exceeded. */ -#define SIGVTALRM 26 /* Virtual timer expired. */ -#define SIGPROF 27 /* Profiling timer expired. */ -#define SIGUSR1 30 /* User-defined signal 1. */ -#define SIGUSR2 31 /* User-defined signal 2. */ - -/* Nonstandard signals found in all modern POSIX systems - (including both BSD and Linux). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ - /* Archaic names for compatibility. */ #define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */ #define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP-11. */ @@ -93,8 +71,9 @@ but some real-time signals may be used internally by glibc. Do not use these constants in application code; use SIGRTMIN and SIGRTMAX (defined in signal.h) instead. */ -#define __SIGRTMIN 32 -#define __SIGRTMAX __SIGRTMIN + +/* Include system specific bits. */ +#include <bits/signum-arch.h> /* Biggest signal number + 1 (including real-time signals). */ #define _NSIG (__SIGRTMAX + 1)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum.h deleted file mode 100644 index 0f70ce5..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/signum.h +++ /dev/null
@@ -1,58 +0,0 @@ -/* Signal number definitions. Linux version. - Copyright (C) 1995-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _BITS_SIGNUM_H -#define _BITS_SIGNUM_H 1 - -#ifndef _SIGNAL_H -#error "Never include <bits/signum.h> directly; use <signal.h> instead." -#endif - -#include <bits/signum-generic.h> - -/* Adjustments and additions to the signal number constants for - most Linux systems. */ - -#define SIGSTKFLT 16 /* Stack fault (obsolete). */ -#define SIGPWR 30 /* Power failure imminent. */ - -#undef SIGBUS -#define SIGBUS 7 -#undef SIGUSR1 -#define SIGUSR1 10 -#undef SIGUSR2 -#define SIGUSR2 12 -#undef SIGCHLD -#define SIGCHLD 17 -#undef SIGCONT -#define SIGCONT 18 -#undef SIGSTOP -#define SIGSTOP 19 -#undef SIGTSTP -#define SIGTSTP 20 -#undef SIGURG -#define SIGURG 23 -#undef SIGPOLL -#define SIGPOLL 29 -#undef SIGSYS -#define SIGSYS 31 - -#undef __SIGRTMAX -#define __SIGRTMAX 64 - -#endif /* <signal.h> included. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigstack.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigstack.h index 712f3da..f317cb6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigstack.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigstack.h
@@ -1,5 +1,5 @@ /* sigstack, sigaltstack definitions. - Copyright (C) 2015-2018 Free Software Foundation, Inc. + Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGSTACK_H #define _BITS_SIGSTACK_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigthread.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigthread.h index b1fb615..8779a4b 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigthread.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sigthread.h
@@ -1,5 +1,5 @@ /* Signal handling function for threaded programs. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; see the file COPYING.LIB. If - not, see <http://www.gnu.org/licenses/>. */ + not, see <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SIGTHREAD_H #define _BITS_SIGTHREAD_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sockaddr.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sockaddr.h index edf36c2..90c5bfb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sockaddr.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sockaddr.h
@@ -1,5 +1,5 @@ /* Definition of struct sockaddr_* common members and sizes, generic version. - Copyright (C) 1995-2018 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <sys/socket.h> instead.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket-constants.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket-constants.h new file mode 100644 index 0000000..84f7a33 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket-constants.h
@@ -0,0 +1,50 @@ +/* Socket constants which vary among Linux architectures. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SOCKET_H +# error "Never include <bits/socket-constants.h> directly; use <sys/socket.h> instead." +#endif + +#include <bits/timesize.h> + +#define SOL_SOCKET 1 +#define SO_ACCEPTCONN 30 +#define SO_BROADCAST 6 +#define SO_DONTROUTE 5 +#define SO_ERROR 4 +#define SO_KEEPALIVE 9 +#define SO_LINGER 13 +#define SO_OOBINLINE 10 +#define SO_RCVBUF 8 +#define SO_RCVLOWAT 18 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_RCVTIMEO 66 +#else +# define SO_RCVTIMEO 20 +#endif +#define SO_REUSEADDR 2 +#define SO_SNDBUF 7 +#define SO_SNDLOWAT 19 +#if (__TIMESIZE == 64 && __WORDSIZE == 32 \ + && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) +# define SO_SNDTIMEO 67 +#else +# define SO_SNDTIMEO 21 +#endif +#define SO_TYPE 3
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket.h index fa409f0..a011a8c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket.h
@@ -1,5 +1,5 @@ /* System-specific socket constants and types. Linux version. - Copyright (C) 1991-2018 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __BITS_SOCKET_H #define __BITS_SOCKET_H @@ -85,7 +85,8 @@ #define PF_KCM 41 /* Kernel Connection Multiplexor. */ #define PF_QIPCRTR 42 /* Qualcomm IPC Router. */ #define PF_SMC 43 /* SMC sockets. */ -#define PF_MAX 44 /* For now.. */ +#define PF_XDP 44 /* XDP sockets. */ +#define PF_MAX 45 /* For now.. */ /* Address families. */ #define AF_UNSPEC PF_UNSPEC @@ -135,6 +136,7 @@ #define AF_KCM PF_KCM #define AF_QIPCRTR PF_QIPCRTR #define AF_SMC PF_SMC +#define AF_XDP PF_XDP #define AF_MAX PF_MAX /* Socket level values. Others are defined in the appropriate headers. @@ -164,9 +166,10 @@ #define SOL_NFC 280 #define SOL_KCM 281 #define SOL_TLS 282 +#define SOL_XDP 283 /* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 +#define SOMAXCONN 4096 /* Get the definition of the macro to define the common sockaddr members. */ #include <bits/sockaddr.h> @@ -346,98 +349,12 @@ }; #endif -/* Ugly workaround for unclean kernel headers. */ -#ifndef __USE_MISC -# ifndef FIOGETOWN -# define __SYS_SOCKET_H_undef_FIOGETOWN -# endif -# ifndef FIOSETOWN -# define __SYS_SOCKET_H_undef_FIOSETOWN -# endif -# ifndef SIOCATMARK -# define __SYS_SOCKET_H_undef_SIOCATMARK -# endif -# ifndef SIOCGPGRP -# define __SYS_SOCKET_H_undef_SIOCGPGRP -# endif -# ifndef SIOCGSTAMP -# define __SYS_SOCKET_H_undef_SIOCGSTAMP -# endif -# ifndef SIOCGSTAMPNS -# define __SYS_SOCKET_H_undef_SIOCGSTAMPNS -# endif -# ifndef SIOCSPGRP -# define __SYS_SOCKET_H_undef_SIOCSPGRP -# endif -#endif -#ifndef IOCSIZE_MASK -# define __SYS_SOCKET_H_undef_IOCSIZE_MASK -#endif -#ifndef IOCSIZE_SHIFT -# define __SYS_SOCKET_H_undef_IOCSIZE_SHIFT -#endif -#ifndef IOC_IN -# define __SYS_SOCKET_H_undef_IOC_IN -#endif -#ifndef IOC_INOUT -# define __SYS_SOCKET_H_undef_IOC_INOUT -#endif -#ifndef IOC_OUT -# define __SYS_SOCKET_H_undef_IOC_OUT -#endif - -/* Get socket manipulation related informations from kernel headers. */ -#include <asm/socket.h> - -#ifndef __USE_MISC -# ifdef __SYS_SOCKET_H_undef_FIOGETOWN -# undef __SYS_SOCKET_H_undef_FIOGETOWN -# undef FIOGETOWN -# endif -# ifdef __SYS_SOCKET_H_undef_FIOSETOWN -# undef __SYS_SOCKET_H_undef_FIOSETOWN -# undef FIOSETOWN -# endif -# ifdef __SYS_SOCKET_H_undef_SIOCATMARK -# undef __SYS_SOCKET_H_undef_SIOCATMARK -# undef SIOCATMARK -# endif -# ifdef __SYS_SOCKET_H_undef_SIOCGPGRP -# undef __SYS_SOCKET_H_undef_SIOCGPGRP -# undef SIOCGPGRP -# endif -# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP -# undef __SYS_SOCKET_H_undef_SIOCGSTAMP -# undef SIOCGSTAMP -# endif -# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS -# undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS -# undef SIOCGSTAMPNS -# endif -# ifdef __SYS_SOCKET_H_undef_SIOCSPGRP -# undef __SYS_SOCKET_H_undef_SIOCSPGRP -# undef SIOCSPGRP -# endif -#endif -#ifdef __SYS_SOCKET_H_undef_IOCSIZE_MASK -# undef __SYS_SOCKET_H_undef_IOCSIZE_MASK -# undef IOCSIZE_MASK -#endif -#ifdef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT -# undef __SYS_SOCKET_H_undef_IOCSIZE_SHIFT -# undef IOCSIZE_SHIFT -#endif -#ifdef __SYS_SOCKET_H_undef_IOC_IN -# undef __SYS_SOCKET_H_undef_IOC_IN -# undef IOC_IN -#endif -#ifdef __SYS_SOCKET_H_undef_IOC_INOUT -# undef __SYS_SOCKET_H_undef_IOC_INOUT -# undef IOC_INOUT -#endif -#ifdef __SYS_SOCKET_H_undef_IOC_OUT -# undef __SYS_SOCKET_H_undef_IOC_OUT -# undef IOC_OUT +#ifdef __USE_MISC +# include <bits/types/time_t.h> +# include <asm/socket.h> +#else +# define SO_DEBUG 1 +# include <bits/socket-constants.h> #endif /* Structure used to manipulate the SO_LINGER option. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket2.h index f2063dd..797449d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket2.h
@@ -1,5 +1,5 @@ /* Checking macros for socket functions. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SOCKET_H # error "Never include <bits/socket2.h> directly; use <sys/socket.h> instead." @@ -33,8 +33,8 @@ "recv called with bigger length than " "size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__buf) != (size_t) -1) - return __recv_chk (__fd, __buf, __n, __bos0 (__buf), __flags); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__buf) != (size_t) -1) + return __recv_chk (__fd, __buf, __n, __glibc_objsize0 (__buf), __flags); return __recv_alias (__fd, __buf, __n, __flags); } __FORTIFY_FUNCTION_END @@ -57,9 +57,9 @@ "recvfrom called with bigger length " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__buf) != (size_t) -1) - return __recvfrom_chk (__fd, __buf, __n, __bos0 (__buf), __flags, __addr, - __addr_len); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__buf) != (size_t) -1) + return __recvfrom_chk (__fd, __buf, __n, __glibc_objsize0 (__buf), __flags, + __addr, __addr_len); return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); } __FORTIFY_FUNCTION_END
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket_type.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket_type.h index 035394a..9cb243c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket_type.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/socket_type.h
@@ -1,5 +1,5 @@ /* Define enum __socket_type for generic Linux. - Copyright (C) 1991-2018 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SOCKET_H # error "Never include <bits/socket_type.h> directly; use <sys/socket.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ss_flags.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ss_flags.h index f7fb9d0..8dc676d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ss_flags.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ss_flags.h
@@ -1,5 +1,5 @@ /* ss_flags values for stack_t. Linux version. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SS_FLAGS_H #define _BITS_SS_FLAGS_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stab.def b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stab.def index ab44580..5c72900 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stab.def +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stab.def
@@ -1,5 +1,5 @@ /* Table of DBX symbol codes for the GNU system. - Copyright (C) 1988, 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1988, 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* This contains contribution from Cygnus Support. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stat.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stat.h index 08e86ef..31868c8 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stat.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stat.h
@@ -1,6 +1,5 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -13,8 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ #if !defined _SYS_STAT_H && !defined _FCNTL_H # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead." @@ -23,117 +22,7 @@ #ifndef _BITS_STAT_H #define _BITS_STAT_H 1 -#include <endian.h> -#include <bits/wordsize.h> - -/* 64-bit libc uses the kernel's 'struct stat', accessed via the - stat() syscall; 32-bit libc uses the kernel's 'struct stat64' - and accesses it via the stat64() syscall. All the various - APIs offered by libc use the kernel shape for their struct stat - structure; the only difference is that 32-bit programs not - using __USE_FILE_OFFSET64 only see the low 32 bits of some - of the fields (specifically st_ino, st_size, and st_blocks). */ -#define _STAT_VER_KERNEL 0 -#define _STAT_VER_LINUX 0 -#define _STAT_VER _STAT_VER_KERNEL - -/* Versions of the `xmknod' interface. */ -#define _MKNOD_VER_LINUX 0 - -#if defined __USE_FILE_OFFSET64 -# define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 -# define __field64(type, type64, name) type name -#elif __BYTE_ORDER == __LITTLE_ENDIAN -# define __field64(type, type64, name) \ - type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad -#else -# define __field64(type, type64, name) \ - int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name -#endif - -struct stat - { - __dev_t st_dev; /* Device. */ - __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the <sys/stat.h> header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -# define st_atime st_atim.tv_sec /* Backward compatibility. */ -# define st_mtime st_mtim.tv_sec -# define st_ctime st_ctim.tv_sec -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; - -#undef __field64 - -#ifdef __USE_LARGEFILE64 -struct stat64 - { - __dev_t st_dev; /* Device. */ - __ino64_t st_ino; /* File serial number. */ - __mode_t st_mode; /* File mode. */ - __nlink_t st_nlink; /* Link count. */ - __uid_t st_uid; /* User ID of the file's owner. */ - __gid_t st_gid; /* Group ID of the file's group.*/ - __dev_t st_rdev; /* Device number, if device. */ - __dev_t __pad1; - __off64_t st_size; /* Size of file, in bytes. */ - __blksize_t st_blksize; /* Optimal block size for I/O. */ - int __pad2; - __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ -#ifdef __USE_XOPEN2K8 - /* Nanosecond resolution timestamps are stored in a format - equivalent to 'struct timespec'. This is the type used - whenever possible but the Unix namespace rules do not allow the - identifier 'timespec' to appear in the <sys/stat.h> header. - Therefore we have to handle the use of this header in strictly - standard-compliant sources special. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ -#else - __time_t st_atime; /* Time of last access. */ - unsigned long int st_atimensec; /* Nscecs of last access. */ - __time_t st_mtime; /* Time of last modification. */ - unsigned long int st_mtimensec; /* Nsecs of last modification. */ - __time_t st_ctime; /* Time of last status change. */ - unsigned long int st_ctimensec; /* Nsecs of last status change. */ -#endif - int __glibc_reserved[2]; - }; -#endif - -/* Tell code we have these members. */ -#define _STATBUF_ST_BLKSIZE -#define _STATBUF_ST_RDEV -/* Nanosecond resolution time values are supported. */ -#define _STATBUF_ST_NSEC +#include <bits/struct_stat.h> /* Encoding of the file mode. */ @@ -168,4 +57,4 @@ # define UTIME_OMIT ((1l << 30) - 2l) #endif -#endif /* bits/stat.h */ +#endif /* bits/stat.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statfs.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statfs.h index 846dd5f..bef18a3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statfs.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statfs.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2018 Free Software Foundation, Inc. +/* Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -14,13 +14,13 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_STATFS_H # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead." #endif -#include <endian.h> +#include <bits/endian.h> #include <bits/types.h> #include <bits/wordsize.h> @@ -34,7 +34,7 @@ #if defined __USE_FILE_OFFSET64 # define __field64(type, type64, name) type64 name -#elif __WORDSIZE == 64 +#elif __WORDSIZE == 64 || __STATFS_MATCHES_STATFS64 # define __field64(type, type64, name) type name #elif __BYTE_ORDER == __LITTLE_ENDIAN # define __field64(type, type64, name) \
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statvfs.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statvfs.h index 0d95901..8d5db12 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statvfs.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statvfs.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_STATVFS_H # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx-generic.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx-generic.h new file mode 100644 index 0000000..f8b0f4d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx-generic.h
@@ -0,0 +1,64 @@ +/* Generic statx-related definitions and declarations. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +/* This interface is based on <linux/stat.h> in Linux. */ + +#ifndef _SYS_STAT_H +# error Never include <bits/statx-generic.h> directly, include <sys/stat.h> instead. +#endif + +#include <bits/types/struct_statx_timestamp.h> +#include <bits/types/struct_statx.h> + +#ifndef STATX_TYPE +# define STATX_TYPE 0x0001U +# define STATX_MODE 0x0002U +# define STATX_NLINK 0x0004U +# define STATX_UID 0x0008U +# define STATX_GID 0x0010U +# define STATX_ATIME 0x0020U +# define STATX_MTIME 0x0040U +# define STATX_CTIME 0x0080U +# define STATX_INO 0x0100U +# define STATX_SIZE 0x0200U +# define STATX_BLOCKS 0x0400U +# define STATX_BASIC_STATS 0x07ffU +# define STATX_ALL 0x0fffU +# define STATX_BTIME 0x0800U +# define STATX_MNT_ID 0x1000U +# define STATX__RESERVED 0x80000000U + +# define STATX_ATTR_COMPRESSED 0x0004 +# define STATX_ATTR_IMMUTABLE 0x0010 +# define STATX_ATTR_APPEND 0x0020 +# define STATX_ATTR_NODUMP 0x0040 +# define STATX_ATTR_ENCRYPTED 0x0800 +# define STATX_ATTR_AUTOMOUNT 0x1000 +# define STATX_ATTR_MOUNT_ROOT 0x2000 +# define STATX_ATTR_VERITY 0x100000 +# define STATX_ATTR_DAX 0x200000 +#endif /* !STATX_TYPE */ + +__BEGIN_DECLS + +/* Fill *BUF with information about PATH in DIRFD. */ +int statx (int __dirfd, const char *__restrict __path, int __flags, + unsigned int __mask, struct statx *__restrict __buf) + __THROW __nonnull ((2, 5)); + +__END_DECLS
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx.h new file mode 100644 index 0000000..baa37d1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/statx.h
@@ -0,0 +1,39 @@ +/* statx-related definitions and declarations. Linux version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +/* This interface is based on <linux/stat.h> in Linux. */ + +#ifndef _SYS_STAT_H +# error Never include <bits/statx.h> directly, include <sys/stat.h> instead. +#endif + +/* Use the Linux kernel header if available. */ + +/* Use "" to work around incorrect macro expansion of the + __has_include argument (GCC PR 80005). */ +#ifdef __has_include +# if __has_include ("linux/stat.h") +# include "linux/stat.h" +# ifdef STATX_TYPE +# define __statx_timestamp_defined 1 +# define __statx_defined 1 +# endif +# endif +#endif + +#include <bits/statx-generic.h>
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-intn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-intn.h index de1ffcc..8a1cf5d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-intn.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-intn.h
@@ -1,5 +1,5 @@ /* Define intN_t types. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_STDINT_INTN_H #define _BITS_STDINT_INTN_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-uintn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-uintn.h index 350b65b..a4fca46 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-uintn.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdint-uintn.h
@@ -1,5 +1,5 @@ /* Define uintN_t types. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_STDINT_UINTN_H #define _BITS_STDINT_UINTN_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio-ldbl.h index 99d9bcc..067a2fb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for stdio functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _STDIO_H # error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead." @@ -26,12 +26,18 @@ __LDBL_REDIR_DECL (vfprintf) __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) -#if defined __USE_ISOC99 && !defined __USE_GNU \ - && !defined __REDIRECT \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) +#if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128) +__LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128) +__LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #else __LDBL_REDIR_DECL (fscanf) __LDBL_REDIR_DECL (scanf) @@ -44,11 +50,18 @@ #endif #ifdef __USE_ISOC99 -# if !defined __USE_GNU && !defined __REDIRECT \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) +# if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128) +__LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128) +__LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfscanf) __LDBL_REDIR_DECL (vsscanf) @@ -63,33 +76,33 @@ #ifdef __USE_GNU __LDBL_REDIR_DECL (vasprintf) -__LDBL_REDIR_DECL (__asprintf) +__LDBL_REDIR2_DECL (asprintf) __LDBL_REDIR_DECL (asprintf) __LDBL_REDIR_DECL (obstack_printf) __LDBL_REDIR_DECL (obstack_vprintf) #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__sprintf_chk) -__LDBL_REDIR_DECL (__vsprintf_chk) +__LDBL_REDIR2_DECL (sprintf_chk) +__LDBL_REDIR2_DECL (vsprintf_chk) # if defined __USE_ISOC99 || defined __USE_UNIX98 -__LDBL_REDIR_DECL (__snprintf_chk) -__LDBL_REDIR_DECL (__vsnprintf_chk) +__LDBL_REDIR2_DECL (snprintf_chk) +__LDBL_REDIR2_DECL (vsnprintf_chk) # endif # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fprintf_chk) -__LDBL_REDIR_DECL (__printf_chk) -__LDBL_REDIR_DECL (__vfprintf_chk) -__LDBL_REDIR_DECL (__vprintf_chk) +__LDBL_REDIR2_DECL (fprintf_chk) +__LDBL_REDIR2_DECL (printf_chk) +__LDBL_REDIR2_DECL (vfprintf_chk) +__LDBL_REDIR2_DECL (vprintf_chk) # ifdef __USE_XOPEN2K8 -__LDBL_REDIR_DECL (__dprintf_chk) -__LDBL_REDIR_DECL (__vdprintf_chk) +__LDBL_REDIR2_DECL (dprintf_chk) +__LDBL_REDIR2_DECL (vdprintf_chk) # endif # ifdef __USE_GNU -__LDBL_REDIR_DECL (__asprintf_chk) -__LDBL_REDIR_DECL (__vasprintf_chk) -__LDBL_REDIR_DECL (__obstack_printf_chk) -__LDBL_REDIR_DECL (__obstack_vprintf_chk) +__LDBL_REDIR2_DECL (asprintf_chk) +__LDBL_REDIR2_DECL (vasprintf_chk) +__LDBL_REDIR2_DECL (obstack_printf_chk) +__LDBL_REDIR2_DECL (obstack_vprintf_chk) # endif # endif #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio.h index d287083..b56fcb0 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio.h
@@ -1,5 +1,5 @@ /* Optimizing macros and inline functions for stdio functions. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,10 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_STDIO_H +#define _BITS_STDIO_H 1 #ifndef _STDIO_H # error "Never include <bits/stdio.h> directly; use <stdio.h> instead." @@ -28,12 +31,12 @@ #ifdef __USE_EXTERN_INLINES -/* For -D_FORTIFY_SOURCE{,=2} bits/stdio2.h will define a different +/* For -D_FORTIFY_SOURCE{,=2,=3} bits/stdio2.h will define a different inline. */ # if !(__USE_FORTIFY_LEVEL > 0 && defined __fortify_function) /* Write formatted output to stdout from argument list ARG. */ __STDIO_INLINE int -vprintf (const char *__restrict __fmt, _G_va_list __arg) +vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } @@ -43,7 +46,7 @@ __STDIO_INLINE int getchar (void) { - return _IO_getc (stdin); + return getc (stdin); } @@ -52,24 +55,24 @@ __STDIO_INLINE int fgetc_unlocked (FILE *__fp) { - return _IO_getc_unlocked (__fp); + return __getc_unlocked_body (__fp); } # endif /* misc */ -# ifdef __USE_POSIX +# ifdef __USE_POSIX199506 /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int getc_unlocked (FILE *__fp) { - return _IO_getc_unlocked (__fp); + return __getc_unlocked_body (__fp); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int getchar_unlocked (void) { - return _IO_getc_unlocked (stdin); + return __getc_unlocked_body (stdin); } # endif /* POSIX */ @@ -78,7 +81,7 @@ __STDIO_INLINE int putchar (int __c) { - return _IO_putc (__c, stdout); + return putc (__c, stdout); } @@ -87,31 +90,31 @@ __STDIO_INLINE int fputc_unlocked (int __c, FILE *__stream) { - return _IO_putc_unlocked (__c, __stream); + return __putc_unlocked_body (__c, __stream); } # endif /* misc */ -# ifdef __USE_POSIX +# ifdef __USE_POSIX199506 /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int putc_unlocked (int __c, FILE *__stream) { - return _IO_putc_unlocked (__c, __stream); + return __putc_unlocked_body (__c, __stream); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int putchar_unlocked (int __c) { - return _IO_putc_unlocked (__c, stdout); + return __putc_unlocked_body (__c, stdout); } # endif /* POSIX */ # ifdef __USE_GNU /* Like `getdelim', but reads up to a newline. */ -__STDIO_INLINE _IO_ssize_t +__STDIO_INLINE __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { return __getdelim (__lineptr, __n, '\n', __stream); @@ -124,14 +127,14 @@ __STDIO_INLINE int __NTH (feof_unlocked (FILE *__stream)) { - return _IO_feof_unlocked (__stream); + return __feof_unlocked_body (__stream); } /* Faster versions when locking is not required. */ __STDIO_INLINE int __NTH (ferror_unlocked (FILE *__stream)) { - return _IO_ferror_unlocked (__stream); + return __ferror_unlocked_body (__stream); } # endif /* misc */ @@ -151,7 +154,7 @@ for (__cnt = (size_t) (size) * (size_t) (n); \ __cnt > 0; --__cnt) \ { \ - int __c = _IO_getc_unlocked (__stream); \ + int __c = getc_unlocked (__stream); \ if (__c == EOF) \ break; \ *__ptr++ = __c; \ @@ -174,7 +177,7 @@ size_t __cnt; \ for (__cnt = (size_t) (size) * (size_t) (n); \ __cnt > 0; --__cnt) \ - if (_IO_putc_unlocked (*__ptr++, __stream) == EOF) \ + if (putc_unlocked (*__ptr++, __stream) == EOF) \ break; \ ((size_t) (size) * (size_t) (n) - __cnt) \ / (size_t) (size); }) \ @@ -188,3 +191,5 @@ /* Define helper macro. */ #undef __STDIO_INLINE + +#endif /* bits/stdio.h. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio2.h index 6dd04fc..d5d3570 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio2.h
@@ -1,5 +1,5 @@ /* Checking macros for stdio functions. - Copyright (C) 2004-2018 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,17 +14,22 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_STDIO2_H +#define _BITS_STDIO2_H 1 #ifndef _STDIO_H # error "Never include <bits/stdio2.h> directly; use <stdio.h> instead." #endif extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, - const char *__restrict __format, ...) __THROW; + const char *__restrict __format, ...) __THROW + __attr_access ((__write_only__, 1, 3)); extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, - _G_va_list __ap) __THROW; + __gnuc_va_list __ap) __THROW + __attr_access ((__write_only__, 1, 3)); #define __mul_may_overflow(size, n) \ ((size | n) >= (((size_t)1) << (8 * sizeof (size_t) / 2))) @@ -39,33 +44,34 @@ __FORTIFY_INIT_ARG_PACK(__fmt); int __result = __FORTIFY_CALL_VA_BUILTIN (sprintf, __s, __USE_FORTIFY_LEVEL - 1, - __bos (__s), __fmt, + __glibc_objsize (__s), __fmt, __FORTIFY_ARG_PACK); __FORTIFY_FREE_ARG_PACK(); return __result; } #elif !defined __cplusplus # define sprintf(str, ...) \ - __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, __bos (str), \ - __VA_ARGS__) + __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, \ + __glibc_objsize (str), __VA_ARGS__) #endif __fortify_potential_overload int __NTH (vsprintf (char *__restrict const __clang_pass_object_size __s, - const char *__restrict __fmt, _G_va_list __ap)) + const char *__restrict __fmt, __gnuc_va_list __ap)) { return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, - __bos (__s), __fmt, __ap); + __glibc_objsize (__s), __fmt, __ap); } #if defined __USE_ISOC99 || defined __USE_UNIX98 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, - ...) __THROW; + ...) __THROW + __attr_access ((__write_only__, 1, 2)); extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, - _G_va_list __ap) __THROW; + __gnuc_va_list __ap) __THROW; # ifdef __FORTIFY_ARG_PACK_OK __fortify_potential_overload __attribute__ ((__format__ (__printf__, 3, 4))) int @@ -78,26 +84,26 @@ __FORTIFY_INIT_ARG_PACK(__fmt); int __result = __FORTIFY_CALL_VA_BUILTIN (snprintf, __s, __n, __USE_FORTIFY_LEVEL - 1, - __bos (__s), __fmt, + __glibc_objsize (__s), __fmt, __FORTIFY_ARG_PACK); __FORTIFY_FREE_ARG_PACK(); return __result; } # elif !defined __cplusplus # define snprintf(str, len, ...) \ - __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ - __VA_ARGS__) + __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, \ + __glibc_objsize (str), __VA_ARGS__) # endif __fortify_potential_overload __attribute__ ((__format__ (__printf__, 3, 0))) int __NTH (vsnprintf (char *__restrict const __clang_pass_object_size __s, - size_t __n, const char *__restrict __fmt, _G_va_list __ap)) + size_t __n, const char *__restrict __fmt, __gnuc_va_list __ap)) __clang_warning_if (__bos_static_lt (__n, __s), "call to vsnprintf may overflow the destination " "buffer") { return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, - __bos (__s), __fmt, __ap); + __glibc_objsize (__s), __fmt, __ap); } #endif @@ -108,9 +114,9 @@ const char *__restrict __format, ...); extern int __printf_chk (int __flag, const char *__restrict __format, ...); extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, - const char *__restrict __format, _G_va_list __ap); + const char *__restrict __format, __gnuc_va_list __ap); extern int __vprintf_chk (int __flag, const char *__restrict __format, - _G_va_list __ap); + __gnuc_va_list __ap); # ifdef __FORTIFY_ARG_PACK_OK __fortify_potential_overload __attribute__ ((__format__ (__printf__, 2, 3))) int @@ -143,7 +149,7 @@ __fortify_potential_overload __attribute__ ((__format__ (__printf__, 1, 0))) int vprintf (const char *__restrict const __clang_pass_object_size __fmt, - _G_va_list __ap) + __gnuc_va_list __ap) { # ifdef __USE_EXTERN_INLINES return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); @@ -154,7 +160,7 @@ __fortify_potential_overload __attribute__ ((__format__ (__printf__, 2, 0))) int vfprintf (FILE *__restrict const __clang_pass_object_size __stream, - const char *__restrict __fmt, _G_va_list __ap) + const char *__restrict __fmt, __gnuc_va_list __ap) { return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } @@ -163,7 +169,7 @@ extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int __vdprintf_chk (int __fd, int __flag, - const char *__restrict __fmt, _G_va_list __arg) + const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); # ifdef __FORTIFY_ARG_PACK_OK @@ -185,7 +191,7 @@ __fortify_potential_overload __attribute__ ((__format__ (__printf__, 2, 0))) int vdprintf (int __fd, const char *__restrict const __clang_pass_object_size __fmt, - _G_va_list __ap) + __gnuc_va_list __ap) { return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } @@ -197,7 +203,7 @@ const char *__restrict __fmt, ...) __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur; extern int __vasprintf_chk (char **__restrict __ptr, int __flag, - const char *__restrict __fmt, _G_va_list __arg) + const char *__restrict __fmt, __gnuc_va_list __arg) __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur; extern int __obstack_printf_chk (struct obstack *__restrict __obstack, int __flag, const char *__restrict __format, @@ -206,7 +212,7 @@ extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack, int __flag, const char *__restrict __format, - _G_va_list __args) + __gnuc_va_list __args) __THROW __attribute__ ((__format__ (__printf__, 3, 0))); # ifdef __FORTIFY_ARG_PACK_OK @@ -265,15 +271,15 @@ __fortify_potential_overload __attribute__ ((__format__ (__printf__, 2, 0))) __wur int __NTH (vasprintf (char **__restrict const __clang_pass_object_size __ptr, - const char *__restrict __fmt, _G_va_list __ap)) + const char *__restrict __fmt, __gnuc_va_list __ap)) { return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); } __fortify_potential_overload __attribute__ ((__format__ (__printf__, 2, 0))) int __NTH (obstack_vprintf (struct obstack * - __restrict const __clang_pass_object_size __obstack, - const char *__restrict __fmt, _G_va_list __ap)) + __restrict const __clang_pass_object_size __obstack, + const char *__restrict __fmt, __gnuc_va_list __ap)) { return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt, __ap); @@ -290,24 +296,26 @@ __fortify_potential_overload __wur char * gets (char *const __clang_pass_object_size __str) __FORTIFY_PRECONDITIONS - __FORTIFY_WARNING_IF (__gets_warn, __bos (__str) == (size_t) -1, + __FORTIFY_WARNING_IF (__gets_warn, __glibc_objsize (__str) == (size_t) -1, "please use fgets or getline instead, gets can't " "specify buffer size") { - if (__bos (__str) != (size_t) -1) - return __gets_chk (__str, __bos (__str)); + if (__glibc_objsize (__str) != (size_t) -1) + return __gets_chk (__str, __glibc_objsize (__str)); return __gets_alias (__str); } __FORTIFY_FUNCTION_END #endif extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, - FILE *__restrict __stream) __wur; + FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets) __wur; + FILE *__restrict __stream), fgets) + __wur __attr_access ((__write_only__, 1, 2)); -__fortify_potential_overload __wur char * +__fortify_potential_overload __wur __attr_access ((__write_only__, 1, 2)) char * fgets (char *__restrict const __clang_pass_object_size __s, int __n, FILE *__restrict __stream) __FORTIFY_PRECONDITIONS @@ -315,8 +323,8 @@ "fgets called with bigger size than length of " "destination buffer") { - if (__bos (__s) != (size_t) -1) - return __fgets_chk (__s, __bos (__s), __n, __stream); + if (__glibc_objsize (__s) != (size_t) -1) + return __fgets_chk (__s, __glibc_objsize (__s), __n, __stream); return __fgets_alias (__s, __n, __stream); } __FORTIFY_FUNCTION_END @@ -338,20 +346,22 @@ "fread called with bigger size * nmemb than length " "of destination buffer") { - if (__bos0 (__ptr) != (size_t) -1) - return __fread_chk (__ptr, __bos0 (__ptr), __size, __n, __stream); + if (__glibc_objsize0 (__ptr) != (size_t) -1) + return __fread_chk (__ptr, __glibc_objsize0 (__ptr), __size, __n, __stream); return __fread_alias (__ptr, __size, __n, __stream); } __FORTIFY_FUNCTION_END #ifdef __USE_GNU extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size, - int __n, FILE *__restrict __stream) __wur; + int __n, FILE *__restrict __stream) + __wur __attr_access ((__write_only__, 1, 3)); extern char *__REDIRECT (__fgets_unlocked_alias, (char *__restrict __s, int __n, - FILE *__restrict __stream), fgets_unlocked) __wur; + FILE *__restrict __stream), fgets_unlocked) + __wur __attr_access ((__write_only__, 1, 2)); -__fortify_potential_overload __wur char * +__fortify_potential_overload __wur __attr_access ((__write_only__, 1, 2)) char * fgets_unlocked (char *__restrict const __clang_pass_object_size __s, int __n, FILE *__restrict __stream) __FORTIFY_PRECONDITIONS @@ -360,8 +370,8 @@ "fgets_unlocked called with bigger size than length " "of destination buffer") { - if (__bos (__s) != (size_t) -1) - return __fgets_unlocked_chk (__s, __bos (__s), __n, __stream); + if (__glibc_objsize (__s) != (size_t) -1) + return __fgets_unlocked_chk (__s, __glibc_objsize (__s), __n, __stream); return __fgets_unlocked_alias (__s, __n, __stream); } __FORTIFY_FUNCTION_END @@ -387,8 +397,8 @@ "fread_unlocked called with bigger size * n than " "length of destination buffer") { - if (__bos0 (__ptr) != (size_t) -1) - return __fread_unlocked_chk (__ptr, __bos0 (__ptr), __size, __n, __stream); + if (__glibc_objsize0 (__ptr) != (size_t) -1) + return __fread_unlocked_chk (__ptr, __glibc_objsize0 (__ptr), __size, __n, __stream); # ifdef __USE_EXTERN_INLINES if (__builtin_constant_p (__size) @@ -403,7 +413,7 @@ for (; __cnt > 0; --__cnt) { - int __c = _IO_getc_unlocked (__stream); + int __c = getc_unlocked (__stream); if (__c == EOF) break; *__cptr++ = __c; @@ -415,4 +425,6 @@ } __FORTIFY_FUNCTION_END #endif + #undef __mul_may_overflow +#endif /* bits/stdio2.h. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio_lim.h index 1be90e6..ff1a2c3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdio_lim.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1994-2018 Free Software Foundation, Inc. +/* Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_STDIO_LIM_H #define _BITS_STDIO_LIM_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-bsearch.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-bsearch.h index d83239a..4132dc6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-bsearch.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-bsearch.h
@@ -1,5 +1,5 @@ /* Perform binary search - inline version. - Copyright (C) 1991-2018 Free Software Foundation, Inc. + Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ __extern_inline void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-float.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-float.h index cb0c35b..3373c5b 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-float.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-float.h
@@ -1,5 +1,5 @@ /* Floating-point inline functions for stdlib.h. - Copyright (C) 2012-2018 Free Software Foundation, Inc. + Copyright (C) 2012-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never use <bits/stdlib-float.h> directly; include <stdlib.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-ldbl.h index f7ae101..775b6e5 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for <stdlib.h> functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,28 +14,50 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never include <bits/stdlib-ldbl.h> directly; use <stdlib.h> instead." #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold, strtod) +# else +__LDBL_REDIR1_DECL (strtold, __strtoieee128) +# endif #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strtold_l, strtod_l) +# else +__LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) +# endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) +# else +__LDBL_REDIR1_DECL (strfroml, __strfromieee128) +# endif #endif #ifdef __USE_MISC +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (qecvt, ecvt) __LDBL_REDIR1_DECL (qfcvt, fcvt) __LDBL_REDIR1_DECL (qgcvt, gcvt) __LDBL_REDIR1_DECL (qecvt_r, ecvt_r) __LDBL_REDIR1_DECL (qfcvt_r, fcvt_r) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (qecvt, __qecvtieee128) +__LDBL_REDIR1_DECL (qfcvt, __qfcvtieee128) +__LDBL_REDIR1_DECL (qgcvt, __qgcvtieee128) +__LDBL_REDIR1_DECL (qecvt_r, __qecvtieee128_r) +__LDBL_REDIR1_DECL (qfcvt_r, __qfcvtieee128_r) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib.h index 3c54273..79babec 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stdlib.h
@@ -1,5 +1,5 @@ /* Checking macros for stdlib functions. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _STDLIB_H # error "Never include <bits/stdlib.h> directly; use <stdlib.h> instead." @@ -42,18 +42,19 @@ #if defined _LIBC_LIMITS_H_ && defined PATH_MAX __FORTIFY_CALL_CHK && #endif - __bos (__resolved) != (size_t) -1) - return __realpath_chk (__name, __resolved, __bos (__resolved)); + __glibc_objsize (__resolved) != (size_t) -1) + return __realpath_chk (__name, __resolved, __glibc_objsize (__resolved)); return __realpath_alias (__name, __resolved); } __FORTIFY_FUNCTION_END extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf, size_t __buflen), ptsname_r) - __nonnull ((2)); + __nonnull ((2)) __attr_access ((__write_only__, 2, 3)); __fortify_potential_overload int __NTH (ptsname_r (int __fd, char *const __clang_pass_object_size __buf, @@ -63,8 +64,8 @@ "ptsname_r called with buflen " "bigger than size of buf") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __ptsname_r_chk (__fd, __buf, __buflen, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __ptsname_r_chk (__fd, __buf, __buflen, __glibc_objsize (__buf)); return __ptsname_r_alias (__fd, __buf, __buflen); } __FORTIFY_FUNCTION_END @@ -84,19 +85,22 @@ #if defined MB_LEN_MAX && MB_LEN_MAX != __STDLIB_MB_LEN_MAX # error "Assumed value of MB_LEN_MAX wrong" #endif - if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s)) - return __wctomb_chk (__s, __wchar, __bos (__s)); + if (__glibc_objsize (__s) != (size_t) -1 + && __STDLIB_MB_LEN_MAX > __glibc_objsize (__s)) + return __wctomb_chk (__s, __wchar, __glibc_objsize (__s)); return __wctomb_alias (__s, __wchar); } extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__mbstowcs_alias, (wchar_t *__restrict __dst, const char *__restrict __src, - size_t __len), mbstowcs); + size_t __len), mbstowcs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); __fortify_potential_overload size_t __NTH (mbstowcs (wchar_t *__restrict const __clang_pass_object_size __dst, @@ -107,9 +111,9 @@ "mbstowcs called with dst buffer " "smaller than len * sizeof (wchar_t)") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) return __mbstowcs_chk (__dst, __src, __len, - __bos (__dst) / sizeof (wchar_t)); + __glibc_objsize (__dst) / sizeof (wchar_t)); return __mbstowcs_alias (__dst, __src, __len); } __FORTIFY_FUNCTION_END @@ -117,11 +121,13 @@ extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len, size_t __dstlen) __THROW; + size_t __len, size_t __dstlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern size_t __REDIRECT_NTH (__wcstombs_alias, (char *__restrict __dst, const wchar_t *__restrict __src, - size_t __len), wcstombs); + size_t __len), wcstombs) + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); __fortify_potential_overload size_t __NTH (wcstombs (char *__restrict const __clang_pass_object_size __dst, @@ -131,8 +137,8 @@ "wcstombs called with dst buffer " "smaller than len") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) - return __wcstombs_chk (__dst, __src, __len, __bos (__dst)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) + return __wcstombs_chk (__dst, __src, __len, __glibc_objsize (__dst)); return __wcstombs_alias (__dst, __src, __len); } __FORTIFY_FUNCTION_END
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/string_fortified.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/string_fortified.h index 7b16afa..6a8d207 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/string_fortified.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/string_fortified.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2018 Free Software Foundation, Inc. +/* Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_STRING_FORTIFIED_H #define _BITS_STRING_FORTIFIED_H 1 @@ -28,16 +28,16 @@ #define __size_too_small(bos, dest, len) \ (bos (dest) != (size_t) -1 && bos (dest) < len) #define __warn_if_dest_too_small(dest, len) \ - __clang_warning_if (__size_too_small (__bos, dest, len), \ + __clang_warning_if (__size_too_small (__glibc_objsize, dest, len), \ __warn_len_too_large) #define __warn_if_dest_too_small0(dest, len) \ - __clang_warning_if (__size_too_small (__bos0, dest, len), \ + __clang_warning_if (__size_too_small (__glibc_objsize0, dest, len), \ __warn_len_too_large) #define __warn_input_str_too_large \ "destination buffer will always be overflown by source" #define __warn_if_src_too_large(dest, src) \ - __clang_warning_if (__size_too_small (__bos, dest, __builtin_strlen (src) + 1), \ + __clang_warning_if (__size_too_small (__glibc_objsize, dest, __builtin_strlen (src) + 1), \ __warn_input_str_too_large) __fortify_potential_overload void * @@ -45,11 +45,11 @@ const void *__restrict __src, size_t __len)) __warn_if_dest_too_small0 (__dest, __len) { - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) return __builtin_memcpy (__dest, __src, __len); - return __builtin___memcpy_chk (__dest, __src, __len, __bos_dst); + return __builtin___memcpy_chk (__dest, __src, __len, __glibc_objsize_dst); } __fortify_potential_overload void * @@ -57,11 +57,11 @@ const void *__src, size_t __len)) __warn_if_dest_too_small0 (__dest, __len) { - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) return __builtin_memmove (__dest, __src, __len); - return __builtin___memmove_chk (__dest, __src, __len, __bos_dst); + return __builtin___memmove_chk (__dest, __src, __len, __glibc_objsize_dst); } #ifdef __USE_GNU @@ -70,11 +70,11 @@ const void *__restrict __src, size_t __len)) __warn_if_dest_too_small0 (__dest, __len) { - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) return __builtin_mempcpy (__dest, __src, __len); - return __builtin___mempcpy_chk (__dest, __src, __len, __bos_dst); + return __builtin___mempcpy_chk (__dest, __src, __len, __glibc_objsize_dst); } #endif @@ -86,30 +86,17 @@ #define __warn_memset_zero_len_msg \ "memset used with constant zero length parameter; this could be due to " \ "transposed parameters" -#if !__GNUC_PREREQ (5,0) -__warndecl (__warn_memset_zero_len, __warn_memset_zero_len_msg); -#endif __fortify_potential_overload void * __NTH (memset (void *const __clang_pass_object_size0 __dest, int __ch, size_t __len)) __warn_if_dest_too_small0 (__dest, __len) __clang_warning_if (__len == 0 && __ch != 0, __warn_memset_zero_len_msg) { - /* GCC-5.0 and newer implements these checks in the compiler, so we don't - need them here. */ -#if !__GNUC_PREREQ (5,0) && !defined __use_clang_fortify - if (__builtin_constant_p (__len) && __len == 0 - && (!__builtin_constant_p (__ch) || __ch != 0)) - { - __warn_memset_zero_len (); - return __dest; - } -#endif - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) return __builtin_memset (__dest, __ch, __len); - return __builtin___memset_chk (__dest, __ch, __len, __bos_dst); + return __builtin___memset_chk (__dest, __ch, __len, __glibc_objsize_dst); } #undef __warn_memset_zero_len_msg @@ -117,12 +104,12 @@ # include <bits/strings_fortified.h> void __explicit_bzero_chk (void *__dest, size_t __len, size_t __destlen) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); __fortify_function void __NTH (explicit_bzero (void *__dest, size_t __len)) { - __explicit_bzero_chk (__dest, __len, __bos0 (__dest)); + __explicit_bzero_chk (__dest, __len, __glibc_objsize0 (__dest)); } #endif @@ -131,7 +118,7 @@ const char *__restrict __src)) __warn_if_src_too_large (__dest, __src) { - return __builtin___strcpy_chk (__dest, __src, __bos (__dest)); + return __builtin___strcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #ifdef __USE_GNU @@ -140,23 +127,24 @@ const char *__restrict __src)) __warn_if_src_too_large (__dest, __src) { - return __builtin___stpcpy_chk (__dest, __src, __bos (__dest)); + return __builtin___stpcpy_chk (__dest, __src, __glibc_objsize (__dest)); } #endif __fortify_potential_overload char * __NTH (strncpy (char *__restrict const __clang_pass_object_size __dest, const char *__restrict __src, size_t __len)) -/* clang: Don't warn when __builtin_strlen (__src) < __bos (__dest), - but __len > __bos (__dest). The user should fix their code instead. */ +/* clang: Don't warn when __builtin_strlen (__src) < __glibc_objsize (__dest), + but __len > __glibc_objsize (__dest). The user should fix their code instead. */ __warn_if_dest_too_small (__dest, __len) { - return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); + return __builtin___strncpy_chk (__dest, __src, __len, + __glibc_objsize (__dest)); } -/* XXX We have no corresponding builtin yet. */ extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, - size_t __destlen) __THROW; + size_t __destlen) __THROW + __attr_access ((__write_only__, 1, 3)) __attr_access ((__read_only__, 2)); extern char *__REDIRECT_NTH (__stpncpy_alias, (char *__dest, const char *__src, size_t __n), stpncpy); @@ -165,8 +153,8 @@ size_t __n)) __warn_if_dest_too_small (__dest, __n) { - if (__bos (__dest) != (size_t) -1) - return __stpncpy_chk (__dest, __src, __n, __bos (__dest)); + if (__glibc_objsize (__dest) != (size_t) -1) + return __stpncpy_chk (__dest, __src, __n, __glibc_objsize (__dest)); return __stpncpy_alias (__dest, __src, __n); } @@ -175,7 +163,7 @@ const char *__restrict __src)) __warn_if_src_too_large (__dest, __src) { - return __builtin___strcat_chk (__dest, __src, __bos (__dest)); + return __builtin___strcat_chk (__dest, __src, __glibc_objsize (__dest)); } __fortify_potential_overload char * @@ -183,7 +171,8 @@ const char *__restrict __src, size_t __len)) __warn_if_src_too_large (__dest, __src) { - return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest)); + return __builtin___strncat_chk (__dest, __src, __len, + __glibc_objsize (__dest)); } #undef __warn_len_too_large
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/strings_fortified.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/strings_fortified.h index e910d28..4c610f4 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/strings_fortified.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/strings_fortified.h
@@ -1,5 +1,5 @@ /* Fortify macros for strings.h functions. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __STRINGS_FORTIFIED # define __STRINGS_FORTIFIED 1 @@ -31,12 +31,12 @@ __clang_warning_if (__strings_size_too_small (__dest, __len), __strings_warn_len_too_large) { - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) (void) __builtin_memmove (__dest, __src, __len); else - (void) __builtin___memmove_chk (__dest, __src, __len, __bos_dst); + (void) __builtin___memmove_chk (__dest, __src, __len, __glibc_objsize_dst); } __fortify_potential_overload void @@ -44,12 +44,12 @@ __clang_warning_if (__strings_size_too_small (__dest, __len), __strings_warn_len_too_large) { - size_t __bos_dst = __bos0 (__dest); - if (__bos_dst == (size_t) -1 || (__builtin_constant_p (__len) - && __bos_dst >= __len)) + size_t __glibc_objsize_dst = __glibc_objsize0 (__dest); + if (__glibc_objsize_dst == (size_t) -1 || (__builtin_constant_p (__len) + && __glibc_objsize_dst >= __len)) (void) __builtin_memset (__dest, '\0', __len); else - (void) __builtin___memset_chk (__dest, '\0', __len, __bos_dst); + (void) __builtin___memset_chk (__dest, '\0', __len, __glibc_objsize_dst); }
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stropts.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stropts.h deleted file mode 100644 index 8410b6c..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/stropts.h +++ /dev/null
@@ -1,230 +0,0 @@ -/* Copyright (C) 1998-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _STROPTS_H -# error "Never include <bits/stropts.h> directly; use <stropts.h> instead." -#endif - -#ifndef _BITS_STROPTS_H -#define _BITS_STROPTS_H 1 - -#include <bits/types.h> - -/* Macros used as `request' argument to `ioctl'. */ -#define __SID ('S' << 8) - -#define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data - block in the first message. */ -#define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current - STREAM, just below the STREAM head. */ -#define I_POP (__SID | 3) /* Remove STREAMS module from just below the - STREAM head. */ -#define I_LOOK (__SID | 4) /* Retrieve the name of the module just below - the STREAM head and place it in a character - string. */ -#define I_FLUSH (__SID | 5) /* Flush all input and/or output. */ -#define I_SRDOPT (__SID | 6) /* Sets the read mode. */ -#define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */ -#define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl' - message and send that message downstream. */ -#define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process - wants the SIGPOLL signal issued. */ -#define I_GETSIG (__SID |10) /* Return the events for which the calling - process is currently registered to be sent - a SIGPOLL signal. */ -#define I_FIND (__SID |11) /* Compares the names of all modules currently - present in the STREAM to the name pointed to - by `arg'. */ -#define I_LINK (__SID |12) /* Connect two STREAMs. */ -#define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */ -#define I_PEEK (__SID |15) /* Allows a process to retrieve the information - in the first message on the STREAM head read - queue without taking the message off the - queue. */ -#define I_FDINSERT (__SID |16) /* Create a message from the specified - buffer(s), adds information about another - STREAM, and send the message downstream. */ -#define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes' - to send a message, containing a file - pointer, to the STREAM head at the other end - of a STREAMS pipe. */ -#define I_RECVFD (__SID |14) /* Non-EFT definition. */ -#define I_SWROPT (__SID |19) /* Set the write mode. */ -#define I_GWROPT (__SID |20) /* Return the current write mode setting. */ -#define I_LIST (__SID |21) /* List all the module names on the STREAM, up - to and including the topmost driver name. */ -#define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent - link. */ -#define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were - connected with a persistent link. */ -#define I_FLUSHBAND (__SID |28) /* Flush only band specified. */ -#define I_CKBAND (__SID |29) /* Check if the message of a given priority - band exists on the STREAM head read - queue. */ -#define I_GETBAND (__SID |30) /* Return the priority band of the first - message on the STREAM head read queue. */ -#define I_ATMARK (__SID |31) /* See if the current message on the STREAM - head read queue is "marked" by some module - downstream. */ -#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when - a STREAM is closing and there is data on - the write queues. */ -#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */ -#define I_CANPUT (__SID |34) /* Check if a certain band is writable. */ - - -/* Used in `I_LOOK' request. */ -#define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */ - -/* Flush options. */ -#define FLUSHR 0x01 /* Flush read queues. */ -#define FLUSHW 0x02 /* Flush write queues. */ -#define FLUSHRW 0x03 /* Flush read and write queues. */ -#ifdef __USE_GNU -# define FLUSHBAND 0x04 /* Flush only specified band. */ -#endif - -/* Possible arguments for `I_SETSIG'. */ -#define S_INPUT 0x0001 /* A message, other than a high-priority - message, has arrived. */ -#define S_HIPRI 0x0002 /* A high-priority message is present. */ -#define S_OUTPUT 0x0004 /* The write queue for normal data is no longer - full. */ -#define S_MSG 0x0008 /* A STREAMS signal message that contains the - SIGPOLL signal reaches the front of the - STREAM head read queue. */ -#define S_ERROR 0x0010 /* Notification of an error condition. */ -#define S_HANGUP 0x0020 /* Notification of a hangup. */ -#define S_RDNORM 0x0040 /* A normal message has arrived. */ -#define S_WRNORM S_OUTPUT -#define S_RDBAND 0x0080 /* A message with a non-zero priority has - arrived. */ -#define S_WRBAND 0x0100 /* The write queue for a non-zero priority - band is no longer full. */ -#define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND, - SIGURG is generated instead of SIGPOLL when - a priority message reaches the front of the - STREAM head read queue. */ - -/* Option for `I_PEEK'. */ -#define RS_HIPRI 0x01 /* Only look for high-priority messages. */ - -/* Options for `I_SRDOPT'. */ -#define RNORM 0x0000 /* Byte-STREAM mode, the default. */ -#define RMSGD 0x0001 /* Message-discard mode. */ -#define RMSGN 0x0002 /* Message-nondiscard mode. */ -#define RPROTDAT 0x0004 /* Deliver the control part of a message as - data. */ -#define RPROTDIS 0x0008 /* Discard the control part of a message, - delivering any data part. */ -#define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message - containing a control part is at the front - of the STREAM head read queue. */ -#ifdef __USE_GNU -# define RPROTMASK 0x001C /* The RPROT bits */ -#endif - -/* Possible mode for `I_SWROPT'. */ -#define SNDZERO 0x001 /* Send a zero-length message downstream when a - `write' of 0 bytes occurs. */ -#ifdef __USE_GNU -# define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if - sd_werror is set. */ -#endif - -/* Arguments for `I_ATMARK'. */ -#define ANYMARK 0x01 /* Check if the message is marked. */ -#define LASTMARK 0x02 /* Check if the message is the last one marked - on the queue. */ - -/* Argument for `I_UNLINK'. */ -#ifdef __USE_GNU -# define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM - associated with `fildes'. */ -#endif - - -/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */ -#define MSG_HIPRI 0x01 /* Send/receive high priority message. */ -#define MSG_ANY 0x02 /* Receive any message. */ -#define MSG_BAND 0x04 /* Receive message from specified band. */ - -/* Values returned by getmsg and getpmsg */ -#define MORECTL 1 /* More control information is left in - message. */ -#define MOREDATA 2 /* More data is left in message. */ - - -/* Structure used for the I_FLUSHBAND ioctl on streams. */ -struct bandinfo - { - unsigned char bi_pri; - int bi_flag; - }; - -struct strbuf - { - int maxlen; /* Maximum buffer length. */ - int len; /* Length of data. */ - char *buf; /* Pointer to buffer. */ - }; - -struct strpeek - { - struct strbuf ctlbuf; - struct strbuf databuf; - t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ - }; - -struct strfdinsert - { - struct strbuf ctlbuf; - struct strbuf databuf; - t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ - int fildes; - int offset; - }; - -struct strioctl - { - int ic_cmd; - int ic_timout; - int ic_len; - char *ic_dp; - }; - -struct strrecvfd - { - int fd; - uid_t uid; - gid_t gid; - char __fill[8]; /* UnixWare/Solaris compatibility */ - }; - - -struct str_mlist - { - char l_name[FMNAMESZ + 1]; - }; - -struct str_list - { - int sl_nmods; - struct str_mlist *sl_modlist; - }; - -#endif /* bits/stropts.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_mutex.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_mutex.h new file mode 100644 index 0000000..16c17a1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_mutex.h
@@ -0,0 +1,84 @@ +/* Default mutex implementation struct definitions. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _THREAD_MUTEX_INTERNAL_H +#define _THREAD_MUTEX_INTERNAL_H 1 + +/* Generic struct for both POSIX and C11 mutexes. New ports are expected + to use the default layout, however architecture can redefine it to + add arch-specific extension (such as lock-elision). The struct have + a size of 32 bytes on LP32 and 40 bytes on LP64 architectures. */ + +struct __pthread_mutex_s +{ + int __lock __LOCK_ALIGNMENT; + unsigned int __count; + int __owner; +#if __WORDSIZE == 64 + unsigned int __nusers; +#endif + /* KIND must stay at this position in the structure to maintain + binary compatibility with static initializers. + + Concurrency notes: + The __kind of a mutex is initialized either by the static + PTHREAD_MUTEX_INITIALIZER or by a call to pthread_mutex_init. + + After a mutex has been initialized, the __kind of a mutex is usually not + changed. BUT it can be set to -1 in pthread_mutex_destroy or elision can + be enabled. This is done concurrently in the pthread_mutex_*lock + functions by using the macro FORCE_ELISION. This macro is only defined + for architectures which supports lock elision. + + For elision, there are the flags PTHREAD_MUTEX_ELISION_NP and + PTHREAD_MUTEX_NO_ELISION_NP which can be set in addition to the already + set type of a mutex. Before a mutex is initialized, only + PTHREAD_MUTEX_NO_ELISION_NP can be set with pthread_mutexattr_settype. + + After a mutex has been initialized, the functions pthread_mutex_*lock can + enable elision - if the mutex-type and the machine supports it - by + setting the flag PTHREAD_MUTEX_ELISION_NP. This is done concurrently. + Afterwards the lock / unlock functions are using specific elision + code-paths. */ + int __kind; +#if __WORDSIZE != 64 + unsigned int __nusers; +#endif +#if __WORDSIZE == 64 + int __spins; + __pthread_list_t __list; +# define __PTHREAD_MUTEX_HAVE_PREV 1 +#else + __extension__ union + { + int __spins; + __pthread_slist_t __list; + }; +# define __PTHREAD_MUTEX_HAVE_PREV 0 +#endif +}; + +#if __PTHREAD_MUTEX_HAVE_PREV == 1 +# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ + 0, 0, 0, 0, __kind, 0, { 0, 0 } +#else +# define __PTHREAD_MUTEX_INITIALIZER(__kind) \ + 0, 0, 0, __kind, 0, { 0 } +#endif + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_rwlock.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_rwlock.h new file mode 100644 index 0000000..bf28a94 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_rwlock.h
@@ -0,0 +1,41 @@ +/* AArch64 internal rwlock struct definitions. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _RWLOCK_INTERNAL_H +#define _RWLOCK_INTERNAL_H + +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; + int __cur_writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + unsigned int __flags; +}; + +#define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_stat.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_stat.h new file mode 100644 index 0000000..32ef511 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/struct_stat.h
@@ -0,0 +1,127 @@ +/* Definition for struct stat. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#if !defined _SYS_STAT_H && !defined _FCNTL_H +# error "Never include <bits/struct_stat.h> directly; use <sys/stat.h> instead." +#endif + +#ifndef _BITS_STRUCT_STAT_H +#define _BITS_STRUCT_STAT_H 1 + +#include <bits/endian.h> +#include <bits/wordsize.h> + +#if defined __USE_FILE_OFFSET64 +# define __field64(type, type64, name) type64 name +#elif __WORDSIZE == 64 || defined __INO_T_MATCHES_INO64_T +# if defined __INO_T_MATCHES_INO64_T && !defined __OFF_T_MATCHES_OFF64_T +# error "ino_t and off_t must both be the same type" +# endif +# define __field64(type, type64, name) type name +#elif __BYTE_ORDER == __LITTLE_ENDIAN +# define __field64(type, type64, name) \ + type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad +#else +# define __field64(type, type64, name) \ + int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name +#endif + +struct stat + { + __dev_t st_dev; /* Device. */ + __field64(__ino_t, __ino64_t, st_ino); /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __field64(__off_t, __off64_t, st_size); /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __field64(__blkcnt_t, __blkcnt64_t, st_blocks); /* 512-byte blocks */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +# define st_atime st_atim.tv_sec /* Backward compatibility. */ +# define st_mtime st_mtim.tv_sec +# define st_ctime st_ctim.tv_sec +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + int __glibc_reserved[2]; + }; + +#undef __field64 + +#ifdef __USE_LARGEFILE64 +struct stat64 + { + __dev_t st_dev; /* Device. */ + __ino64_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + __dev_t st_rdev; /* Device number, if device. */ + __dev_t __pad1; + __off64_t st_size; /* Size of file, in bytes. */ + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad2; + __blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */ +#ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + equivalent to 'struct timespec'. This is the type used + whenever possible but the Unix namespace rules do not allow the + identifier 'timespec' to appear in the <sys/stat.h> header. + Therefore we have to handle the use of this header in strictly + standard-compliant sources special. */ + struct timespec st_atim; /* Time of last access. */ + struct timespec st_mtim; /* Time of last modification. */ + struct timespec st_ctim; /* Time of last status change. */ +#else + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ +#endif + int __glibc_reserved[2]; + }; +#endif + +/* Tell code we have these members. */ +#define _STATBUF_ST_BLKSIZE +#define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC + +#endif /* _BITS_STRUCT_STAT_H */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sys_errlist.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sys_errlist.h deleted file mode 100644 index 4f725e9..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sys_errlist.h +++ /dev/null
@@ -1,32 +0,0 @@ -/* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. - Copyright (C) 2002-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _STDIO_H -# error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead." -#endif - -/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ - -#ifdef __USE_MISC -extern int sys_nerr; -extern const char *const sys_errlist[]; -#endif -#ifdef __USE_GNU -extern int _sys_nerr; -extern const char *const _sys_errlist[]; -#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syscall.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syscall.h index 65a64d0..98c9ea7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syscall.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syscall.h
@@ -1,11 +1,11 @@ /* Generated at libc build time from syscall list. */ -/* The system call list corresponds to kernel 4.14. */ +/* The system call list corresponds to kernel 5.10. */ #ifndef _SYSCALL_H # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead." #endif -#define __GLIBC_LINUX_VERSION_CODE 265728 +#define __GLIBC_LINUX_VERSION_CODE 330240 #ifdef __NR_FAST_atomic_update # define SYS_FAST_atomic_update __NR_FAST_atomic_update @@ -75,6 +75,18 @@ # define SYS_alloc_hugepages __NR_alloc_hugepages #endif +#ifdef __NR_arc_gettls +# define SYS_arc_gettls __NR_arc_gettls +#endif + +#ifdef __NR_arc_settls +# define SYS_arc_settls __NR_arc_settls +#endif + +#ifdef __NR_arc_usr_cmpxchg +# define SYS_arc_usr_cmpxchg __NR_arc_usr_cmpxchg +#endif + #ifdef __NR_arch_prctl # define SYS_arch_prctl __NR_arch_prctl #endif @@ -115,6 +127,10 @@ # define SYS_break __NR_break #endif +#ifdef __NR_breakpoint +# define SYS_breakpoint __NR_breakpoint +#endif + #ifdef __NR_brk # define SYS_brk __NR_brk #endif @@ -159,22 +175,42 @@ # define SYS_clock_adjtime __NR_clock_adjtime #endif +#ifdef __NR_clock_adjtime64 +# define SYS_clock_adjtime64 __NR_clock_adjtime64 +#endif + #ifdef __NR_clock_getres # define SYS_clock_getres __NR_clock_getres #endif +#ifdef __NR_clock_getres_time64 +# define SYS_clock_getres_time64 __NR_clock_getres_time64 +#endif + #ifdef __NR_clock_gettime # define SYS_clock_gettime __NR_clock_gettime #endif +#ifdef __NR_clock_gettime64 +# define SYS_clock_gettime64 __NR_clock_gettime64 +#endif + #ifdef __NR_clock_nanosleep # define SYS_clock_nanosleep __NR_clock_nanosleep #endif +#ifdef __NR_clock_nanosleep_time64 +# define SYS_clock_nanosleep_time64 __NR_clock_nanosleep_time64 +#endif + #ifdef __NR_clock_settime # define SYS_clock_settime __NR_clock_settime #endif +#ifdef __NR_clock_settime64 +# define SYS_clock_settime64 __NR_clock_settime64 +#endif + #ifdef __NR_clone # define SYS_clone __NR_clone #endif @@ -183,10 +219,18 @@ # define SYS_clone2 __NR_clone2 #endif +#ifdef __NR_clone3 +# define SYS_clone3 __NR_clone3 +#endif + #ifdef __NR_close # define SYS_close __NR_close #endif +#ifdef __NR_close_range +# define SYS_close_range __NR_close_range +#endif + #ifdef __NR_cmpxchg_badaddr # define SYS_cmpxchg_badaddr __NR_cmpxchg_badaddr #endif @@ -291,6 +335,10 @@ # define SYS_faccessat __NR_faccessat #endif +#ifdef __NR_faccessat2 +# define SYS_faccessat2 __NR_faccessat2 +#endif + #ifdef __NR_fadvise64 # define SYS_fadvise64 __NR_fadvise64 #endif @@ -367,6 +415,10 @@ # define SYS_fork __NR_fork #endif +#ifdef __NR_fp_udfiex_crtl +# define SYS_fp_udfiex_crtl __NR_fp_udfiex_crtl +#endif + #ifdef __NR_free_hugepages # define SYS_free_hugepages __NR_free_hugepages #endif @@ -375,10 +427,26 @@ # define SYS_fremovexattr __NR_fremovexattr #endif +#ifdef __NR_fsconfig +# define SYS_fsconfig __NR_fsconfig +#endif + #ifdef __NR_fsetxattr # define SYS_fsetxattr __NR_fsetxattr #endif +#ifdef __NR_fsmount +# define SYS_fsmount __NR_fsmount +#endif + +#ifdef __NR_fsopen +# define SYS_fsopen __NR_fsopen +#endif + +#ifdef __NR_fspick +# define SYS_fspick __NR_fspick +#endif + #ifdef __NR_fstat # define SYS_fstat __NR_fstat #endif @@ -419,6 +487,10 @@ # define SYS_futex __NR_futex #endif +#ifdef __NR_futex_time64 +# define SYS_futex_time64 __NR_futex_time64 +#endif + #ifdef __NR_futimesat # define SYS_futimesat __NR_futimesat #endif @@ -439,6 +511,10 @@ # define SYS_get_thread_area __NR_get_thread_area #endif +#ifdef __NR_get_tls +# define SYS_get_tls __NR_get_tls +#endif + #ifdef __NR_getcpu # define SYS_getcpu __NR_getcpu #endif @@ -651,6 +727,14 @@ # define SYS_io_getevents __NR_io_getevents #endif +#ifdef __NR_io_pgetevents +# define SYS_io_pgetevents __NR_io_pgetevents +#endif + +#ifdef __NR_io_pgetevents_time64 +# define SYS_io_pgetevents_time64 __NR_io_pgetevents_time64 +#endif + #ifdef __NR_io_setup # define SYS_io_setup __NR_io_setup #endif @@ -659,6 +743,18 @@ # define SYS_io_submit __NR_io_submit #endif +#ifdef __NR_io_uring_enter +# define SYS_io_uring_enter __NR_io_uring_enter +#endif + +#ifdef __NR_io_uring_register +# define SYS_io_uring_register __NR_io_uring_register +#endif + +#ifdef __NR_io_uring_setup +# define SYS_io_uring_setup __NR_io_uring_setup +#endif + #ifdef __NR_ioctl # define SYS_ioctl __NR_ioctl #endif @@ -843,6 +939,10 @@ # define SYS_mount __NR_mount #endif +#ifdef __NR_move_mount +# define SYS_move_mount __NR_move_mount +#endif + #ifdef __NR_move_pages # define SYS_move_pages __NR_move_pages #endif @@ -871,10 +971,18 @@ # define SYS_mq_timedreceive __NR_mq_timedreceive #endif +#ifdef __NR_mq_timedreceive_time64 +# define SYS_mq_timedreceive_time64 __NR_mq_timedreceive_time64 +#endif + #ifdef __NR_mq_timedsend # define SYS_mq_timedsend __NR_mq_timedsend #endif +#ifdef __NR_mq_timedsend_time64 +# define SYS_mq_timedsend_time64 __NR_mq_timedsend_time64 +#endif + #ifdef __NR_mq_unlink # define SYS_mq_unlink __NR_mq_unlink #endif @@ -947,6 +1055,10 @@ # define SYS_old_adjtimex __NR_old_adjtimex #endif +#ifdef __NR_old_getpagesize +# define SYS_old_getpagesize __NR_old_getpagesize +#endif + #ifdef __NR_oldfstat # define SYS_oldfstat __NR_oldfstat #endif @@ -979,10 +1091,18 @@ # define SYS_open_by_handle_at __NR_open_by_handle_at #endif +#ifdef __NR_open_tree +# define SYS_open_tree __NR_open_tree +#endif + #ifdef __NR_openat # define SYS_openat __NR_openat #endif +#ifdef __NR_openat2 +# define SYS_openat2 __NR_openat2 +#endif + #ifdef __NR_osf_adjtime # define SYS_osf_adjtime __NR_osf_adjtime #endif @@ -1455,6 +1575,18 @@ # define SYS_personality __NR_personality #endif +#ifdef __NR_pidfd_getfd +# define SYS_pidfd_getfd __NR_pidfd_getfd +#endif + +#ifdef __NR_pidfd_open +# define SYS_pidfd_open __NR_pidfd_open +#endif + +#ifdef __NR_pidfd_send_signal +# define SYS_pidfd_send_signal __NR_pidfd_send_signal +#endif + #ifdef __NR_pipe # define SYS_pipe __NR_pipe #endif @@ -1487,6 +1619,10 @@ # define SYS_ppoll __NR_ppoll #endif +#ifdef __NR_ppoll_time64 +# define SYS_ppoll_time64 __NR_ppoll_time64 +#endif + #ifdef __NR_prctl # define SYS_prctl __NR_prctl #endif @@ -1507,6 +1643,10 @@ # define SYS_prlimit64 __NR_prlimit64 #endif +#ifdef __NR_process_madvise +# define SYS_process_madvise __NR_process_madvise +#endif + #ifdef __NR_process_vm_readv # define SYS_process_vm_readv __NR_process_vm_readv #endif @@ -1527,6 +1667,10 @@ # define SYS_pselect6 __NR_pselect6 #endif +#ifdef __NR_pselect6_time64 +# define SYS_pselect6_time64 __NR_pselect6_time64 +#endif + #ifdef __NR_ptrace # define SYS_ptrace __NR_ptrace #endif @@ -1595,6 +1739,10 @@ # define SYS_recvmmsg __NR_recvmmsg #endif +#ifdef __NR_recvmmsg_time64 +# define SYS_recvmmsg_time64 __NR_recvmmsg_time64 +#endif + #ifdef __NR_recvmsg # define SYS_recvmsg __NR_recvmsg #endif @@ -1627,10 +1775,18 @@ # define SYS_restart_syscall __NR_restart_syscall #endif +#ifdef __NR_riscv_flush_icache +# define SYS_riscv_flush_icache __NR_riscv_flush_icache +#endif + #ifdef __NR_rmdir # define SYS_rmdir __NR_rmdir #endif +#ifdef __NR_rseq +# define SYS_rseq __NR_rseq +#endif + #ifdef __NR_rt_sigaction # define SYS_rt_sigaction __NR_rt_sigaction #endif @@ -1659,6 +1815,10 @@ # define SYS_rt_sigtimedwait __NR_rt_sigtimedwait #endif +#ifdef __NR_rt_sigtimedwait_time64 +# define SYS_rt_sigtimedwait_time64 __NR_rt_sigtimedwait_time64 +#endif + #ifdef __NR_rt_tgsigqueueinfo # define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo #endif @@ -1683,6 +1843,10 @@ # define SYS_s390_runtime_instr __NR_s390_runtime_instr #endif +#ifdef __NR_s390_sthyi +# define SYS_s390_sthyi __NR_s390_sthyi +#endif + #ifdef __NR_sched_get_affinity # define SYS_sched_get_affinity __NR_sched_get_affinity #endif @@ -1715,6 +1879,10 @@ # define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #endif +#ifdef __NR_sched_rr_get_interval_time64 +# define SYS_sched_rr_get_interval_time64 __NR_sched_rr_get_interval_time64 +#endif + #ifdef __NR_sched_set_affinity # define SYS_sched_set_affinity __NR_sched_set_affinity #endif @@ -1767,6 +1935,10 @@ # define SYS_semtimedop __NR_semtimedop #endif +#ifdef __NR_semtimedop_time64 +# define SYS_semtimedop_time64 __NR_semtimedop_time64 +#endif + #ifdef __NR_send # define SYS_send __NR_send #endif @@ -1807,6 +1979,10 @@ # define SYS_set_tid_address __NR_set_tid_address #endif +#ifdef __NR_set_tls +# define SYS_set_tls __NR_set_tls +#endif + #ifdef __NR_setdomainname # define SYS_setdomainname __NR_setdomainname #endif @@ -2155,10 +2331,18 @@ # define SYS_timer_gettime __NR_timer_gettime #endif +#ifdef __NR_timer_gettime64 +# define SYS_timer_gettime64 __NR_timer_gettime64 +#endif + #ifdef __NR_timer_settime # define SYS_timer_settime __NR_timer_settime #endif +#ifdef __NR_timer_settime64 +# define SYS_timer_settime64 __NR_timer_settime64 +#endif + #ifdef __NR_timerfd # define SYS_timerfd __NR_timerfd #endif @@ -2171,10 +2355,18 @@ # define SYS_timerfd_gettime __NR_timerfd_gettime #endif +#ifdef __NR_timerfd_gettime64 +# define SYS_timerfd_gettime64 __NR_timerfd_gettime64 +#endif + #ifdef __NR_timerfd_settime # define SYS_timerfd_settime __NR_timerfd_settime #endif +#ifdef __NR_timerfd_settime64 +# define SYS_timerfd_settime64 __NR_timerfd_settime64 +#endif + #ifdef __NR_times # define SYS_times __NR_times #endif @@ -2195,6 +2387,10 @@ # define SYS_tuxcall __NR_tuxcall #endif +#ifdef __NR_udftrap +# define SYS_udftrap __NR_udftrap +#endif + #ifdef __NR_ugetrlimit # define SYS_ugetrlimit __NR_ugetrlimit #endif @@ -2239,6 +2435,14 @@ # define SYS_userfaultfd __NR_userfaultfd #endif +#ifdef __NR_usr26 +# define SYS_usr26 __NR_usr26 +#endif + +#ifdef __NR_usr32 +# define SYS_usr32 __NR_usr32 +#endif + #ifdef __NR_ustat # define SYS_ustat __NR_ustat #endif @@ -2251,6 +2455,10 @@ # define SYS_utimensat __NR_utimensat #endif +#ifdef __NR_utimensat_time64 +# define SYS_utimensat_time64 __NR_utimensat_time64 +#endif + #ifdef __NR_utimes # define SYS_utimes __NR_utimes #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysctl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysctl.h deleted file mode 100644 index 81447b2..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysctl.h +++ /dev/null
@@ -1 +0,0 @@ -/* Empty file. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-ldbl.h index 977f90a..b6fbb08 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for syslog functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include <bits/syslog-ldbl.h> directly; use <sys/syslog.h> instead." @@ -27,9 +27,9 @@ #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__syslog_chk) +__LDBL_REDIR2_DECL (syslog_chk) # ifdef __USE_MISC -__LDBL_REDIR_DECL (__vsyslog_chk) +__LDBL_REDIR2_DECL (vsyslog_chk) # endif #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-path.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-path.h index b569190..1449062 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-path.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog-path.h
@@ -1,5 +1,5 @@ /* <bits/syslog-path.h> -- _PATH_LOG definition - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include this file directly. Use <sys/syslog.h> instead"
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog.h index ef58020..5825f13 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/syslog.h
@@ -1,5 +1,5 @@ /* Checking macros for syslog functions. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_SYSLOG_H # error "Never include <bits/syslog.h> directly; use <sys/syslog.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysmacros.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysmacros.h index ea8d562..55913b1 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysmacros.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/sysmacros.h
@@ -1,5 +1,5 @@ /* Definitions of macros to access `dev_t' values. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_SYSMACROS_H #define _BITS_SYSMACROS_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-baud.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-baud.h new file mode 100644 index 0000000..0ec0484 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-baud.h
@@ -0,0 +1,48 @@ +/* termios baud rate selection definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-baud.h> directly; use <termios.h> instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */ +# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD. + (not in POSIX). */ +# define CIBAUD 002003600000 /* Input baud rate (not used). */ +# define CMSPAR 010000000000 /* Mark or space (stick) parity. */ +# define CRTSCTS 020000000000 /* Flow control. */ +#endif + +/* Extra output baud rates (not in POSIX). */ +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 +#define __MAX_BAUD B4000000
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cc.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cc.h new file mode 100644 index 0000000..a44813c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cc.h
@@ -0,0 +1,40 @@ +/* termios c_cc symbolic constant definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios_c_cc.h> directly; use <termios.h> instead." +#endif + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VTIME 5 +#define VMIN 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VEOL 11 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOL2 16
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cflag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cflag.h new file mode 100644 index 0000000..d1b45e6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_cflag.h
@@ -0,0 +1,34 @@ +/* termios control mode definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-c_cflag.h> directly; use <termios.h> instead." +#endif + +/* c_cflag bits. */ +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_iflag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_iflag.h new file mode 100644 index 0000000..c74511c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_iflag.h
@@ -0,0 +1,40 @@ +/* termios input mode definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-ciflags.h> directly; use <termios.h> instead." +#endif + +/* c_iflag bits */ +#define IGNBRK 0000001 /* Ignore break condition. */ +#define BRKINT 0000002 /* Signal interrupt on break. */ +#define IGNPAR 0000004 /* Ignore characters with parity errors. */ +#define PARMRK 0000010 /* Mark parity and framing errors. */ +#define INPCK 0000020 /* Enable input parity check. */ +#define ISTRIP 0000040 /* Strip 8th bit off characters. */ +#define INLCR 0000100 /* Map NL to CR on input. */ +#define IGNCR 0000200 /* Ignore CR. */ +#define ICRNL 0000400 /* Map CR to NL on input. */ +#define IUCLC 0001000 /* Map uppercase characters to lowercase on input + (not in POSIX). */ +#define IXON 0002000 /* Enable start/stop output control. */ +#define IXANY 0004000 /* Enable any character to restart output. */ +#define IXOFF 0010000 /* Enable start/stop input control. */ +#define IMAXBEL 0020000 /* Ring bell when input queue is full + (not in POSIX). */ +#define IUTF8 0040000 /* Input is UTF8 (not in POSIX). */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_lflag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_lflag.h new file mode 100644 index 0000000..0b2b5db --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_lflag.h
@@ -0,0 +1,58 @@ +/* termios local mode definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-c_lflag.h> directly; use <termios.h> instead." +#endif + +/* c_lflag bits */ +#define ISIG 0000001 /* Enable signals. */ +#define ICANON 0000002 /* Canonical input (erase and kill processing). */ +#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) +# define XCASE 0000004 +#endif +#define ECHO 0000010 /* Enable echo. */ +#define ECHOE 0000020 /* Echo erase character as error-correcting + backspace. */ +#define ECHOK 0000040 /* Echo KILL. */ +#define ECHONL 0000100 /* Echo NL. */ +#define NOFLSH 0000200 /* Disable flush after interrupt or quit. */ +#define TOSTOP 0000400 /* Send SIGTTOU for background output. */ +#ifdef __USE_MISC +# define ECHOCTL 0001000 /* If ECHO is also set, terminal special characters + other than TAB, NL, START, and STOP are echoed as + ^X, where X is the character with ASCII code 0x40 + greater than the special character + (not in POSIX). */ +# define ECHOPRT 0002000 /* If ICANON and ECHO are also set, characters are + printed as they are being erased + (not in POSIX). */ +# define ECHOKE 0004000 /* If ICANON is also set, KILL is echoed by erasing + each character on the line, as specified by ECHOE + and ECHOPRT (not in POSIX). */ +# define FLUSHO 0010000 /* Output is being flushed. This flag is toggled by + typing the DISCARD character (not in POSIX). */ +# define PENDIN 0040000 /* All characters in the input queue are reprinted + when the next character is read + (not in POSIX). */ +#endif +#define IEXTEN 0100000 /* Enable implementation-defined input + processing. */ +#ifdef __USE_MISC +# define EXTPROC 0200000 +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_oflag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_oflag.h new file mode 100644 index 0000000..6bf7a29 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-c_oflag.h
@@ -0,0 +1,61 @@ +/* termios output mode definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-c_oflag.h> directly; use <termios.h> instead." +#endif + +/* c_oflag bits */ +#define OPOST 0000001 /* Post-process output. */ +#define OLCUC 0000002 /* Map lowercase characters to uppercase on output. + (not in POSIX). */ +#define ONLCR 0000004 /* Map NL to CR-NL on output. */ +#define OCRNL 0000010 /* Map CR to NL on output. */ +#define ONOCR 0000020 /* No CR output at column 0. */ +#define ONLRET 0000040 /* NL performs CR function. */ +#define OFILL 0000100 /* Use fill characters for delay. */ +#define OFDEL 0000200 /* Fill is DEL. */ +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0000400 /* Select newline delays: */ +# define NL0 0000000 /* Newline type 0. */ +# define NL1 0000400 /* Newline type 1. */ +# define CRDLY 0003000 /* Select carriage-return delays: */ +# define CR0 0000000 /* Carriage-return delay type 0. */ +# define CR1 0001000 /* Carriage-return delay type 1. */ +# define CR2 0002000 /* Carriage-return delay type 2. */ +# define CR3 0003000 /* Carriage-return delay type 3. */ +# define TABDLY 0014000 /* Select horizontal-tab delays: */ +# define TAB0 0000000 /* Horizontal-tab delay type 0. */ +# define TAB1 0004000 /* Horizontal-tab delay type 1. */ +# define TAB2 0010000 /* Horizontal-tab delay type 2. */ +# define TAB3 0014000 /* Expand tabs to spaces. */ +# define BSDLY 0020000 /* Select backspace delays: */ +# define BS0 0000000 /* Backspace-delay type 0. */ +# define BS1 0020000 /* Backspace-delay type 1. */ +# define FFDLY 0100000 /* Select form-feed delays: */ +# define FF0 0000000 /* Form-feed delay type 0. */ +# define FF1 0100000 /* Form-feed delay type 1. */ +#endif + +#define VTDLY 0040000 /* Select vertical-tab delays: */ +#define VT0 0000000 /* Vertical-tab delay type 0. */ +#define VT1 0040000 /* Vertical-tab delay type 1. */ + +#ifdef __USE_MISC +# define XTABS 0014000 +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-misc.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-misc.h new file mode 100644 index 0000000..690b601 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-misc.h
@@ -0,0 +1,21 @@ +/* termios baud platform specific definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-misc.h> directly; use <termios.h> instead." +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-struct.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-struct.h new file mode 100644 index 0000000..f227f5b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-struct.h
@@ -0,0 +1,36 @@ +/* struct termios definition. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-struct.h> directly; use <termios.h> instead." +#endif + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 + };
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-tcflow.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-tcflow.h new file mode 100644 index 0000000..3ee5631 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios-tcflow.h
@@ -0,0 +1,26 @@ +/* termios tcflag symbolic contants definitions. Linux/generic version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _TERMIOS_H +# error "Never include <bits/termios-tcflow.h> directly; use <termios.h> instead." +#endif + +/* tcsetattr uses these. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios.h index 35efa97..67c847f 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/termios.h
@@ -1,5 +1,5 @@ /* termios type and macro definitions. Linux version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _TERMIOS_H # error "Never include <bits/termios.h> directly; use <termios.h> instead." @@ -24,100 +24,12 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#define NCCS 32 -struct termios - { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 - }; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0000400 -# define NL0 0000000 -# define NL1 0000400 -# define CRDLY 0003000 -# define CR0 0000000 -# define CR1 0001000 -# define CR2 0002000 -# define CR3 0003000 -# define TABDLY 0014000 -# define TAB0 0000000 -# define TAB1 0004000 -# define TAB2 0010000 -# define TAB3 0014000 -# define BSDLY 0020000 -# define BS0 0000000 -# define BS1 0020000 -# define FFDLY 0100000 -# define FF0 0000000 -# define FF1 0100000 -#endif - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#ifdef __USE_MISC -# define XTABS 0014000 -#endif +#include <bits/termios-struct.h> +#include <bits/termios-c_cc.h> +#include <bits/termios-c_iflag.h> +#include <bits/termios-c_oflag.h> /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0010017 -#endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 @@ -138,64 +50,14 @@ # define EXTA B19200 # define EXTB B38400 #endif -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#ifdef __USE_MISC -# define CBAUDEX 0010000 -#endif -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 -#ifdef __USE_MISC -# define CIBAUD 002003600000 /* input baud rate (not used) */ -# define CMSPAR 010000000000 /* mark or space (stick) parity */ -# define CRTSCTS 020000000000 /* flow control */ -#endif +#include <bits/termios-baud.h> -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0000004 -#endif -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 +#include <bits/termios-c_cflag.h> +#include <bits/termios-c_lflag.h> + #ifdef __USE_MISC -# define ECHOCTL 0001000 -# define ECHOPRT 0002000 -# define ECHOKE 0004000 -# define FLUSHO 0010000 -# define PENDIN 0040000 -#endif -#define IEXTEN 0100000 -#ifdef __USE_MISC -# define EXTPROC 0200000 +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* tcflow() and TCXONC use these */ @@ -209,11 +71,6 @@ #define TCOFLUSH 1 #define TCIOFLUSH 2 -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#include <bits/termios-tcflow.h> - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) +#include <bits/termios-misc.h>
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/thread-shared-types.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/thread-shared-types.h index 1e2092a..44bf1e3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/thread-shared-types.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/thread-shared-types.h
@@ -1,5 +1,5 @@ /* Common threading primitives definitions for both POSIX and C11. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _THREAD_SHARED_TYPES_H #define _THREAD_SHARED_TYPES_H 1 @@ -32,36 +32,6 @@ __SIZEOF_PTHREAD_BARRIER_T - size of pthread_barrier_t. __SIZEOF_PTHREAD_BARRIERATTR_T - size of pthread_barrierattr_t. - Also, the following macros must be define for internal pthread_mutex_t - struct definitions (struct __pthread_mutex_s): - - __PTHREAD_COMPAT_PADDING_MID - any additional members after 'kind' - and before '__spin' (for 64 bits) or - '__nusers' (for 32 bits). - __PTHREAD_COMPAT_PADDING_END - any additional members at the end of - the internal structure. - __PTHREAD_MUTEX_LOCK_ELISION - 1 if the architecture supports lock - elision or 0 otherwise. - __PTHREAD_MUTEX_NUSERS_AFTER_KIND - control where to put __nusers. The - preferred value for new architectures - is 0. - __PTHREAD_MUTEX_USE_UNION - control whether internal __spins and - __list will be place inside a union for - linuxthreads compatibility. - The preferred value for new architectures - is 0. - - For a new port the preferred values for the required defines are: - - #define __PTHREAD_COMPAT_PADDING_MID - #define __PTHREAD_COMPAT_PADDING_END - #define __PTHREAD_MUTEX_LOCK_ELISION 0 - #define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 - #define __PTHREAD_MUTEX_USE_UNION 0 - - __PTHREAD_MUTEX_LOCK_ELISION can be set to 1 if the hardware plans to - eventually support lock elision using transactional memory. - The additional macro defines any constraint for the lock alignment inside the thread structures: @@ -69,81 +39,52 @@ Same idea but for the once locking primitive: - __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. + __ONCE_ALIGNMENT - for pthread_once_t/once_flag definition. */ - And finally the internal pthread_rwlock_t (struct __pthread_rwlock_arch_t) - must be defined. - */ #include <bits/pthreadtypes-arch.h> + /* Common definition of pthread_mutex_t. */ -#if !__PTHREAD_MUTEX_USE_UNION typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; -#else + typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; -#endif -/* Lock elision support. */ -#if __PTHREAD_MUTEX_LOCK_ELISION -# if !__PTHREAD_MUTEX_USE_UNION -# define __PTHREAD_SPINS_DATA \ - short __spins; \ - short __elision -# define __PTHREAD_SPINS 0, 0 -# else -# define __PTHREAD_SPINS_DATA \ - struct \ - { \ - short __espins; \ - short __eelision; \ - } __elision_data -# define __PTHREAD_SPINS { 0, 0 } -# define __spins __elision_data.__espins -# define __elision __elision_data.__eelision -# endif -#else -# define __PTHREAD_SPINS_DATA int __spins -/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ -# define __PTHREAD_SPINS 0 -#endif +/* Arch-specific mutex definitions. A generic implementation is provided + by sysdeps/nptl/bits/struct_mutex.h. If required, an architecture + can override it by defining: -struct __pthread_mutex_s -{ - int __lock __LOCK_ALIGNMENT; - unsigned int __count; - int __owner; -#if !__PTHREAD_MUTEX_NUSERS_AFTER_KIND - unsigned int __nusers; -#endif - /* KIND must stay at this position in the structure to maintain - binary compatibility with static initializers. */ - int __kind; - __PTHREAD_COMPAT_PADDING_MID -#if __PTHREAD_MUTEX_NUSERS_AFTER_KIND - unsigned int __nusers; -#endif -#if !__PTHREAD_MUTEX_USE_UNION - __PTHREAD_SPINS_DATA; - __pthread_list_t __list; -# define __PTHREAD_MUTEX_HAVE_PREV 1 -#else - __extension__ union - { - __PTHREAD_SPINS_DATA; - __pthread_slist_t __list; - }; -# define __PTHREAD_MUTEX_HAVE_PREV 0 -#endif - __PTHREAD_COMPAT_PADDING_END -}; + 1. struct __pthread_mutex_s (used on both pthread_mutex_t and mtx_t + definition). It should contains at least the internal members + defined in the generic version. + + 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with + atomic operations. + + 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization. + It should initialize the mutex internal flag. */ + +#include <bits/struct_mutex.h> + +/* Arch-sepecific read-write lock definitions. A generic implementation is + provided by struct_rwlock.h. If required, an architecture can override it + by defining: + + 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition). + It should contain at least the internal members defined in the + generic version. + + 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization. + It should initialize the rwlock internal type. */ + +#include <bits/struct_rwlock.h> /* Common definition of pthread_cond_t. */ @@ -175,4 +116,14 @@ unsigned int __g_signals[2]; }; +typedef unsigned int __tss_t; +typedef unsigned long int __thrd_t; + +typedef struct +{ + int __data __ONCE_ALIGNMENT; +} __once_flag; + +#define __ONCE_FLAG_INIT { 0 } + #endif /* _THREAD_SHARED_TYPES_H */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time.h index 3df0dfd..ee5a8b3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time.h
@@ -1,5 +1,5 @@ /* System-dependent timing definitions. Linux version. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <time.h> instead.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time64.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time64.h new file mode 100644 index 0000000..af3e731 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/time64.h
@@ -0,0 +1,36 @@ +/* bits/time64.h -- underlying types for __time64_t. Generic version. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_TYPES_H +# error "Never include <bits/time64.h> directly; use <sys/types.h> instead." +#endif + +#ifndef _BITS_TIME64_H +#define _BITS_TIME64_H 1 + +/* Define __TIME64_T_TYPE so that it is always a 64-bit type. */ + +#if __TIMESIZE == 64 +/* If we already have 64-bit time type then use it. */ +# define __TIME64_T_TYPE __TIME_T_TYPE +#else +/* Define a 64-bit time type alongsize the 32-bit one. */ +# define __TIME64_T_TYPE __SQUAD_TYPE +#endif + +#endif /* bits/time64.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timerfd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timerfd.h index 305f1e4..6444915 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timerfd.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timerfd.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2018 Free Software Foundation, Inc. +/* Copyright (C) 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_TIMERFD_H # error "Never use <bits/timerfd.h> directly; include <sys/timerfd.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timesize.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timesize.h new file mode 100644 index 0000000..11a9c9a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timesize.h
@@ -0,0 +1,22 @@ +/* Bit size of the time_t type at glibc build time, general case. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <bits/wordsize.h> + +/* Size in bits of the 'time_t' type of the default ABI. */ +#define __TIMESIZE __WORDSIZE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timex.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timex.h index 1dbcc0b..9b2e30f 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timex.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/timex.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_TIMEX_H #define _BITS_TIMEX_H 1 @@ -104,7 +104,7 @@ #define STA_CLK 0x8000 /* clock source (0 = A, 1 = B) (ro) */ /* Read-only bits */ -#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \ - STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) +#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER \ + | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK) #endif /* bits/timex.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types.h index bd06e2d..2dc63de 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types.h
@@ -1,5 +1,5 @@ /* bits/types.h -- definitions of __*_t types underlying *_t types. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <sys/types.h> instead. @@ -25,6 +25,7 @@ #include <features.h> #include <bits/wordsize.h> +#include <bits/timesize.h> /* Convenience types. */ typedef unsigned char __u_char; @@ -47,6 +48,16 @@ __extension__ typedef unsigned long long int __uint64_t; #endif +/* Smallest types with at least a given width. */ +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + /* quad_t is also 64 bits. */ #if __WORDSIZE == 64 typedef long int __quad_t; @@ -76,7 +87,7 @@ 32 -- "natural" 32-bit type (always int) 64 -- "natural" 64-bit type (long or long long) LONG32 -- 32-bit type, traditionally long - QUAD -- 64-bit type, always long long + QUAD -- 64-bit type, traditionally long long WORD -- natural type of __WORDSIZE bits (int or long) LONGWORD -- type of __WORDSIZE bits, traditionally long @@ -102,14 +113,14 @@ #define __SLONGWORD_TYPE long int #define __ULONGWORD_TYPE unsigned long int #if __WORDSIZE == 32 -# define __SQUAD_TYPE __quad_t -# define __UQUAD_TYPE __u_quad_t +# define __SQUAD_TYPE __int64_t +# define __UQUAD_TYPE __uint64_t # define __SWORD_TYPE int # define __UWORD_TYPE unsigned int # define __SLONG32_TYPE long int # define __ULONG32_TYPE unsigned long int -# define __S64_TYPE __quad_t -# define __U64_TYPE __u_quad_t +# define __S64_TYPE __int64_t +# define __U64_TYPE __uint64_t /* We want __extension__ before typedef's that use nonstandard base types such as `long long' in C89 mode. */ # define __STD_TYPE __extension__ typedef @@ -128,6 +139,7 @@ # error #endif #include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */ +#include <bits/time64.h> /* Defines __TIME*_T_TYPE macros. */ __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */ @@ -148,6 +160,7 @@ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ +__STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ @@ -201,6 +214,15 @@ It is not currently necessary for this to be machine-specific. */ typedef int __sig_atomic_t; +/* Seconds since the Epoch, visible to user code when time_t is too + narrow only for consistency with the old way of widening too-narrow + types. User code should never use __time64_t. */ +#if __TIMESIZE == 64 && defined __LIBC +# define __time64_t __time_t +#elif __TIMESIZE != 64 +__STD_TYPE __TIME64_T_TYPE __time64_t; +#endif + #undef __STD_TYPE #endif /* bits/types.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos64_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos64_t.h new file mode 100644 index 0000000..06a6891 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos64_t.h
@@ -0,0 +1,16 @@ +#ifndef _____fpos64_t_defined +#define _____fpos64_t_defined 1 + +#include <bits/types.h> +#include <bits/types/__mbstate_t.h> + +/* The tag name of this struct is _G_fpos64_t to preserve historic + C++ mangled names for functions taking fpos_t and/or fpos64_t + arguments. That name should not be used in new code. */ +typedef struct _G_fpos64_t +{ + __off64_t __pos; + __mbstate_t __state; +} __fpos64_t; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos_t.h new file mode 100644 index 0000000..bb04576 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__fpos_t.h
@@ -0,0 +1,16 @@ +#ifndef _____fpos_t_defined +#define _____fpos_t_defined 1 + +#include <bits/types.h> +#include <bits/types/__mbstate_t.h> + +/* The tag name of this struct is _G_fpos_t to preserve historic + C++ mangled names for functions taking fpos_t arguments. + That name should not be used in new code. */ +typedef struct _G_fpos_t +{ + __off_t __pos; + __mbstate_t __state; +} __fpos_t; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__locale_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__locale_t.h index a6cccf6..b0742bf 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__locale_t.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__locale_t.h
@@ -1,5 +1,5 @@ /* Definition of struct __locale_struct and __locale_t. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES___LOCALE_T_H #define _BITS_TYPES___LOCALE_T_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__sigval_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__sigval_t.h index 395ce50..0737bf9 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__sigval_t.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/__sigval_t.h
@@ -1,5 +1,5 @@ /* Define __sigval_t. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef ____sigval_t_defined #define ____sigval_t_defined
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/cookie_io_functions_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/cookie_io_functions_t.h new file mode 100644 index 0000000..097b056 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/cookie_io_functions_t.h
@@ -0,0 +1,63 @@ +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef __cookie_io_functions_t_defined +#define __cookie_io_functions_t_defined 1 + +#include <bits/types.h> + +/* Functions to do I/O and file management for a stream. */ + +/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF. + Return number of bytes read. */ +typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf, + size_t __nbytes); + +/* Write NBYTES bytes pointed to by BUF to COOKIE. Write all NBYTES bytes + unless there is an error. Return number of bytes written. If + there is an error, return 0 and do not write anything. If the file + has been opened for append (__mode.__append set), then set the file + pointer to the end of the file and then do the write; if not, just + write at the current file pointer. */ +typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf, + size_t __nbytes); + +/* Move COOKIE's file position to *POS bytes from the + beginning of the file (if W is SEEK_SET), + the current position (if W is SEEK_CUR), + or the end of the file (if W is SEEK_END). + Set *POS to the new file position. + Returns zero if successful, nonzero if not. */ +typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w); + +/* Close COOKIE. */ +typedef int cookie_close_function_t (void *__cookie); + +/* The structure with the cookie function pointers. + The tag name of this struct is _IO_cookie_io_functions_t to + preserve historic C++ mangled names for functions taking + cookie_io_functions_t arguments. That name should not be used in + new code. */ +typedef struct _IO_cookie_io_functions_t +{ + cookie_read_function_t *read; /* Read bytes. */ + cookie_write_function_t *write; /* Write bytes. */ + cookie_seek_function_t *seek; /* Seek/tell file position. */ + cookie_close_function_t *close; /* Close file. */ +} cookie_io_functions_t; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/error_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/error_t.h new file mode 100644 index 0000000..f8e26a9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/error_t.h
@@ -0,0 +1,24 @@ +/* Define error_t. + Copyright (C) 1991-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef __error_t_defined +# define __error_t_defined 1 + +typedef int error_t; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/locale_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/locale_t.h index 6a7aad2..f46e9b0 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/locale_t.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/locale_t.h
@@ -1,5 +1,5 @@ /* Definition of locale_t. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_LOCALE_T_H #define _BITS_TYPES_LOCALE_T_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/siginfo_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/siginfo_t.h index 33766d1..43c4e00 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/siginfo_t.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/siginfo_t.h
@@ -107,7 +107,7 @@ /* SIGPOLL. */ struct { - long int si_band; /* Band event for SIGPOLL. */ + __SI_BAND_TYPE si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/stack_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/stack_t.h index ce809ad..b544027 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/stack_t.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/stack_t.h
@@ -1,5 +1,5 @@ /* Define stack_t. Linux version. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __stack_t_defined #define __stack_t_defined 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_FILE.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_FILE.h new file mode 100644 index 0000000..ff8aef5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_FILE.h
@@ -0,0 +1,120 @@ +/* Copyright (C) 1991-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef __struct_FILE_defined +#define __struct_FILE_defined 1 + +/* Caution: The contents of this file are not part of the official + stdio.h API. However, much of it is part of the official *binary* + interface, and therefore cannot be changed. */ + +#if defined _IO_USE_OLD_IO_FILE && !defined _LIBC +# error "_IO_USE_OLD_IO_FILE should only be defined when building libc itself" +#endif + +#if defined _IO_lock_t_defined && !defined _LIBC +# error "_IO_lock_t_defined should only be defined when building libc itself" +#endif + +#include <bits/types.h> + +struct _IO_FILE; +struct _IO_marker; +struct _IO_codecvt; +struct _IO_wide_data; + +/* During the build of glibc itself, _IO_lock_t will already have been + defined by internal headers. */ +#ifndef _IO_lock_t_defined +typedef void _IO_lock_t; +#endif + +/* The tag name of this struct is _IO_FILE to preserve historic + C++ mangled names for functions taking FILE* arguments. + That name should not be used in new code. */ +struct _IO_FILE +{ + int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ + + /* The following pointers correspond to the C++ streambuf protocol. */ + char *_IO_read_ptr; /* Current read pointer */ + char *_IO_read_end; /* End of get area. */ + char *_IO_read_base; /* Start of putback+get area. */ + char *_IO_write_base; /* Start of put area. */ + char *_IO_write_ptr; /* Current put pointer. */ + char *_IO_write_end; /* End of put area. */ + char *_IO_buf_base; /* Start of reserve area. */ + char *_IO_buf_end; /* End of reserve area. */ + + /* The following fields are used to support backing up and undo. */ + char *_IO_save_base; /* Pointer to start of non-current get area. */ + char *_IO_backup_base; /* Pointer to first valid character of backup area */ + char *_IO_save_end; /* Pointer to end of non-current get area. */ + + struct _IO_marker *_markers; + + struct _IO_FILE *_chain; + + int _fileno; + int _flags2; + __off_t _old_offset; /* This used to be _offset but it's too small. */ + + /* 1+column number of pbase(); 0 is unknown. */ + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + + _IO_lock_t *_lock; +#ifdef _IO_USE_OLD_IO_FILE +}; + +struct _IO_FILE_complete +{ + struct _IO_FILE _file; +#endif + __off64_t _offset; + /* Wide character stream stuff. */ + struct _IO_codecvt *_codecvt; + struct _IO_wide_data *_wide_data; + struct _IO_FILE *_freeres_list; + void *_freeres_buf; + size_t __pad5; + int _mode; + /* Make sure we don't get into trouble again. */ + char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; +}; + +/* These macros are used by bits/stdio.h and internal headers. */ +#define __getc_unlocked_body(_fp) \ + (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end) \ + ? __uflow (_fp) : *(unsigned char *) (_fp)->_IO_read_ptr++) + +#define __putc_unlocked_body(_ch, _fp) \ + (__glibc_unlikely ((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \ + ? __overflow (_fp, (unsigned char) (_ch)) \ + : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch))) + +#define _IO_EOF_SEEN 0x0010 +#define __feof_unlocked_body(_fp) (((_fp)->_flags & _IO_EOF_SEEN) != 0) + +#define _IO_ERR_SEEN 0x0020 +#define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0) + +#define _IO_USER_LOCK 0x8000 +/* Many more flag bits are defined internally. */ + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct___jmp_buf_tag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct___jmp_buf_tag.h new file mode 100644 index 0000000..c7e0911 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct___jmp_buf_tag.h
@@ -0,0 +1,37 @@ +/* Define struct __jmp_buf_tag. + Copyright (C) 1991-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef __jmp_buf_tag_defined +#define __jmp_buf_tag_defined 1 + +#include <bits/setjmp.h> /* Get `__jmp_buf'. */ +#include <bits/types/__sigset_t.h> + +/* Calling environment, plus possibly a saved signal mask. */ +struct __jmp_buf_tag + { + /* NOTE: The machine-dependent definitions of `__sigsetjmp' + assume that a `jmp_buf' begins with a `__jmp_buf' and that + `__mask_was_saved' follows it. Do not move these members + or add others before it. */ + __jmp_buf __jmpbuf; /* Calling environment. */ + int __mask_was_saved; /* Saved the signal mask? */ + __sigset_t __saved_mask; /* Saved signal mask. */ + }; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_iovec.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_iovec.h index 490b06b..89a87b7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_iovec.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_iovec.h
@@ -1,5 +1,5 @@ /* Define struct iovec. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __iovec_defined #define __iovec_defined 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_msqid_ds.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_msqid_ds.h new file mode 100644 index 0000000..1ed041a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_msqid_ds.h
@@ -0,0 +1,47 @@ +/* Generic implementation of the SysV message struct msqid_ds. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_MSG_H +# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead." +#endif + +/* Structure of record for one message inside the kernel. + The type `struct msg' is opaque. */ +struct msqid_ds +{ + struct ipc_perm msg_perm; /* structure describing operation permission */ +#if __TIMESIZE == 32 + __time_t msg_stime; /* time of last msgsnd command */ + unsigned long int __msg_stime_high; + __time_t msg_rtime; /* time of last msgsnd command */ + unsigned long int __msg_rtime_high; + __time_t msg_ctime; /* time of last change */ + unsigned long int __msg_ctime_high; +#else + __time_t msg_stime; /* time of last msgsnd command */ + __time_t msg_rtime; /* time of last msgsnd command */ + __time_t msg_ctime; /* time of last change */ +#endif + __syscall_ulong_t __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + __syscall_ulong_t __glibc_reserved4; + __syscall_ulong_t __glibc_reserved5; +};
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_rusage.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_rusage.h index 5dc0916..7edd761 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_rusage.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_rusage.h
@@ -1,5 +1,5 @@ /* Define struct rusage. - Copyright (C) 1994-2018 Free Software Foundation, Inc. + Copyright (C) 1994-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __rusage_defined #define __rusage_defined 1 @@ -22,7 +22,9 @@ #include <bits/types.h> #include <bits/types/struct_timeval.h> -/* Structure which says how much of each resource has been used. */ +/* Structure which says how much of each resource has been used. If + the system does not keep track of a particular value, the struct + field is always zero. */ /* The purpose of all the unions is to have the kernel-compatible layout while keeping the API type as 'long int', and among machines where @@ -42,7 +44,6 @@ }; /* Amount of sharing of text segment memory with other processes (kilobyte-seconds). */ - /* Maximum resident set size (in kilobytes). */ __extension__ union { long int ru_ixrss;
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sched_param.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sched_param.h new file mode 100644 index 0000000..78f3d0b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sched_param.h
@@ -0,0 +1,28 @@ +/* Sched parameter structure. Generic version. + Copyright (C) 1996-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _BITS_TYPES_STRUCT_SCHED_PARAM +#define _BITS_TYPES_STRUCT_SCHED_PARAM 1 + +/* Data structure to describe a process' schedulability. */ +struct sched_param +{ + int sched_priority; +}; + +#endif /* bits/types/struct_sched_param.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_semid_ds.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_semid_ds.h new file mode 100644 index 0000000..2f32fa5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_semid_ds.h
@@ -0,0 +1,39 @@ +/* Generic implementation of the semaphore struct semid_ds. + Copyright (C) 1995-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SEM_H +# error "Never include <bits/types/struct_semid_ds.h> directly; use <sys/sem.h> instead." +#endif + +/* Data structure describing a set of semaphores. */ +struct semid_ds +{ + struct ipc_perm sem_perm; /* operation permission struct */ +#if __TIMESIZE == 32 + __time_t sem_otime; /* last semop() time */ + __syscall_ulong_t __sem_otime_high; + __time_t sem_ctime; /* last time changed by semctl() */ + __syscall_ulong_t __sem_ctime_high; +#else + __time_t sem_otime; + __time_t sem_ctime; +#endif + __syscall_ulong_t sem_nsems; /* number of semaphores in set */ + __syscall_ulong_t __glibc_reserved3; + __syscall_ulong_t __glibc_reserved4; +};
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_shmid_ds.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_shmid_ds.h new file mode 100644 index 0000000..2bd587d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_shmid_ds.h
@@ -0,0 +1,45 @@ +/* Generic implementation of the shared memory struct shmid_ds. + Copyright (C) 2020-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_SHM_H +# error "Never include <bits/types/struct_shmid_ds.h> directly; use <sys/shm.h> instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ +#if __TIMESIZE == 32 + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __shm_atime_high; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __shm_dtime_high; + __time_t shm_ctime; /* time of last change by shmctl() */ + unsigned long int __shm_ctime_high; +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#endif + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; + };
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sigstack.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sigstack.h index 22da176..6500c01 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sigstack.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_sigstack.h
@@ -1,5 +1,5 @@ /* Define struct sigstack. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef __sigstack_defined #define __sigstack_defined 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx.h new file mode 100644 index 0000000..44153a8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx.h
@@ -0,0 +1,55 @@ +/* Definition of the generic version of struct statx. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_STAT_H +# error Never include <bits/types/struct_statx.h> directly, include <sys/stat.h> instead. +#endif + +#ifndef __statx_defined +#define __statx_defined 1 + +/* Warning: The kernel may add additional fields to this struct in the + future. Only use this struct for calling the statx function, not + for storing data. (Expansion will be controlled by the mask + argument of the statx function.) */ +struct statx +{ + __uint32_t stx_mask; + __uint32_t stx_blksize; + __uint64_t stx_attributes; + __uint32_t stx_nlink; + __uint32_t stx_uid; + __uint32_t stx_gid; + __uint16_t stx_mode; + __uint16_t __statx_pad1[1]; + __uint64_t stx_ino; + __uint64_t stx_size; + __uint64_t stx_blocks; + __uint64_t stx_attributes_mask; + struct statx_timestamp stx_atime; + struct statx_timestamp stx_btime; + struct statx_timestamp stx_ctime; + struct statx_timestamp stx_mtime; + __uint32_t stx_rdev_major; + __uint32_t stx_rdev_minor; + __uint32_t stx_dev_major; + __uint32_t stx_dev_minor; + __uint64_t __statx_pad2[14]; +}; + +#endif /* __statx_defined */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx_timestamp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx_timestamp.h new file mode 100644 index 0000000..360d46c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_statx_timestamp.h
@@ -0,0 +1,33 @@ +/* Definition of the generic version of struct statx_timestamp. + Copyright (C) 2018-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _SYS_STAT_H +# error Never include <bits/types/struct_statx_timestamp.h> directly, include <sys/stat.h> instead. +#endif + +#ifndef __statx_timestamp_defined +#define __statx_timestamp_defined 1 + +struct statx_timestamp +{ + __int64_t tv_sec; + __uint32_t tv_nsec; + __int32_t __statx_timestamp_pad1[1]; +}; + +#endif /* __statx_timestamp_defined */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timeb.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timeb.h new file mode 100644 index 0000000..1fe60c7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timeb.h
@@ -0,0 +1,15 @@ +#ifndef __timeb_defined +#define __timeb_defined 1 + +#include <bits/types/time_t.h> + +/* Structure returned by the 'ftime' function. */ +struct timeb + { + time_t time; /* Seconds since epoch, as from 'time'. */ + unsigned short int millitm; /* Additional milliseconds. */ + short int timezone; /* Minutes west of GMT. */ + short int dstflag; /* Nonzero if Daylight Savings Time used. */ + }; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timespec.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timespec.h index 5b77c52..d11c69c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timespec.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/types/struct_timespec.h
@@ -3,13 +3,26 @@ #define _STRUCT_TIMESPEC 1 #include <bits/types.h> +#include <bits/endian.h> /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { __time_t tv_sec; /* Seconds. */ +#if __WORDSIZE == 64 \ + || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ + || __TIMESIZE == 32 __syscall_slong_t tv_nsec; /* Nanoseconds. */ +#else +# if __BYTE_ORDER == __BIG_ENDIAN + int: 32; /* Padding. */ + long int tv_nsec; /* Nanoseconds. */ +# else + long int tv_nsec; /* Nanoseconds. */ + int: 32; /* Padding. */ +# endif +#endif }; #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/typesizes.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/typesizes.h index a2cb343..0dd3363 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/typesizes.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/typesizes.h
@@ -1,5 +1,5 @@ /* bits/typesizes.h -- underlying types for *_t. For the generic Linux ABI. - Copyright (C) 2011-2018 Free Software Foundation, Inc. + Copyright (C) 2011-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_TYPES_H # error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead." @@ -26,31 +26,45 @@ /* See <bits/types.h> for the meaning of these macros. This file exists so that <bits/types.h> need not vary across different GNU platforms. */ +#if __TIMESIZE == 64 && __WORDSIZE == 32 +/* These are the "new" y2038 types defined for architectures added after + the 5.1 kernel. */ +# define __INO_T_TYPE __UQUAD_TYPE +# define __OFF_T_TYPE __SQUAD_TYPE +# define __RLIM_T_TYPE __UQUAD_TYPE +# define __BLKCNT_T_TYPE __SQUAD_TYPE +# define __FSBLKCNT_T_TYPE __UQUAD_TYPE +# define __FSFILCNT_T_TYPE __UQUAD_TYPE +# define __TIME_T_TYPE __SQUAD_TYPE +# define __SUSECONDS_T_TYPE __SQUAD_TYPE +#else +# define __INO_T_TYPE __ULONGWORD_TYPE +# define __OFF_T_TYPE __SLONGWORD_TYPE +# define __RLIM_T_TYPE __ULONGWORD_TYPE +# define __BLKCNT_T_TYPE __SLONGWORD_TYPE +# define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE +# define __FSFILCNT_T_TYPE __ULONGWORD_TYPE +# define __TIME_T_TYPE __SLONGWORD_TYPE +# define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#endif #define __DEV_T_TYPE __UQUAD_TYPE #define __UID_T_TYPE __U32_TYPE #define __GID_T_TYPE __U32_TYPE -#define __INO_T_TYPE __ULONGWORD_TYPE #define __INO64_T_TYPE __UQUAD_TYPE #define __MODE_T_TYPE __U32_TYPE #define __NLINK_T_TYPE __U32_TYPE -#define __OFF_T_TYPE __SLONGWORD_TYPE #define __OFF64_T_TYPE __SQUAD_TYPE #define __PID_T_TYPE __S32_TYPE -#define __RLIM_T_TYPE __ULONGWORD_TYPE #define __RLIM64_T_TYPE __UQUAD_TYPE -#define __BLKCNT_T_TYPE __SLONGWORD_TYPE #define __BLKCNT64_T_TYPE __SQUAD_TYPE -#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE #define __FSBLKCNT64_T_TYPE __UQUAD_TYPE -#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE #define __FSFILCNT64_T_TYPE __UQUAD_TYPE #define __FSWORD_T_TYPE __SWORD_TYPE #define __ID_T_TYPE __U32_TYPE #define __CLOCK_T_TYPE __SLONGWORD_TYPE -#define __TIME_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE -#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE +#define __SUSECONDS64_T_TYPE __SQUAD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE @@ -62,7 +76,7 @@ #define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE #define __CPU_MASK_TYPE __ULONGWORD_TYPE -#ifdef __LP64__ +#if defined __LP64__ || (__TIMESIZE == 64 && __WORDSIZE == 32) /* Tell the libc code that off_t and off64_t are actually the same type for all ABI purposes, even if possibly expressed as different base types for C type-checking purposes. */ @@ -73,8 +87,18 @@ /* And for __rlim_t and __rlim64_t. */ # define __RLIM_T_MATCHES_RLIM64_T 1 + +/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ +# define __STATFS_MATCHES_STATFS64 1 + +/* And for getitimer, setitimer and rusage */ +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 (__WORDSIZE == 64) #else # define __RLIM_T_MATCHES_RLIM64_T 0 + +# define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif /* Number of descriptors that can fit in an `fd_set'. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uintn-identity.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uintn-identity.h index 2ce9235..6eb4964 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uintn-identity.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uintn-identity.h
@@ -1,5 +1,5 @@ /* Inline functions to return unsigned integer values unchanged. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined _NETINET_IN_H && !defined _ENDIAN_H # error "Never use <bits/uintn-identity.h> directly; include <netinet/in.h> or <endian.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio-ext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio-ext.h index 8698bc1..d5dd41a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio-ext.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio-ext.h
@@ -1,5 +1,5 @@ /* Operating system-specific extensions to sys/uio.h - Linux version. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_UIO_EXT_H #define _BITS_UIO_EXT_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio_lim.h index a443fd8..2abf22e 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/uio_lim.h
@@ -1,5 +1,5 @@ /* Implementation limits related to sys/uio.h - Linux version. - Copyright (C) 2017-2018 Free Software Foundation, Inc. + Copyright (C) 2017-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_UIO_LIM_H #define _BITS_UIO_LIM_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd.h index 4304966..d5687ad 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd.h
@@ -1,5 +1,5 @@ /* Checking macros for unistd functions. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,16 +14,18 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _UNISTD_H # error "Never include <bits/unistd.h> directly; use <unistd.h> instead." #endif extern ssize_t __read_chk (int __fd, void *__buf, size_t __nbytes, - size_t __buflen) __wur; + size_t __buflen) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, - size_t __nbytes), read) __wur; + size_t __nbytes), read) + __wur __attr_access ((__write_only__, 2, 3)); __fortify_potential_overload __wur ssize_t read (int __fd, void *const __clang_pass_object_size0 __buf, size_t __nbytes) @@ -32,23 +34,27 @@ "read called with bigger length than " "size of the destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__buf) != (size_t) -1) - return __read_chk (__fd, __buf, __nbytes, __bos0 (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__buf) != (size_t) -1) + return __read_chk (__fd, __buf, __nbytes, __glibc_objsize0 (__buf)); return __read_alias (__fd, __buf, __nbytes); } __FORTIFY_FUNCTION_END #ifdef __USE_UNIX98 extern ssize_t __pread_chk (int __fd, void *__buf, size_t __nbytes, - __off_t __offset, size_t __bufsize) __wur; + __off_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __pread64_chk (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset, size_t __bufsize) __wur; + __off64_t __offset, size_t __bufsize) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread_alias, (int __fd, void *__buf, size_t __nbytes, - __off_t __offset), pread) __wur; + __off_t __offset), pread) + __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT (__pread64_alias, (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset), pread64) __wur; + __off64_t __offset), pread64) + __wur __attr_access ((__write_only__, 2, 3)); # ifndef __USE_FILE_OFFSET64 # define __fo_pread_chk __pread_chk @@ -68,8 +74,8 @@ "pread called with bigger length than " "size of the destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__buf) != (size_t) -1) - return __fo_pread_chk (__fd, __buf, __nbytes, __offset, __bos0 (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__buf) != (size_t) -1) + return __fo_pread_chk (__fd, __buf, __nbytes, __offset, __glibc_objsize0 (__buf)); return __fo_pread_alias (__fd, __buf, __nbytes, __offset); } __FORTIFY_FUNCTION_END @@ -87,8 +93,8 @@ "pread64 called with bigger length " "than size of the destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__buf) != (size_t) -1) - return __pread64_chk (__fd, __buf, __nbytes, __offset, __bos0 (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__buf) != (size_t) -1) + return __pread64_chk (__fd, __buf, __nbytes, __offset, __glibc_objsize0 (__buf)); return __pread64_alias (__fd, __buf, __nbytes, __offset); } __FORTIFY_FUNCTION_END @@ -99,11 +105,11 @@ extern ssize_t __readlink_chk (const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); extern ssize_t __REDIRECT_NTH (__readlink_alias, (const char *__restrict __path, char *__restrict __buf, size_t __len), readlink) - __nonnull ((1, 2)) __wur; + __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); __fortify_potential_overload __nonnull ((1, 2)) __wur ssize_t __NTH (readlink (const char *__restrict __path, @@ -114,8 +120,8 @@ "readlink called with bigger length " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __readlink_chk (__path, __buf, __len, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __readlink_chk (__path, __buf, __len, __glibc_objsize (__buf)); return __readlink_alias (__path, __buf, __len); } __FORTIFY_FUNCTION_END @@ -125,12 +131,12 @@ extern ssize_t __readlinkat_chk (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) - __THROW __nonnull ((2, 3)) __wur; + __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); extern ssize_t __REDIRECT_NTH (__readlinkat_alias, (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len), readlinkat) - __nonnull ((2, 3)) __wur; + __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); __fortify_potential_overload __nonnull ((2, 3)) __wur ssize_t __NTH (readlinkat (int __fd, @@ -142,8 +148,8 @@ "readlinkat called with bigger length " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __readlinkat_chk (__fd, __path, __buf, __len, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __readlinkat_chk (__fd, __path, __buf, __len, __glibc_objsize (__buf)); return __readlinkat_alias (__fd, __path, __buf, __len); } __FORTIFY_FUNCTION_END @@ -161,8 +167,8 @@ "getcwd called with bigger length than " "size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __getcwd_chk (__buf, __size, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __getcwd_chk (__buf, __size, __glibc_objsize (__buf)); return __getcwd_alias (__buf, __size); } __FORTIFY_FUNCTION_END @@ -172,7 +178,7 @@ "please use getcwd instead, as getwd doesn't specify buffer size" extern char *__getwd_chk (char *__buf, size_t buflen) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern char *__REDIRECT_NTH (__getwd_warn, (char *__buf), getwd) __nonnull ((1)) __wur __warnattr (__warn_getwd_use_something_else); @@ -181,20 +187,22 @@ __fortify_potential_overload __nonnull ((1)) __attribute_deprecated__ __wur char * __NTH (getwd (char *const __clang_pass_object_size __buf)) - __clang_warning_if (__bos (__buf) == (size_t) -1, + __clang_warning_if (__glibc_objsize (__buf) == (size_t) -1, __warn_getwd_use_something_else) { - if (__bos (__buf) != (size_t) -1) - return __getwd_chk (__buf, __bos (__buf)); + if (__glibc_objsize (__buf) != (size_t) -1) + return __getwd_chk (__buf, __glibc_objsize (__buf)); return __getwd_warn (__buf); } # undef __warn_getwd_use_something_else #endif extern size_t __confstr_chk (int __name, char *__buf, size_t __len, - size_t __buflen) __THROW; + size_t __buflen) __THROW + __attr_access ((__write_only__, 2, 3)); extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf, - size_t __len), confstr); + size_t __len), confstr) + __attr_access ((__write_only__, 2, 3)); __fortify_potential_overload size_t __NTH (confstr (int __name, char *const __clang_pass_object_size __buf, @@ -204,16 +212,16 @@ "confstr called with bigger length than " "size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __confstr_chk (__name, __buf, __len, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __confstr_chk (__name, __buf, __len, __glibc_objsize (__buf)); return __confstr_alias (__name, __buf, __len); } __FORTIFY_FUNCTION_END extern int __getgroups_chk (int __size, __gid_t __list[], size_t __listlen) - __THROW __wur; + __THROW __wur __attr_access ((__write_only__, 2, 1)); extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]), - getgroups) __wur; + getgroups) __wur __attr_access ((__write_only__, 2, 1)); __fortify_potential_overload int __NTH (getgroups (int __size, __gid_t *const __clang_pass_object_size __list)) @@ -224,15 +232,16 @@ "count than what can fit into " "destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__list) != (size_t) -1) - return __getgroups_chk (__size, __list, __bos (__list)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__list) != (size_t) -1) + return __getgroups_chk (__size, __list, __glibc_objsize (__list)); return __getgroups_alias (__size, __list); } __FORTIFY_FUNCTION_END extern int __ttyname_r_chk (int __fd, char *__buf, size_t __buflen, - size_t __nreal) __THROW __nonnull ((2)); + size_t __nreal) __THROW __nonnull ((2)) + __attr_access ((__write_only__, 2, 3)); extern int __REDIRECT_NTH (__ttyname_r_alias, (int __fd, char *__buf, size_t __buflen), ttyname_r) __nonnull ((2)); @@ -250,8 +259,8 @@ "ttyname_r called with bigger buflen " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __ttyname_r_chk (__fd, __buf, __buflen, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __ttyname_r_chk (__fd, __buf, __buflen, __glibc_objsize (__buf)); return __ttyname_r_alias (__fd, __buf, __buflen); } __FORTIFY_FUNCTION_END @@ -259,7 +268,7 @@ #ifdef __USE_POSIX199506 extern int __getlogin_r_chk (char *__buf, size_t __buflen, size_t __nreal) - __nonnull ((1)); + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen), getlogin_r) __nonnull ((1)); @@ -270,8 +279,8 @@ "getlogin_r called with bigger buflen " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __getlogin_r_chk (__buf, __buflen, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __getlogin_r_chk (__buf, __buflen, __glibc_objsize (__buf)); return __getlogin_r_alias (__buf, __buflen); } __FORTIFY_FUNCTION_END @@ -280,9 +289,10 @@ #if defined __USE_MISC || defined __USE_UNIX98 extern int __gethostname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)); + __THROW __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen), - gethostname) __nonnull ((1)); + gethostname) + __nonnull ((1)) __attr_access ((__write_only__, 1, 2)); __fortify_potential_overload int __NTH (gethostname (char *const __clang_pass_object_size __buf, @@ -292,8 +302,8 @@ "gethostname called with bigger buflen " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __gethostname_chk (__buf, __buflen, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __gethostname_chk (__buf, __buflen, __glibc_objsize (__buf)); return __gethostname_alias (__buf, __buflen); } __FORTIFY_FUNCTION_END @@ -302,10 +312,11 @@ #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_UNIX98) extern int __getdomainname_chk (char *__buf, size_t __buflen, size_t __nreal) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)) __wur __attr_access ((__write_only__, 1, 2)); extern int __REDIRECT_NTH (__getdomainname_alias, (char *__buf, size_t __buflen), - getdomainname) __nonnull ((1)) __wur; + getdomainname) __nonnull ((1)) + __wur __attr_access ((__write_only__, 1, 2)); __fortify_potential_overload int __NTH (getdomainname (char *const __clang_pass_object_size __buf, @@ -315,8 +326,8 @@ "getdomainname called with bigger " "buflen than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__buf) != (size_t) -1) - return __getdomainname_chk (__buf, __buflen, __bos (__buf)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__buf) != (size_t) -1) + return __getdomainname_chk (__buf, __buflen, __glibc_objsize (__buf)); return __getdomainname_alias (__buf, __buflen); } __FORTIFY_FUNCTION_END
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd_ext.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd_ext.h new file mode 100644 index 0000000..2e529be --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/unistd_ext.h
@@ -0,0 +1,36 @@ +/* System-specific extensions of <unistd.h>, Linux version. + Copyright (C) 2019-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#ifndef _UNISTD_H +# error "Never include <bits/unistd_ext.h> directly; use <unistd.h> instead." +#endif + +#ifdef __USE_GNU + +/* Return the kernel thread ID (TID) of the current thread. The + returned value is not subject to caching. Most Linux system calls + accept a TID in place of a PID. Using the TID to change properties + of a thread that has been created using pthread_create can lead to + undefined behavior (comparable to manipulating file descriptors + directly that have not been created explicitly). Note that a TID + uniquely identifies a thread only while this thread is running; a + TID can be reused once a thread has exited, even if the thread is + not detached and has not been joined. */ +extern __pid_t gettid (void) __THROW; + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ustat.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ustat.h deleted file mode 100644 index ac9acca..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/ustat.h +++ /dev/null
@@ -1,30 +0,0 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _SYS_USTAT_H -# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead." -#endif - -#include <sys/types.h> - -struct ustat - { - __daddr_t f_tfree; /* Number of free blocks. */ - __ino_t f_tinode; /* Number of free inodes. */ - char f_fname[6]; - char f_fpack[6]; - };
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmp.h index 47a6082..7e5512e 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmp.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmp.h
@@ -1,5 +1,5 @@ -/* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. +/* The `struct utmp' type, describing entries in the utmp file. + Copyright (C) 1993-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _UTMP_H # error "Never include <bits/utmp.h> directly; use <utmp.h> instead." @@ -61,7 +61,8 @@ pid_t ut_pid; /* Process ID of login process. */ char ut_line[UT_LINESIZE] __attribute_nonstring__; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ char ut_user[UT_NAMESIZE] __attribute_nonstring__; /* Username. */ char ut_host[UT_HOSTSIZE]
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmpx.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmpx.h index 2a77efc..c859c5b 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmpx.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utmpx.h
@@ -1,5 +1,5 @@ /* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997-2018 Free Software Foundation, Inc. + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _UTMPX_H # error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead." @@ -56,10 +56,14 @@ { short int ut_type; /* Type of login. */ __pid_t ut_pid; /* Process ID of login process. */ - char ut_line[__UT_LINESIZE]; /* Devicename. */ - char ut_id[4]; /* Inittab ID. */ - char ut_user[__UT_NAMESIZE]; /* Username. */ - char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ + char ut_line[__UT_LINESIZE] + __attribute_nonstring__; /* Devicename. */ + char ut_id[4] + __attribute_nonstring__; /* Inittab ID. */ + char ut_user[__UT_NAMESIZE] + __attribute_nonstring__; /* Username. */ + char ut_host[__UT_HOSTSIZE] + __attribute_nonstring__; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utsname.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utsname.h index 9cc1c35..ec46d7a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utsname.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/utsname.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2018 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _SYS_UTSNAME_H # error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitflags.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitflags.h index e8b1ddd..bf75ade 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitflags.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitflags.h
@@ -1,5 +1,5 @@ /* Definitions of flag bits for `waitpid' et al. - Copyright (C) 1992-2018 Free Software Foundation, Inc. + Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitstatus.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitstatus.h index a1c2326..baaf96a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitstatus.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/waitstatus.h
@@ -1,5 +1,5 @@ /* Definitions of status bits for `wait' et al. - Copyright (C) 1992-2018 Free Software Foundation, Inc. + Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #if !defined _SYS_WAIT_H && !defined _STDLIB_H # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar-ldbl.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar-ldbl.h index b91ee9f..868c8c6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar-ldbl.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar-ldbl.h
@@ -1,5 +1,5 @@ /* -mlong-double-64 compatibility mode for <wchar.h> functions. - Copyright (C) 2006-2018 Free Software Foundation, Inc. + Copyright (C) 2006-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _WCHAR_H # error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead." @@ -27,12 +27,18 @@ __LDBL_REDIR_DECL (vfwprintf); __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); -# if defined __USE_ISOC99 && !defined __USE_GNU \ - && !defined __REDIRECT \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) +# if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128) +__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128) +__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (fwscanf); __LDBL_REDIR_DECL (wscanf); @@ -41,12 +47,23 @@ #endif #ifdef __USE_ISOC99 +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold, wcstod); -# if !defined __USE_GNU && !defined __REDIRECT \ - && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) +# else +__LDBL_REDIR1_DECL (wcstold, __wcstoieee128) +# endif +# if !__GLIBC_USE (DEPRECATED_SCANF) +# if defined __LDBL_COMPAT __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) +# elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128) +__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128) +__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128) +# else +# error bits/stdlib-ldbl.h included when no ldbl redirections are required. +# endif # else __LDBL_REDIR_DECL (vfwscanf); __LDBL_REDIR_DECL (vwscanf); @@ -55,16 +72,20 @@ #endif #ifdef __USE_GNU +# ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (wcstold_l, wcstod_l); +# else +__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l) +# endif #endif #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function -__LDBL_REDIR_DECL (__swprintf_chk) -__LDBL_REDIR_DECL (__vswprintf_chk) +__LDBL_REDIR2_DECL (swprintf_chk) +__LDBL_REDIR2_DECL (vswprintf_chk) # if __USE_FORTIFY_LEVEL > 1 -__LDBL_REDIR_DECL (__fwprintf_chk) -__LDBL_REDIR_DECL (__wprintf_chk) -__LDBL_REDIR_DECL (__vfwprintf_chk) -__LDBL_REDIR_DECL (__vwprintf_chk) +__LDBL_REDIR2_DECL (fwprintf_chk) +__LDBL_REDIR2_DECL (wprintf_chk) +__LDBL_REDIR2_DECL (vfwprintf_chk) +__LDBL_REDIR2_DECL (vwprintf_chk) # endif #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar.h index 5fa6ccd..36623e3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar.h
@@ -1,5 +1,5 @@ /* wchar_t type related definitions. - Copyright (C) 2000-2018 Free Software Foundation, Inc. + Copyright (C) 2000-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar2.h index d1d9ecc..23f1ee6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar2.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wchar2.h
@@ -1,5 +1,5 @@ /* Checking macros for wchar functions. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _WCHAR_H # error "Never include <bits/wchar2.h> directly; use <wchar.h> instead." @@ -37,8 +37,9 @@ "wmemcpy called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__s1) != (size_t)-1) - return __wmemcpy_chk(__s1, __s2, __n, __bos0(__s1) / sizeof (wchar_t)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__s1) != (size_t)-1) + return __wmemcpy_chk(__s1, __s2, __n, + __glibc_objsize0(__s1) / sizeof (wchar_t)); return __wmemcpy_alias(__s1, __s2, __n); } __FORTIFY_FUNCTION_END @@ -58,8 +59,9 @@ "wmemmove called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__s1) != (size_t) -1) - return __wmemmove_chk (__s1, __s2, __n, __bos0 (__s1) / sizeof (wchar_t)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__s1) != (size_t) -1) + return __wmemmove_chk (__s1, __s2, __n, + __glibc_objsize0 (__s1) / sizeof (wchar_t)); return __wmemmove_alias (__s1, __s2, __n); } __FORTIFY_FUNCTION_END @@ -83,8 +85,9 @@ "wmempcpy called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__s1) != (size_t)-1) - return __wmempcpy_chk(__s1, __s2, __n, __bos0(__s1) / sizeof (wchar_t)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__s1) != (size_t)-1) + return __wmempcpy_chk(__s1, __s2, __n, + __glibc_objsize0(__s1) / sizeof (wchar_t)); return __wmempcpy_alias(__s1, __s2, __n); } __FORTIFY_FUNCTION_END @@ -105,8 +108,9 @@ "wmemset called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos0 (__s) != (size_t) -1) - return __wmemset_chk (__s, __c, __n, __bos0 (__s) / sizeof (wchar_t)); + if (__FORTIFY_CALL_CHK && __glibc_objsize0 (__s) != (size_t) -1) + return __wmemset_chk (__s, __c, __n, + __glibc_objsize0 (__s) / sizeof (wchar_t)); return __wmemset_alias (__s, __c, __n); } __FORTIFY_FUNCTION_END @@ -123,8 +127,9 @@ __NTH (wcscpy (wchar_t *__restrict const __clang_pass_object_size __dest, const wchar_t *__restrict __src)) { - if (__bos (__dest) != (size_t) -1) - return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t)); + if (__glibc_objsize (__dest) != (size_t) -1) + return __wcscpy_chk (__dest, __src, + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcscpy_alias (__dest, __src); } @@ -140,8 +145,9 @@ __NTH (wcpcpy (wchar_t *__restrict const __clang_pass_object_size __dest, const wchar_t *__restrict __src)) { - if (__bos (__dest) != (size_t) -1) - return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t)); + if (__glibc_objsize (__dest) != (size_t) -1) + return __wcpcpy_chk (__dest, __src, + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcpcpy_alias (__dest, __src); } @@ -163,9 +169,9 @@ "wcsncpy called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__dest) != (size_t) -1) + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dest) != (size_t) -1) return __wcsncpy_chk (__dest, __src, __n, - __bos (__dest) / sizeof (wchar_t)); + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcsncpy_alias (__dest, __src, __n); } __FORTIFY_FUNCTION_END @@ -188,9 +194,9 @@ "wcpncpy called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__dest) != (size_t) -1) + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dest) != (size_t) -1) return __wcpncpy_chk (__dest, __src, __n, - __bos (__dest) / sizeof (wchar_t)); + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcpncpy_alias (__dest, __src, __n); } __FORTIFY_FUNCTION_END @@ -206,8 +212,9 @@ __NTH (wcscat (wchar_t *__restrict const __clang_pass_object_size __dest, const wchar_t *__restrict __src)) { - if (__bos (__dest) != (size_t) -1) - return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t)); + if (__glibc_objsize (__dest) != (size_t) -1) + return __wcscat_chk (__dest, __src, + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcscat_alias (__dest, __src); } @@ -224,9 +231,9 @@ __NTH (wcsncat (wchar_t *__restrict const __clang_pass_object_size __dest, const wchar_t *__restrict __src, size_t __n)) { - if (__bos (__dest) != (size_t) -1) + if (__glibc_objsize (__dest) != (size_t) -1) return __wcsncat_chk (__dest, __src, __n, - __bos (__dest) / sizeof (wchar_t)); + __glibc_objsize (__dest) / sizeof (wchar_t)); return __wcsncat_alias (__dest, __src, __n); } @@ -259,10 +266,10 @@ { __FORTIFY_INIT_ARG_PACK(__fmt); int __result; - if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) + if (__glibc_objsize (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) __result = __FORTIFY_CALL_VA_CHK(swprintf, __s, __n, __USE_FORTIFY_LEVEL - 1, - __bos (__s) / sizeof (wchar_t), __fmt, + __glibc_objsize (__s) / sizeof (wchar_t), __fmt, __FORTIFY_ARG_PACK); else __result = __FORTIFY_CALL_VA_ALIAS(swprintf, __s, __n, __fmt, @@ -273,9 +280,9 @@ #elif !defined __cplusplus /* XXX We might want to have support in gcc for swprintf. */ # define swprintf(s, n, ...) \ - (__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \ + (__glibc_objsize (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \ ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, \ - __bos (s) / sizeof (wchar_t), __VA_ARGS__) \ + __glibc_objsize (s) / sizeof (wchar_t), __VA_ARGS__) \ : swprintf (s, n, __VA_ARGS__)) #endif @@ -284,9 +291,10 @@ size_t __n, const wchar_t *__restrict __fmt, __gnuc_va_list __ap)) { - if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) + if (__glibc_objsize (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1) return __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, - __bos (__s) / sizeof (wchar_t), __fmt, __ap); + __glibc_objsize (__s) / sizeof (wchar_t), __fmt, + __ap); return __vswprintf_alias (__s, __n, __fmt, __ap); } @@ -363,8 +371,9 @@ "fgetws called with length bigger " "than size of destination buffer") { - if (__FORTIFY_CALL_CHK && __bos (__s) != (size_t) -1) - return __fgetws_chk (__s, __bos (__s) / sizeof (wchar_t), __n, __stream); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__s) != (size_t) -1) + return __fgetws_chk (__s, __glibc_objsize (__s) / sizeof (wchar_t), + __n, __stream); return __fgetws_alias (__s, __n, __stream); } __FORTIFY_FUNCTION_END @@ -384,12 +393,13 @@ __FORTIFY_PRECONDITIONS __FORTIFY_WARNING_IF (__fgetws_unlocked_warn, __n > 0 - && __bos_static_lt2 (__n, __s, sizeof (wchar_t)), + && __bos_static_lt2 (__n, __s, + sizeof (wchar_t)), "fgetws_unlocked called with bigger size than " "length of destination buffer") { - if (__bos (__s) != (size_t) -1) - return __fgetws_unlocked_chk (__s, __bos (__s) / sizeof (wchar_t), + if (__glibc_objsize (__s) != (size_t) -1) + return __fgetws_unlocked_chk (__s, __glibc_objsize (__s) / sizeof (wchar_t), __n, __stream); return __fgetws_unlocked_alias (__s, __n, __stream); } @@ -415,8 +425,9 @@ #if defined MB_LEN_MAX && MB_LEN_MAX != __WCHAR_MB_LEN_MAX # error "Assumed value of MB_LEN_MAX wrong" #endif - if (__bos (__s) != (size_t) -1 && __WCHAR_MB_LEN_MAX > __bos (__s)) - return __wcrtomb_chk (__s, __wchar, __ps, __bos (__s)); + if (__glibc_objsize (__s) != (size_t) -1 + && __WCHAR_MB_LEN_MAX > __glibc_objsize (__s)) + return __wcrtomb_chk (__s, __wchar, __ps, __glibc_objsize (__s)); return __wcrtomb_alias (__s, __wchar, __ps); } @@ -441,9 +452,9 @@ "mbsrtowcs called with dst buffer " "smaller than len * sizeof (wchar_t)") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) return __mbsrtowcs_chk (__dst, __src, __len, __ps, - __bos (__dst) / sizeof (wchar_t)); + __glibc_objsize (__dst) / sizeof (wchar_t)); return __mbsrtowcs_alias (__dst, __src, __len, __ps); } __FORTIFY_FUNCTION_END @@ -468,8 +479,8 @@ "wcsrtombs called with dst buffer " "smaller than len") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) - return __wcsrtombs_chk (__dst, __src, __len, __ps, __bos (__dst)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) + return __wcsrtombs_chk (__dst, __src, __len, __ps, __glibc_objsize (__dst)); return __wcsrtombs_alias (__dst, __src, __len, __ps); } __FORTIFY_FUNCTION_END @@ -496,9 +507,9 @@ "mbsnrtowcs called with dst buffer " "smaller than len * sizeof (wchar_t)") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) return __mbsnrtowcs_chk (__dst, __src, __nmc, __len, __ps, - __bos (__dst) / sizeof (wchar_t)); + __glibc_objsize (__dst) / sizeof (wchar_t)); return __mbsnrtowcs_alias (__dst, __src, __nmc, __len, __ps); } __FORTIFY_FUNCTION_END @@ -524,8 +535,9 @@ "wcsnrtombs called with dst buffer " "smaller than len") { - if (__FORTIFY_CALL_CHK && __bos (__dst) != (size_t) -1) - return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps, __bos (__dst)); + if (__FORTIFY_CALL_CHK && __glibc_objsize (__dst) != (size_t) -1) + return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps, + __glibc_objsize (__dst)); return __wcsnrtombs_alias (__dst, __src, __nwc, __len, __ps); } __FORTIFY_FUNCTION_END
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wctype-wchar.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wctype-wchar.h index 03c2077..01827a7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wctype-wchar.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wctype-wchar.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * ISO C99 Standard: 7.25 @@ -42,7 +42,7 @@ endian). We define the bit value interpretations here dependent on the machine's byte order. */ -# include <endian.h> +# include <bits/endian.h> # if __BYTE_ORDER == __BIG_ENDIAN # define _ISwbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wordsize.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wordsize.h index ea7eecd..91da566 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wordsize.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/wordsize.h
@@ -1,6 +1,6 @@ /* Determine the wordsize from the preprocessor defines. - Copyright (C) 2016-2018 Free Software Foundation, Inc. + Copyright (C) 2016-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifdef __LP64__ # define __WORDSIZE 64
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xopen_lim.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xopen_lim.h index d14b633..0be465f 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xopen_lim.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xopen_lim.h
@@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2018 Free Software Foundation, Inc. +/* Copyright (C) 1996-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ /* * Never include this file directly; use <limits.h> instead.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xtitypes.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xtitypes.h deleted file mode 100644 index 1b5c8ac..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/bits/xtitypes.h +++ /dev/null
@@ -1,33 +0,0 @@ -/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>. Generic. - Copyright (C) 2002-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _STROPTS_H -# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead." -#endif - -#ifndef _BITS_XTITYPES_H -#define _BITS_XTITYPES_H 1 - -#include <bits/types.h> - -/* This type is used by some structs in <bits/stropts.h>. */ -typedef __SLONGWORD_TYPE __t_scalar_t; -typedef __ULONGWORD_TYPE __t_uscalar_t; - - -#endif /* bits/xtitypes.h */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/byteswap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/byteswap.h index a45b3e2..e9da7a4 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/byteswap.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/byteswap.h
@@ -1,4 +1,5 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. +/* Swap byte order for 16, 32 and 64 bit values + Copyright (C) 1997-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _BYTESWAP_H #define _BYTESWAP_H 1 @@ -24,10 +25,10 @@ #include <bits/byteswap.h> -/* The following definitions must all be macros since otherwise some +/* The following definitions must all be macros, otherwise some of the possible optimizations are not possible. */ -/* Return a value with all bytes in the 16 bit argument swapped. */ +/* Return a value with both bytes in the 16 bit argument swapped. */ #define bswap_16(x) __bswap_16 (x) /* Return a value with all bytes in the 32 bit argument swapped. */
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/adjacent_find.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/adjacent_find.h new file mode 100644 index 0000000..621ef5f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/adjacent_find.h
@@ -0,0 +1,46 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H +#define _LIBCPP___ALGORITHM_ADJACENT_FIND_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) { + if (__first != __last) { + _ForwardIterator __i = __first; + while (++__i != __last) { + if (__pred(*__first, *__i)) + return __first; + __first = __i; + } + } + return __last; +} + +template <class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +adjacent_find(_ForwardIterator __first, _ForwardIterator __last) { + typedef typename iterator_traits<_ForwardIterator>::value_type __v; + return _VSTD::adjacent_find(__first, __last, __equal_to<__v>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/all_of.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/all_of.h new file mode 100644 index 0000000..817a4bc --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/all_of.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ALL_OF_H +#define _LIBCPP___ALGORITHM_ALL_OF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + for (; __first != __last; ++__first) + if (!__pred(*__first)) + return false; + return true; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ALL_OF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/any_of.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/any_of.h new file mode 100644 index 0000000..f4116d9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/any_of.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ANY_OF_H +#define _LIBCPP___ALGORITHM_ANY_OF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + for (; __first != __last; ++__first) + if (__pred(*__first)) + return true; + return false; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ANY_OF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/binary_search.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/binary_search.h new file mode 100644 index 0000000..8fc55b9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/binary_search.h
@@ -0,0 +1,55 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_BINARY_SEARCH_H +#define _LIBCPP___ALGORITHM_BINARY_SEARCH_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/lower_bound.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + __first = _VSTD::__lower_bound<_Compare>(__first, __last, __value_, __comp); + return __first != __last && !__comp(__value_, *__first); +} + +template <class _ForwardIterator, class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__binary_search<_Comp_ref>(__first, __last, __value_, __comp); +} + +template <class _ForwardIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + return _VSTD::binary_search(__first, __last, __value_, + __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_BINARY_SEARCH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/clamp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/clamp.h new file mode 100644 index 0000000..db28735 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/clamp.h
@@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_CLAMP_H +#define _LIBCPP___ALGORITHM_CLAMP_H + +#include <__config> +#include <__debug> +#include <__algorithm/comp.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 +template<class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +const _Tp& +clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp) +{ + _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp"); + return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v; + +} + +template<class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +const _Tp& +clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi) +{ + return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>()); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_CLAMP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp.h new file mode 100644 index 0000000..b3f971e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp.h
@@ -0,0 +1,92 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COMP_H +#define _LIBCPP___ALGORITHM_COMP_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// I'd like to replace these with _VSTD::equal_to<void>, but can't because: +// * That only works with C++14 and later, and +// * We haven't included <functional> here. +template <class _T1, class _T2 = _T1> +struct __equal_to +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} +}; + +template <class _T1> +struct __equal_to<_T1, _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} +}; + +template <class _T1> +struct __equal_to<const _T1, _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} +}; + +template <class _T1> +struct __equal_to<_T1, const _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} +}; + +template <class _T1, class _T2 = _T1> +struct __less +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;} +}; + +template <class _T1> +struct __less<_T1, _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} +}; + +template <class _T1> +struct __less<const _T1, _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} +}; + +template <class _T1> +struct __less<_T1, const _T1> +{ + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COMP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp_ref_type.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp_ref_type.h new file mode 100644 index 0000000..6cc6405 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/comp_ref_type.h
@@ -0,0 +1,85 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COMP_REF_TYPE_H +#define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H + +#include <__config> + +#ifdef _LIBCPP_DEBUG +# include <__debug> +# include <__utility/declval.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifdef _LIBCPP_DEBUG + +template <class _Compare> +struct __debug_less +{ + _Compare &__comp_; + _LIBCPP_CONSTEXPR_AFTER_CXX17 + __debug_less(_Compare& __c) : __comp_(__c) {} + + template <class _Tp, class _Up> + _LIBCPP_CONSTEXPR_AFTER_CXX17 + bool operator()(const _Tp& __x, const _Up& __y) + { + bool __r = __comp_(__x, __y); + if (__r) + __do_compare_assert(0, __y, __x); + return __r; + } + + template <class _Tp, class _Up> + _LIBCPP_CONSTEXPR_AFTER_CXX17 + bool operator()(_Tp& __x, _Up& __y) + { + bool __r = __comp_(__x, __y); + if (__r) + __do_compare_assert(0, __y, __x); + return __r; + } + + template <class _LHS, class _RHS> + _LIBCPP_CONSTEXPR_AFTER_CXX17 + inline _LIBCPP_INLINE_VISIBILITY + decltype((void)declval<_Compare&>()( + declval<_LHS &>(), declval<_RHS &>())) + __do_compare_assert(int, _LHS & __l, _RHS & __r) { + _LIBCPP_ASSERT(!__comp_(__l, __r), + "Comparator does not induce a strict weak ordering"); + } + + template <class _LHS, class _RHS> + _LIBCPP_CONSTEXPR_AFTER_CXX17 + inline _LIBCPP_INLINE_VISIBILITY + void __do_compare_assert(long, _LHS &, _RHS &) {} +}; + +#endif // _LIBCPP_DEBUG + +template <class _Comp> +struct __comp_ref_type { + // Pass the comparator by lvalue reference. Or in debug mode, using a + // debugging wrapper that stores a reference. +#ifndef _LIBCPP_DEBUG + typedef _Comp& type; +#else + typedef __debug_less<_Comp> type; +#endif +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy.h new file mode 100644 index 0000000..e7e8b9e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy.h
@@ -0,0 +1,77 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COPY_H +#define _LIBCPP___ALGORITHM_COPY_H + +#include <__config> +#include <__algorithm/unwrap_iter.h> +#include <__iterator/iterator_traits.h> +#include <cstring> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// copy + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +__copy_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + for (; __first != __last; ++__first, (void) ++__result) + *__result = *__first; + return __result; +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY +_OutputIterator +__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + return _VSTD::__copy_constexpr(__first, __last, __result); +} + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +typename enable_if +< + is_same<typename remove_const<_Tp>::type, _Up>::value && + is_trivially_copy_assignable<_Up>::value, + _Up* +>::type +__copy(_Tp* __first, _Tp* __last, _Up* __result) +{ + const size_t __n = static_cast<size_t>(__last - __first); + if (__n > 0) + _VSTD::memmove(__result, __first, __n * sizeof(_Up)); + return __result + __n; +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + if (__libcpp_is_constant_evaluated()) { + return _VSTD::__copy_constexpr(__first, __last, __result); + } else { + return _VSTD::__rewrap_iter(__result, + _VSTD::__copy(_VSTD::__unwrap_iter(__first), + _VSTD::__unwrap_iter(__last), + _VSTD::__unwrap_iter(__result))); + } +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_backward.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_backward.h new file mode 100644 index 0000000..4a2f8c0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_backward.h
@@ -0,0 +1,79 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COPY_BACKWARD_H +#define _LIBCPP___ALGORITHM_COPY_BACKWARD_H + +#include <__config> +#include <__algorithm/unwrap_iter.h> +#include <__iterator/iterator_traits.h> +#include <cstring> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BidirectionalIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +__copy_backward_constexpr(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) +{ + while (__first != __last) + *--__result = *--__last; + return __result; +} + +template <class _BidirectionalIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY +_OutputIterator +__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) +{ + return _VSTD::__copy_backward_constexpr(__first, __last, __result); +} + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +typename enable_if +< + is_same<typename remove_const<_Tp>::type, _Up>::value && + is_trivially_copy_assignable<_Up>::value, + _Up* +>::type +__copy_backward(_Tp* __first, _Tp* __last, _Up* __result) +{ + const size_t __n = static_cast<size_t>(__last - __first); + if (__n > 0) + { + __result -= __n; + _VSTD::memmove(__result, __first, __n * sizeof(_Up)); + } + return __result; +} + +template <class _BidirectionalIterator1, class _BidirectionalIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_BidirectionalIterator2 +copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, + _BidirectionalIterator2 __result) +{ + if (__libcpp_is_constant_evaluated()) { + return _VSTD::__copy_backward_constexpr(__first, __last, __result); + } else { + return _VSTD::__rewrap_iter(__result, + _VSTD::__copy_backward(_VSTD::__unwrap_iter(__first), + _VSTD::__unwrap_iter(__last), + _VSTD::__unwrap_iter(__result))); + } +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COPY_BACKWARD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_if.h new file mode 100644 index 0000000..230826f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_if.h
@@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COPY_IF_H +#define _LIBCPP___ALGORITHM_COPY_IF_H + +#include <__config> +#include <__algorithm/unwrap_iter.h> +#include <__iterator/iterator_traits.h> +#include <cstring> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _InputIterator, class _OutputIterator, class _Predicate> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +copy_if(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, _Predicate __pred) +{ + for (; __first != __last; ++__first) + { + if (__pred(*__first)) + { + *__result = *__first; + ++__result; + } + } + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COPY_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_n.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_n.h new file mode 100644 index 0000000..38a84a4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/copy_n.h
@@ -0,0 +1,68 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COPY_N_H +#define _LIBCPP___ALGORITHM_COPY_N_H + +#include <__config> +#include <__algorithm/copy.h> +#include <__algorithm/unwrap_iter.h> +#include <__iterator/iterator_traits.h> +#include <cstring> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _InputIterator, class _Size, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +typename enable_if +< + __is_cpp17_input_iterator<_InputIterator>::value && + !__is_cpp17_random_access_iterator<_InputIterator>::value, + _OutputIterator +>::type +copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) +{ + typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize; + _IntegralSize __n = __orig_n; + if (__n > 0) + { + *__result = *__first; + ++__result; + for (--__n; __n > 0; --__n) + { + ++__first; + *__result = *__first; + ++__result; + } + } + return __result; +} + +template<class _InputIterator, class _Size, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +typename enable_if +< + __is_cpp17_random_access_iterator<_InputIterator>::value, + _OutputIterator +>::type +copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) +{ + typedef typename iterator_traits<_InputIterator>::difference_type difference_type; + typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize; + _IntegralSize __n = __orig_n; + return _VSTD::copy(__first, __first + difference_type(__n), __result); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COPY_N_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count.h new file mode 100644 index 0000000..81a2c18 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count.h
@@ -0,0 +1,35 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COUNT_H +#define _LIBCPP___ALGORITHM_COUNT_H + +#include <__config> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename iterator_traits<_InputIterator>::difference_type + count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { + typename iterator_traits<_InputIterator>::difference_type __r(0); + for (; __first != __last; ++__first) + if (*__first == __value_) + ++__r; + return __r; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COUNT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count_if.h new file mode 100644 index 0000000..00f5d67 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/count_if.h
@@ -0,0 +1,35 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_COUNT_IF_H +#define _LIBCPP___ALGORITHM_COUNT_IF_H + +#include <__config> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename iterator_traits<_InputIterator>::difference_type + count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + typename iterator_traits<_InputIterator>::difference_type __r(0); + for (; __first != __last; ++__first) + if (__pred(*__first)) + ++__r; + return __r; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_COUNT_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal.h new file mode 100644 index 0000000..0fe1a21 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal.h
@@ -0,0 +1,85 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_EQUAL_H +#define _LIBCPP___ALGORITHM_EQUAL_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/distance.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { + for (; __first1 != __last1; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + return false; + return true; +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { + typedef typename iterator_traits<_InputIterator1>::value_type __v1; + typedef typename iterator_traits<_InputIterator2>::value_type __v2; + return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>()); +} + +#if _LIBCPP_STD_VER > 11 +template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, + _BinaryPredicate __pred, input_iterator_tag, input_iterator_tag) { + for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + return false; + return __first1 == __last1 && __first2 == __last2; +} + +template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, + _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, + random_access_iterator_tag) { + if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2)) + return false; + return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2, + _BinaryPredicate&>(__first1, __last1, __first2, __pred); +} + +template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, + _BinaryPredicate __pred) { + return _VSTD::__equal<_BinaryPredicate&>( + __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_InputIterator1>::iterator_category(), + typename iterator_traits<_InputIterator2>::iterator_category()); +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { + typedef typename iterator_traits<_InputIterator1>::value_type __v1; + typedef typename iterator_traits<_InputIterator2>::value_type __v2; + return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(), + typename iterator_traits<_InputIterator1>::iterator_category(), + typename iterator_traits<_InputIterator2>::iterator_category()); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_EQUAL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal_range.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal_range.h new file mode 100644 index 0000000..679456e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/equal_range.h
@@ -0,0 +1,82 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_EQUAL_RANGE_H +#define _LIBCPP___ALGORITHM_EQUAL_RANGE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/half_positive.h> +#include <__algorithm/lower_bound.h> +#include <__algorithm/upper_bound.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator, class _Tp> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> +__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; + difference_type __len = _VSTD::distance(__first, __last); + while (__len != 0) + { + difference_type __l2 = _VSTD::__half_positive(__len); + _ForwardIterator __m = __first; + _VSTD::advance(__m, __l2); + if (__comp(*__m, __value_)) + { + __first = ++__m; + __len -= __l2 + 1; + } + else if (__comp(__value_, *__m)) + { + __last = __m; + __len = __l2; + } + else + { + _ForwardIterator __mp1 = __m; + return pair<_ForwardIterator, _ForwardIterator> + ( + _VSTD::__lower_bound<_Compare>(__first, __m, __value_, __comp), + _VSTD::__upper_bound<_Compare>(++__mp1, __last, __value_, __comp) + ); + } + } + return pair<_ForwardIterator, _ForwardIterator>(__first, __first); +} + +template <class _ForwardIterator, class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +pair<_ForwardIterator, _ForwardIterator> +equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__equal_range<_Comp_ref>(__first, __last, __value_, __comp); +} + +template <class _ForwardIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +pair<_ForwardIterator, _ForwardIterator> +equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + return _VSTD::equal_range(__first, __last, __value_, + __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_EQUAL_RANGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill.h new file mode 100644 index 0000000..1fad1de --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill.h
@@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FILL_H +#define _LIBCPP___ALGORITHM_FILL_H + +#include <__config> +#include <__algorithm/fill_n.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag) +{ + for (; __first != __last; ++__first) + *__first = __value_; +} + +template <class _RandomAccessIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag) +{ + _VSTD::fill_n(__first, __last - __first, __value_); +} + +template <class _ForwardIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FILL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill_n.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill_n.h new file mode 100644 index 0000000..857ac14 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/fill_n.h
@@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FILL_N_H +#define _LIBCPP___ALGORITHM_FILL_N_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _OutputIterator, class _Size, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) +{ + for (; __n > 0; ++__first, (void) --__n) + *__first = __value_; + return __first; +} + +template <class _OutputIterator, class _Size, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) +{ + return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value_); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FILL_N_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find.h new file mode 100644 index 0000000..2a6dfbe --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FIND_H +#define _LIBCPP___ALGORITHM_FIND_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator +find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { + for (; __first != __last; ++__first) + if (*__first == __value_) + break; + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FIND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_end.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_end.h new file mode 100644 index 0000000..5d971c5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_end.h
@@ -0,0 +1,150 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FIND_END_OF_H +#define _LIBCPP___ALGORITHM_FIND_END_OF_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, + _ForwardIterator2 __first2, _ForwardIterator2 __last2, + _BinaryPredicate __pred, forward_iterator_tag, + forward_iterator_tag) { + // modeled after search algorithm + _ForwardIterator1 __r = __last1; // __last1 is the "default" answer + if (__first2 == __last2) + return __r; + while (true) { + while (true) { + if (__first1 == __last1) // if source exhausted return last correct answer + return __r; // (or __last1 if never found) + if (__pred(*__first1, *__first2)) + break; + ++__first1; + } + // *__first1 matches *__first2, now match elements after here + _ForwardIterator1 __m1 = __first1; + _ForwardIterator2 __m2 = __first2; + while (true) { + if (++__m2 == __last2) { // Pattern exhaused, record answer and search for another one + __r = __first1; + ++__first1; + break; + } + if (++__m1 == __last1) // Source exhausted, return last answer + return __r; + if (!__pred(*__m1, *__m2)) // mismatch, restart with a new __first + { + ++__first1; + break; + } // else there is a match, check next elements + } + } +} + +template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1 __find_end( + _BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, _BidirectionalIterator2 __first2, + _BidirectionalIterator2 __last2, _BinaryPredicate __pred, bidirectional_iterator_tag, bidirectional_iterator_tag) { + // modeled after search algorithm (in reverse) + if (__first2 == __last2) + return __last1; // Everything matches an empty sequence + _BidirectionalIterator1 __l1 = __last1; + _BidirectionalIterator2 __l2 = __last2; + --__l2; + while (true) { + // Find last element in sequence 1 that matchs *(__last2-1), with a mininum of loop checks + while (true) { + if (__first1 == __l1) // return __last1 if no element matches *__first2 + return __last1; + if (__pred(*--__l1, *__l2)) + break; + } + // *__l1 matches *__l2, now match elements before here + _BidirectionalIterator1 __m1 = __l1; + _BidirectionalIterator2 __m2 = __l2; + while (true) { + if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern) + return __m1; + if (__m1 == __first1) // Otherwise if source exhaused, pattern not found + return __last1; + if (!__pred(*--__m1, *--__m2)) // if there is a mismatch, restart with a new __l1 + { + break; + } // else there is a match, check next elements + } + } +} + +template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1 __find_end( + _RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, + _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, random_access_iterator_tag) { + typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1; + typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2; + // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern + _D2 __len2 = __last2 - __first2; + if (__len2 == 0) + return __last1; + _D1 __len1 = __last1 - __first1; + if (__len1 < __len2) + return __last1; + const _RandomAccessIterator1 __s = __first1 + _D1(__len2 - 1); // End of pattern match can't go before here + _RandomAccessIterator1 __l1 = __last1; + _RandomAccessIterator2 __l2 = __last2; + --__l2; + while (true) { + while (true) { + if (__s == __l1) + return __last1; + if (__pred(*--__l1, *__l2)) + break; + } + _RandomAccessIterator1 __m1 = __l1; + _RandomAccessIterator2 __m2 = __l2; + while (true) { + if (__m2 == __first2) + return __m1; + // no need to check range on __m1 because __s guarantees we have enough source + if (!__pred(*--__m1, *--__m2)) { + break; + } + } + } +} + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 +find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, + _BinaryPredicate __pred) { + return _VSTD::__find_end<_BinaryPredicate&>( + __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_ForwardIterator1>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); +} + +template <class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 +find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { + typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; + typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; + return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FIND_END_OF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_first_of.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_first_of.h new file mode 100644 index 0000000..79a00ac --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_first_of.h
@@ -0,0 +1,52 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FIND_FIRST_OF_H +#define _LIBCPP___ALGORITHM_FIND_FIRST_OF_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1, + _ForwardIterator1 __last1, + _ForwardIterator2 __first2, + _ForwardIterator2 __last2, _BinaryPredicate __pred) { + for (; __first1 != __last1; ++__first1) + for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) + if (__pred(*__first1, *__j)) + return __first1; + return __last1; +} + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 +find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, + _ForwardIterator2 __last2, _BinaryPredicate __pred) { + return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred); +} + +template <class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 find_first_of( + _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { + typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; + typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; + return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FIND_FIRST_OF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if.h new file mode 100644 index 0000000..a94196a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FIND_IF_H +#define _LIBCPP___ALGORITHM_FIND_IF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator +find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + for (; __first != __last; ++__first) + if (__pred(*__first)) + break; + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FIND_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if_not.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if_not.h new file mode 100644 index 0000000..e057db5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/find_if_not.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FIND_IF_NOT_H +#define _LIBCPP___ALGORITHM_FIND_IF_NOT_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator +find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + for (; __first != __last; ++__first) + if (!__pred(*__first)) + break; + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FIND_IF_NOT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each.h new file mode 100644 index 0000000..1612ffa --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FOR_EACH_H +#define _LIBCPP___ALGORITHM_FOR_EACH_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Function> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _Function for_each(_InputIterator __first, + _InputIterator __last, + _Function __f) { + for (; __first != __last; ++__first) + __f(*__first); + return __f; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FOR_EACH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each_n.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each_n.h new file mode 100644 index 0000000..00e3fb9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/for_each_n.h
@@ -0,0 +1,42 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_FOR_EACH_N_H +#define _LIBCPP___ALGORITHM_FOR_EACH_N_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +template <class _InputIterator, class _Size, class _Function> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _InputIterator for_each_n(_InputIterator __first, + _Size __orig_n, + _Function __f) { + typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize; + _IntegralSize __n = __orig_n; + while (__n > 0) { + __f(*__first); + ++__first; + --__n; + } + return __first; +} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_FOR_EACH_N_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate.h new file mode 100644 index 0000000..10834cd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate.h
@@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_GENERATE_H +#define _LIBCPP___ALGORITHM_GENERATE_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Generator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) +{ + for (; __first != __last; ++__first) + *__first = __gen(); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_GENERATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate_n.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate_n.h new file mode 100644 index 0000000..595007c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/generate_n.h
@@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_GENERATE_N_H +#define _LIBCPP___ALGORITHM_GENERATE_N_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _OutputIterator, class _Size, class _Generator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) +{ + typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize; + _IntegralSize __n = __orig_n; + for (; __n > 0; ++__first, (void) --__n) + *__first = __gen(); + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_GENERATE_N_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/half_positive.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/half_positive.h new file mode 100644 index 0000000..5d36ff5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/half_positive.h
@@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_HALF_POSITIVE_H +#define _LIBCPP___ALGORITHM_HALF_POSITIVE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Perform division by two quickly for positive integers (llvm.org/PR39129) + +template <typename _Integral> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +typename enable_if +< + is_integral<_Integral>::value, + _Integral +>::type +__half_positive(_Integral __value) +{ + return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2); +} + +template <typename _Tp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +typename enable_if +< + !is_integral<_Tp>::value, + _Tp +>::type +__half_positive(_Tp __value) +{ + return __value / 2; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_HALF_POSITIVE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/includes.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/includes.h new file mode 100644 index 0000000..9cc54d9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/includes.h
@@ -0,0 +1,62 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_INCLUDES_H +#define _LIBCPP___ALGORITHM_INCLUDES_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, + _Compare __comp) +{ + for (; __first2 != __last2; ++__first1) + { + if (__first1 == __last1 || __comp(*__first2, *__first1)) + return false; + if (!__comp(*__first1, *__first2)) + ++__first2; + } + return true; +} + +template <class _InputIterator1, class _InputIterator2, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, + _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) +{ + return _VSTD::includes(__first1, __last1, __first2, __last2, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_INCLUDES_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/inplace_merge.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/inplace_merge.h new file mode 100644 index 0000000..c74633a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/inplace_merge.h
@@ -0,0 +1,231 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_INPLACE_MERGE_H +#define _LIBCPP___ALGORITHM_INPLACE_MERGE_H + +#include <__config> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/comp.h> +#include <__algorithm/lower_bound.h> +#include <__algorithm/min.h> +#include <__algorithm/move.h> +#include <__algorithm/rotate.h> +#include <__algorithm/upper_bound.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> +#include <memory> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Predicate> +class __invert // invert the sense of a comparison +{ +private: + _Predicate __p_; +public: + _LIBCPP_INLINE_VISIBILITY __invert() {} + + _LIBCPP_INLINE_VISIBILITY + explicit __invert(_Predicate __p) : __p_(__p) {} + + template <class _T1> + _LIBCPP_INLINE_VISIBILITY + bool operator()(const _T1& __x) {return !__p_(__x);} + + template <class _T1, class _T2> + _LIBCPP_INLINE_VISIBILITY + bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);} +}; + +template <class _Compare, class _InputIterator1, class _InputIterator2, + class _OutputIterator> +void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) +{ + for (; __first1 != __last1; ++__result) + { + if (__first2 == __last2) + { + _VSTD::move(__first1, __last1, __result); + return; + } + + if (__comp(*__first2, *__first1)) + { + *__result = _VSTD::move(*__first2); + ++__first2; + } + else + { + *__result = _VSTD::move(*__first1); + ++__first1; + } + } + // __first2 through __last2 are already in the right spot. +} + +template <class _Compare, class _BidirectionalIterator> +void +__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, + _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, + typename iterator_traits<_BidirectionalIterator>::difference_type __len2, + typename iterator_traits<_BidirectionalIterator>::value_type* __buff) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); + if (__len1 <= __len2) + { + value_type* __p = __buff; + for (_BidirectionalIterator __i = __first; __i != __middle; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p) + ::new ((void*)__p) value_type(_VSTD::move(*__i)); + _VSTD::__half_inplace_merge<_Compare>(__buff, __p, __middle, __last, __first, __comp); + } + else + { + value_type* __p = __buff; + for (_BidirectionalIterator __i = __middle; __i != __last; __d.template __incr<value_type>(), (void) ++__i, (void) ++__p) + ::new ((void*)__p) value_type(_VSTD::move(*__i)); + typedef reverse_iterator<_BidirectionalIterator> _RBi; + typedef reverse_iterator<value_type*> _Rv; + typedef __invert<_Compare> _Inverted; + _VSTD::__half_inplace_merge<_Inverted>(_Rv(__p), _Rv(__buff), + _RBi(__middle), _RBi(__first), + _RBi(__last), _Inverted(__comp)); + } +} + +template <class _Compare, class _BidirectionalIterator> +void +__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, + _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, + typename iterator_traits<_BidirectionalIterator>::difference_type __len2, + typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size) +{ + typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; + while (true) + { + // if __middle == __last, we're done + if (__len2 == 0) + return; + if (__len1 <= __buff_size || __len2 <= __buff_size) + return _VSTD::__buffered_inplace_merge<_Compare> + (__first, __middle, __last, __comp, __len1, __len2, __buff); + // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0 + for (; true; ++__first, (void) --__len1) + { + if (__len1 == 0) + return; + if (__comp(*__middle, *__first)) + break; + } + // __first < __middle < __last + // *__first > *__middle + // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that + // all elements in: + // [__first, __m1) <= [__middle, __m2) + // [__middle, __m2) < [__m1, __middle) + // [__m1, __middle) <= [__m2, __last) + // and __m1 or __m2 is in the middle of its range + _BidirectionalIterator __m1; // "median" of [__first, __middle) + _BidirectionalIterator __m2; // "median" of [__middle, __last) + difference_type __len11; // distance(__first, __m1) + difference_type __len21; // distance(__middle, __m2) + // binary search smaller range + if (__len1 < __len2) + { // __len >= 1, __len2 >= 2 + __len21 = __len2 / 2; + __m2 = __middle; + _VSTD::advance(__m2, __len21); + __m1 = _VSTD::__upper_bound<_Compare>(__first, __middle, *__m2, __comp); + __len11 = _VSTD::distance(__first, __m1); + } + else + { + if (__len1 == 1) + { // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1 + // It is known *__first > *__middle + swap(*__first, *__middle); + return; + } + // __len1 >= 2, __len2 >= 1 + __len11 = __len1 / 2; + __m1 = __first; + _VSTD::advance(__m1, __len11); + __m2 = _VSTD::__lower_bound<_Compare>(__middle, __last, *__m1, __comp); + __len21 = _VSTD::distance(__middle, __m2); + } + difference_type __len12 = __len1 - __len11; // distance(__m1, __middle) + difference_type __len22 = __len2 - __len21; // distance(__m2, __last) + // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) + // swap middle two partitions + __middle = _VSTD::rotate(__m1, __middle, __m2); + // __len12 and __len21 now have swapped meanings + // merge smaller range with recursive call and larger with tail recursion elimination + if (__len11 + __len21 < __len12 + __len22) + { + _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size); +// _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size); + __first = __middle; + __middle = __m2; + __len1 = __len12; + __len2 = __len22; + } + else + { + _VSTD::__inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size); +// _VSTD::__inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size); + __last = __middle; + __middle = __m1; + __len1 = __len11; + __len2 = __len21; + } + } +} + +template <class _BidirectionalIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY +void +inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, + _Compare __comp) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; + difference_type __len1 = _VSTD::distance(__first, __middle); + difference_type __len2 = _VSTD::distance(__middle, __last); + difference_type __buf_size = _VSTD::min(__len1, __len2); + pair<value_type*, ptrdiff_t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size); + unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2, + __buf.first, __buf.second); +} + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY +void +inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last) +{ + _VSTD::inplace_merge(__first, __middle, __last, + __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_INPLACE_MERGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap.h new file mode 100644 index 0000000..22c27a6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap.h
@@ -0,0 +1,45 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_HEAP_H +#define _LIBCPP___ALGORITHM_IS_HEAP_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/is_heap_until.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _RandomAccessIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__is_heap_until<_Comp_ref>(__first, __last, __comp) == __last; +} + +template<class _RandomAccessIterator> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_HEAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap_until.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap_until.h new file mode 100644 index 0000000..dd8a62f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_heap_until.h
@@ -0,0 +1,67 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H +#define _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator +__is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + difference_type __len = __last - __first; + difference_type __p = 0; + difference_type __c = 1; + _RandomAccessIterator __pp = __first; + while (__c < __len) + { + _RandomAccessIterator __cp = __first + __c; + if (__comp(*__pp, *__cp)) + return __cp; + ++__c; + ++__cp; + if (__c == __len) + return __last; + if (__comp(*__pp, *__cp)) + return __cp; + ++__p; + ++__pp; + __c = 2 * __p + 1; + } + return __last; +} + +template <class _RandomAccessIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator +is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__is_heap_until<_Comp_ref>(__first, __last, __comp); +} + +template<class _RandomAccessIterator> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator +is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + return _VSTD::__is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_partitioned.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_partitioned.h new file mode 100644 index 0000000..e5b2214 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_partitioned.h
@@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_PARTITIONED_H +#define _LIBCPP___ALGORITHM_IS_PARTITIONED_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) +{ + for (; __first != __last; ++__first) + if (!__pred(*__first)) + break; + if ( __first == __last ) + return true; + ++__first; + for (; __first != __last; ++__first) + if (__pred(*__first)) + return false; + return true; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_PARTITIONED_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_permutation.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_permutation.h new file mode 100644 index 0000000..344aa76 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_permutation.h
@@ -0,0 +1,162 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_PERMUTATION_H +#define _LIBCPP___ALGORITHM_IS_PERMUTATION_H + +#include <__algorithm/comp.h> +#include <__config> +#include <__iterator/distance.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/next.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, + _BinaryPredicate __pred) { + // shorten sequences as much as possible by lopping of any equal prefix + for (; __first1 != __last1; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + break; + if (__first1 == __last1) + return true; + + // __first1 != __last1 && *__first1 != *__first2 + typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; + _D1 __l1 = _VSTD::distance(__first1, __last1); + if (__l1 == _D1(1)) + return false; + _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1); + // For each element in [f1, l1) see if there are the same number of + // equal elements in [f2, l2) + for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { + // Have we already counted the number of *__i in [f1, l1)? + _ForwardIterator1 __match = __first1; + for (; __match != __i; ++__match) + if (__pred(*__match, *__i)) + break; + if (__match == __i) { + // Count number of *__i in [f2, l2) + _D1 __c2 = 0; + for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) + if (__pred(*__i, *__j)) + ++__c2; + if (__c2 == 0) + return false; + // Count number of *__i in [__i, l1) (we can start with 1) + _D1 __c1 = 1; + for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j) + if (__pred(*__i, *__j)) + ++__c1; + if (__c1 != __c2) + return false; + } + } + return true; +} + +template <class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { + typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; + typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; + return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>()); +} + +#if _LIBCPP_STD_VER > 11 +template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, + _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) { + // shorten sequences as much as possible by lopping of any equal prefix + for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + break; + if (__first1 == __last1) + return __first2 == __last2; + else if (__first2 == __last2) + return false; + + typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; + _D1 __l1 = _VSTD::distance(__first1, __last1); + + typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2; + _D2 __l2 = _VSTD::distance(__first2, __last2); + if (__l1 != __l2) + return false; + + // For each element in [f1, l1) see if there are the same number of + // equal elements in [f2, l2) + for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) { + // Have we already counted the number of *__i in [f1, l1)? + _ForwardIterator1 __match = __first1; + for (; __match != __i; ++__match) + if (__pred(*__match, *__i)) + break; + if (__match == __i) { + // Count number of *__i in [f2, l2) + _D1 __c2 = 0; + for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) + if (__pred(*__i, *__j)) + ++__c2; + if (__c2 == 0) + return false; + // Count number of *__i in [__i, l1) (we can start with 1) + _D1 __c1 = 1; + for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j) + if (__pred(*__i, *__j)) + ++__c1; + if (__c1 != __c2) + return false; + } + } + return true; +} + +template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, + _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, + _BinaryPredicate __pred, random_access_iterator_tag, + random_access_iterator_tag) { + if (_VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2)) + return false; + return _VSTD::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2, + _BinaryPredicate&>(__first1, __last1, __first2, __pred); +} + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, + _ForwardIterator2 __last2, _BinaryPredicate __pred) { + return _VSTD::__is_permutation<_BinaryPredicate&>( + __first1, __last1, __first2, __last2, __pred, typename iterator_traits<_ForwardIterator1>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); +} + +template <class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, + _ForwardIterator2 __last2) { + typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; + typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; + return _VSTD::__is_permutation(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(), + typename iterator_traits<_ForwardIterator1>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted.h new file mode 100644 index 0000000..5795329 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted.h
@@ -0,0 +1,45 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_SORTED_H +#define _LIBCPP___ALGORITHM_IS_SORTED_H + +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/is_sorted_until.h> +#include <__config> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp) == __last; +} + +template<class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +is_sorted(_ForwardIterator __first, _ForwardIterator __last) +{ + return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_SORTED_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted_until.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted_until.h new file mode 100644 index 0000000..9a7f275 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/is_sorted_until.h
@@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H +#define _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +__is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + if (__first != __last) + { + _ForwardIterator __i = __first; + while (++__i != __last) + { + if (__comp(*__i, *__first)) + return __i; + __first = __i; + } + } + return __last; +} + +template <class _ForwardIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp); +} + +template<class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) +{ + return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/iter_swap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/iter_swap.h new file mode 100644 index 0000000..9f7d0d7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/iter_swap.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ITER_SWAP_H +#define _LIBCPP___ALGORITHM_ITER_SWAP_H + +#include <__config> +#include <__utility/declval.h> +#include <__utility/swap.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator1, class _ForwardIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void iter_swap(_ForwardIterator1 __a, + _ForwardIterator2 __b) + // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b))) + _NOEXCEPT_(_NOEXCEPT_(swap(*declval<_ForwardIterator1>(), *declval<_ForwardIterator2>()))) { + swap(*__a, *__b); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ITER_SWAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lexicographical_compare.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lexicographical_compare.h new file mode 100644 index 0000000..a110a58 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lexicographical_compare.h
@@ -0,0 +1,63 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H +#define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) +{ + for (; __first2 != __last2; ++__first1, (void) ++__first2) + { + if (__first1 == __last1 || __comp(*__first1, *__first2)) + return true; + if (__comp(*__first2, *__first1)) + return false; + } + return false; +} + +template <class _InputIterator1, class _InputIterator2, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2) +{ + return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lower_bound.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lower_bound.h new file mode 100644 index 0000000..ddaecb0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/lower_bound.h
@@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_LOWER_BOUND_H +#define _LIBCPP___ALGORITHM_LOWER_BOUND_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/half_positive.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator, class _Tp> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; + difference_type __len = _VSTD::distance(__first, __last); + while (__len != 0) + { + difference_type __l2 = _VSTD::__half_positive(__len); + _ForwardIterator __m = __first; + _VSTD::advance(__m, __l2); + if (__comp(*__m, __value_)) + { + __first = ++__m; + __len -= __l2 + 1; + } + else + __len = __l2; + } + return __first; +} + +template <class _ForwardIterator, class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + return _VSTD::__lower_bound<_Compare&>(__first, __last, __value_, __comp); +} + +template <class _ForwardIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + return _VSTD::lower_bound(__first, __last, __value_, + __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_LOWER_BOUND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/make_heap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/make_heap.h new file mode 100644 index 0000000..b3defd4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/make_heap.h
@@ -0,0 +1,59 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MAKE_HEAP_H +#define _LIBCPP___ALGORITHM_MAKE_HEAP_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/sift_down.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void +__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + difference_type __n = __last - __first; + if (__n > 1) + { + // start from the first parent, there is no need to consider children + for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start) + { + _VSTD::__sift_down<_Compare>(__first, __last, __comp, __n, __first + __start); + } + } +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__make_heap<_Comp_ref>(__first, __last, __comp); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max.h new file mode 100644 index 0000000..79cbd2b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MAX_H +#define _LIBCPP___ALGORITHM_MAX_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/max_element.h> +#include <initializer_list> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Tp& +max(const _Tp& __a, const _Tp& __b, _Compare __comp) +{ + return __comp(__a, __b) ? __b : __a; +} + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Tp& +max(const _Tp& __a, const _Tp& __b) +{ + return _VSTD::max(__a, __b, __less<_Tp>()); +} + +#ifndef _LIBCPP_CXX03_LANG + +template<class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp +max(initializer_list<_Tp> __t, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return *_VSTD::__max_element<_Comp_ref>(__t.begin(), __t.end(), __comp); +} + +template<class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp +max(initializer_list<_Tp> __t) +{ + return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>()); +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_MAX_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max_element.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max_element.h new file mode 100644 index 0000000..f932ca7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/max_element.h
@@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MAX_ELEMENT_H +#define _LIBCPP___ALGORITHM_MAX_ELEMENT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator> +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +__max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, + "std::max_element requires a ForwardIterator"); + if (__first != __last) + { + _ForwardIterator __i = __first; + while (++__i != __last) + if (__comp(*__first, *__i)) + __first = __i; + } + return __first; +} + +template <class _ForwardIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__max_element<_Comp_ref>(__first, __last, __comp); +} + + +template <class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +max_element(_ForwardIterator __first, _ForwardIterator __last) +{ + return _VSTD::max_element(__first, __last, + __less<typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MAX_ELEMENT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/merge.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/merge.h new file mode 100644 index 0000000..480380d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/merge.h
@@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MERGE_H +#define _LIBCPP___ALGORITHM_MERGE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/copy.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +__merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + for (; __first1 != __last1; ++__result) + { + if (__first2 == __last2) + return _VSTD::copy(__first1, __last1, __result); + if (__comp(*__first2, *__first1)) + { + *__result = *__first2; + ++__first2; + } + else + { + *__result = *__first1; + ++__first1; + } + } + return _VSTD::copy(__first2, __last2, __result); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) +{ + typedef typename iterator_traits<_InputIterator1>::value_type __v1; + typedef typename iterator_traits<_InputIterator2>::value_type __v2; + return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MERGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min.h new file mode 100644 index 0000000..5cacb2f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MIN_H +#define _LIBCPP___ALGORITHM_MIN_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/min_element.h> +#include <initializer_list> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Tp& +min(const _Tp& __a, const _Tp& __b, _Compare __comp) +{ + return __comp(__b, __a) ? __b : __a; +} + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Tp& +min(const _Tp& __a, const _Tp& __b) +{ + return _VSTD::min(__a, __b, __less<_Tp>()); +} + +#ifndef _LIBCPP_CXX03_LANG + +template<class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp +min(initializer_list<_Tp> __t, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return *_VSTD::__min_element<_Comp_ref>(__t.begin(), __t.end(), __comp); +} + +template<class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp +min(initializer_list<_Tp> __t) +{ + return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>()); +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_MIN_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min_element.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min_element.h new file mode 100644 index 0000000..3aebebc --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/min_element.h
@@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MIN_ELEMENT_H +#define _LIBCPP___ALGORITHM_MIN_ELEMENT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator> +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +__min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, + "std::min_element requires a ForwardIterator"); + if (__first != __last) + { + _ForwardIterator __i = __first; + while (++__i != __last) + if (__comp(*__i, *__first)) + __first = __i; + } + return __first; +} + +template <class _ForwardIterator, class _Compare> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__min_element<_Comp_ref>(__first, __last, __comp); +} + +template <class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +min_element(_ForwardIterator __first, _ForwardIterator __last) +{ + return _VSTD::min_element(__first, __last, + __less<typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax.h new file mode 100644 index 0000000..a96a5b2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax.h
@@ -0,0 +1,96 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MINMAX_H +#define _LIBCPP___ALGORITHM_MINMAX_H + +#include <__config> +#include <__algorithm/comp.h> +#include <initializer_list> +#include <utility> + + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<const _Tp&, const _Tp&> +minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) +{ + return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) : + pair<const _Tp&, const _Tp&>(__a, __b); +} + +template<class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<const _Tp&, const _Tp&> +minmax(const _Tp& __a, const _Tp& __b) +{ + return _VSTD::minmax(__a, __b, __less<_Tp>()); +} + +#ifndef _LIBCPP_CXX03_LANG + +template<class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<_Tp, _Tp> +minmax(initializer_list<_Tp> __t, _Compare __comp) +{ + typedef typename initializer_list<_Tp>::const_iterator _Iter; + _Iter __first = __t.begin(); + _Iter __last = __t.end(); + pair<_Tp, _Tp> __result(*__first, *__first); + + ++__first; + if (__t.size() % 2 == 0) + { + if (__comp(*__first, __result.first)) + __result.first = *__first; + else + __result.second = *__first; + ++__first; + } + + while (__first != __last) + { + _Tp __prev = *__first++; + if (__comp(*__first, __prev)) { + if ( __comp(*__first, __result.first)) __result.first = *__first; + if (!__comp(__prev, __result.second)) __result.second = __prev; + } + else { + if ( __comp(__prev, __result.first)) __result.first = __prev; + if (!__comp(*__first, __result.second)) __result.second = *__first; + } + + __first++; + } + return __result; +} + +template<class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<_Tp, _Tp> +minmax(initializer_list<_Tp> __t) +{ + return _VSTD::minmax(__t, __less<_Tp>()); +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MINMAX_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax_element.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax_element.h new file mode 100644 index 0000000..d21ff6f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/minmax_element.h
@@ -0,0 +1,85 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H +#define _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Compare> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<_ForwardIterator, _ForwardIterator> +minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) +{ + static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, + "std::minmax_element requires a ForwardIterator"); + pair<_ForwardIterator, _ForwardIterator> __result(__first, __first); + if (__first != __last) + { + if (++__first != __last) + { + if (__comp(*__first, *__result.first)) + __result.first = __first; + else + __result.second = __first; + while (++__first != __last) + { + _ForwardIterator __i = __first; + if (++__first == __last) + { + if (__comp(*__i, *__result.first)) + __result.first = __i; + else if (!__comp(*__i, *__result.second)) + __result.second = __i; + break; + } + else + { + if (__comp(*__first, *__i)) + { + if (__comp(*__first, *__result.first)) + __result.first = __first; + if (!__comp(*__i, *__result.second)) + __result.second = __i; + } + else + { + if (__comp(*__i, *__result.first)) + __result.first = __i; + if (!__comp(*__first, *__result.second)) + __result.second = __first; + } + } + } + } + } + return __result; +} + +template <class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<_ForwardIterator, _ForwardIterator> +minmax_element(_ForwardIterator __first, _ForwardIterator __last) +{ + return _VSTD::minmax_element(__first, __last, + __less<typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/mismatch.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/mismatch.h new file mode 100644 index 0000000..7a01a98 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/mismatch.h
@@ -0,0 +1,67 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MISMATCH_H +#define _LIBCPP___ALGORITHM_MISMATCH_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> + mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { + for (; __first1 != __last1; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + break; + return pair<_InputIterator1, _InputIterator2>(__first1, __first2); +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> + mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) { + typedef typename iterator_traits<_InputIterator1>::value_type __v1; + typedef typename iterator_traits<_InputIterator2>::value_type __v2; + return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>()); +} + +#if _LIBCPP_STD_VER > 11 +template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> + mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, + _BinaryPredicate __pred) { + for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void)++__first2) + if (!__pred(*__first1, *__first2)) + break; + return pair<_InputIterator1, _InputIterator2>(__first1, __first2); +} + +template <class _InputIterator1, class _InputIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_InputIterator1, _InputIterator2> + mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) { + typedef typename iterator_traits<_InputIterator1>::value_type __v1; + typedef typename iterator_traits<_InputIterator2>::value_type __v2; + return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MISMATCH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move.h new file mode 100644 index 0000000..7430bf0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move.h
@@ -0,0 +1,78 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MOVE_H +#define _LIBCPP___ALGORITHM_MOVE_H + +#include <__config> +#include <__algorithm/unwrap_iter.h> +#include <__utility/move.h> +#include <cstring> +#include <utility> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// move + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +_OutputIterator +__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + for (; __first != __last; ++__first, (void) ++__result) + *__result = _VSTD::move(*__first); + return __result; +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +_OutputIterator +__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + return _VSTD::__move_constexpr(__first, __last, __result); +} + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +typename enable_if +< + is_same<typename remove_const<_Tp>::type, _Up>::value && + is_trivially_move_assignable<_Up>::value, + _Up* +>::type +__move(_Tp* __first, _Tp* __last, _Up* __result) +{ + const size_t __n = static_cast<size_t>(__last - __first); + if (__n > 0) + _VSTD::memmove(__result, __first, __n * sizeof(_Up)); + return __result + __n; +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + if (__libcpp_is_constant_evaluated()) { + return _VSTD::__move_constexpr(__first, __last, __result); + } else { + return _VSTD::__rewrap_iter(__result, + _VSTD::__move(_VSTD::__unwrap_iter(__first), + _VSTD::__unwrap_iter(__last), + _VSTD::__unwrap_iter(__result))); + } +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MOVE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move_backward.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move_backward.h new file mode 100644 index 0000000..ee72d39 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/move_backward.h
@@ -0,0 +1,79 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_MOVE_BACKWARD_H +#define _LIBCPP___ALGORITHM_MOVE_BACKWARD_H + +#include <__config> +#include <__algorithm/unwrap_iter.h> +#include <cstring> +#include <utility> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +_OutputIterator +__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + while (__first != __last) + *--__result = _VSTD::move(*--__last); + return __result; +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +_OutputIterator +__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + return _VSTD::__move_backward_constexpr(__first, __last, __result); +} + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +typename enable_if +< + is_same<typename remove_const<_Tp>::type, _Up>::value && + is_trivially_move_assignable<_Up>::value, + _Up* +>::type +__move_backward(_Tp* __first, _Tp* __last, _Up* __result) +{ + const size_t __n = static_cast<size_t>(__last - __first); + if (__n > 0) + { + __result -= __n; + _VSTD::memmove(__result, __first, __n * sizeof(_Up)); + } + return __result; +} + +template <class _BidirectionalIterator1, class _BidirectionalIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_BidirectionalIterator2 +move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, + _BidirectionalIterator2 __result) +{ + if (__libcpp_is_constant_evaluated()) { + return _VSTD::__move_backward_constexpr(__first, __last, __result); + } else { + return _VSTD::__rewrap_iter(__result, + _VSTD::__move_backward(_VSTD::__unwrap_iter(__first), + _VSTD::__unwrap_iter(__last), + _VSTD::__unwrap_iter(__result))); + } +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_MOVE_BACKWARD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/next_permutation.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/next_permutation.h new file mode 100644 index 0000000..1d71354 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/next_permutation.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H +#define _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/reverse.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _BidirectionalIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + _BidirectionalIterator __i = __last; + if (__first == __last || __first == --__i) + return false; + while (true) + { + _BidirectionalIterator __ip1 = __i; + if (__comp(*--__i, *__ip1)) + { + _BidirectionalIterator __j = __last; + while (!__comp(*__i, *--__j)) + ; + swap(*__i, *__j); + _VSTD::reverse(__ip1, __last); + return true; + } + if (__i == __first) + { + _VSTD::reverse(__first, __last); + return false; + } + } +} + +template <class _BidirectionalIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__next_permutation<_Comp_ref>(__first, __last, __comp); +} + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) +{ + return _VSTD::next_permutation(__first, __last, + __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/none_of.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/none_of.h new file mode 100644 index 0000000..10339e2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/none_of.h
@@ -0,0 +1,32 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_NONE_OF_H +#define _LIBCPP___ALGORITHM_NONE_OF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) { + for (; __first != __last; ++__first) + if (__pred(*__first)) + return false; + return true; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_NONE_OF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/nth_element.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/nth_element.h new file mode 100644 index 0000000..63feba1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/nth_element.h
@@ -0,0 +1,248 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_NTH_ELEMENT_H +#define _LIBCPP___ALGORITHM_NTH_ELEMENT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/sort.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> + +#if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# include <__algorithm/shuffle.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 bool +__nth_element_find_guard(_RandomAccessIterator& __i, _RandomAccessIterator& __j, + _RandomAccessIterator __m, _Compare __comp) +{ + // manually guard downward moving __j against __i + while (true) { + if (__i == --__j) { + return false; + } + if (__comp(*__j, *__m)) { + return true; // found guard for downward moving __j, now use unguarded partition + } + } +} + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void +__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) +{ + // _Compare is known to be a reference type + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + const difference_type __limit = 7; + while (true) + { + if (__nth == __last) + return; + difference_type __len = __last - __first; + switch (__len) + { + case 0: + case 1: + return; + case 2: + if (__comp(*--__last, *__first)) + swap(*__first, *__last); + return; + case 3: + { + _RandomAccessIterator __m = __first; + _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp); + return; + } + } + if (__len <= __limit) + { + _VSTD::__selection_sort<_Compare>(__first, __last, __comp); + return; + } + // __len > __limit >= 3 + _RandomAccessIterator __m = __first + __len/2; + _RandomAccessIterator __lm1 = __last; + unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp); + // *__m is median + // partition [__first, __m) < *__m and *__m <= [__m, __last) + // (this inhibits tossing elements equivalent to __m around unnecessarily) + _RandomAccessIterator __i = __first; + _RandomAccessIterator __j = __lm1; + // j points beyond range to be tested, *__lm1 is known to be <= *__m + // The search going up is known to be guarded but the search coming down isn't. + // Prime the downward search with a guard. + if (!__comp(*__i, *__m)) // if *__first == *__m + { + // *__first == *__m, *__first doesn't go in first part + if (_VSTD::__nth_element_find_guard<_Compare>(__i, __j, __m, __comp)) { + swap(*__i, *__j); + ++__n_swaps; + } else { + // *__first == *__m, *__m <= all other elements + // Partition instead into [__first, __i) == *__first and *__first < [__i, __last) + ++__i; // __first + 1 + __j = __last; + if (!__comp(*__first, *--__j)) { // we need a guard if *__first == *(__last-1) + while (true) { + if (__i == __j) { + return; // [__first, __last) all equivalent elements + } else if (__comp(*__first, *__i)) { + swap(*__i, *__j); + ++__n_swaps; + ++__i; + break; + } + ++__i; + } + } + // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1 + if (__i == __j) { + return; + } + while (true) { + while (!__comp(*__first, *__i)) + ++__i; + while (__comp(*__first, *--__j)) + ; + if (__i >= __j) + break; + swap(*__i, *__j); + ++__n_swaps; + ++__i; + } + // [__first, __i) == *__first and *__first < [__i, __last) + // The first part is sorted, + if (__nth < __i) { + return; + } + // __nth_element the second part + // _VSTD::__nth_element<_Compare>(__i, __nth, __last, __comp); + __first = __i; + continue; + } + } + ++__i; + // j points beyond range to be tested, *__lm1 is known to be <= *__m + // if not yet partitioned... + if (__i < __j) + { + // known that *(__i - 1) < *__m + while (true) + { + // __m still guards upward moving __i + while (__comp(*__i, *__m)) + ++__i; + // It is now known that a guard exists for downward moving __j + while (!__comp(*--__j, *__m)) + ; + if (__i >= __j) + break; + swap(*__i, *__j); + ++__n_swaps; + // It is known that __m != __j + // If __m just moved, follow it + if (__m == __i) + __m = __j; + ++__i; + } + } + // [__first, __i) < *__m and *__m <= [__i, __last) + if (__i != __m && __comp(*__m, *__i)) + { + swap(*__i, *__m); + ++__n_swaps; + } + // [__first, __i) < *__i and *__i <= [__i+1, __last) + if (__nth == __i) + return; + if (__n_swaps == 0) + { + // We were given a perfectly partitioned sequence. Coincidence? + if (__nth < __i) + { + // Check for [__first, __i) already sorted + __j = __m = __first; + while (true) { + if (++__j == __i) { + // [__first, __i) sorted + return; + } + if (__comp(*__j, *__m)) { + // not yet sorted, so sort + break; + } + __m = __j; + } + } + else + { + // Check for [__i, __last) already sorted + __j = __m = __i; + while (true) { + if (++__j == __last) { + // [__i, __last) sorted + return; + } + if (__comp(*__j, *__m)) { + // not yet sorted, so sort + break; + } + __m = __j; + } + } + } + // __nth_element on range containing __nth + if (__nth < __i) + { + // _VSTD::__nth_element<_Compare>(__first, __nth, __i, __comp); + __last = __i; + } + else + { + // _VSTD::__nth_element<_Compare>(__i+1, __nth, __last, __comp); + __first = ++__i; + } + } +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) +{ + _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__nth_element<_Comp_ref>(__first, __nth, __last, __comp); + _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __nth); + if (__nth != __last) { + _LIBCPP_DEBUG_RANDOMIZE_RANGE(++__nth, __last); + } +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) +{ + _VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_NTH_ELEMENT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort.h new file mode 100644 index 0000000..622624e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_H +#define _LIBCPP___ALGORITHM_PARTIAL_SORT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/make_heap.h> +#include <__algorithm/sift_down.h> +#include <__algorithm/sort_heap.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> + +#if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# include <__algorithm/shuffle.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 void +__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, + _Compare __comp) +{ + _VSTD::__make_heap<_Compare>(__first, __middle, __comp); + typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first; + for (_RandomAccessIterator __i = __middle; __i != __last; ++__i) + { + if (__comp(*__i, *__first)) + { + swap(*__i, *__first); + _VSTD::__sift_down<_Compare>(__first, __middle, __comp, __len, __first); + } + } + _VSTD::__sort_heap<_Compare>(__first, __middle, __comp); +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, + _Compare __comp) +{ + _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__partial_sort<_Comp_ref>(__first, __middle, __last, __comp); + _LIBCPP_DEBUG_RANDOMIZE_RANGE(__middle, __last); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) +{ + _VSTD::partial_sort(__first, __middle, __last, + __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort_copy.h new file mode 100644 index 0000000..4c0c9f5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partial_sort_copy.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H +#define _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/make_heap.h> +#include <__algorithm/sift_down.h> +#include <__algorithm/sort_heap.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> // swap + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator +__partial_sort_copy(_InputIterator __first, _InputIterator __last, + _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) +{ + _RandomAccessIterator __r = __result_first; + if (__r != __result_last) + { + for (; __first != __last && __r != __result_last; ++__first, (void) ++__r) + *__r = *__first; + _VSTD::__make_heap<_Compare>(__result_first, __r, __comp); + typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first; + for (; __first != __last; ++__first) + if (__comp(*__first, *__result_first)) + { + *__result_first = *__first; + _VSTD::__sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first); + } + _VSTD::__sort_heap<_Compare>(__result_first, __r, __comp); + } + return __r; +} + +template <class _InputIterator, class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_RandomAccessIterator +partial_sort_copy(_InputIterator __first, _InputIterator __last, + _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp); +} + +template <class _InputIterator, class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_RandomAccessIterator +partial_sort_copy(_InputIterator __first, _InputIterator __last, + _RandomAccessIterator __result_first, _RandomAccessIterator __result_last) +{ + return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last, + __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition.h new file mode 100644 index 0000000..2614520 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition.h
@@ -0,0 +1,82 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PARTITION_H +#define _LIBCPP___ALGORITHM_PARTITION_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> +#include <utility> // pair + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Predicate, class _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag) +{ + while (true) + { + if (__first == __last) + return __first; + if (!__pred(*__first)) + break; + ++__first; + } + for (_ForwardIterator __p = __first; ++__p != __last;) + { + if (__pred(*__p)) + { + swap(*__first, *__p); + ++__first; + } + } + return __first; +} + +template <class _Predicate, class _BidirectionalIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator +__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, + bidirectional_iterator_tag) +{ + while (true) + { + while (true) + { + if (__first == __last) + return __first; + if (!__pred(*__first)) + break; + ++__first; + } + do + { + if (__first == --__last) + return __first; + } while (!__pred(*__last)); + swap(*__first, *__last); + ++__first; + } +} + +template <class _ForwardIterator, class _Predicate> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) +{ + return _VSTD::__partition<_Predicate&>( + __first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PARTITION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_copy.h new file mode 100644 index 0000000..d349445 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_copy.h
@@ -0,0 +1,47 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PARTITION_COPY_H +#define _LIBCPP___ALGORITHM_PARTITION_COPY_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <utility> // pair + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator1, + class _OutputIterator2, class _Predicate> +_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> +partition_copy(_InputIterator __first, _InputIterator __last, + _OutputIterator1 __out_true, _OutputIterator2 __out_false, + _Predicate __pred) +{ + for (; __first != __last; ++__first) + { + if (__pred(*__first)) + { + *__out_true = *__first; + ++__out_true; + } + else + { + *__out_false = *__first; + ++__out_false; + } + } + return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PARTITION_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_point.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_point.h new file mode 100644 index 0000000..33aaf33 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/partition_point.h
@@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PARTITION_POINT_H +#define _LIBCPP___ALGORITHM_PARTITION_POINT_H + +#include <__config> +#include <__algorithm/half_positive.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _ForwardIterator, class _Predicate> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) +{ + typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; + difference_type __len = _VSTD::distance(__first, __last); + while (__len != 0) + { + difference_type __l2 = _VSTD::__half_positive(__len); + _ForwardIterator __m = __first; + _VSTD::advance(__m, __l2); + if (__pred(*__m)) + { + __first = ++__m; + __len -= __l2 + 1; + } + else + __len = __l2; + } + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PARTITION_POINT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/pop_heap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/pop_heap.h new file mode 100644 index 0000000..e8c801a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/pop_heap.h
@@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_POP_HEAP_H +#define _LIBCPP___ALGORITHM_POP_HEAP_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/sift_down.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len) +{ + if (__len > 1) + { + swap(*__first, *--__last); + _VSTD::__sift_down<_Compare>(__first, __last, __comp, __len - 1, __first); + } +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_POP_HEAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/prev_permutation.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/prev_permutation.h new file mode 100644 index 0000000..12c1816 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/prev_permutation.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PREV_PERMUTATION_H +#define _LIBCPP___ALGORITHM_PREV_PERMUTATION_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/reverse.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _BidirectionalIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + _BidirectionalIterator __i = __last; + if (__first == __last || __first == --__i) + return false; + while (true) + { + _BidirectionalIterator __ip1 = __i; + if (__comp(*__ip1, *--__i)) + { + _BidirectionalIterator __j = __last; + while (!__comp(*--__j, *__i)) + ; + swap(*__i, *__j); + _VSTD::reverse(__ip1, __last); + return true; + } + if (__i == __first) + { + _VSTD::reverse(__first, __last); + return false; + } + } +} + +template <class _BidirectionalIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__prev_permutation<_Comp_ref>(__first, __last, __comp); +} + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool +prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) +{ + return _VSTD::prev_permutation(__first, __last, + __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PREV_PERMUTATION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/push_heap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/push_heap.h new file mode 100644 index 0000000..9327fe0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/push_heap.h
@@ -0,0 +1,70 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_PUSH_HEAP_H +#define _LIBCPP___ALGORITHM_PUSH_HEAP_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> +#include <__utility/move.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void +__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len) +{ + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + if (__len > 1) + { + __len = (__len - 2) / 2; + _RandomAccessIterator __ptr = __first + __len; + if (__comp(*__ptr, *--__last)) + { + value_type __t(_VSTD::move(*__last)); + do + { + *__last = _VSTD::move(*__ptr); + __last = __ptr; + if (__len == 0) + break; + __len = (__len - 1) / 2; + __ptr = __first + __len; + } while (__comp(*__ptr, __t)); + *__last = _VSTD::move(__t); + } + } +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__sift_up<_Comp_ref>(__first, __last, __comp, __last - __first); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove.h new file mode 100644 index 0000000..171d832 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove.h
@@ -0,0 +1,45 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REMOVE_H +#define _LIBCPP___ALGORITHM_REMOVE_H + +#include <__config> +#include <__algorithm/find.h> +#include <__algorithm/find_if.h> +#include <__utility/move.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Tp> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + __first = _VSTD::find(__first, __last, __value_); + if (__first != __last) + { + _ForwardIterator __i = __first; + while (++__i != __last) + { + if (!(*__i == __value_)) + { + *__first = _VSTD::move(*__i); + ++__first; + } + } + } + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REMOVE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy.h new file mode 100644 index 0000000..338ca94 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy.h
@@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_H +#define _LIBCPP___ALGORITHM_REMOVE_COPY_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_) +{ + for (; __first != __last; ++__first) + { + if (!(*__first == __value_)) + { + *__result = *__first; + ++__result; + } + } + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy_if.h new file mode 100644 index 0000000..a556387 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_copy_if.h
@@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H +#define _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator, class _Predicate> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) +{ + for (; __first != __last; ++__first) + { + if (!__pred(*__first)) + { + *__result = *__first; + ++__result; + } + } + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_if.h new file mode 100644 index 0000000..4df3689 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/remove_if.h
@@ -0,0 +1,44 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REMOVE_IF_H +#define _LIBCPP___ALGORITHM_REMOVE_IF_H + +#include <__config> +#include <__algorithm/find_if.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Predicate> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) +{ + __first = _VSTD::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred); + if (__first != __last) + { + _ForwardIterator __i = __first; + while (++__i != __last) + { + if (!__pred(*__i)) + { + *__first = _VSTD::move(*__i); + ++__first; + } + } + } + return __first; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REMOVE_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace.h new file mode 100644 index 0000000..2bc96ff --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REPLACE_H +#define _LIBCPP___ALGORITHM_REPLACE_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) +{ + for (; __first != __last; ++__first) + if (*__first == __old_value) + *__first = __new_value; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REPLACE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy.h new file mode 100644 index 0000000..c6c5fe3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy.h
@@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_H +#define _LIBCPP___ALGORITHM_REPLACE_COPY_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, + const _Tp& __old_value, const _Tp& __new_value) +{ + for (; __first != __last; ++__first, (void) ++__result) + if (*__first == __old_value) + *__result = __new_value; + else + *__result = *__first; + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy_if.h new file mode 100644 index 0000000..274d8e6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_copy_if.h
@@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H +#define _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, + _Predicate __pred, const _Tp& __new_value) +{ + for (; __first != __last; ++__first, (void) ++__result) + if (__pred(*__first)) + *__result = __new_value; + else + *__result = *__first; + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_if.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_if.h new file mode 100644 index 0000000..bcc3feb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/replace_if.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REPLACE_IF_H +#define _LIBCPP___ALGORITHM_REPLACE_IF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _Predicate, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) +{ + for (; __first != __last; ++__first) + if (__pred(*__first)) + *__first = __new_value; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REPLACE_IF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse.h new file mode 100644 index 0000000..28bd2e8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse.h
@@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REVERSE_H +#define _LIBCPP___ALGORITHM_REVERSE_H + +#include <__config> +#include <__algorithm/iter_swap.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag) +{ + while (__first != __last) + { + if (__first == --__last) + break; + _VSTD::iter_swap(__first, __last); + ++__first; + } +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) +{ + if (__first != __last) + for (; __first < --__last; ++__first) + _VSTD::iter_swap(__first, __last); +} + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) +{ + _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REVERSE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse_copy.h new file mode 100644 index 0000000..002c034 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/reverse_copy.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_REVERSE_COPY_H +#define _LIBCPP___ALGORITHM_REVERSE_COPY_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BidirectionalIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) +{ + for (; __first != __last; ++__result) + *__result = *--__last; + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_REVERSE_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate.h new file mode 100644 index 0000000..fd6d3e9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate.h
@@ -0,0 +1,200 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ROTATE_H +#define _LIBCPP___ALGORITHM_ROTATE_H + +#include <__algorithm/move.h> +#include <__algorithm/move_backward.h> +#include <__algorithm/swap_ranges.h> +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__iterator/next.h> +#include <__iterator/prev.h> +#include <__utility/swap.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +__rotate_left(_ForwardIterator __first, _ForwardIterator __last) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; + value_type __tmp = _VSTD::move(*__first); + _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first); + *__lm1 = _VSTD::move(__tmp); + return __lm1; +} + +template <class _BidirectionalIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator +__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + _BidirectionalIterator __lm1 = _VSTD::prev(__last); + value_type __tmp = _VSTD::move(*__lm1); + _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last); + *__first = _VSTD::move(__tmp); + return __fp1; +} + +template <class _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator +__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) +{ + _ForwardIterator __i = __middle; + while (true) + { + swap(*__first, *__i); + ++__first; + if (++__i == __last) + break; + if (__first == __middle) + __middle = __i; + } + _ForwardIterator __r = __first; + if (__first != __middle) + { + __i = __middle; + while (true) + { + swap(*__first, *__i); + ++__first; + if (++__i == __last) + { + if (__first == __middle) + break; + __i = __middle; + } + else if (__first == __middle) + __middle = __i; + } + } + return __r; +} + +template<typename _Integral> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral +__algo_gcd(_Integral __x, _Integral __y) +{ + do + { + _Integral __t = __x % __y; + __x = __y; + __y = __t; + } while (__y); + return __x; +} + +template<typename _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator +__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + + const difference_type __m1 = __middle - __first; + const difference_type __m2 = __last - __middle; + if (__m1 == __m2) + { + _VSTD::swap_ranges(__first, __middle, __middle); + return __middle; + } + const difference_type __g = _VSTD::__algo_gcd(__m1, __m2); + for (_RandomAccessIterator __p = __first + __g; __p != __first;) + { + value_type __t(_VSTD::move(*--__p)); + _RandomAccessIterator __p1 = __p; + _RandomAccessIterator __p2 = __p1 + __m1; + do + { + *__p1 = _VSTD::move(*__p2); + __p1 = __p2; + const difference_type __d = __last - __p2; + if (__m1 < __d) + __p2 += __m1; + else + __p2 = __first + (__m1 - __d); + } while (__p2 != __p); + *__p1 = _VSTD::move(__t); + } + return __first + __m2; +} + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, + _VSTD::forward_iterator_tag) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; + if (is_trivially_move_assignable<value_type>::value) + { + if (_VSTD::next(__first) == __middle) + return _VSTD::__rotate_left(__first, __last); + } + return _VSTD::__rotate_forward(__first, __middle, __last); +} + +template <class _BidirectionalIterator> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator +__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, + bidirectional_iterator_tag) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + if (is_trivially_move_assignable<value_type>::value) + { + if (_VSTD::next(__first) == __middle) + return _VSTD::__rotate_left(__first, __last); + if (_VSTD::next(__middle) == __last) + return _VSTD::__rotate_right(__first, __last); + } + return _VSTD::__rotate_forward(__first, __middle, __last); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator +__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, + random_access_iterator_tag) +{ + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + if (is_trivially_move_assignable<value_type>::value) + { + if (_VSTD::next(__first) == __middle) + return _VSTD::__rotate_left(__first, __last); + if (_VSTD::next(__middle) == __last) + return _VSTD::__rotate_right(__first, __last); + return _VSTD::__rotate_gcd(__first, __middle, __last); + } + return _VSTD::__rotate_forward(__first, __middle, __last); +} + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) +{ + if (__first == __middle) + return __last; + if (__middle == __last) + return __first; + return _VSTD::__rotate(__first, __middle, __last, + typename iterator_traits<_ForwardIterator>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ROTATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate_copy.h new file mode 100644 index 0000000..4c682ef --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/rotate_copy.h
@@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_ROTATE_COPY_H +#define _LIBCPP___ALGORITHM_ROTATE_COPY_H + +#include <__config> +#include <__algorithm/copy.h> +#include <iterator> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result) +{ + return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_ROTATE_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sample.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sample.h new file mode 100644 index 0000000..33264c4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sample.h
@@ -0,0 +1,102 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SAMPLE_H +#define _LIBCPP___ALGORITHM_SAMPLE_H + +#include <__algorithm/min.h> +#include <__config> +#include <__debug> +#include <__random/uniform_int_distribution.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _PopulationIterator, class _SampleIterator, class _Distance, + class _UniformRandomNumberGenerator> +_LIBCPP_INLINE_VISIBILITY +_SampleIterator __sample(_PopulationIterator __first, + _PopulationIterator __last, _SampleIterator __output_iter, + _Distance __n, + _UniformRandomNumberGenerator & __g, + input_iterator_tag) { + + _Distance __k = 0; + for (; __first != __last && __k < __n; ++__first, (void) ++__k) + __output_iter[__k] = *__first; + _Distance __sz = __k; + for (; __first != __last; ++__first, (void) ++__k) { + _Distance __r = uniform_int_distribution<_Distance>(0, __k)(__g); + if (__r < __sz) + __output_iter[__r] = *__first; + } + return __output_iter + _VSTD::min(__n, __k); +} + +template <class _PopulationIterator, class _SampleIterator, class _Distance, + class _UniformRandomNumberGenerator> +_LIBCPP_INLINE_VISIBILITY +_SampleIterator __sample(_PopulationIterator __first, + _PopulationIterator __last, _SampleIterator __output_iter, + _Distance __n, + _UniformRandomNumberGenerator& __g, + forward_iterator_tag) { + _Distance __unsampled_sz = _VSTD::distance(__first, __last); + for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) { + _Distance __r = uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); + if (__r < __n) { + *__output_iter++ = *__first; + --__n; + } + } + return __output_iter; +} + +template <class _PopulationIterator, class _SampleIterator, class _Distance, + class _UniformRandomNumberGenerator> +_LIBCPP_INLINE_VISIBILITY +_SampleIterator __sample(_PopulationIterator __first, + _PopulationIterator __last, _SampleIterator __output_iter, + _Distance __n, _UniformRandomNumberGenerator& __g) { + typedef typename iterator_traits<_PopulationIterator>::iterator_category + _PopCategory; + typedef typename iterator_traits<_PopulationIterator>::difference_type + _Difference; + static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value || + __is_cpp17_random_access_iterator<_SampleIterator>::value, + "SampleIterator must meet the requirements of RandomAccessIterator"); + typedef typename common_type<_Distance, _Difference>::type _CommonType; + _LIBCPP_ASSERT(__n >= 0, "N must be a positive number."); + return _VSTD::__sample( + __first, __last, __output_iter, _CommonType(__n), + __g, _PopCategory()); +} + +#if _LIBCPP_STD_VER > 14 +template <class _PopulationIterator, class _SampleIterator, class _Distance, + class _UniformRandomNumberGenerator> +inline _LIBCPP_INLINE_VISIBILITY +_SampleIterator sample(_PopulationIterator __first, + _PopulationIterator __last, _SampleIterator __output_iter, + _Distance __n, _UniformRandomNumberGenerator&& __g) { + return _VSTD::__sample(__first, __last, __output_iter, __n, __g); +} +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_SAMPLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search.h new file mode 100644 index 0000000..cfaec0e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search.h
@@ -0,0 +1,125 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SEARCH_H +#define _LIBCPP___ALGORITHM_SEARCH_H + +#include <__algorithm/comp.h> +#include <__config> +#include <__iterator/iterator_traits.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> +pair<_ForwardIterator1, _ForwardIterator1> + _LIBCPP_CONSTEXPR_AFTER_CXX11 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, + _ForwardIterator2 __first2, _ForwardIterator2 __last2, + _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) { + if (__first2 == __last2) + return _VSTD::make_pair(__first1, __first1); // Everything matches an empty sequence + while (true) { + // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks + while (true) { + if (__first1 == __last1) // return __last1 if no element matches *__first2 + return _VSTD::make_pair(__last1, __last1); + if (__pred(*__first1, *__first2)) + break; + ++__first1; + } + // *__first1 matches *__first2, now match elements after here + _ForwardIterator1 __m1 = __first1; + _ForwardIterator2 __m2 = __first2; + while (true) { + if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern) + return _VSTD::make_pair(__first1, __m1); + if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found + return _VSTD::make_pair(__last1, __last1); + if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1 + { + ++__first1; + break; + } // else there is a match, check next elements + } + } +} + +template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> +_LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_RandomAccessIterator1, _RandomAccessIterator1> +__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, + _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, + random_access_iterator_tag) { + typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1; + typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2; + // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern + const _D2 __len2 = __last2 - __first2; + if (__len2 == 0) + return _VSTD::make_pair(__first1, __first1); + const _D1 __len1 = __last1 - __first1; + if (__len1 < __len2) + return _VSTD::make_pair(__last1, __last1); + const _RandomAccessIterator1 __s = __last1 - _D1(__len2 - 1); // Start of pattern match can't go beyond here + + while (true) { + while (true) { + if (__first1 == __s) + return _VSTD::make_pair(__last1, __last1); + if (__pred(*__first1, *__first2)) + break; + ++__first1; + } + + _RandomAccessIterator1 __m1 = __first1; + _RandomAccessIterator2 __m2 = __first2; + while (true) { + if (++__m2 == __last2) + return _VSTD::make_pair(__first1, __first1 + _D1(__len2)); + ++__m1; // no need to check range on __m1 because __s guarantees we have enough source + if (!__pred(*__m1, *__m2)) { + ++__first1; + break; + } + } + } +} + +template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 +search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, + _BinaryPredicate __pred) { + return _VSTD::__search<_BinaryPredicate&>( + __first1, __last1, __first2, __last2, __pred, + typename iterator_traits<_ForwardIterator1>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()).first; +} + +template <class _ForwardIterator1, class _ForwardIterator2> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 +search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) { + typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; + typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; + return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); +} + +#if _LIBCPP_STD_VER > 14 +template <class _ForwardIterator, class _Searcher> +_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher& __s) { + return __s(__f, __l).first; +} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SEARCH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search_n.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search_n.h new file mode 100644 index 0000000..67d066a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/search_n.h
@@ -0,0 +1,112 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SEARCH_N_H +#define _LIBCPP___ALGORITHM_SEARCH_N_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> // __convert_to_integral + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator __search_n(_ForwardIterator __first, _ForwardIterator __last, + _Size __count, const _Tp& __value_, _BinaryPredicate __pred, + forward_iterator_tag) { + if (__count <= 0) + return __first; + while (true) { + // Find first element in sequence that matchs __value_, with a mininum of loop checks + while (true) { + if (__first == __last) // return __last if no element matches __value_ + return __last; + if (__pred(*__first, __value_)) + break; + ++__first; + } + // *__first matches __value_, now match elements after here + _ForwardIterator __m = __first; + _Size __c(0); + while (true) { + if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern) + return __first; + if (++__m == __last) // Otherwise if source exhaused, pattern not found + return __last; + if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first + { + __first = __m; + ++__first; + break; + } // else there is a match, check next elements + } + } +} + +template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __search_n(_RandomAccessIterator __first, + _RandomAccessIterator __last, _Size __count, + const _Tp& __value_, _BinaryPredicate __pred, + random_access_iterator_tag) { + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + if (__count <= 0) + return __first; + _Size __len = static_cast<_Size>(__last - __first); + if (__len < __count) + return __last; + const _RandomAccessIterator __s = __last - difference_type(__count - 1); // Start of pattern match can't go beyond here + while (true) { + // Find first element in sequence that matchs __value_, with a mininum of loop checks + while (true) { + if (__first >= __s) // return __last if no element matches __value_ + return __last; + if (__pred(*__first, __value_)) + break; + ++__first; + } + // *__first matches __value_, now match elements after here + _RandomAccessIterator __m = __first; + _Size __c(0); + while (true) { + if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern) + return __first; + ++__m; // no need to check range on __m because __s guarantees we have enough source + if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first + { + __first = __m; + ++__first; + break; + } // else there is a match, check next elements + } + } +} + +template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator search_n( + _ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_, _BinaryPredicate __pred) { + return _VSTD::__search_n<_BinaryPredicate&>( + __first, __last, _VSTD::__convert_to_integral(__count), __value_, __pred, + typename iterator_traits<_ForwardIterator>::iterator_category()); +} + +template <class _ForwardIterator, class _Size, class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) { + typedef typename iterator_traits<_ForwardIterator>::value_type __v; + return _VSTD::search_n(__first, __last, _VSTD::__convert_to_integral(__count), __value_, __equal_to<__v, _Tp>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SEARCH_N_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_difference.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_difference.h new file mode 100644 index 0000000..d4a9750 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_difference.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SET_DIFFERENCE_H +#define _LIBCPP___ALGORITHM_SET_DIFFERENCE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/copy.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__set_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + while (__first1 != __last1) + { + if (__first2 == __last2) + return _VSTD::copy(__first1, __last1, __result); + if (__comp(*__first1, *__first2)) + { + *__result = *__first1; + ++__result; + ++__first1; + } + else + { + if (!__comp(*__first2, *__first1)) + ++__first1; + ++__first2; + } + } + return __result; +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) +{ + return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SET_DIFFERENCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_intersection.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_intersection.h new file mode 100644 index 0000000..518e5e6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_intersection.h
@@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SET_INTERSECTION_H +#define _LIBCPP___ALGORITHM_SET_INTERSECTION_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + while (__first1 != __last1 && __first2 != __last2) + { + if (__comp(*__first1, *__first2)) + ++__first1; + else + { + if (!__comp(*__first2, *__first1)) + { + *__result = *__first1; + ++__result; + ++__first1; + } + ++__first2; + } + } + return __result; +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) +{ + return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SET_INTERSECTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_symmetric_difference.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_symmetric_difference.h new file mode 100644 index 0000000..efdf627 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_symmetric_difference.h
@@ -0,0 +1,77 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H +#define _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/copy.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + while (__first1 != __last1) + { + if (__first2 == __last2) + return _VSTD::copy(__first1, __last1, __result); + if (__comp(*__first1, *__first2)) + { + *__result = *__first1; + ++__result; + ++__first1; + } + else + { + if (__comp(*__first2, *__first1)) + { + *__result = *__first2; + ++__result; + } + else + ++__first1; + ++__first2; + } + } + return _VSTD::copy(__first2, __last2, __result); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) +{ + return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_union.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_union.h new file mode 100644 index 0000000..388f037 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/set_union.h
@@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SET_UNION_H +#define _LIBCPP___ALGORITHM_SET_UNION_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/copy.h> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__set_union(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + for (; __first1 != __last1; ++__result) + { + if (__first2 == __last2) + return _VSTD::copy(__first1, __last1, __result); + if (__comp(*__first2, *__first1)) + { + *__result = *__first2; + ++__first2; + } + else + { + if (!__comp(*__first1, *__first2)) + ++__first2; + *__result = *__first1; + ++__first1; + } + } + return _VSTD::copy(__first2, __last2, __result); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_union(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return _VSTD::__set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +set_union(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) +{ + return _VSTD::set_union(__first1, __last1, __first2, __last2, __result, + __less<typename iterator_traits<_InputIterator1>::value_type, + typename iterator_traits<_InputIterator2>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SET_UNION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_left.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_left.h new file mode 100644 index 0000000..8d9bc07 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_left.h
@@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H +#define _LIBCPP___ALGORITHM_SHIFT_LEFT_H + +#include <__config> +#include <__algorithm/move.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> // swap + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY constexpr +_ForwardIterator +shift_left(_ForwardIterator __first, _ForwardIterator __last, + typename iterator_traits<_ForwardIterator>::difference_type __n) +{ + if (__n == 0) { + return __last; + } + + _ForwardIterator __m = __first; + if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) { + if (__n >= __last - __first) { + return __first; + } + __m += __n; + } else { + for (; __n > 0; --__n) { + if (__m == __last) { + return __first; + } + ++__m; + } + } + return _VSTD::move(__m, __last, __first); +} + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SHIFT_LEFT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_right.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_right.h new file mode 100644 index 0000000..cee1773 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shift_right.h
@@ -0,0 +1,101 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H +#define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H + +#include <__config> +#include <__algorithm/move.h> +#include <__algorithm/move_backward.h> +#include <__algorithm/swap_ranges.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> // swap + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY constexpr +_ForwardIterator +shift_right(_ForwardIterator __first, _ForwardIterator __last, + typename iterator_traits<_ForwardIterator>::difference_type __n) +{ + if (__n == 0) { + return __first; + } + + if constexpr (__is_cpp17_random_access_iterator<_ForwardIterator>::value) { + decltype(__n) __d = __last - __first; + if (__n >= __d) { + return __last; + } + _ForwardIterator __m = __first + (__d - __n); + return _VSTD::move_backward(__first, __m, __last); + } else if constexpr (__is_cpp17_bidirectional_iterator<_ForwardIterator>::value) { + _ForwardIterator __m = __last; + for (; __n > 0; --__n) { + if (__m == __first) { + return __last; + } + --__m; + } + return _VSTD::move_backward(__first, __m, __last); + } else { + _ForwardIterator __ret = __first; + for (; __n > 0; --__n) { + if (__ret == __last) { + return __last; + } + ++__ret; + } + + // We have an __n-element scratch space from __first to __ret. + // Slide an __n-element window [__trail, __lead) from left to right. + // We're essentially doing swap_ranges(__first, __ret, __trail, __lead) + // over and over; but once __lead reaches __last we needn't bother + // to save the values of elements [__trail, __last). + + auto __trail = __first; + auto __lead = __ret; + while (__trail != __ret) { + if (__lead == __last) { + _VSTD::move(__first, __trail, __ret); + return __ret; + } + ++__trail; + ++__lead; + } + + _ForwardIterator __mid = __first; + while (true) { + if (__lead == __last) { + __trail = _VSTD::move(__mid, __ret, __trail); + _VSTD::move(__first, __mid, __trail); + return __ret; + } + swap(*__mid, *__trail); + ++__mid; + ++__trail; + ++__lead; + if (__mid == __ret) { + __mid = __first; + } + } + } +} + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SHIFT_RIGHT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shuffle.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shuffle.h new file mode 100644 index 0000000..7f6ad50 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/shuffle.h
@@ -0,0 +1,160 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SHUFFLE_H +#define _LIBCPP___ALGORITHM_SHUFFLE_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__random/uniform_int_distribution.h> +#include <__utility/swap.h> +#include <cstddef> +#include <cstdint> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer { +public: + __libcpp_debug_randomizer() { + __state = __seed(); + __inc = __state + 0xda3e39cb94b95bdbULL; + __inc = (__inc << 1) | 1; + } + typedef uint_fast32_t result_type; + + static const result_type _Min = 0; + static const result_type _Max = 0xFFFFFFFF; + + _LIBCPP_HIDE_FROM_ABI result_type operator()() { + uint_fast64_t __oldstate = __state; + __state = __oldstate * 6364136223846793005ULL + __inc; + return __oldstate >> 32; + } + + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type min() { return _Min; } + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type max() { return _Max; } + +private: + uint_fast64_t __state; + uint_fast64_t __inc; + _LIBCPP_HIDE_FROM_ABI static uint_fast64_t __seed() { +#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED + return _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED; +#else + static char __x; + return reinterpret_cast<uintptr_t>(&__x); +#endif + } +}; + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \ + || defined(_LIBCPP_BUILDING_LIBRARY) +class _LIBCPP_TYPE_VIS __rs_default; + +_LIBCPP_FUNC_VIS __rs_default __rs_get(); + +class _LIBCPP_TYPE_VIS __rs_default +{ + static unsigned __c_; + + __rs_default(); +public: + typedef uint_fast32_t result_type; + + static const result_type _Min = 0; + static const result_type _Max = 0xFFFFFFFF; + + __rs_default(const __rs_default&); + ~__rs_default(); + + result_type operator()(); + + static _LIBCPP_CONSTEXPR result_type min() {return _Min;} + static _LIBCPP_CONSTEXPR result_type max() {return _Max;} + + friend _LIBCPP_FUNC_VIS __rs_default __rs_get(); +}; + +_LIBCPP_FUNC_VIS __rs_default __rs_get(); + +template <class _RandomAccessIterator> +_LIBCPP_DEPRECATED_IN_CXX14 void +random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef uniform_int_distribution<ptrdiff_t> _Dp; + typedef typename _Dp::param_type _Pp; + difference_type __d = __last - __first; + if (__d > 1) + { + _Dp __uid; + __rs_default __g = __rs_get(); + for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) + { + difference_type __i = __uid(__g, _Pp(0, __d)); + if (__i != difference_type(0)) + swap(*__first, *(__first + __i)); + } + } +} + +template <class _RandomAccessIterator, class _RandomNumberGenerator> +_LIBCPP_DEPRECATED_IN_CXX14 void +random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, +#ifndef _LIBCPP_CXX03_LANG + _RandomNumberGenerator&& __rand) +#else + _RandomNumberGenerator& __rand) +#endif +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + difference_type __d = __last - __first; + if (__d > 1) + { + for (--__last; __first < __last; ++__first, (void) --__d) + { + difference_type __i = __rand(__d); + if (__i != difference_type(0)) + swap(*__first, *(__first + __i)); + } + } +} +#endif + +template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> + void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, + _UniformRandomNumberGenerator&& __g) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef uniform_int_distribution<ptrdiff_t> _Dp; + typedef typename _Dp::param_type _Pp; + difference_type __d = __last - __first; + if (__d > 1) + { + _Dp __uid; + for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) + { + difference_type __i = __uid(__g, _Pp(0, __d)); + if (__i != difference_type(0)) + swap(*__first, *(__first + __i)); + } + } +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___ALGORITHM_SHUFFLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sift_down.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sift_down.h new file mode 100644 index 0000000..4d99ff2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sift_down.h
@@ -0,0 +1,79 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SIFT_DOWN_H +#define _LIBCPP___ALGORITHM_SIFT_DOWN_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__utility/move.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void +__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/, + _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len, + _RandomAccessIterator __start) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + // left-child of __start is at 2 * __start + 1 + // right-child of __start is at 2 * __start + 2 + difference_type __child = __start - __first; + + if (__len < 2 || (__len - 2) / 2 < __child) + return; + + __child = 2 * __child + 1; + _RandomAccessIterator __child_i = __first + __child; + + if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) { + // right-child exists and is greater than left-child + ++__child_i; + ++__child; + } + + // check if we are in heap-order + if (__comp(*__child_i, *__start)) + // we are, __start is larger than it's largest child + return; + + value_type __top(_VSTD::move(*__start)); + do + { + // we are not in heap-order, swap the parent with its largest child + *__start = _VSTD::move(*__child_i); + __start = __child_i; + + if ((__len - 2) / 2 < __child) + break; + + // recompute the child based off of the updated parent + __child = 2 * __child + 1; + __child_i = __first + __child; + + if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) { + // right-child exists and is greater than left-child + ++__child_i; + ++__child; + } + + // check if we are in heap-order + } while (!__comp(*__child_i, __top)); + *__start = _VSTD::move(__top); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort.h new file mode 100644 index 0000000..bc12768 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort.h
@@ -0,0 +1,556 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SORT_H +#define _LIBCPP___ALGORITHM_SORT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/min_element.h> +#include <__algorithm/partial_sort.h> +#include <__algorithm/unwrap_iter.h> +#include <__utility/swap.h> +#include <memory> + +#if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# include <__algorithm/shuffle.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// stable, 2-3 compares, 0-2 swaps + +template <class _Compare, class _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 unsigned +__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c) +{ + unsigned __r = 0; + if (!__c(*__y, *__x)) // if x <= y + { + if (!__c(*__z, *__y)) // if y <= z + return __r; // x <= y && y <= z + // x <= y && y > z + swap(*__y, *__z); // x <= z && y < z + __r = 1; + if (__c(*__y, *__x)) // if x > y + { + swap(*__x, *__y); // x < y && y <= z + __r = 2; + } + return __r; // x <= y && y < z + } + if (__c(*__z, *__y)) // x > y, if y > z + { + swap(*__x, *__z); // x < y && y < z + __r = 1; + return __r; + } + swap(*__x, *__y); // x > y && y <= z + __r = 1; // x < y && x <= z + if (__c(*__z, *__y)) // if y > z + { + swap(*__y, *__z); // x <= y && y < z + __r = 2; + } + return __r; +} // x <= y && y <= z + +// stable, 3-6 compares, 0-5 swaps + +template <class _Compare, class _ForwardIterator> +unsigned +__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, + _ForwardIterator __x4, _Compare __c) +{ + unsigned __r = _VSTD::__sort3<_Compare>(__x1, __x2, __x3, __c); + if (__c(*__x4, *__x3)) + { + swap(*__x3, *__x4); + ++__r; + if (__c(*__x3, *__x2)) + { + swap(*__x2, *__x3); + ++__r; + if (__c(*__x2, *__x1)) + { + swap(*__x1, *__x2); + ++__r; + } + } + } + return __r; +} + +// stable, 4-10 compares, 0-9 swaps + +template <class _Compare, class _ForwardIterator> +_LIBCPP_HIDDEN +unsigned +__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, + _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c) +{ + unsigned __r = _VSTD::__sort4<_Compare>(__x1, __x2, __x3, __x4, __c); + if (__c(*__x5, *__x4)) + { + swap(*__x4, *__x5); + ++__r; + if (__c(*__x4, *__x3)) + { + swap(*__x3, *__x4); + ++__r; + if (__c(*__x3, *__x2)) + { + swap(*__x2, *__x3); + ++__r; + if (__c(*__x2, *__x1)) + { + swap(*__x1, *__x2); + ++__r; + } + } + } + } + return __r; +} + +// Assumes size > 0 +template <class _Compare, class _BidirectionalIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX11 void +__selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + _BidirectionalIterator __lm1 = __last; + for (--__lm1; __first != __lm1; ++__first) + { + _BidirectionalIterator __i = _VSTD::min_element(__first, __last, __comp); + if (__i != __first) + swap(*__first, *__i); + } +} + +template <class _Compare, class _BidirectionalIterator> +void +__insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + if (__first != __last) + { + _BidirectionalIterator __i = __first; + for (++__i; __i != __last; ++__i) + { + _BidirectionalIterator __j = __i; + value_type __t(_VSTD::move(*__j)); + for (_BidirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j) + *__j = _VSTD::move(*__k); + *__j = _VSTD::move(__t); + } + } +} + +template <class _Compare, class _RandomAccessIterator> +void +__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + _RandomAccessIterator __j = __first+difference_type(2); + _VSTD::__sort3<_Compare>(__first, __first+difference_type(1), __j, __comp); + for (_RandomAccessIterator __i = __j+difference_type(1); __i != __last; ++__i) + { + if (__comp(*__i, *__j)) + { + value_type __t(_VSTD::move(*__i)); + _RandomAccessIterator __k = __j; + __j = __i; + do + { + *__j = _VSTD::move(*__k); + __j = __k; + } while (__j != __first && __comp(__t, *--__k)); + *__j = _VSTD::move(__t); + } + __j = __i; + } +} + +template <class _Compare, class _RandomAccessIterator> +bool +__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + switch (__last - __first) + { + case 0: + case 1: + return true; + case 2: + if (__comp(*--__last, *__first)) + swap(*__first, *__last); + return true; + case 3: + _VSTD::__sort3<_Compare>(__first, __first+difference_type(1), --__last, __comp); + return true; + case 4: + _VSTD::__sort4<_Compare>(__first, __first+difference_type(1), __first+difference_type(2), --__last, __comp); + return true; + case 5: + _VSTD::__sort5<_Compare>(__first, __first+difference_type(1), __first+difference_type(2), __first+difference_type(3), --__last, __comp); + return true; + } + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + _RandomAccessIterator __j = __first+difference_type(2); + _VSTD::__sort3<_Compare>(__first, __first+difference_type(1), __j, __comp); + const unsigned __limit = 8; + unsigned __count = 0; + for (_RandomAccessIterator __i = __j+difference_type(1); __i != __last; ++__i) + { + if (__comp(*__i, *__j)) + { + value_type __t(_VSTD::move(*__i)); + _RandomAccessIterator __k = __j; + __j = __i; + do + { + *__j = _VSTD::move(*__k); + __j = __k; + } while (__j != __first && __comp(__t, *--__k)); + *__j = _VSTD::move(__t); + if (++__count == __limit) + return ++__i == __last; + } + __j = __i; + } + return true; +} + +template <class _Compare, class _BidirectionalIterator> +void +__insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1, + typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) +{ + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + if (__first1 != __last1) + { + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h(__first2, __d); + value_type* __last2 = __first2; + ::new ((void*)__last2) value_type(_VSTD::move(*__first1)); + __d.template __incr<value_type>(); + for (++__last2; ++__first1 != __last1; ++__last2) + { + value_type* __j2 = __last2; + value_type* __i2 = __j2; + if (__comp(*__first1, *--__i2)) + { + ::new ((void*)__j2) value_type(_VSTD::move(*__i2)); + __d.template __incr<value_type>(); + for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2) + *__j2 = _VSTD::move(*__i2); + *__j2 = _VSTD::move(*__first1); + } + else + { + ::new ((void*)__j2) value_type(_VSTD::move(*__first1)); + __d.template __incr<value_type>(); + } + } + __h.release(); + } +} + +template <class _Compare, class _RandomAccessIterator> +void +__introsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __depth) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + const difference_type __limit = is_trivially_copy_constructible<value_type>::value && + is_trivially_copy_assignable<value_type>::value ? 30 : 6; + while (true) + { + __restart: + difference_type __len = __last - __first; + switch (__len) + { + case 0: + case 1: + return; + case 2: + if (__comp(*--__last, *__first)) + swap(*__first, *__last); + return; + case 3: + _VSTD::__sort3<_Compare>(__first, __first+difference_type(1), --__last, __comp); + return; + case 4: + _VSTD::__sort4<_Compare>(__first, __first+difference_type(1), __first+difference_type(2), --__last, __comp); + return; + case 5: + _VSTD::__sort5<_Compare>(__first, __first+difference_type(1), __first+difference_type(2), __first+difference_type(3), --__last, __comp); + return; + } + if (__len <= __limit) + { + _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp); + return; + } + // __len > 5 + if (__depth == 0) + { + // Fallback to heap sort as Introsort suggests. + _VSTD::__partial_sort<_Compare>(__first, __last, __last, __comp); + return; + } + --__depth; + _RandomAccessIterator __m = __first; + _RandomAccessIterator __lm1 = __last; + --__lm1; + unsigned __n_swaps; + { + difference_type __delta; + if (__len >= 1000) + { + __delta = __len/2; + __m += __delta; + __delta /= 2; + __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp); + } + else + { + __delta = __len/2; + __m += __delta; + __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp); + } + } + // *__m is median + // partition [__first, __m) < *__m and *__m <= [__m, __last) + // (this inhibits tossing elements equivalent to __m around unnecessarily) + _RandomAccessIterator __i = __first; + _RandomAccessIterator __j = __lm1; + // j points beyond range to be tested, *__m is known to be <= *__lm1 + // The search going up is known to be guarded but the search coming down isn't. + // Prime the downward search with a guard. + if (!__comp(*__i, *__m)) // if *__first == *__m + { + // *__first == *__m, *__first doesn't go in first part + // manually guard downward moving __j against __i + while (true) + { + if (__i == --__j) + { + // *__first == *__m, *__m <= all other elements + // Parition instead into [__first, __i) == *__first and *__first < [__i, __last) + ++__i; // __first + 1 + __j = __last; + if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1) + { + while (true) + { + if (__i == __j) + return; // [__first, __last) all equivalent elements + if (__comp(*__first, *__i)) + { + swap(*__i, *__j); + ++__n_swaps; + ++__i; + break; + } + ++__i; + } + } + // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1 + if (__i == __j) + return; + while (true) + { + while (!__comp(*__first, *__i)) + ++__i; + while (__comp(*__first, *--__j)) + ; + if (__i >= __j) + break; + swap(*__i, *__j); + ++__n_swaps; + ++__i; + } + // [__first, __i) == *__first and *__first < [__i, __last) + // The first part is sorted, sort the second part + // _VSTD::__sort<_Compare>(__i, __last, __comp); + __first = __i; + goto __restart; + } + if (__comp(*__j, *__m)) + { + swap(*__i, *__j); + ++__n_swaps; + break; // found guard for downward moving __j, now use unguarded partition + } + } + } + // It is known that *__i < *__m + ++__i; + // j points beyond range to be tested, *__m is known to be <= *__lm1 + // if not yet partitioned... + if (__i < __j) + { + // known that *(__i - 1) < *__m + // known that __i <= __m + while (true) + { + // __m still guards upward moving __i + while (__comp(*__i, *__m)) + ++__i; + // It is now known that a guard exists for downward moving __j + while (!__comp(*--__j, *__m)) + ; + if (__i > __j) + break; + swap(*__i, *__j); + ++__n_swaps; + // It is known that __m != __j + // If __m just moved, follow it + if (__m == __i) + __m = __j; + ++__i; + } + } + // [__first, __i) < *__m and *__m <= [__i, __last) + if (__i != __m && __comp(*__m, *__i)) + { + swap(*__i, *__m); + ++__n_swaps; + } + // [__first, __i) < *__i and *__i <= [__i+1, __last) + // If we were given a perfect partition, see if insertion sort is quick... + if (__n_swaps == 0) + { + bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp); + if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+difference_type(1), __last, __comp)) + { + if (__fs) + return; + __last = __i; + continue; + } + else + { + if (__fs) + { + __first = ++__i; + continue; + } + } + } + // sort smaller range with recursive call and larger with tail recursion elimination + if (__i - __first < __last - __i) + { + _VSTD::__introsort<_Compare>(__first, __i, __comp, __depth); + __first = ++__i; + } + else + { + _VSTD::__introsort<_Compare>(__i + difference_type(1), __last, __comp, __depth); + __last = __i; + } + } +} + +template <typename _Number> +inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) { + _Number __log2 = 0; + while (__n > 1) { + __log2++; + __n >>= 1; + } + return __log2; +} + +template <class _Compare, class _RandomAccessIterator> +void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + difference_type __depth_limit = 2 * __log2i(__last - __first); + _VSTD::__introsort<_Compare>(__first, __last, __comp, __depth_limit); +} + +template <class _Compare, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +void +__sort(_Tp** __first, _Tp** __last, __less<_Tp*>&) +{ + __less<uintptr_t> __comp; + _VSTD::__sort<__less<uintptr_t>&, uintptr_t*>((uintptr_t*)__first, (uintptr_t*)__last, __comp); +} + +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&)) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&)) +#endif +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&)) + +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&)) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&)) +#endif +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&)) +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&)) + +_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&)) + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + if (__libcpp_is_constant_evaluated()) { + _VSTD::__partial_sort<_Comp_ref>(__first, __last, __last, _Comp_ref(__comp)); + } else { + _VSTD::__sort<_Comp_ref>(_VSTD::__unwrap_iter(__first), _VSTD::__unwrap_iter(__last), _Comp_ref(__comp)); + } +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +sort(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SORT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort_heap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort_heap.h new file mode 100644 index 0000000..bf6200c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/sort_heap.h
@@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SORT_HEAP_H +#define _LIBCPP___ALGORITHM_SORT_HEAP_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/pop_heap.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> // swap + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _RandomAccessIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 void +__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n) + _VSTD::__pop_heap<_Compare>(__first, __last, __comp, __n); +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__sort_heap<_Comp_ref>(__first, __last, __comp); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +void +sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SORT_HEAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_partition.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_partition.h new file mode 100644 index 0000000..323b323 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_partition.h
@@ -0,0 +1,295 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_STABLE_PARTITION_H +#define _LIBCPP___ALGORITHM_STABLE_PARTITION_H + +#include <__config> +#include <__algorithm/rotate.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> +#include <memory> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair> +_ForwardIterator +__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, + _Distance __len, _Pair __p, forward_iterator_tag __fit) +{ + // *__first is known to be false + // __len >= 1 + if (__len == 1) + return __first; + if (__len == 2) + { + _ForwardIterator __m = __first; + if (__pred(*++__m)) + { + swap(*__first, *__m); + return __m; + } + return __first; + } + if (__len <= __p.second) + { // The buffer is big enough to use + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); + // Move the falses into the temporary buffer, and the trues to the front of the line + // Update __first to always point to the end of the trues + value_type* __t = __p.first; + ::new ((void*)__t) value_type(_VSTD::move(*__first)); + __d.template __incr<value_type>(); + ++__t; + _ForwardIterator __i = __first; + while (++__i != __last) + { + if (__pred(*__i)) + { + *__first = _VSTD::move(*__i); + ++__first; + } + else + { + ::new ((void*)__t) value_type(_VSTD::move(*__i)); + __d.template __incr<value_type>(); + ++__t; + } + } + // All trues now at start of range, all falses in buffer + // Move falses back into range, but don't mess up __first which points to first false + __i = __first; + for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) + *__i = _VSTD::move(*__t2); + // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer + return __first; + } + // Else not enough buffer, do in place + // __len >= 3 + _ForwardIterator __m = __first; + _Distance __len2 = __len / 2; // __len2 >= 2 + _VSTD::advance(__m, __len2); + // recurse on [__first, __m), *__first know to be false + // F????????????????? + // f m l + _ForwardIterator __first_false = _VSTD::__stable_partition<_Predicate&>(__first, __m, __pred, __len2, __p, __fit); + // TTTFFFFF?????????? + // f ff m l + // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true + _ForwardIterator __m1 = __m; + _ForwardIterator __second_false = __last; + _Distance __len_half = __len - __len2; + while (__pred(*__m1)) + { + if (++__m1 == __last) + goto __second_half_done; + --__len_half; + } + // TTTFFFFFTTTF?????? + // f ff m m1 l + __second_false = _VSTD::__stable_partition<_Predicate&>(__m1, __last, __pred, __len_half, __p, __fit); +__second_half_done: + // TTTFFFFFTTTTTFFFFF + // f ff m sf l + return _VSTD::rotate(__first_false, __m, __second_false); + // TTTTTTTTFFFFFFFFFF + // | +} + +template <class _Predicate, class _ForwardIterator> +_ForwardIterator +__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, + forward_iterator_tag) +{ + const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment + // Either prove all true and return __first or point to first false + while (true) + { + if (__first == __last) + return __first; + if (!__pred(*__first)) + break; + ++__first; + } + // We now have a reduced range [__first, __last) + // *__first is known to be false + typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; + difference_type __len = _VSTD::distance(__first, __last); + pair<value_type*, ptrdiff_t> __p(0, 0); + unique_ptr<value_type, __return_temporary_buffer> __h; + if (__len >= __alloc_limit) + { + __p = _VSTD::get_temporary_buffer<value_type>(__len); + __h.reset(__p.first); + } + return _VSTD::__stable_partition<_Predicate&>(__first, __last, __pred, __len, __p, forward_iterator_tag()); +} + +template <class _Predicate, class _BidirectionalIterator, class _Distance, class _Pair> +_BidirectionalIterator +__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, + _Distance __len, _Pair __p, bidirectional_iterator_tag __bit) +{ + // *__first is known to be false + // *__last is known to be true + // __len >= 2 + if (__len == 2) + { + swap(*__first, *__last); + return __last; + } + if (__len == 3) + { + _BidirectionalIterator __m = __first; + if (__pred(*++__m)) + { + swap(*__first, *__m); + swap(*__m, *__last); + return __last; + } + swap(*__m, *__last); + swap(*__first, *__m); + return __m; + } + if (__len <= __p.second) + { // The buffer is big enough to use + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); + // Move the falses into the temporary buffer, and the trues to the front of the line + // Update __first to always point to the end of the trues + value_type* __t = __p.first; + ::new ((void*)__t) value_type(_VSTD::move(*__first)); + __d.template __incr<value_type>(); + ++__t; + _BidirectionalIterator __i = __first; + while (++__i != __last) + { + if (__pred(*__i)) + { + *__first = _VSTD::move(*__i); + ++__first; + } + else + { + ::new ((void*)__t) value_type(_VSTD::move(*__i)); + __d.template __incr<value_type>(); + ++__t; + } + } + // move *__last, known to be true + *__first = _VSTD::move(*__i); + __i = ++__first; + // All trues now at start of range, all falses in buffer + // Move falses back into range, but don't mess up __first which points to first false + for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) + *__i = _VSTD::move(*__t2); + // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer + return __first; + } + // Else not enough buffer, do in place + // __len >= 4 + _BidirectionalIterator __m = __first; + _Distance __len2 = __len / 2; // __len2 >= 2 + _VSTD::advance(__m, __len2); + // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false + // F????????????????T + // f m l + _BidirectionalIterator __m1 = __m; + _BidirectionalIterator __first_false = __first; + _Distance __len_half = __len2; + while (!__pred(*--__m1)) + { + if (__m1 == __first) + goto __first_half_done; + --__len_half; + } + // F???TFFF?????????T + // f m1 m l + __first_false = _VSTD::__stable_partition<_Predicate&>(__first, __m1, __pred, __len_half, __p, __bit); +__first_half_done: + // TTTFFFFF?????????T + // f ff m l + // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true + __m1 = __m; + _BidirectionalIterator __second_false = __last; + ++__second_false; + __len_half = __len - __len2; + while (__pred(*__m1)) + { + if (++__m1 == __last) + goto __second_half_done; + --__len_half; + } + // TTTFFFFFTTTF?????T + // f ff m m1 l + __second_false = _VSTD::__stable_partition<_Predicate&>(__m1, __last, __pred, __len_half, __p, __bit); +__second_half_done: + // TTTFFFFFTTTTTFFFFF + // f ff m sf l + return _VSTD::rotate(__first_false, __m, __second_false); + // TTTTTTTTFFFFFFFFFF + // | +} + +template <class _Predicate, class _BidirectionalIterator> +_BidirectionalIterator +__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, + bidirectional_iterator_tag) +{ + typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; + typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; + const difference_type __alloc_limit = 4; // might want to make this a function of trivial assignment + // Either prove all true and return __first or point to first false + while (true) + { + if (__first == __last) + return __first; + if (!__pred(*__first)) + break; + ++__first; + } + // __first points to first false, everything prior to __first is already set. + // Either prove [__first, __last) is all false and return __first, or point __last to last true + do + { + if (__first == --__last) + return __first; + } while (!__pred(*__last)); + // We now have a reduced range [__first, __last] + // *__first is known to be false + // *__last is known to be true + // __len >= 2 + difference_type __len = _VSTD::distance(__first, __last) + 1; + pair<value_type*, ptrdiff_t> __p(0, 0); + unique_ptr<value_type, __return_temporary_buffer> __h; + if (__len >= __alloc_limit) + { + __p = _VSTD::get_temporary_buffer<value_type>(__len); + __h.reset(__p.first); + } + return _VSTD::__stable_partition<_Predicate&>(__first, __last, __pred, __len, __p, bidirectional_iterator_tag()); +} + +template <class _ForwardIterator, class _Predicate> +inline _LIBCPP_INLINE_VISIBILITY +_ForwardIterator +stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) +{ + return _VSTD::__stable_partition<_Predicate&>(__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_STABLE_PARTITION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_sort.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_sort.h new file mode 100644 index 0000000..41e17bd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/stable_sort.h
@@ -0,0 +1,230 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_STABLE_SORT_H +#define _LIBCPP___ALGORITHM_STABLE_SORT_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/inplace_merge.h> +#include <__algorithm/sort.h> +#include <__iterator/iterator_traits.h> +#include <__utility/swap.h> +#include <memory> +#include <type_traits> // swap + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _InputIterator1, class _InputIterator2> +void +__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp) +{ + typedef typename iterator_traits<_InputIterator1>::value_type value_type; + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h(__result, __d); + for (; true; ++__result) + { + if (__first1 == __last1) + { + for (; __first2 != __last2; ++__first2, (void) ++__result, __d.template __incr<value_type>()) + ::new ((void*)__result) value_type(_VSTD::move(*__first2)); + __h.release(); + return; + } + if (__first2 == __last2) + { + for (; __first1 != __last1; ++__first1, (void) ++__result, __d.template __incr<value_type>()) + ::new ((void*)__result) value_type(_VSTD::move(*__first1)); + __h.release(); + return; + } + if (__comp(*__first2, *__first1)) + { + ::new ((void*)__result) value_type(_VSTD::move(*__first2)); + __d.template __incr<value_type>(); + ++__first2; + } + else + { + ::new ((void*)__result) value_type(_VSTD::move(*__first1)); + __d.template __incr<value_type>(); + ++__first1; + } + } +} + +template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> +void +__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) +{ + for (; __first1 != __last1; ++__result) + { + if (__first2 == __last2) + { + for (; __first1 != __last1; ++__first1, (void) ++__result) + *__result = _VSTD::move(*__first1); + return; + } + if (__comp(*__first2, *__first1)) + { + *__result = _VSTD::move(*__first2); + ++__first2; + } + else + { + *__result = _VSTD::move(*__first1); + ++__first1; + } + } + for (; __first2 != __last2; ++__first2, (void) ++__result) + *__result = _VSTD::move(*__first2); +} + +template <class _Compare, class _RandomAccessIterator> +void +__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len, + typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size); + +template <class _Compare, class _RandomAccessIterator> +void +__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len, + typename iterator_traits<_RandomAccessIterator>::value_type* __first2) +{ + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + switch (__len) + { + case 0: + return; + case 1: + ::new ((void*)__first2) value_type(_VSTD::move(*__first1)); + return; + case 2: + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h2(__first2, __d); + if (__comp(*--__last1, *__first1)) + { + ::new ((void*)__first2) value_type(_VSTD::move(*__last1)); + __d.template __incr<value_type>(); + ++__first2; + ::new ((void*)__first2) value_type(_VSTD::move(*__first1)); + } + else + { + ::new ((void*)__first2) value_type(_VSTD::move(*__first1)); + __d.template __incr<value_type>(); + ++__first2; + ::new ((void*)__first2) value_type(_VSTD::move(*__last1)); + } + __h2.release(); + return; + } + if (__len <= 8) + { + _VSTD::__insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp); + return; + } + typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; + _RandomAccessIterator __m = __first1 + __l2; + _VSTD::__stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2); + _VSTD::__stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2); + _VSTD::__merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp); +} + +template <class _Tp> +struct __stable_sort_switch +{ + static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value; +}; + +template <class _Compare, class _RandomAccessIterator> +void +__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, + typename iterator_traits<_RandomAccessIterator>::difference_type __len, + typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size) +{ + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + switch (__len) + { + case 0: + case 1: + return; + case 2: + if (__comp(*--__last, *__first)) + swap(*__first, *__last); + return; + } + if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value)) + { + _VSTD::__insertion_sort<_Compare>(__first, __last, __comp); + return; + } + typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; + _RandomAccessIterator __m = __first + __l2; + if (__len <= __buff_size) + { + __destruct_n __d(0); + unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); + _VSTD::__stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff); + __d.__set(__l2, (value_type*)nullptr); + _VSTD::__stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2); + __d.__set(__len, (value_type*)nullptr); + _VSTD::__merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp); +// _VSTD::__merge<_Compare>(move_iterator<value_type*>(__buff), +// move_iterator<value_type*>(__buff + __l2), +// move_iterator<_RandomAccessIterator>(__buff + __l2), +// move_iterator<_RandomAccessIterator>(__buff + __len), +// __first, __comp); + return; + } + _VSTD::__stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size); + _VSTD::__stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size); + _VSTD::__inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size); +} + +template <class _RandomAccessIterator, class _Compare> +inline _LIBCPP_INLINE_VISIBILITY +void +stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) +{ + typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; + difference_type __len = __last - __first; + pair<value_type*, ptrdiff_t> __buf(0, 0); + unique_ptr<value_type, __return_temporary_buffer> __h; + if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value)) + { + __buf = _VSTD::get_temporary_buffer<value_type>(__len); + __h.reset(__buf.first); + } + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + _VSTD::__stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second); +} + +template <class _RandomAccessIterator> +inline _LIBCPP_INLINE_VISIBILITY +void +stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + _VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_STABLE_SORT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/swap_ranges.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/swap_ranges.h new file mode 100644 index 0000000..2b099c7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/swap_ranges.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_SWAP_RANGES_H +#define _LIBCPP___ALGORITHM_SWAP_RANGES_H + +#include <__config> +#include <__utility/swap.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _ForwardIterator1, class _ForwardIterator2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator2 +swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2) { + for (; __first1 != __last1; ++__first1, (void)++__first2) + swap(*__first1, *__first2); + return __first2; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_SWAP_RANGES_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/transform.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/transform.h new file mode 100644 index 0000000..494cb71 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/transform.h
@@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_TRANSFORM_H +#define _LIBCPP___ALGORITHM_TRANSFORM_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _OutputIterator, class _UnaryOperation> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op) +{ + for (; __first != __last; ++__first, (void) ++__result) + *__result = __op(*__first); + return __result; +} + +template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, + _OutputIterator __result, _BinaryOperation __binary_op) +{ + for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result) + *__result = __binary_op(*__first1, *__first2); + return __result; +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_TRANSFORM_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique.h new file mode 100644 index 0000000..62f0490 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique.h
@@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_UNIQUE_H +#define _LIBCPP___ALGORITHM_UNIQUE_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/adjacent_find.h> +#include <__iterator/iterator_traits.h> +#include <__utility/move.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// unique + +template <class _ForwardIterator, class _BinaryPredicate> +_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) +{ + __first = _VSTD::adjacent_find<_ForwardIterator, _BinaryPredicate&>(__first, __last, __pred); + if (__first != __last) + { + // ... a a ? ... + // f i + _ForwardIterator __i = __first; + for (++__i; ++__i != __last;) + if (!__pred(*__first, *__i)) + *++__first = _VSTD::move(*__i); + ++__first; + } + return __first; +} + +template <class _ForwardIterator> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +unique(_ForwardIterator __first, _ForwardIterator __last) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type __v; + return _VSTD::unique(__first, __last, __equal_to<__v>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_UNIQUE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique_copy.h new file mode 100644 index 0000000..4c916dc --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unique_copy.h
@@ -0,0 +1,107 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_UNIQUE_COPY_H +#define _LIBCPP___ALGORITHM_UNIQUE_COPY_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__iterator/iterator_traits.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _BinaryPredicate, class _InputIterator, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred, + input_iterator_tag, output_iterator_tag) +{ + if (__first != __last) + { + typename iterator_traits<_InputIterator>::value_type __t(*__first); + *__result = __t; + ++__result; + while (++__first != __last) + { + if (!__pred(__t, *__first)) + { + __t = *__first; + *__result = __t; + ++__result; + } + } + } + return __result; +} + +template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator +__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred, + forward_iterator_tag, output_iterator_tag) +{ + if (__first != __last) + { + _ForwardIterator __i = __first; + *__result = *__i; + ++__result; + while (++__first != __last) + { + if (!__pred(*__i, *__first)) + { + *__result = *__first; + ++__result; + __i = __first; + } + } + } + return __result; +} + +template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred, + input_iterator_tag, forward_iterator_tag) +{ + if (__first != __last) + { + *__result = *__first; + while (++__first != __last) + if (!__pred(*__result, *__first)) + *++__result = *__first; + ++__result; + } + return __result; +} + +template <class _InputIterator, class _OutputIterator, class _BinaryPredicate> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) +{ + return _VSTD::__unique_copy<_BinaryPredicate&>(__first, __last, __result, __pred, + typename iterator_traits<_InputIterator>::iterator_category(), + typename iterator_traits<_OutputIterator>::iterator_category()); +} + +template <class _InputIterator, class _OutputIterator> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_OutputIterator +unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) +{ + typedef typename iterator_traits<_InputIterator>::value_type __v; + return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>()); +} + + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_UNIQUE_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unwrap_iter.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unwrap_iter.h new file mode 100644 index 0000000..f77ecca --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/unwrap_iter.h
@@ -0,0 +1,84 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_UNWRAP_ITER_H +#define _LIBCPP___ALGORITHM_UNWRAP_ITER_H + +#include <__config> +#include <iterator> +#include <__memory/pointer_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// The job of __unwrap_iter is to lower contiguous iterators (such as +// vector<T>::iterator) into pointers, to reduce the number of template +// instantiations and to enable pointer-based optimizations e.g. in std::copy. +// For iterators that are not contiguous, it must be a no-op. +// In debug mode, we don't do this. +// +// __unwrap_iter is non-constexpr for user-defined iterators whose +// `to_address` and/or `operator->` is non-constexpr. This is okay; but we +// try to avoid doing __unwrap_iter in constant-evaluated contexts anyway. +// +// Some algorithms (e.g. std::copy, but not std::sort) need to convert an +// "unwrapped" result back into a contiguous iterator. Since contiguous iterators +// are random-access, we can do this portably using iterator arithmetic; this +// is the job of __rewrap_iter. + +template <class _Iter, bool = __is_cpp17_contiguous_iterator<_Iter>::value> +struct __unwrap_iter_impl { + static _LIBCPP_CONSTEXPR _Iter + __apply(_Iter __i) _NOEXCEPT { + return __i; + } +}; + +#if _LIBCPP_DEBUG_LEVEL < 2 + +template <class _Iter> +struct __unwrap_iter_impl<_Iter, true> { + static _LIBCPP_CONSTEXPR decltype(_VSTD::__to_address(declval<_Iter>())) + __apply(_Iter __i) _NOEXCEPT { + return _VSTD::__to_address(__i); + } +}; + +#endif // _LIBCPP_DEBUG_LEVEL < 2 + +template<class _Iter, class _Impl = __unwrap_iter_impl<_Iter> > +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +decltype(_Impl::__apply(declval<_Iter>())) +__unwrap_iter(_Iter __i) _NOEXCEPT +{ + return _Impl::__apply(__i); +} + +template<class _OrigIter> +_LIBCPP_HIDE_FROM_ABI +_OrigIter __rewrap_iter(_OrigIter, _OrigIter __result) +{ + return __result; +} + +template<class _OrigIter, class _UnwrappedIter> +_LIBCPP_HIDE_FROM_ABI +_OrigIter __rewrap_iter(_OrigIter __first, _UnwrappedIter __result) +{ + // Precondition: __result is reachable from __first + // Precondition: _OrigIter is a contiguous iterator + return __first + (__result - _VSTD::__unwrap_iter(__first)); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/upper_bound.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/upper_bound.h new file mode 100644 index 0000000..4ae7b8f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__algorithm/upper_bound.h
@@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ALGORITHM_UPPER_BOUND_H +#define _LIBCPP___ALGORITHM_UPPER_BOUND_H + +#include <__config> +#include <__algorithm/comp.h> +#include <__algorithm/half_positive.h> +#include <iterator> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Compare, class _ForwardIterator, class _Tp> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; + difference_type __len = _VSTD::distance(__first, __last); + while (__len != 0) + { + difference_type __l2 = _VSTD::__half_positive(__len); + _ForwardIterator __m = __first; + _VSTD::advance(__m, __l2); + if (__comp(__value_, *__m)) + __len = __l2; + else + { + __first = ++__m; + __len -= __l2 + 1; + } + } + return __first; +} + +template <class _ForwardIterator, class _Tp, class _Compare> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) +{ + return _VSTD::__upper_bound<_Compare&>(__first, __last, __value_, __comp); +} + +template <class _ForwardIterator, class _Tp> +_LIBCPP_NODISCARD_EXT inline +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator +upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) +{ + return _VSTD::upper_bound(__first, __last, __value_, + __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__availability b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__availability new file mode 100644 index 0000000..87d43ed --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__availability
@@ -0,0 +1,270 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___AVAILABILITY +#define _LIBCPP___AVAILABILITY + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +// Libc++ is shipped by various vendors. In particular, it is used as a system +// library on macOS, iOS and other Apple platforms. In order for users to be +// able to compile a binary that is intended to be deployed to an older version +// of a platform, Clang provides availability attributes [1]. These attributes +// can be placed on declarations and are used to describe the life cycle of a +// symbol in the library. +// +// The main goal is to ensure a compile-time error if a symbol that hasn't been +// introduced in a previously released library is used in a program that targets +// that previously released library. Normally, this would be a load-time error +// when one tries to launch the program against the older library. +// +// For example, the filesystem library was introduced in the dylib in macOS 10.15. +// If a user compiles on a macOS 10.15 host but targets macOS 10.13 with their +// program, the compiler would normally not complain (because the required +// declarations are in the headers), but the dynamic loader would fail to find +// the symbols when actually trying to launch the program on macOS 10.13. To +// turn this into a compile-time issue instead, declarations are annotated with +// when they were introduced, and the compiler can produce a diagnostic if the +// program references something that isn't available on the deployment target. +// +// This mechanism is general in nature, and any vendor can add their markup to +// the library (see below). Whenever a new feature is added that requires support +// in the shared library, a macro should be added below to mark this feature +// as unavailable. When vendors decide to ship the feature as part of their +// shared library, they can update the markup appropriately. +// +// Furthermore, many features in the standard library have corresponding +// feature-test macros. When a feature is made unavailable on some deployment +// target, a macro should be defined to signal that it is unavailable. That +// macro can then be picked up when feature-test macros are generated (see +// generate_feature_test_macro_components.py) to make sure that feature-test +// macros don't announce a feature as being implemented if it has been marked +// as unavailable. +// +// Note that this mechanism is disabled by default in the "upstream" libc++. +// Availability annotations are only meaningful when shipping libc++ inside +// a platform (i.e. as a system library), and so vendors that want them should +// turn those annotations on at CMake configuration time. +// +// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability + + +// For backwards compatibility, allow users to define _LIBCPP_DISABLE_AVAILABILITY +// for a while. +#if defined(_LIBCPP_DISABLE_AVAILABILITY) +# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +# endif +#endif + +// Availability markup is disabled when building the library, or when the compiler +// doesn't support the proper attributes. +#if defined(_LIBCPP_BUILDING_LIBRARY) || \ + defined(_LIBCXXABI_BUILDING_LIBRARY) || \ + !__has_feature(attribute_availability_with_strict) || \ + !__has_feature(attribute_availability_in_templates) || \ + !__has_extension(pragma_clang_attribute_external_declaration) +# if !defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) +# define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +# endif +#endif + +#if defined(_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS) + + // This controls the availability of std::shared_mutex and std::shared_timed_mutex, + // which were added to the dylib later. +# define _LIBCPP_AVAILABILITY_SHARED_MUTEX +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex + + // These macros control the availability of std::bad_optional_access and + // other exception types. These were put in the shared library to prevent + // code bloat from every user program defining the vtable for these exception + // types. +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST + + // This controls the availability of std::uncaught_exceptions(). +# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS + + // This controls the availability of the sized version of ::operator delete, + // which was added to the dylib later. +# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE + + // This controls the availability of the std::future_error exception. +# define _LIBCPP_AVAILABILITY_FUTURE_ERROR + + // This controls the availability of std::type_info's vtable. + // I can't imagine how using std::type_info can work at all if + // this isn't supported. +# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE + + // This controls the availability of std::locale::category members + // (e.g. std::locale::collate), which are defined in the dylib. +# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY + + // This controls the availability of atomic operations on std::shared_ptr + // (e.g. `std::atomic_store(std::shared_ptr)`), which require a shared + // lock table located in the dylib. +# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR + + // These macros control the availability of all parts of <filesystem> that + // depend on something in the dylib. +# define _LIBCPP_AVAILABILITY_FILESYSTEM +# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH +# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem + + // This controls the availability of std::to_chars. +# define _LIBCPP_AVAILABILITY_TO_CHARS + + // This controls the availability of the C++20 synchronization library, + // which requires shared library support for various operations + // (see libcxx/src/atomic.cpp). +# define _LIBCPP_AVAILABILITY_SYNC +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore + + // This controls the availability of the C++20 format library. + // The library is in development and not ABI stable yet. P2216 is + // retroactively accepted in C++20. This paper contains ABI breaking + // changes. +# define _LIBCPP_AVAILABILITY_FORMAT +// # define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format + +#elif defined(__APPLE__) + +# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \ + __attribute__((availability(macosx,strict,introduced=10.12))) \ + __attribute__((availability(ios,strict,introduced=10.0))) \ + __attribute__((availability(tvos,strict,introduced=10.0))) \ + __attribute__((availability(watchos,strict,introduced=3.0))) +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101200) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 100000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 100000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 30000) +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_mutex +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_shared_timed_mutex +# endif + +# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \ + __attribute__((availability(macosx,strict,introduced=10.13))) \ + __attribute__((availability(ios,strict,introduced=11.0))) \ + __attribute__((availability(tvos,strict,introduced=11.0))) \ + __attribute__((availability(watchos,strict,introduced=4.0))) +# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \ + _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \ + _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS + +# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \ + __attribute__((availability(macosx,strict,introduced=10.12))) \ + __attribute__((availability(ios,strict,introduced=10.0))) \ + __attribute__((availability(tvos,strict,introduced=10.0))) \ + __attribute__((availability(watchos,strict,introduced=3.0))) + +# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \ + __attribute__((availability(macosx,strict,introduced=10.12))) \ + __attribute__((availability(ios,strict,introduced=10.0))) \ + __attribute__((availability(tvos,strict,introduced=10.0))) \ + __attribute__((availability(watchos,strict,introduced=3.0))) + +# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \ + __attribute__((availability(ios,strict,introduced=6.0))) + +# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \ + __attribute__((availability(macosx,strict,introduced=10.9))) \ + __attribute__((availability(ios,strict,introduced=7.0))) + +# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \ + __attribute__((availability(macosx,strict,introduced=10.9))) \ + __attribute__((availability(ios,strict,introduced=7.0))) + +# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \ + __attribute__((availability(macosx,strict,introduced=10.9))) \ + __attribute__((availability(ios,strict,introduced=7.0))) + +# define _LIBCPP_AVAILABILITY_FILESYSTEM \ + __attribute__((availability(macosx,strict,introduced=10.15))) \ + __attribute__((availability(ios,strict,introduced=13.0))) \ + __attribute__((availability(tvos,strict,introduced=13.0))) \ + __attribute__((availability(watchos,strict,introduced=6.0))) +# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \ + _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \ + _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))") +# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") \ + _Pragma("clang attribute pop") +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 130000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 130000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 60000) +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_filesystem +# endif + +# define _LIBCPP_AVAILABILITY_TO_CHARS \ + _LIBCPP_AVAILABILITY_FILESYSTEM + +# define _LIBCPP_AVAILABILITY_SYNC \ + __attribute__((availability(macosx,strict,introduced=11.0))) \ + __attribute__((availability(ios,strict,introduced=14.0))) \ + __attribute__((availability(tvos,strict,introduced=14.0))) \ + __attribute__((availability(watchos,strict,introduced=7.0))) +# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 140000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 140000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 70000) +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_atomic_wait +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_barrier +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_latch +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_semaphore +# endif + + // This controls the availability of the C++20 format library. + // The library is in development and not ABI stable yet. P2216 is + // retroactively accepted in C++20. This paper contains ABI breaking + // changes. +# define _LIBCPP_AVAILABILITY_FORMAT \ + __attribute__((unavailable)) +# define _LIBCPP_AVAILABILITY_DISABLE_FTM___cpp_lib_format +#else + +// ...New vendors can add availability markup here... + +# error "It looks like you're trying to enable vendor availability markup, but you haven't defined the corresponding macros yet!" + +#endif + +// Define availability attributes that depend on _LIBCPP_NO_EXCEPTIONS. +// Those are defined in terms of the availability attributes above, and +// should not be vendor-specific. +#if defined(_LIBCPP_NO_EXCEPTIONS) +# define _LIBCPP_AVAILABILITY_FUTURE +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS +#else +# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR +# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST +# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS +# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS +#endif + +#endif // _LIBCPP___AVAILABILITY
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/bit_cast.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/bit_cast.h new file mode 100644 index 0000000..6cfe4d7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/bit_cast.h
@@ -0,0 +1,38 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___BIT_BIT_CAST_H +#define _LIBCPP___BIT_BIT_CAST_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +template<class _ToType, class _FromType, class = enable_if_t< + sizeof(_ToType) == sizeof(_FromType) && + is_trivially_copyable_v<_ToType> && + is_trivially_copyable_v<_FromType> +>> +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI +constexpr _ToType bit_cast(_FromType const& __from) noexcept { + return __builtin_bit_cast(_ToType, __from); +} + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___BIT_BIT_CAST_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/byteswap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/byteswap.h new file mode 100644 index 0000000..970074e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit/byteswap.h
@@ -0,0 +1,55 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___BIT_BYTESWAP_H +#define _LIBCPP___BIT_BYTESWAP_H + +#include <__concepts/arithmetic.h> +#include <__config> +#include <cstdint> +#include <cstdlib> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <integral _Tp> +_LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept { + + if constexpr (sizeof(_Tp) == 1) { + return __val; + } else if constexpr (sizeof(_Tp) == 2) { + return __builtin_bswap16(__val); + } else if constexpr (sizeof(_Tp) == 4) { + return __builtin_bswap32(__val); + } else if constexpr (sizeof(_Tp) == 8) { + return __builtin_bswap64(__val); +#ifndef _LIBCPP_HAS_NO_INT128 + } else if constexpr (sizeof(_Tp) == 16) { +#if __has_builtin(__builtin_bswap128) + return __builtin_bswap128(__val); +#else + return static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64 | + static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64))); +#endif // __has_builtin(__builtin_bswap128) +#endif // _LIBCPP_HAS_NO_INT128 + } else { + static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size"); + } +} + +#endif // _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___BIT_BYTESWAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit_reference b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit_reference index 4a2b820..a02492c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit_reference +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bit_reference
@@ -11,7 +11,7 @@ #define _LIBCPP___BIT_REFERENCE #include <__config> -#include <bit> +#include <__bits> #include <algorithm> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -239,8 +239,8 @@ find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); - return __find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__find_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // count @@ -313,8 +313,8 @@ count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast<bool>(__value_)) - return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); - return __count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first)); + return _VSTD::__count_bool_false(__first, static_cast<typename _Cp::size_type>(__last - __first)); } // fill_n @@ -387,9 +387,9 @@ if (__n > 0) { if (__value_) - __fill_n_true(__first, __n); + _VSTD::__fill_n_true(__first, __n); else - __fill_n_false(__first, __n); + _VSTD::__fill_n_false(__first, __n); } } @@ -538,8 +538,8 @@ copy(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__first.__ctz_ == __result.__ctz_) - return __copy_aligned(__first, __last, __result); - return __copy_unaligned(__first, __last, __result); + return _VSTD::__copy_aligned(__first, __last, __result); + return _VSTD::__copy_unaligned(__first, __last, __result); } // copy_backward @@ -685,8 +685,8 @@ copy_backward(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { if (__last.__ctz_ == __result.__ctz_) - return __copy_backward_aligned(__first, __last, __result); - return __copy_backward_unaligned(__first, __last, __result); + return _VSTD::__copy_backward_aligned(__first, __last, __result); + return _VSTD::__copy_backward_unaligned(__first, __last, __result); } // move @@ -868,8 +868,8 @@ __bit_iterator<__C2, false> __first2) { if (__first1.__ctz_ == __first2.__ctz_) - return __swap_ranges_aligned(__first1, __last1, __first2); - return __swap_ranges_unaligned(__first1, __last1, __first2); + return _VSTD::__swap_ranges_aligned(__first1, __last1, __first2); + return _VSTD::__swap_ranges_unaligned(__first1, __last1, __first2); } // rotate @@ -1083,8 +1083,8 @@ equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2) { if (__first1.__ctz_ == __first2.__ctz_) - return __equal_aligned(__first1, __last1, __first2); - return __equal_unaligned(__first1, __last1, __first2); + return _VSTD::__equal_aligned(__first1, __last1, __first2); + return _VSTD::__equal_unaligned(__first1, __last1, __first2); } template <class _Cp, bool _IsConst, @@ -1114,28 +1114,26 @@ #endif {} - // avoid re-declaring a copy constructor for the non-const version. - using __type_for_copy_to_const = - _If<_IsConst, __bit_iterator<_Cp, false>, struct __private_nat>; - + // When _IsConst=false, this is the copy constructor. + // It is non-trivial. Making it trivial would break ABI. + // When _IsConst=true, this is a converting constructor; + // the copy and move constructors are implicitly generated + // and trivial. _LIBCPP_INLINE_VISIBILITY - __bit_iterator(const __type_for_copy_to_const& __it) _NOEXCEPT + __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {} - // The non-const __bit_iterator has historically had a non-trivial - // copy constructor (as a quirk of its construction). We need to maintain - // this for ABI purposes. - using __type_for_abi_non_trivial_copy_ctor = - _If<!_IsConst, __bit_iterator, struct __private_nat>; - + // When _IsConst=false, we have a user-provided copy constructor, + // so we must also provide a copy assignment operator because + // the implicit generation of a defaulted one is deprecated. + // When _IsConst=true, the assignment operators are + // implicitly generated and trivial. _LIBCPP_INLINE_VISIBILITY - __bit_iterator(__type_for_abi_non_trivial_copy_ctor const& __it) _NOEXCEPT - : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {} - - // Always declare the copy assignment operator since the implicit declaration - // is deprecated. - _LIBCPP_INLINE_VISIBILITY - __bit_iterator& operator=(__bit_iterator const&) = default; + __bit_iterator& operator=(const _If<_IsConst, struct __private_nat, __bit_iterator>& __it) { + __seg_ = __it.__seg_; + __ctz_ = __it.__ctz_; + return *this; + } _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT {return reference(__seg_, __storage_type(1) << __ctz_);} @@ -1302,4 +1300,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP___BIT_REFERENCE +#endif // _LIBCPP___BIT_REFERENCE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bits b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bits new file mode 100644 index 0000000..b565a78 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bits
@@ -0,0 +1,145 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___BITS +#define _LIBCPP___BITS + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_COMPILER_MSVC + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_ctz(unsigned __x) _NOEXCEPT { return __builtin_ctz(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_ctz(unsigned long __x) _NOEXCEPT { return __builtin_ctzl(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_ctz(unsigned long long __x) _NOEXCEPT { return __builtin_ctzll(__x); } + + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_clz(unsigned __x) _NOEXCEPT { return __builtin_clz(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_clz(unsigned long __x) _NOEXCEPT { return __builtin_clzl(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_clz(unsigned long long __x) _NOEXCEPT { return __builtin_clzll(__x); } + + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_popcount(unsigned __x) _NOEXCEPT { return __builtin_popcount(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_popcount(unsigned long __x) _NOEXCEPT { return __builtin_popcountl(__x); } + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +int __libcpp_popcount(unsigned long long __x) _NOEXCEPT { return __builtin_popcountll(__x); } + +#else // _LIBCPP_COMPILER_MSVC + +// Precondition: __x != 0 +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_ctz(unsigned __x) { + static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); + static_assert(sizeof(unsigned long) == 4, ""); + unsigned long __where; + if (_BitScanForward(&__where, __x)) + return static_cast<int>(__where); + return 32; +} + +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_ctz(unsigned long __x) { + static_assert(sizeof(unsigned long) == sizeof(unsigned), ""); + return __ctz(static_cast<unsigned>(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_ctz(unsigned long long __x) { + unsigned long __where; +#if defined(_LIBCPP_HAS_BITSCAN64) + if (_BitScanForward64(&__where, __x)) + return static_cast<int>(__where); +#else + // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls. + if (_BitScanForward(&__where, static_cast<unsigned long>(__x))) + return static_cast<int>(__where); + if (_BitScanForward(&__where, static_cast<unsigned long>(__x >> 32))) + return static_cast<int>(__where + 32); +#endif + return 64; +} + +// Precondition: __x != 0 +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_clz(unsigned __x) { + static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); + static_assert(sizeof(unsigned long) == 4, ""); + unsigned long __where; + if (_BitScanReverse(&__where, __x)) + return static_cast<int>(31 - __where); + return 32; // Undefined Behavior. +} + +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_clz(unsigned long __x) { + static_assert(sizeof(unsigned) == sizeof(unsigned long), ""); + return __libcpp_clz(static_cast<unsigned>(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY +int __libcpp_clz(unsigned long long __x) { + unsigned long __where; +#if defined(_LIBCPP_HAS_BITSCAN64) + if (_BitScanReverse64(&__where, __x)) + return static_cast<int>(63 - __where); +#else + // Win32 doesn't have _BitScanReverse64 so emulate it with two 32 bit calls. + if (_BitScanReverse(&__where, static_cast<unsigned long>(__x >> 32))) + return static_cast<int>(63 - (__where + 32)); + if (_BitScanReverse(&__where, static_cast<unsigned long>(__x))) + return static_cast<int>(63 - __where); +#endif + return 64; // Undefined Behavior. +} + +inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned __x) { + static_assert(sizeof(unsigned) == 4, ""); + return __popcnt(__x); +} + +inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long __x) { + static_assert(sizeof(unsigned long) == 4, ""); + return __popcnt(__x); +} + +inline _LIBCPP_INLINE_VISIBILITY int __libcpp_popcount(unsigned long long __x) { + static_assert(sizeof(unsigned long long) == 8, ""); + return __popcnt64(__x); +} + +#endif // _LIBCPP_COMPILER_MSVC + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___BITS
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_defaults.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_defaults.h index 2ace2a2..0d6506c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_defaults.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_defaults.h
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------- __bsd_locale_defaults.h -----------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_fallbacks.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_fallbacks.h index a807fe0..a5788d9 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_fallbacks.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__bsd_locale_fallbacks.h
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------- __bsd_locale_fallbacks.h ----------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -13,9 +13,9 @@ #ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H #define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H -#include <stdlib.h> -#include <stdarg.h> #include <memory> +#include <stdarg.h> +#include <stdlib.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -30,6 +30,7 @@ return MB_CUR_MAX; } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_btowc_l(int __c, locale_t __l) { @@ -88,6 +89,7 @@ __libcpp_locale_guard __current(__l); return mbrlen(__s, __n, __ps); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY lconv *__libcpp_localeconv_l(locale_t __l) @@ -96,6 +98,7 @@ return localeconv(); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_INLINE_VISIBILITY size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len, mbstate_t *__ps, locale_t __l) @@ -103,8 +106,9 @@ __libcpp_locale_guard __current(__l); return mbsrtowcs(__dest, __src, __len, __ps); } +#endif -inline +inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 4, 5) int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -114,7 +118,7 @@ return __res; } -inline +inline _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 3, 4) int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format); @@ -124,7 +128,7 @@ return __res; } -inline +inline _LIBCPP_ATTRIBUTE_FORMAT(__scanf__, 3, 4) int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) { va_list __va; va_start(__va, __format);
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/chars_format.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/chars_format.h new file mode 100644 index 0000000..22e70b5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/chars_format.h
@@ -0,0 +1,77 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CHARCONV_CHARS_FORMAT_H +#define _LIBCPP___CHARCONV_CHARS_FORMAT_H + +#include <__config> +#include <__utility/to_underlying.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG + +enum class _LIBCPP_ENUM_VIS chars_format +{ + scientific = 0x1, + fixed = 0x2, + hex = 0x4, + general = fixed | scientific +}; + +inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format +operator~(chars_format __x) { + return chars_format(~_VSTD::__to_underlying(__x)); +} + +inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format +operator&(chars_format __x, chars_format __y) { + return chars_format(_VSTD::__to_underlying(__x) & + _VSTD::__to_underlying(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format +operator|(chars_format __x, chars_format __y) { + return chars_format(_VSTD::__to_underlying(__x) | + _VSTD::__to_underlying(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY constexpr chars_format +operator^(chars_format __x, chars_format __y) { + return chars_format(_VSTD::__to_underlying(__x) ^ + _VSTD::__to_underlying(__y)); +} + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format& +operator&=(chars_format& __x, chars_format __y) { + __x = __x & __y; + return __x; +} + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format& +operator|=(chars_format& __x, chars_format __y) { + __x = __x | __y; + return __x; +} + +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 chars_format& +operator^=(chars_format& __x, chars_format __y) { + __x = __x ^ __y; + return __x; +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CHARCONV_CHARS_FORMAT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/from_chars_result.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/from_chars_result.h new file mode 100644 index 0000000..fbd7d50 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/from_chars_result.h
@@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H +#define _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H + +#include <__config> +#include <__errc> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG + +struct _LIBCPP_TYPE_VIS from_chars_result +{ + const char* ptr; + errc ec; +# if _LIBCPP_STD_VER > 17 + _LIBCPP_HIDE_FROM_ABI friend bool operator==(const from_chars_result&, const from_chars_result&) = default; +# endif +}; + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/to_chars_result.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/to_chars_result.h new file mode 100644 index 0000000..f515ee3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__charconv/to_chars_result.h
@@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CHARCONV_TO_CHARS_RESULT_H +#define _LIBCPP___CHARCONV_TO_CHARS_RESULT_H + +#include <__config> +#include <__errc> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG + +struct _LIBCPP_TYPE_VIS to_chars_result +{ + char* ptr; + errc ec; +# if _LIBCPP_STD_VER > 17 + _LIBCPP_HIDE_FROM_ABI friend bool operator==(const to_chars_result&, const to_chars_result&) = default; +# endif +}; + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CHARCONV_TO_CHARS_RESULT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/common_comparison_category.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/common_comparison_category.h new file mode 100644 index 0000000..37a28db --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/common_comparison_category.h
@@ -0,0 +1,94 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H +#define _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H + +#include <__compare/ordering.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +namespace __comp_detail { + +enum _ClassifyCompCategory : unsigned { + _None, + _PartialOrd, + _WeakOrd, + _StrongOrd, + _CCC_Size +}; + +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI +constexpr _ClassifyCompCategory __type_to_enum() noexcept { + if (is_same_v<_Tp, partial_ordering>) + return _PartialOrd; + if (is_same_v<_Tp, weak_ordering>) + return _WeakOrd; + if (is_same_v<_Tp, strong_ordering>) + return _StrongOrd; + return _None; +} + +template <size_t _Size> +_LIBCPP_HIDE_FROM_ABI +constexpr _ClassifyCompCategory +__compute_comp_type(const _ClassifyCompCategory (&__types)[_Size]) { + int __seen[_CCC_Size] = {}; + for (auto __type : __types) + ++__seen[__type]; + if (__seen[_None]) + return _None; + if (__seen[_PartialOrd]) + return _PartialOrd; + if (__seen[_WeakOrd]) + return _WeakOrd; + return _StrongOrd; +} + +template <class ..._Ts, bool _False = false> +_LIBCPP_HIDE_FROM_ABI +constexpr auto __get_comp_type() { + using _CCC = _ClassifyCompCategory; + constexpr _CCC __type_kinds[] = {_StrongOrd, __type_to_enum<_Ts>()...}; + constexpr _CCC _Cat = __compute_comp_type(__type_kinds); + if constexpr (_Cat == _None) + return void(); + else if constexpr (_Cat == _PartialOrd) + return partial_ordering::equivalent; + else if constexpr (_Cat == _WeakOrd) + return weak_ordering::equivalent; + else if constexpr (_Cat == _StrongOrd) + return strong_ordering::equivalent; + else + static_assert(_False, "unhandled case"); +} +} // namespace __comp_detail + +// [cmp.common], common comparison category type +template<class... _Ts> +struct _LIBCPP_TEMPLATE_VIS common_comparison_category { + using type = decltype(__comp_detail::__get_comp_type<_Ts...>()); +}; + +template<class... _Ts> +using common_comparison_category_t = typename common_comparison_category<_Ts...>::type; + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way.h new file mode 100644 index 0000000..3edddf1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way.h
@@ -0,0 +1,41 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_H +#define _LIBCPP___COMPARE_COMPARE_THREE_WAY_H + +#include <__config> +#include <__compare/three_way_comparable.h> +#include <__utility/forward.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +struct _LIBCPP_TEMPLATE_VIS compare_three_way +{ + template<class _T1, class _T2> + requires three_way_comparable_with<_T1, _T2> + constexpr _LIBCPP_HIDE_FROM_ABI + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) <=> _VSTD::forward<_T2>(__u))) + { return _VSTD::forward<_T1>(__t) <=> _VSTD::forward<_T2>(__u); } + + using is_transparent = void; +}; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way_result.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way_result.h new file mode 100644 index 0000000..14908c6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/compare_three_way_result.h
@@ -0,0 +1,43 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H +#define _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +template<class, class, class> +struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result { }; + +template<class _Tp, class _Up> +struct _LIBCPP_HIDE_FROM_ABI __compare_three_way_result<_Tp, _Up, decltype( + declval<__make_const_lvalue_ref<_Tp>>() <=> declval<__make_const_lvalue_ref<_Up>>(), void() +)> { + using type = decltype(declval<__make_const_lvalue_ref<_Tp>>() <=> declval<__make_const_lvalue_ref<_Up>>()); +}; + +template<class _Tp, class _Up = _Tp> +struct _LIBCPP_TEMPLATE_VIS compare_three_way_result : __compare_three_way_result<_Tp, _Up, void> { }; + +template<class _Tp, class _Up = _Tp> +using compare_three_way_result_t = typename compare_three_way_result<_Tp, _Up>::type; + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/is_eq.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/is_eq.h new file mode 100644 index 0000000..906cb07 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/is_eq.h
@@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_IS_EQ_H +#define _LIBCPP___COMPARE_IS_EQ_H + +#include <__compare/ordering.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_eq(partial_ordering __c) noexcept { return __c == 0; } +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_neq(partial_ordering __c) noexcept { return __c != 0; } +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lt(partial_ordering __c) noexcept { return __c < 0; } +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_lteq(partial_ordering __c) noexcept { return __c <= 0; } +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gt(partial_ordering __c) noexcept { return __c > 0; } +_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_gteq(partial_ordering __c) noexcept { return __c >= 0; } + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_IS_EQ_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/ordering.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/ordering.h new file mode 100644 index 0000000..d4087bc --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/ordering.h
@@ -0,0 +1,319 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_ORDERING_H +#define _LIBCPP___COMPARE_ORDERING_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// exposition only +enum class _LIBCPP_ENUM_VIS _OrdResult : signed char { + __less = -1, + __equiv = 0, + __greater = 1 +}; + +enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char { + __unordered = -127 +}; + +class partial_ordering; +class weak_ordering; +class strong_ordering; + +template<class _Tp, class... _Args> +inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...); + +struct _CmpUnspecifiedParam { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEVAL + _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {} + + template<class _Tp, class = enable_if_t<!__one_of_v<_Tp, int, partial_ordering, weak_ordering, strong_ordering>>> + _CmpUnspecifiedParam(_Tp) = delete; +}; + +class partial_ordering { + using _ValueT = signed char; + + _LIBCPP_HIDE_FROM_ABI + explicit constexpr partial_ordering(_OrdResult __v) noexcept + : __value_(_ValueT(__v)) {} + + _LIBCPP_HIDE_FROM_ABI + explicit constexpr partial_ordering(_NCmpResult __v) noexcept + : __value_(_ValueT(__v)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr bool __is_ordered() const noexcept { + return __value_ != _ValueT(_NCmpResult::__unordered); + } +public: + // valid values + static const partial_ordering less; + static const partial_ordering equivalent; + static const partial_ordering greater; + static const partial_ordering unordered; + + // comparisons + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ == 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ < 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ <= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ > 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__is_ordered() && __v.__value_ >= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 < __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 <= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 > __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v.__is_ordered() && 0 >= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept { + return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v); + } +private: + _ValueT __value_; +}; + +inline constexpr partial_ordering partial_ordering::less(_OrdResult::__less); +inline constexpr partial_ordering partial_ordering::equivalent(_OrdResult::__equiv); +inline constexpr partial_ordering partial_ordering::greater(_OrdResult::__greater); +inline constexpr partial_ordering partial_ordering::unordered(_NCmpResult ::__unordered); + +class weak_ordering { + using _ValueT = signed char; + + _LIBCPP_HIDE_FROM_ABI + explicit constexpr weak_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {} + +public: + static const weak_ordering less; + static const weak_ordering equivalent; + static const weak_ordering greater; + + _LIBCPP_HIDE_FROM_ABI + constexpr operator partial_ordering() const noexcept { + return __value_ == 0 ? partial_ordering::equivalent + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + + // comparisons + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ < 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ <= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ > 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ >= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 < __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 <= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 > __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return 0 >= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept { + return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v); + } + +private: + _ValueT __value_; +}; + +inline constexpr weak_ordering weak_ordering::less(_OrdResult::__less); +inline constexpr weak_ordering weak_ordering::equivalent(_OrdResult::__equiv); +inline constexpr weak_ordering weak_ordering::greater(_OrdResult::__greater); + +class strong_ordering { + using _ValueT = signed char; + + _LIBCPP_HIDE_FROM_ABI + explicit constexpr strong_ordering(_OrdResult __v) noexcept : __value_(_ValueT(__v)) {} + +public: + static const strong_ordering less; + static const strong_ordering equal; + static const strong_ordering equivalent; + static const strong_ordering greater; + + // conversions + _LIBCPP_HIDE_FROM_ABI + constexpr operator partial_ordering() const noexcept { + return __value_ == 0 ? partial_ordering::equivalent + : (__value_ < 0 ? partial_ordering::less : partial_ordering::greater); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr operator weak_ordering() const noexcept { + return __value_ == 0 ? weak_ordering::equivalent + : (__value_ < 0 ? weak_ordering::less : weak_ordering::greater); + } + + // comparisons + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default; + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ == 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ < 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ <= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ > 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v.__value_ >= 0; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 < __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 <= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 > __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return 0 >= __v.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept { + return __v; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept { + return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v); + } + +private: + _ValueT __value_; +}; + +inline constexpr strong_ordering strong_ordering::less(_OrdResult::__less); +inline constexpr strong_ordering strong_ordering::equal(_OrdResult::__equiv); +inline constexpr strong_ordering strong_ordering::equivalent(_OrdResult::__equiv); +inline constexpr strong_ordering strong_ordering::greater(_OrdResult::__greater); + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_ORDERING_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/partial_order.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/partial_order.h new file mode 100644 index 0000000..ac8b405 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/partial_order.h
@@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_PARTIAL_ORDER +#define _LIBCPP___COMPARE_PARTIAL_ORDER + +#include <__compare/compare_three_way.h> +#include <__compare/ordering.h> +#include <__compare/weak_order.h> +#include <__config> +#include <__utility/forward.h> +#include <__utility/priority_tag.h> +#include <type_traits> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [cmp.alg] +namespace __partial_order { + struct __fn { + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) + noexcept(noexcept(partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return partial_ordering(partial_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) + noexcept(noexcept(partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return partial_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<0>) + noexcept(noexcept(partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return partial_ordering(_VSTD::weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const + noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()))) + -> decltype( __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>())) + { return __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()); } + }; +} // namespace __partial_order + +inline namespace __cpo { + inline constexpr auto partial_order = __partial_order::__fn{}; +} // namespace __cpo + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_PARTIAL_ORDER
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/strong_order.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/strong_order.h new file mode 100644 index 0000000..e49b2d4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/strong_order.h
@@ -0,0 +1,136 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_STRONG_ORDER +#define _LIBCPP___COMPARE_STRONG_ORDER + +#include <__bit/bit_cast.h> +#include <__compare/compare_three_way.h> +#include <__compare/ordering.h> +#include <__config> +#include <__utility/forward.h> +#include <__utility/priority_tag.h> +#include <cmath> +#include <cstdint> +#include <limits> +#include <type_traits> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [cmp.alg] +namespace __strong_order { + struct __fn { + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) + noexcept(noexcept(strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return strong_ordering(strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up, class _Dp = decay_t<_Tp>> + requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp> + _LIBCPP_HIDE_FROM_ABI static constexpr strong_ordering + __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept + { + if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int32_t)) { + int32_t __rx = _VSTD::bit_cast<int32_t>(__t); + int32_t __ry = _VSTD::bit_cast<int32_t>(__u); + __rx = (__rx < 0) ? (numeric_limits<int32_t>::min() - __rx - 1) : __rx; + __ry = (__ry < 0) ? (numeric_limits<int32_t>::min() - __ry - 1) : __ry; + return (__rx <=> __ry); + } else if constexpr (numeric_limits<_Dp>::is_iec559 && sizeof(_Dp) == sizeof(int64_t)) { + int64_t __rx = _VSTD::bit_cast<int64_t>(__t); + int64_t __ry = _VSTD::bit_cast<int64_t>(__u); + __rx = (__rx < 0) ? (numeric_limits<int64_t>::min() - __rx - 1) : __rx; + __ry = (__ry < 0) ? (numeric_limits<int64_t>::min() - __ry - 1) : __ry; + return (__rx <=> __ry); + } else if (__t < __u) { + return strong_ordering::less; + } else if (__t > __u) { + return strong_ordering::greater; + } else if (__t == __u) { + if constexpr (numeric_limits<_Dp>::radix == 2) { + return _VSTD::signbit(__u) <=> _VSTD::signbit(__t); + } else { + // This is bullet 3 of the IEEE754 algorithm, relevant + // only for decimal floating-point; + // see https://stackoverflow.com/questions/69068075/ + if (__t == 0 || _VSTD::isinf(__t)) { + return _VSTD::signbit(__u) <=> _VSTD::signbit(__t); + } else { + int __texp, __uexp; + (void)_VSTD::frexp(__t, &__texp); + (void)_VSTD::frexp(__u, &__uexp); + return (__t < 0) ? (__texp <=> __uexp) : (__uexp <=> __texp); + } + } + } else { + // They're unordered, so one of them must be a NAN. + // The order is -QNAN, -SNAN, numbers, +SNAN, +QNAN. + bool __t_is_nan = _VSTD::isnan(__t); + bool __u_is_nan = _VSTD::isnan(__u); + bool __t_is_negative = _VSTD::signbit(__t); + bool __u_is_negative = _VSTD::signbit(__u); + using _IntType = std::conditional_t< + sizeof(__t) == sizeof(int32_t), int32_t, std::conditional_t< + sizeof(__t) == sizeof(int64_t), int64_t, void> + >; + if constexpr (std::is_same_v<_IntType, void>) { + static_assert(sizeof(_Dp) == 0, "std::strong_order is unimplemented for this floating-point type"); + } else if (__t_is_nan && __u_is_nan) { + // Order by sign bit, then by "payload bits" (we'll just use bit_cast). + if (__t_is_negative != __u_is_negative) { + return (__u_is_negative <=> __t_is_negative); + } else { + return _VSTD::bit_cast<_IntType>(__t) <=> _VSTD::bit_cast<_IntType>(__u); + } + } else if (__t_is_nan) { + return __t_is_negative ? strong_ordering::less : strong_ordering::greater; + } else { + return __u_is_negative ? strong_ordering::greater : strong_ordering::less; + } + } + } + + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<0>) + noexcept(noexcept(strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return strong_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const + noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()))) + -> decltype( __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>())) + { return __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<2>()); } + }; +} // namespace __strong_order + +inline namespace __cpo { + inline constexpr auto strong_order = __strong_order::__fn{}; +} // namespace __cpo + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___COMPARE_STRONG_ORDER
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/synth_three_way.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/synth_three_way.h new file mode 100644 index 0000000..3d8e738 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/synth_three_way.h
@@ -0,0 +1,51 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_SYNTH_THREE_WAY_H +#define _LIBCPP___COMPARE_SYNTH_THREE_WAY_H + +#include <__config> +#include <__compare/ordering.h> +#include <__compare/three_way_comparable.h> +#include <__concepts/boolean_testable.h> +#include <__utility/declval.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [expos.only.func] + +_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way = + []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u) + requires requires { + { __t < __u } -> __boolean_testable; + { __u < __t } -> __boolean_testable; + } + { + if constexpr (three_way_comparable_with<_Tp, _Up>) { + return __t <=> __u; + } else { + if (__t < __u) return weak_ordering::less; + if (__u < __t) return weak_ordering::greater; + return weak_ordering::equivalent; + } + }; + +template <class _Tp, class _Up = _Tp> +using __synth_three_way_result = decltype(__synth_three_way(declval<_Tp&>(), declval<_Up&>())); + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_SYNTH_THREE_WAY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/three_way_comparable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/three_way_comparable.h new file mode 100644 index 0000000..c479494 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/three_way_comparable.h
@@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H +#define _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H + +#include <__compare/common_comparison_category.h> +#include <__compare/ordering.h> +#include <__concepts/common_reference_with.h> +#include <__concepts/equality_comparable.h> +#include <__concepts/same_as.h> +#include <__concepts/totally_ordered.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template<class _Tp, class _Cat> +concept __compares_as = + same_as<common_comparison_category_t<_Tp, _Cat>, _Cat>; + +template<class _Tp, class _Cat = partial_ordering> +concept three_way_comparable = + __weakly_equality_comparable_with<_Tp, _Tp> && + __partially_ordered_with<_Tp, _Tp> && + requires(__make_const_lvalue_ref<_Tp> __a, __make_const_lvalue_ref<_Tp> __b) { + { __a <=> __b } -> __compares_as<_Cat>; + }; + +template<class _Tp, class _Up, class _Cat = partial_ordering> +concept three_way_comparable_with = + three_way_comparable<_Tp, _Cat> && + three_way_comparable<_Up, _Cat> && + common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> && + three_way_comparable<common_reference_t<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>>, _Cat> && + __weakly_equality_comparable_with<_Tp, _Up> && + __partially_ordered_with<_Tp, _Up> && + requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { + { __t <=> __u } -> __compares_as<_Cat>; + { __u <=> __t } -> __compares_as<_Cat>; + }; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/weak_order.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/weak_order.h new file mode 100644 index 0000000..f67416e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__compare/weak_order.h
@@ -0,0 +1,100 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COMPARE_WEAK_ORDER +#define _LIBCPP___COMPARE_WEAK_ORDER + +#include <__compare/compare_three_way.h> +#include <__compare/ordering.h> +#include <__compare/strong_order.h> +#include <__config> +#include <__utility/forward.h> +#include <__utility/priority_tag.h> +#include <cmath> +#include <type_traits> + +#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [cmp.alg] +namespace __weak_order { + struct __fn { + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<3>) + noexcept(noexcept(weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return weak_ordering(weak_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up, class _Dp = decay_t<_Tp>> + requires is_same_v<_Dp, decay_t<_Up>> && is_floating_point_v<_Dp> + _LIBCPP_HIDE_FROM_ABI static constexpr weak_ordering + __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) noexcept + { + std::partial_ordering __po = (__t <=> __u); + if (__po == std::partial_ordering::less) { + return std::weak_ordering::less; + } else if (__po == std::partial_ordering::equivalent) { + return std::weak_ordering::equivalent; + } else if (__po == std::partial_ordering::greater) { + return std::weak_ordering::greater; + } else { + // Otherwise, at least one of them is a NaN. + bool __t_is_nan = _VSTD::isnan(__t); + bool __u_is_nan = _VSTD::isnan(__u); + bool __t_is_negative = _VSTD::signbit(__t); + bool __u_is_negative = _VSTD::signbit(__u); + if (__t_is_nan && __u_is_nan) { + return (__u_is_negative <=> __t_is_negative); + } else if (__t_is_nan) { + return __t_is_negative ? weak_ordering::less : weak_ordering::greater; + } else { + return __u_is_negative ? weak_ordering::greater : weak_ordering::less; + } + } + } + + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) + noexcept(noexcept(weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return weak_ordering(compare_three_way()(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + requires is_same_v<decay_t<_Tp>, decay_t<_Up>> + _LIBCPP_HIDE_FROM_ABI static constexpr auto + __go(_Tp&& __t, _Up&& __u, __priority_tag<0>) + noexcept(noexcept(weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))))) + -> decltype( weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { return weak_ordering(_VSTD::strong_order(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u))); } + + template<class _Tp, class _Up> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const + noexcept(noexcept(__go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>()))) + -> decltype( __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>())) + { return __go(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u), __priority_tag<3>()); } + }; +} // namespace __weak_order + +inline namespace __cpo { + inline constexpr auto weak_order = __weak_order::__fn{}; +} // namespace __cpo + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___COMPARE_WEAK_ORDER
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/arithmetic.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/arithmetic.h new file mode 100644 index 0000000..9a13839 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/arithmetic.h
@@ -0,0 +1,48 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_ARITHMETIC_H +#define _LIBCPP___CONCEPTS_ARITHMETIC_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concepts.arithmetic], arithmetic concepts + +template<class _Tp> +concept integral = is_integral_v<_Tp>; + +template<class _Tp> +concept signed_integral = integral<_Tp> && is_signed_v<_Tp>; + +template<class _Tp> +concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>; + +template<class _Tp> +concept floating_point = is_floating_point_v<_Tp>; + +// Concept helpers for the internal type traits for the fundamental types. + +template <class _Tp> +concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value; +template <class _Tp> +concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_ARITHMETIC_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/assignable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/assignable.h new file mode 100644 index 0000000..9cfc7c0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/assignable.h
@@ -0,0 +1,40 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_ASSIGNABLE_H +#define _LIBCPP___CONCEPTS_ASSIGNABLE_H + +#include <__concepts/common_reference_with.h> +#include <__concepts/same_as.h> +#include <__config> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.assignable] + +template<class _Lhs, class _Rhs> +concept assignable_from = + is_lvalue_reference_v<_Lhs> && + common_reference_with<__make_const_lvalue_ref<_Lhs>, __make_const_lvalue_ref<_Rhs>> && + requires (_Lhs __lhs, _Rhs&& __rhs) { + { __lhs = _VSTD::forward<_Rhs>(__rhs) } -> same_as<_Lhs>; + }; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_ASSIGNABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/boolean_testable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/boolean_testable.h new file mode 100644 index 0000000..638fc3b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/boolean_testable.h
@@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H +#define _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H + +#include <__concepts/convertible_to.h> +#include <__config> +#include <__utility/forward.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concepts.booleantestable] + +template<class _Tp> +concept __boolean_testable_impl = convertible_to<_Tp, bool>; + +template<class _Tp> +concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp&& __t) { + { !_VSTD::forward<_Tp>(__t) } -> __boolean_testable_impl; +}; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/class_or_enum.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/class_or_enum.h new file mode 100644 index 0000000..43c7636 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/class_or_enum.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H +#define _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// Whether a type is a class type or enumeration type according to the Core wording. + +template<class _Tp> +concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_reference_with.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_reference_with.h new file mode 100644 index 0000000..3269e3a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_reference_with.h
@@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H +#define _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H + +#include <__concepts/convertible_to.h> +#include <__concepts/same_as.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.commonref] + +template<class _Tp, class _Up> +concept common_reference_with = + same_as<common_reference_t<_Tp, _Up>, common_reference_t<_Up, _Tp>> && + convertible_to<_Tp, common_reference_t<_Tp, _Up>> && + convertible_to<_Up, common_reference_t<_Tp, _Up>>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_with.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_with.h new file mode 100644 index 0000000..b575aea --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/common_with.h
@@ -0,0 +1,47 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_COMMON_WITH_H +#define _LIBCPP___CONCEPTS_COMMON_WITH_H + +#include <__concepts/common_reference_with.h> +#include <__concepts/same_as.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.common] + +template<class _Tp, class _Up> +concept common_with = + same_as<common_type_t<_Tp, _Up>, common_type_t<_Up, _Tp>> && + requires { + static_cast<common_type_t<_Tp, _Up>>(declval<_Tp>()); + static_cast<common_type_t<_Tp, _Up>>(declval<_Up>()); + } && + common_reference_with< + add_lvalue_reference_t<const _Tp>, + add_lvalue_reference_t<const _Up>> && + common_reference_with< + add_lvalue_reference_t<common_type_t<_Tp, _Up>>, + common_reference_t< + add_lvalue_reference_t<const _Tp>, + add_lvalue_reference_t<const _Up>>>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_COMMON_WITH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/constructible.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/constructible.h new file mode 100644 index 0000000..9bba811 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/constructible.h
@@ -0,0 +1,56 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H +#define _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H + +#include <__concepts/convertible_to.h> +#include <__concepts/destructible.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.constructible] +template<class _Tp, class... _Args> +concept constructible_from = + destructible<_Tp> && is_constructible_v<_Tp, _Args...>; + +// [concept.default.init] + +template<class _Tp> +concept __default_initializable = requires { ::new _Tp; }; + +template<class _Tp> +concept default_initializable = constructible_from<_Tp> && + requires { _Tp{}; } && __default_initializable<_Tp>; + +// [concept.moveconstructible] +template<class _Tp> +concept move_constructible = + constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>; + +// [concept.copyconstructible] +template<class _Tp> +concept copy_constructible = + move_constructible<_Tp> && + constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> && + constructible_from<_Tp, const _Tp&> && convertible_to<const _Tp&, _Tp> && + constructible_from<_Tp, const _Tp> && convertible_to<const _Tp, _Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/convertible_to.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/convertible_to.h new file mode 100644 index 0000000..ec68967 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/convertible_to.h
@@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H +#define _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.convertible] + +template<class _From, class _To> +concept convertible_to = + is_convertible_v<_From, _To> && + requires (add_rvalue_reference_t<_From> (&__f)()) { + static_cast<_To>(__f()); + }; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/copyable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/copyable.h new file mode 100644 index 0000000..cfeeec8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/copyable.h
@@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_COPYABLE_H +#define _LIBCPP___CONCEPTS_COPYABLE_H + +#include <__concepts/assignable.h> +#include <__concepts/constructible.h> +#include <__concepts/movable.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concepts.object] + +template<class _Tp> +concept copyable = + copy_constructible<_Tp> && + movable<_Tp> && + assignable_from<_Tp&, _Tp&> && + assignable_from<_Tp&, const _Tp&> && + assignable_from<_Tp&, const _Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_COPYABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/derived_from.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/derived_from.h new file mode 100644 index 0000000..f7c83bf --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/derived_from.h
@@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_DERIVED_FROM_H +#define _LIBCPP___CONCEPTS_DERIVED_FROM_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.derived] + +template<class _Dp, class _Bp> +concept derived_from = + is_base_of_v<_Bp, _Dp> && + is_convertible_v<const volatile _Dp*, const volatile _Bp*>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_DERIVED_FROM_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/destructible.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/destructible.h new file mode 100644 index 0000000..800ee2d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/destructible.h
@@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_DESTRUCTIBLE_H +#define _LIBCPP___CONCEPTS_DESTRUCTIBLE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.destructible] + +template<class _Tp> +concept destructible = is_nothrow_destructible_v<_Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_DESTRUCTIBLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/different_from.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/different_from.h new file mode 100644 index 0000000..5def31e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/different_from.h
@@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_DIFFERENT_FROM_H +#define _LIBCPP___CONCEPTS_DIFFERENT_FROM_H + +#include <__concepts/same_as.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template<class _Tp, class _Up> +concept __different_from = !same_as<remove_cvref_t<_Tp>, remove_cvref_t<_Up>>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_DIFFERENT_FROM_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/equality_comparable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/equality_comparable.h new file mode 100644 index 0000000..5df812c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/equality_comparable.h
@@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H +#define _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H + +#include <__concepts/boolean_testable.h> +#include <__concepts/common_reference_with.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.equalitycomparable] + +template<class _Tp, class _Up> +concept __weakly_equality_comparable_with = + requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { + { __t == __u } -> __boolean_testable; + { __t != __u } -> __boolean_testable; + { __u == __t } -> __boolean_testable; + { __u != __t } -> __boolean_testable; + }; + +template<class _Tp> +concept equality_comparable = __weakly_equality_comparable_with<_Tp, _Tp>; + +template<class _Tp, class _Up> +concept equality_comparable_with = + equality_comparable<_Tp> && equality_comparable<_Up> && + common_reference_with<__make_const_lvalue_ref<_Tp>, __make_const_lvalue_ref<_Up>> && + equality_comparable< + common_reference_t< + __make_const_lvalue_ref<_Tp>, + __make_const_lvalue_ref<_Up>>> && + __weakly_equality_comparable_with<_Tp, _Up>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/invocable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/invocable.h new file mode 100644 index 0000000..0a8d9b7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/invocable.h
@@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_INVOCABLE_H +#define _LIBCPP___CONCEPTS_INVOCABLE_H + +#include <__config> +#include <__functional/invoke.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.invocable] + +template<class _Fn, class... _Args> +concept invocable = requires(_Fn&& __fn, _Args&&... __args) { + _VSTD::invoke(_VSTD::forward<_Fn>(__fn), _VSTD::forward<_Args>(__args)...); // not required to be equality preserving +}; + +// [concept.regular.invocable] + +template<class _Fn, class... _Args> +concept regular_invocable = invocable<_Fn, _Args...>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_INVOCABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/movable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/movable.h new file mode 100644 index 0000000..dd0b8fb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/movable.h
@@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_MOVABLE_H +#define _LIBCPP___CONCEPTS_MOVABLE_H + +#include <__concepts/assignable.h> +#include <__concepts/constructible.h> +#include <__concepts/swappable.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concepts.object] + +template<class _Tp> +concept movable = + is_object_v<_Tp> && + move_constructible<_Tp> && + assignable_from<_Tp&, _Tp> && + swappable<_Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_MOVABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/predicate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/predicate.h new file mode 100644 index 0000000..8e88540 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/predicate.h
@@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_PREDICATE_H +#define _LIBCPP___CONCEPTS_PREDICATE_H + +#include <__concepts/boolean_testable.h> +#include <__concepts/invocable.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.predicate] + +template<class _Fn, class... _Args> +concept predicate = + regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_PREDICATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/regular.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/regular.h new file mode 100644 index 0000000..d292e8d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/regular.h
@@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_REGULAR_H +#define _LIBCPP___CONCEPTS_REGULAR_H + +#include <__concepts/equality_comparable.h> +#include <__concepts/semiregular.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.object] + +template<class _Tp> +concept regular = semiregular<_Tp> && equality_comparable<_Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_REGULAR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/relation.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/relation.h new file mode 100644 index 0000000..c6ff20d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/relation.h
@@ -0,0 +1,44 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_RELATION_H +#define _LIBCPP___CONCEPTS_RELATION_H + +#include <__concepts/predicate.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.relation] + +template<class _Rp, class _Tp, class _Up> +concept relation = + predicate<_Rp, _Tp, _Tp> && predicate<_Rp, _Up, _Up> && + predicate<_Rp, _Tp, _Up> && predicate<_Rp, _Up, _Tp>; + +// [concept.equiv] + +template<class _Rp, class _Tp, class _Up> +concept equivalence_relation = relation<_Rp, _Tp, _Up>; + +// [concept.strictweakorder] + +template<class _Rp, class _Tp, class _Up> +concept strict_weak_order = relation<_Rp, _Tp, _Up>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_RELATION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/same_as.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/same_as.h new file mode 100644 index 0000000..5a912b6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/same_as.h
@@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_SAME_AS_H +#define _LIBCPP___CONCEPTS_SAME_AS_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.same] + +template<class _Tp, class _Up> +concept __same_as_impl = _IsSame<_Tp, _Up>::value; + +template<class _Tp, class _Up> +concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_SAME_AS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/semiregular.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/semiregular.h new file mode 100644 index 0000000..4b96fe6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/semiregular.h
@@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_SEMIREGULAR_H +#define _LIBCPP___CONCEPTS_SEMIREGULAR_H + +#include <__concepts/constructible.h> +#include <__concepts/copyable.h> +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.object] + +template<class _Tp> +concept semiregular = copyable<_Tp> && default_initializable<_Tp>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_SEMIREGULAR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/swappable.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/swappable.h new file mode 100644 index 0000000..423b3a8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/swappable.h
@@ -0,0 +1,115 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_SWAPPABLE_H +#define _LIBCPP___CONCEPTS_SWAPPABLE_H + +#include <__concepts/assignable.h> +#include <__concepts/class_or_enum.h> +#include <__concepts/common_reference_with.h> +#include <__concepts/constructible.h> +#include <__config> +#include <__utility/exchange.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.swappable] +namespace ranges::__swap { + // Deleted to inhibit ADL + template<class _Tp> + void swap(_Tp&, _Tp&) = delete; + + + // [1] + template<class _Tp, class _Up> + concept __unqualified_swappable_with = + (__class_or_enum<remove_cvref_t<_Tp>> || __class_or_enum<remove_cvref_t<_Up>>) && + requires(_Tp&& __t, _Up&& __u) { + swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); + }; + + struct __fn; + + template<class _Tp, class _Up, size_t _Size> + concept __swappable_arrays = + !__unqualified_swappable_with<_Tp(&)[_Size], _Up(&)[_Size]> && + extent_v<_Tp> == extent_v<_Up> && + requires(_Tp(& __t)[_Size], _Up(& __u)[_Size], const __fn& __swap) { + __swap(__t[0], __u[0]); + }; + + template<class _Tp> + concept __exchangeable = + !__unqualified_swappable_with<_Tp&, _Tp&> && + move_constructible<_Tp> && + assignable_from<_Tp&, _Tp>; + + struct __fn { + // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and... + // *The name `swap` is used here unqualified. + template<class _Tp, class _Up> + requires __unqualified_swappable_with<_Tp, _Up> + constexpr void operator()(_Tp&& __t, _Up&& __u) const + noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) + { + swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); + } + + // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and... + template<class _Tp, class _Up, size_t _Size> + requires __swappable_arrays<_Tp, _Up, _Size> + constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const + noexcept(noexcept((*this)(*__t, *__u))) + { + // TODO(cjdb): replace with `ranges::swap_ranges`. + for (size_t __i = 0; __i < _Size; ++__i) { + (*this)(__t[__i], __u[__i]); + } + } + + // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models... + template<__exchangeable _Tp> + constexpr void operator()(_Tp& __x, _Tp& __y) const + noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>) + { + __y = _VSTD::exchange(__x, _VSTD::move(__y)); + } + }; +} // namespace ranges::__swap + +namespace ranges::inline __cpo { + inline constexpr auto swap = __swap::__fn{}; +} // namespace ranges::__cpo + +template<class _Tp> +concept swappable = requires(_Tp& __a, _Tp& __b) { ranges::swap(__a, __b); }; + +template<class _Tp, class _Up> +concept swappable_with = + common_reference_with<_Tp, _Up> && + requires(_Tp&& __t, _Up&& __u) { + ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Tp>(__t)); + ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Up>(__u)); + ranges::swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); + ranges::swap(_VSTD::forward<_Up>(__u), _VSTD::forward<_Tp>(__t)); + }; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_SWAPPABLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/totally_ordered.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/totally_ordered.h new file mode 100644 index 0000000..d8dd4a4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__concepts/totally_ordered.h
@@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H +#define _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H + +#include <__concepts/boolean_testable.h> +#include <__concepts/equality_comparable.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [concept.totallyordered] + +template<class _Tp, class _Up> +concept __partially_ordered_with = + requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { + { __t < __u } -> __boolean_testable; + { __t > __u } -> __boolean_testable; + { __t <= __u } -> __boolean_testable; + { __t >= __u } -> __boolean_testable; + { __u < __t } -> __boolean_testable; + { __u > __t } -> __boolean_testable; + { __u <= __t } -> __boolean_testable; + { __u >= __t } -> __boolean_testable; + }; + +template<class _Tp> +concept totally_ordered = equality_comparable<_Tp> && __partially_ordered_with<_Tp, _Tp>; + +template<class _Tp, class _Up> +concept totally_ordered_with = + totally_ordered<_Tp> && totally_ordered<_Up> && + equality_comparable_with<_Tp, _Up> && + totally_ordered< + common_reference_t< + __make_const_lvalue_ref<_Tp>, + __make_const_lvalue_ref<_Up>>> && + __partially_ordered_with<_Tp, _Up>; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config index be9130b..4da01ea 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config
@@ -1,44 +1,5 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_CONFIG_SITE -#define _LIBCPP_CONFIG_SITE - -/* #undef _LIBCPP_ABI_VERSION */ -/* #undef _LIBCPP_ABI_UNSTABLE */ -/* #undef _LIBCPP_ABI_FORCE_ITANIUM */ -/* #undef _LIBCPP_ABI_FORCE_MICROSOFT */ -/* #undef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT */ -/* #undef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE */ -/* #undef _LIBCPP_HAS_NO_STDIN */ -/* #undef _LIBCPP_HAS_NO_STDOUT */ -/* #undef _LIBCPP_HAS_NO_THREADS */ -/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */ -/* #undef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS */ -/* #undef _LIBCPP_HAS_MUSL_LIBC */ -/* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */ -/* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */ -/* #undef _LIBCPP_HAS_THREAD_API_WIN32 */ -/* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */ -/* #undef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS */ -/* #undef _LIBCPP_NO_VCRUNTIME */ -#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION -/* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */ -#endif -/* #undef _LIBCPP_ABI_NAMESPACE */ -/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */ -/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */ - - - -#endif // _LIBCPP_CONFIG_SITE // -*- C++ -*- -//===--------------------------- __config ---------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -49,6 +10,8 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG +#include <__config_site> + #if defined(_MSC_VER) && !defined(__clang__) # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER @@ -61,17 +24,7 @@ #ifdef __cplusplus -#ifdef __GNUC__ -# define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) -// The _GNUC_VER_NEW macro better represents the new GCC versioning scheme -// introduced in GCC 5.0. -# define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__) -#else -# define _GNUC_VER 0 -# define _GNUC_VER_NEW 0 -#endif - -#define _LIBCPP_VERSION 12000 +#define _LIBCPP_VERSION 14000 #ifndef _LIBCPP_ABI_VERSION # define _LIBCPP_ABI_VERSION 1 @@ -88,10 +41,12 @@ # define _LIBCPP_STD_VER 14 # elif __cplusplus <= 201703L # define _LIBCPP_STD_VER 17 +# elif __cplusplus <= 202002L +# define _LIBCPP_STD_VER 20 # else -# define _LIBCPP_STD_VER 18 // current year, or date of c++2a ratification +# define _LIBCPP_STD_VER 21 // current year, or date of c++2b ratification # endif -#endif // _LIBCPP_STD_VER +#endif // _LIBCPP_STD_VER #if defined(__ELF__) # define _LIBCPP_OBJECT_FORMAT_ELF 1 @@ -102,7 +57,7 @@ #elif defined(__wasm__) # define _LIBCPP_OBJECT_FORMAT_WASM 1 #else -# error Unknown object file format + // ... add new file formats here ... #endif #if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 @@ -119,21 +74,23 @@ # define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB # define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB # define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE -// Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr -// provided under the alternate keyword __nullptr, which changes the mangling -// of nullptr_t. This option is ABI incompatible with GCC in C++03 mode. -# define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR -// Define the `pointer_safety` enum as a C++11 strongly typed enumeration -// instead of as a class simulating an enum. If this option is enabled -// `pointer_safety` and `get_pointer_safety()` will no longer be available -// in C++03. -# define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE // Define a key function for `bad_function_call` in the library, to centralize // its vtable and typeinfo to libc++ rather than having all other libraries // using that class define their own copies. # define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION +// Override the default return value of exception::what() for +// bad_function_call::what() with a string that is specific to +// bad_function_call (see http://wg21.link/LWG2233). This is an ABI break +// because it changes the vtable layout of bad_function_call. +# define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE // Enable optimized version of __do_get_(un)signed which avoids redundant copies. # define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET +// In C++20 and later, don't derive std::plus from std::binary_function, +// nor std::negate from std::unary_function. +# define _LIBCPP_ABI_NO_BINDER_BASES +// Give reverse_iterator<T> one data member of type T, not two. +// Also, in C++17 and later, don't derive iterator types from std::iterator. +# define _LIBCPP_ABI_NO_ITERATOR_BASES // Use the smallest possible integer type to represent the index of the variant. // Previously libc++ used "unsigned int" exclusively. # define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION @@ -141,6 +98,8 @@ # define _LIBCPP_ABI_OPTIMIZED_FUNCTION // All the regex constants must be distinct and nonzero. # define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO +// Use raw pointers, not wrapped ones, for std::span's iterator type. +# define _LIBCPP_ABI_SPAN_POINTER_ITERATORS // Re-worked external template instantiations for std::string with a focus on // performance and fast-path inlining. # define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION @@ -164,9 +123,33 @@ # endif #endif -#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR -#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \ - use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead +// By default, don't use a nullptr_t emulation type in C++03. +// +// This is technically an ABI break from previous releases, however it is +// very unlikely to impact anyone. If a user is impacted by this break, +// they can return to using the C++03 nullptr emulation by defining +// _LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION. +// +// This switch will be removed entirely in favour of never providing a +// C++03 emulation after one release. +// +// IMPORTANT: IF YOU ARE READING THIS AND YOU TURN THIS MACRO ON, PLEASE LEAVE +// A COMMENT ON https://reviews.llvm.org/D109459 OR YOU WILL BE BROKEN +// IN THE FUTURE WHEN WE REMOVE THE ABILITY TO USE THE C++03 EMULATION. +#ifndef _LIBCPP_ABI_USE_CXX03_NULLPTR_EMULATION +# define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR +#endif + +#if defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 +// Enable additional explicit instantiations of iostreams components. This +// reduces the number of weak definitions generated in programs that use +// iostreams by providing a single strong definition in the shared library. +# define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 + +// Define a key function for `bad_function_call` in the library, to centralize +// its vtable and typeinfo to libc++ rather than having all other libraries +// using that class define their own copies. +# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION #endif #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y @@ -216,11 +199,12 @@ #define __has_include(...) 0 #endif -#if defined(__clang__) -# define _LIBCPP_COMPILER_CLANG -# ifndef __apple_build_version__ -# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) -# endif +#if defined(__apple_build_version__) +# define _LIBCPP_COMPILER_CLANG_BASED +# define _LIBCPP_APPLE_CLANG_VER (__apple_build_version__ / 10000) +#elif defined(__clang__) +# define _LIBCPP_COMPILER_CLANG_BASED +# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__) #elif defined(__GNUC__) # define _LIBCPP_COMPILER_GCC #elif defined(_MSC_VER) @@ -270,13 +254,13 @@ # if __LITTLE_ENDIAN__ # define _LIBCPP_LITTLE_ENDIAN # endif // __LITTLE_ENDIAN__ -#endif // __LITTLE_ENDIAN__ +#endif // __LITTLE_ENDIAN__ #ifdef __BIG_ENDIAN__ # if __BIG_ENDIAN__ # define _LIBCPP_BIG_ENDIAN # endif // __BIG_ENDIAN__ -#endif // __BIG_ENDIAN__ +#endif // __BIG_ENDIAN__ #ifdef __BYTE_ORDER__ # if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ @@ -294,19 +278,16 @@ # else // _BYTE_ORDER == _LITTLE_ENDIAN # define _LIBCPP_BIG_ENDIAN # endif // _BYTE_ORDER == _LITTLE_ENDIAN -# ifndef __LONG_LONG_SUPPORTED -# define _LIBCPP_HAS_NO_LONG_LONG -# endif // __LONG_LONG_SUPPORTED -#endif // __FreeBSD__ +#endif // __FreeBSD__ -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__OpenBSD__) # include <sys/endian.h> # if _BYTE_ORDER == _LITTLE_ENDIAN # define _LIBCPP_LITTLE_ENDIAN # else // _BYTE_ORDER == _LITTLE_ENDIAN # define _LIBCPP_BIG_ENDIAN # endif // _BYTE_ORDER == _LITTLE_ENDIAN -#endif // __NetBSD__ +#endif // defined(__NetBSD__) || defined(__OpenBSD__) #if defined(_WIN32) # define _LIBCPP_WIN32API @@ -347,7 +328,12 @@ # endif #endif // __sun__ -#if defined(__CloudABI__) +#if defined(_AIX) && !defined(__64BIT__) + // The size of wchar is 2 byte on 32-bit mode on AIX. +# define _LIBCPP_SHORT_WCHAR 1 +#endif + +#if defined(__OpenBSD__) // Certain architectures provide arc4random(). Prefer using // arc4random() over /dev/{u,}random to make it possible to obtain // random data even when using sandboxing mechanisms such as chroots, @@ -375,7 +361,7 @@ # else // __BYTE_ORDER == __BIG_ENDIAN # error unable to determine endian # endif -#endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) +#endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) #if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC) # define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) @@ -383,7 +369,17 @@ # define _LIBCPP_NO_CFI #endif -#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +// If the compiler supports using_if_exists, pretend we have those functions and they'll +// be picked up if the C library provides them. +// +// TODO: Once we drop support for Clang 12, we can assume the compiler supports using_if_exists +// for platforms that don't have a conforming C11 library, so we can drop this whole thing. +#if __has_attribute(using_if_exists) +# define _LIBCPP_HAS_TIMESPEC_GET +# define _LIBCPP_HAS_QUICK_EXIT +# define _LIBCPP_HAS_ALIGNED_ALLOC +#else +#if (defined(__ISO_C_VISIBLE) && (__ISO_C_VISIBLE >= 2011)) || __cplusplus >= 201103L # if defined(__FreeBSD__) # define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT @@ -405,6 +401,9 @@ # define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT # define _LIBCPP_HAS_TIMESPEC_GET +# elif defined(__OpenBSD__) +# define _LIBCPP_HAS_ALIGNED_ALLOC +# define _LIBCPP_HAS_TIMESPEC_GET # elif defined(__linux__) # if !defined(_LIBCPP_HAS_MUSL_LIBC) # if _LIBCPP_GLIBC_PREREQ(2, 15) || defined(__BIONIC__) @@ -419,22 +418,26 @@ # define _LIBCPP_HAS_QUICK_EXIT # define _LIBCPP_HAS_TIMESPEC_GET # endif +# elif defined(_LIBCPP_MSVCRT) + // Using Microsoft's C Runtime library, not MinGW +# define _LIBCPP_HAS_TIMESPEC_GET # elif defined(__APPLE__) // timespec_get and aligned_alloc were introduced in macOS 10.15 and // aligned releases -# if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \ - __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \ - __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \ - __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000) +# if ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500) || \ + (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ + (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000) || \ + (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)) # define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_TIMESPEC_GET # endif # endif // __APPLE__ #endif +#endif // __has_attribute(using_if_exists) #ifndef _LIBCPP_CXX03_LANG # define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp) -#elif defined(_LIBCPP_COMPILER_CLANG) +#elif defined(_LIBCPP_COMPILER_CLANG_BASED) # define _LIBCPP_ALIGNOF(_Tp) _Alignof(_Tp) #else # error "We don't know a correct way to implement alignof(T) in C++03 outside of Clang" @@ -442,7 +445,7 @@ #define _LIBCPP_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp) -#if defined(_LIBCPP_COMPILER_CLANG) +#if defined(_LIBCPP_COMPILER_CLANG_BASED) #if defined(_LIBCPP_ALTERNATE_STRING_LAYOUT) # error _LIBCPP_ALTERNATE_STRING_LAYOUT is deprecated, please use _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT instead @@ -479,10 +482,6 @@ # define _LIBCPP_NORETURN __attribute__ ((noreturn)) #endif -#if !(__has_feature(cxx_lambdas)) -#define _LIBCPP_HAS_NO_LAMBDAS -#endif - #if !(__has_feature(cxx_nullptr)) # if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR) # define nullptr __nullptr @@ -491,10 +490,6 @@ # endif #endif -#if !(__has_feature(cxx_auto_type)) -#define _LIBCPP_HAS_NO_AUTO_TYPE -#endif - // Objective-C++ features (opt-in) #if __has_feature(objc_arc) #define _LIBCPP_HAS_OBJC_ARC @@ -512,47 +507,21 @@ # define _LIBCPP_HAS_BLOCKS_RUNTIME #endif -#if !(__has_feature(cxx_relaxed_constexpr)) -#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR -#endif - -#if !(__has_feature(cxx_variable_templates)) -#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES -#endif - #if !(__has_feature(cxx_noexcept)) #define _LIBCPP_HAS_NO_NOEXCEPT #endif -#if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer) +#if !__has_feature(address_sanitizer) #define _LIBCPP_HAS_NO_ASAN #endif // Allow for build-time disabling of unsigned integer sanitization -#if !defined(_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize) +#if __has_attribute(no_sanitize) #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) #endif -#if __has_builtin(__builtin_launder) -#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER -#endif - -#if __has_builtin(__builtin_constant_p) -#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P -#endif - -#if !__is_identifier(__has_unique_object_representations) -#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS -#endif - #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) -// Literal operators ""d and ""y are supported starting with LLVM Clang 8 and AppleClang 10.0.1 -#if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 800) || \ - (defined(__apple_build_version__) && __apple_build_version__ < 10010000) -#define _LIBCPP_HAS_NO_CXX20_CHRONO_LITERALS -#endif - #define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__ #elif defined(_LIBCPP_COMPILER_GCC) @@ -562,30 +531,14 @@ #define _LIBCPP_NORETURN __attribute__((noreturn)) -#if !__EXCEPTIONS +#if !defined(__EXCEPTIONS) # define _LIBCPP_NO_EXCEPTIONS #endif -// Determine if GCC supports relaxed constexpr -#if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L -#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR -#endif - -// GCC 5 supports variable templates -#if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L -#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES -#endif - -#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__) +#if !defined(__SANITIZE_ADDRESS__) #define _LIBCPP_HAS_NO_ASAN #endif -#if _GNUC_VER >= 700 -#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER -#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P -#define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS -#endif - #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__)) #define _LIBCPP_DISABLE_EXTENSION_WARNING __extension__ @@ -600,8 +553,6 @@ #error "MSVC versions prior to Visual Studio 2015 are not supported" #endif -#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR -#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #define __alignof__ __alignof #define _LIBCPP_NORETURN __declspec(noreturn) #define _ALIGNAS(x) __declspec(align(x)) @@ -625,7 +576,6 @@ #define _LIBCPP_NORETURN __attribute__((noreturn)) #define _LIBCPP_HAS_NO_UNICODE_CHARS -#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #if defined(_AIX) #define __MULTILOCALE_API @@ -680,6 +630,7 @@ #define _LIBCPP_HIDDEN #define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS #define _LIBCPP_TEMPLATE_VIS +#define _LIBCPP_TEMPLATE_DATA_VIS #define _LIBCPP_ENUM_VIS #endif // defined(_LIBCPP_OBJECT_FORMAT_COFF) @@ -729,6 +680,14 @@ # endif #endif +#ifndef _LIBCPP_TEMPLATE_DATA_VIS +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +# define _LIBCPP_TEMPLATE_DATA_VIS __attribute__ ((__visibility__("default"))) +# else +# define _LIBCPP_TEMPLATE_DATA_VIS +# endif +#endif + #ifndef _LIBCPP_EXPORTED_FROM_ABI # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) # define _LIBCPP_EXPORTED_FROM_ABI __attribute__((__visibility__("default"))) @@ -758,7 +717,7 @@ #endif #ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__) +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default"))) # else # define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS @@ -792,16 +751,6 @@ # endif #endif -#ifndef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION -# ifdef _LIBCPP_OBJECT_FORMAT_COFF // Windows binaries can't merge typeinfos. -# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 2 -# else - // TODO: This isn't strictly correct on ELF platforms due to llvm.org/PR37398 - // And we should consider defaulting to OFF. -# define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 1 -# endif -#endif - #ifndef _LIBCPP_HIDE_FROM_ABI # if _LIBCPP_HIDE_FROM_ABI_PER_TU # define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE @@ -842,10 +791,8 @@ #define _VSTD_FS _VSTD::__fs::filesystem -#ifndef _LIBCPP_PREFERRED_OVERLOAD -# if __has_attribute(__enable_if__) -# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, ""))) -# endif +#if __has_attribute(__enable_if__) +# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, ""))) #endif #ifndef _LIBCPP_HAS_NO_NOEXCEPT @@ -859,7 +806,7 @@ #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS typedef unsigned short char16_t; typedef unsigned int char32_t; -#endif // _LIBCPP_HAS_NO_UNICODE_CHARS +#endif #ifndef __SIZEOF_INT128__ #define _LIBCPP_HAS_NO_INT128 @@ -868,7 +815,7 @@ #ifdef _LIBCPP_CXX03_LANG # define static_assert(...) _Static_assert(__VA_ARGS__) # define decltype(...) __decltype(__VA_ARGS__) -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG #ifdef _LIBCPP_CXX03_LANG # define _LIBCPP_CONSTEXPR @@ -882,29 +829,30 @@ # define _LIBCPP_CONSTEVAL consteval #endif +#if !defined(__cpp_concepts) || __cpp_concepts < 201907L +#define _LIBCPP_HAS_NO_CONCEPTS +#endif + +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_HAS_NO_CONCEPTS) +#define _LIBCPP_HAS_NO_RANGES +#endif + #ifdef _LIBCPP_CXX03_LANG # define _LIBCPP_DEFAULT {} #else # define _LIBCPP_DEFAULT = default; #endif -#ifdef _LIBCPP_CXX03_LANG -# define _LIBCPP_EQUAL_DELETE -#else -# define _LIBCPP_EQUAL_DELETE = delete -#endif - #ifdef __GNUC__ # define _LIBCPP_NOALIAS __attribute__((__malloc__)) #else # define _LIBCPP_NOALIAS #endif -#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \ - (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions -# define _LIBCPP_EXPLICIT explicit +#if __has_attribute(using_if_exists) +# define _LIBCPP_USING_IF_EXISTS __attribute__((using_if_exists)) #else -# define _LIBCPP_EXPLICIT +# define _LIBCPP_USING_IF_EXISTS #endif #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS @@ -918,51 +866,67 @@ #else // _LIBCPP_HAS_NO_STRONG_ENUMS # define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x # define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) -#endif // _LIBCPP_HAS_NO_STRONG_ENUMS +#endif // _LIBCPP_HAS_NO_STRONG_ENUMS // _LIBCPP_DEBUG potential values: // - undefined: No assertions. This is the default. // - 0: Basic assertions -// - 1: Basic assertions + iterator validity checks. -#if !defined(_LIBCPP_DEBUG) -# define _LIBCPP_DEBUG_LEVEL 0 -#elif _LIBCPP_DEBUG == 0 -# define _LIBCPP_DEBUG_LEVEL 1 -#elif _LIBCPP_DEBUG == 1 -# define _LIBCPP_DEBUG_LEVEL 2 +// - 1: Basic assertions + iterator validity checks + unspecified behavior randomization. +# if !defined(_LIBCPP_DEBUG) +# define _LIBCPP_DEBUG_LEVEL 0 +# elif _LIBCPP_DEBUG == 0 +# define _LIBCPP_DEBUG_LEVEL 1 +# elif _LIBCPP_DEBUG == 1 +# define _LIBCPP_DEBUG_LEVEL 2 +# else +# error Supported values for _LIBCPP_DEBUG are 0 and 1 +# endif + +# if _LIBCPP_DEBUG_LEVEL >= 2 && !defined(_LIBCPP_CXX03_LANG) +# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY +# endif + +# if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY) +# if defined(_LIBCPP_CXX03_LANG) +# error Support for unspecified stability is only for C++11 and higher +# endif +# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ + do { \ + if (!__builtin_is_constant_evaluated()) \ + _VSTD::shuffle(__first, __last, __libcpp_debug_randomizer()); \ + } while (false) +# else +# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \ + do { \ + } while (false) +# endif + +// Libc++ allows disabling extern template instantiation declarations by +// means of users defining _LIBCPP_DISABLE_EXTERN_TEMPLATE. +// +// Furthermore, when the Debug mode is enabled, we disable extern declarations +// when building user code because we don't want to use the functions compiled +// in the library, which might not have had the debug mode enabled when built. +// However, some extern declarations need to be used, because code correctness +// depends on it (several instances in <locale>). Those special declarations +// are declared with _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE, which is enabled +// even when the debug mode is enabled. +#if defined(_LIBCPP_DISABLE_EXTERN_TEMPLATE) +# define _LIBCPP_EXTERN_TEMPLATE(...) /* nothing */ +# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) /* nothing */ +#elif _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_BUILDING_LIBRARY) +# define _LIBCPP_EXTERN_TEMPLATE(...) /* nothing */ +# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) extern template __VA_ARGS__; #else -# error Supported values for _LIBCPP_DEBUG are 0 and 1 -#endif - -// _LIBCPP_DEBUG_LEVEL is always defined to one of [0, 1, 2] at this point -#if _LIBCPP_DEBUG_LEVEL >= 1 -# define _LIBCPP_DISABLE_EXTERN_TEMPLATE -#endif - -#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE -#define _LIBCPP_EXTERN_TEMPLATE(...) -#endif - -#ifndef _LIBCPP_EXTERN_TEMPLATE -#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; -#endif - -#ifndef _LIBCPP_EXTERN_TEMPLATE_DEFINE -#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__; +# define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; +# define _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(...) extern template __VA_ARGS__; #endif #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \ - defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) + defined(__sun__) || defined(__NetBSD__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) -// Most unix variants have catopen. These are the specific ones that don't. -# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) -# define _LIBCPP_HAS_CATOPEN 1 -# endif -#endif - #ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 #endif @@ -975,18 +939,12 @@ // We're deferring to Microsoft's STL to provide aligned new et al. We don't // have it unless the language feature test macro is defined. # define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION +#elif defined(__MVS__) +# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION #endif -#if defined(__APPLE__) -# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ - defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ -# endif -#endif // defined(__APPLE__) - -#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \ - (defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || \ - (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606)) +#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || \ + (!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606) # define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION #endif @@ -999,7 +957,7 @@ #endif #if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t) -#define _LIBCPP_NO_HAS_CHAR8_T +#define _LIBCPP_HAS_NO_CHAR8_T #endif // Deprecation macros. @@ -1036,18 +994,29 @@ # define _LIBCPP_DEPRECATED_IN_CXX17 #endif -// Macros to enter and leave a state where deprecation warnings are suppressed. -#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \ - (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC)) -# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") -# define _LIBCPP_SUPPRESS_DEPRECATED_POP \ - _Pragma("GCC diagnostic pop") +#if _LIBCPP_STD_VER > 17 +# define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED +#else +# define _LIBCPP_DEPRECATED_IN_CXX20 #endif -#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) -# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH -# define _LIBCPP_SUPPRESS_DEPRECATED_POP + +#if !defined(_LIBCPP_HAS_NO_CHAR8_T) +# define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED +#else +# define _LIBCPP_DEPRECATED_WITH_CHAR8_T +#endif + +// Macros to enter and leave a state where deprecation warnings are suppressed. +#if defined(_LIBCPP_COMPILER_CLANG_BASED) || defined(_LIBCPP_COMPILER_GCC) +# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +# define _LIBCPP_SUPPRESS_DEPRECATED_POP \ + _Pragma("GCC diagnostic pop") +#else +# define _LIBCPP_SUPPRESS_DEPRECATED_PUSH +# define _LIBCPP_SUPPRESS_DEPRECATED_POP #endif #if _LIBCPP_STD_VER <= 11 @@ -1056,72 +1025,54 @@ # define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit #endif -#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#if _LIBCPP_STD_VER > 11 # define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr #else # define _LIBCPP_CONSTEXPR_AFTER_CXX11 #endif -#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#if _LIBCPP_STD_VER > 14 # define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr #else # define _LIBCPP_CONSTEXPR_AFTER_CXX14 #endif -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#if _LIBCPP_STD_VER > 17 # define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr #else # define _LIBCPP_CONSTEXPR_AFTER_CXX17 #endif -#if _LIBCPP_STD_VER > 17 && \ - !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) && \ - !defined(_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED) -# define _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED constexpr -#else -# define _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED -#endif - -// The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other -// NODISCARD macros to the correct attribute. #if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC) -# define _LIBCPP_NODISCARD_ATTRIBUTE [[nodiscard]] -#elif defined(_LIBCPP_COMPILER_CLANG) && !defined(_LIBCPP_CXX03_LANG) -# define _LIBCPP_NODISCARD_ATTRIBUTE [[clang::warn_unused_result]] +# define _LIBCPP_NODISCARD [[nodiscard]] +#elif defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_CXX03_LANG) +# define _LIBCPP_NODISCARD [[clang::warn_unused_result]] #else // We can't use GCC's [[gnu::warn_unused_result]] and // __attribute__((warn_unused_result)), because GCC does not silence them via // (void) cast. -# define _LIBCPP_NODISCARD_ATTRIBUTE +# define _LIBCPP_NODISCARD #endif // _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not // specified as such as an extension. #if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT) -# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD_ATTRIBUTE +# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD #else # define _LIBCPP_NODISCARD_EXT #endif #if !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) && \ (_LIBCPP_STD_VER > 17 || defined(_LIBCPP_ENABLE_NODISCARD)) -# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD_ATTRIBUTE +# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD #else # define _LIBCPP_NODISCARD_AFTER_CXX17 #endif -#if _LIBCPP_STD_VER > 14 && defined(__cpp_inline_variables) && (__cpp_inline_variables >= 201606L) -# define _LIBCPP_INLINE_VAR inline +#if !defined(_LIBCPP_DEBUG) && _LIBCPP_STD_VER > 11 +# define _LIBCPP_CONSTEXPR_IF_NODEBUG constexpr #else -# define _LIBCPP_INLINE_VAR -#endif - -#ifndef _LIBCPP_CONSTEXPR_IF_NODEBUG -#if defined(_LIBCPP_DEBUG) || defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) -#define _LIBCPP_CONSTEXPR_IF_NODEBUG -#else -#define _LIBCPP_CONSTEXPR_IF_NODEBUG constexpr -#endif +# define _LIBCPP_CONSTEXPR_IF_NODEBUG #endif #if __has_attribute(no_destroy) @@ -1131,12 +1082,12 @@ #endif #ifndef _LIBCPP_HAS_NO_ASAN -_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( +extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container( const void *, const void *, const void *, const void *); #endif // Try to find out if RTTI is disabled. -#if defined(_LIBCPP_COMPILER_CLANG) && !__has_feature(cxx_rtti) +#if defined(_LIBCPP_COMPILER_CLANG_BASED) && !__has_feature(cxx_rtti) # define _LIBCPP_NO_RTTI #elif defined(__GNUC__) && !defined(__GXX_RTTI) # define _LIBCPP_NO_RTTI @@ -1156,12 +1107,14 @@ # if defined(__FreeBSD__) || \ defined(__wasi__) || \ defined(__NetBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NuttX__) || \ defined(__linux__) || \ defined(__GNU__) || \ defined(__APPLE__) || \ - defined(__CloudABI__) || \ defined(__sun__) || \ - (defined(__MINGW32__) && __has_include(<pthread.h>)) + defined(__MVS__) || \ + defined(_AIX) # define _LIBCPP_HAS_THREAD_API_PTHREAD # elif defined(__Fuchsia__) // TODO(44575): Switch to C11 thread API when possible. @@ -1198,10 +1151,6 @@ _LIBCPP_HAS_NO_THREADS is defined. #endif -#if defined(__STDCPP_THREADS__) && defined(_LIBCPP_HAS_NO_THREADS) -#error _LIBCPP_HAS_NO_THREADS cannot be set when __STDCPP_THREADS__ is set. -#endif - #if !defined(_LIBCPP_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__) #define __STDCPP_THREADS__ 1 #endif @@ -1235,50 +1184,28 @@ # define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION #endif -// Systems that use capability-based security (FreeBSD with Capsicum, -// Nuxi CloudABI) may only provide local filesystem access (using *at()). -// Functions like open(), rename(), unlink() and stat() should not be -// used, as they attempt to access the global filesystem namespace. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE -#endif - -// CloudABI is intended for running networked services. Processes do not -// have standard input and output channels. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_STDIN -#define _LIBCPP_HAS_NO_STDOUT -#endif - // Some systems do not provide gets() in their C library, for security reasons. -#ifndef _LIBCPP_C_HAS_NO_GETS -# if defined(_LIBCPP_MSVCRT) || \ - (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) -# define _LIBCPP_C_HAS_NO_GETS -# endif +#if defined(_LIBCPP_MSVCRT) || \ + (defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || \ + defined(__OpenBSD__) +# define _LIBCPP_C_HAS_NO_GETS #endif -#if defined(__BIONIC__) || defined(__CloudABI__) || \ - defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) +#if defined(__BIONIC__) || defined(__NuttX__) || \ + defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \ + defined(__MVS__) || defined(__OpenBSD__) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE #endif -// Thread-unsafe functions such as strtok() and localtime() -// are not available. -#ifdef __CloudABI__ -#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -#endif - #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic) # define _LIBCPP_HAS_C_ATOMIC_IMP #elif defined(_LIBCPP_COMPILER_GCC) # define _LIBCPP_HAS_GCC_ATOMIC_IMP #endif -#if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && \ - !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) && \ - !defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP)) \ - || defined(_LIBCPP_HAS_NO_THREADS) +#if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && \ + !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) && \ + !defined(_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP) # define _LIBCPP_HAS_NO_ATOMIC_HEADER #else # ifndef _LIBCPP_ATOMIC_FLAG_TYPE @@ -1304,13 +1231,11 @@ # endif #endif -#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION -# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS -# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x)) -# else -# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) -# endif -#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION +#ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS +# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x)) +#else +# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) +#endif #if __has_attribute(require_constant_initialization) # define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__)) @@ -1318,20 +1243,6 @@ # define _LIBCPP_SAFE_STATIC #endif -#if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700 -#define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF -#endif - -#if !__has_builtin(__builtin_is_constant_evaluated) && _GNUC_VER < 900 -#define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED -#endif - -#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS) -# if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION) -# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS -# endif -#endif - #if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS) # define _LIBCPP_DIAGNOSE_WARNING(...) \ __attribute__((diagnose_if(__VA_ARGS__, "warning"))) @@ -1347,7 +1258,7 @@ # define _LIBCPP_FALLTHROUGH() [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) # define _LIBCPP_FALLTHROUGH() [[clang::fallthrough]] -#elif __has_attribute(fallthrough) || _GNUC_VER >= 700 +#elif __has_attribute(__fallthrough__) # define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__)) #else # define _LIBCPP_FALLTHROUGH() ((void)0) @@ -1359,14 +1270,27 @@ #define _LIBCPP_NODEBUG #endif -#ifndef _LIBCPP_NODEBUG_TYPE -#if __has_attribute(__nodebug__) && \ - (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 900) -#define _LIBCPP_NODEBUG_TYPE __attribute__((nodebug)) +#if __has_attribute(__standalone_debug__) +#define _LIBCPP_STANDALONE_DEBUG __attribute__((__standalone_debug__)) #else -#define _LIBCPP_NODEBUG_TYPE +#define _LIBCPP_STANDALONE_DEBUG #endif -#endif // !defined(_LIBCPP_NODEBUG_TYPE) + +#if __has_attribute(__preferred_name__) +#define _LIBCPP_PREFERRED_NAME(x) __attribute__((__preferred_name__(x))) +#else +#define _LIBCPP_PREFERRED_NAME(x) +#endif + +// We often repeat things just for handling wide characters in the library. +// When wide characters are disabled, it can be useful to have a quick way of +// disabling it without having to resort to #if-#endif, which has a larger +// impact on readability. +#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# define _LIBCPP_IF_WIDE_CHARACTERS(...) +#else +# define _LIBCPP_IF_WIDE_CHARACTERS(...) __VA_ARGS__ +#endif #if defined(_LIBCPP_ABI_MICROSOFT) && \ (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) @@ -1377,139 +1301,21 @@ #if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES) #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -#define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS -#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE +#define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS #endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES -#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611 -#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES -#endif +#if defined(_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES) +#define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS +#define _LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS +#define _LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS +#define _LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR +#define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS +#endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES -#if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001) -#define _LIBCPP_HAS_NO_IS_AGGREGATE -#endif - -#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L -#define _LIBCPP_HAS_NO_COROUTINES -#endif - -#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201907L -#define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR -#endif - -// Decide whether to use availability macros. -#if !defined(_LIBCPP_BUILDING_LIBRARY) && \ - !defined(_LIBCXXABI_BUILDING_LIBRARY) && \ - !defined(_LIBCPP_DISABLE_AVAILABILITY) && \ - __has_feature(attribute_availability_with_strict) && \ - __has_feature(attribute_availability_in_templates) && \ - __has_extension(pragma_clang_attribute_external_declaration) -# ifdef __APPLE__ -# define _LIBCPP_USE_AVAILABILITY_APPLE -# endif -#endif - -// Define availability macros. -#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) -# define _LIBCPP_AVAILABILITY_SHARED_MUTEX \ - __attribute__((availability(macosx,strict,introduced=10.12))) \ - __attribute__((availability(ios,strict,introduced=10.0))) \ - __attribute__((availability(tvos,strict,introduced=10.0))) \ - __attribute__((availability(watchos,strict,introduced=3.0))) -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS \ - __attribute__((availability(macosx,strict,introduced=10.13))) \ - __attribute__((availability(ios,strict,introduced=11.0))) \ - __attribute__((availability(tvos,strict,introduced=11.0))) \ - __attribute__((availability(watchos,strict,introduced=4.0))) -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \ - _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \ - _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \ - __attribute__((availability(macosx,strict,introduced=10.12))) \ - __attribute__((availability(ios,strict,introduced=10.0))) \ - __attribute__((availability(tvos,strict,introduced=10.0))) \ - __attribute__((availability(watchos,strict,introduced=3.0))) -# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \ - __attribute__((availability(macosx,strict,introduced=10.12))) \ - __attribute__((availability(ios,strict,introduced=10.0))) \ - __attribute__((availability(tvos,strict,introduced=10.0))) \ - __attribute__((availability(watchos,strict,introduced=3.0))) -# define _LIBCPP_AVAILABILITY_FUTURE_ERROR \ - __attribute__((availability(ios,strict,introduced=6.0))) -# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \ - __attribute__((availability(macosx,strict,introduced=10.9))) \ - __attribute__((availability(ios,strict,introduced=7.0))) -# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \ - __attribute__((availability(macosx,strict,introduced=10.9))) \ - __attribute__((availability(ios,strict,introduced=7.0))) -# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \ - __attribute__((availability(macosx,strict,introduced=10.9))) \ - __attribute__((availability(ios,strict,introduced=7.0))) -# define _LIBCPP_AVAILABILITY_FILESYSTEM \ - __attribute__((availability(macosx,strict,introduced=10.15))) \ - __attribute__((availability(ios,strict,introduced=13.0))) \ - __attribute__((availability(tvos,strict,introduced=13.0))) \ - __attribute__((availability(watchos,strict,introduced=6.0))) -# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH \ - _Pragma("clang attribute push(__attribute__((availability(macosx,strict,introduced=10.15))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(ios,strict,introduced=13.0))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(tvos,strict,introduced=13.0))), apply_to=any(function,record))") \ - _Pragma("clang attribute push(__attribute__((availability(watchos,strict,introduced=6.0))), apply_to=any(function,record))") -# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") \ - _Pragma("clang attribute pop") -# define _LIBCPP_AVAILABILITY_TO_CHARS \ - _LIBCPP_AVAILABILITY_FILESYSTEM -# define _LIBCPP_AVAILABILITY_SYNC \ - __attribute__((unavailable)) -#else -# define _LIBCPP_AVAILABILITY_SHARED_MUTEX -# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST -# define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS -# define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE -# define _LIBCPP_AVAILABILITY_FUTURE_ERROR -# define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE -# define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY -# define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR -# define _LIBCPP_AVAILABILITY_FILESYSTEM -# define _LIBCPP_AVAILABILITY_FILESYSTEM_PUSH -# define _LIBCPP_AVAILABILITY_FILESYSTEM_POP -# define _LIBCPP_AVAILABILITY_TO_CHARS -# define _LIBCPP_AVAILABILITY_SYNC -#endif - -// Define availability that depends on _LIBCPP_NO_EXCEPTIONS. -#ifdef _LIBCPP_NO_EXCEPTIONS -# define _LIBCPP_AVAILABILITY_FUTURE -# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST -# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS -#else -# define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR -# define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_ANY_CAST -# define _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS -#endif - -// The stream API was dropped and re-added in the dylib shipped on macOS -// and iOS. We can only assume the dylib to provide these definitions for -// macosx >= 10.9 and ios >= 7.0. Otherwise, the definitions are available -// from the headers, but not from the dylib. Explicit instantiation -// declarations for streams exist conditionally to this; if we provide -// an explicit instantiation declaration and we try to deploy to a dylib -// that does not provide those symbols, we'll get a load-time error. -#if !defined(_LIBCPP_BUILDING_LIBRARY) && \ - ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) || \ - (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000)) -# define _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB +#if !defined(__cpp_impl_coroutine) || __cpp_impl_coroutine < 201902L +#define _LIBCPP_HAS_NO_CXX20_COROUTINES #endif #if defined(_LIBCPP_COMPILER_IBM) @@ -1544,7 +1350,7 @@ #ifndef _LIBCPP_NO_AUTO_LINK # if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) -# if defined(_DLL) +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) # pragma comment(lib, "c++.lib") # else # pragma comment(lib, "libc++.lib") @@ -1552,8 +1358,6 @@ # endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) #endif // _LIBCPP_NO_AUTO_LINK -#define _LIBCPP_UNUSED_VAR(x) ((void)(x)) - // Configures the fopen close-on-exec mode character, if any. This string will // be appended to any mode string used by fstream for fopen/fdopen. // @@ -1565,12 +1369,6 @@ # define _LIBCPP_FOPEN_CLOEXEC_MODE #endif -#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P -#define _LIBCPP_BUILTIN_CONSTANT_P(x) __builtin_constant_p(x) -#else -#define _LIBCPP_BUILTIN_CONSTANT_P(x) false -#endif - // Support for _FILE_OFFSET_BITS=64 landed gradually in Android, so the full set // of functions used in cstdio may not be available for low API levels when // using 64-bit file offsets on LP32. @@ -1578,6 +1376,27 @@ #define _LIBCPP_HAS_NO_FGETPOS_FSETPOS #endif +#if __has_attribute(init_priority) + // TODO: Remove this once we drop support for building libc++ with old Clangs +# if (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER < 1200) || \ + (defined(__apple_build_version__) && __apple_build_version__ < 13000000) +# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(101))) +# else +# define _LIBCPP_INIT_PRIORITY_MAX __attribute__((init_priority(100))) +# endif +#else +# define _LIBCPP_INIT_PRIORITY_MAX +#endif + +#if defined(__GNUC__) || defined(__clang__) + // The attribute uses 1-based indices for ordinary and static member functions. + // The attribute uses 2-based indices for non-static member functions. +# define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) \ + __attribute__((__format__(archetype, format_string_index, first_format_arg_index))) +#else +# define _LIBCPP_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) /* nothing */ +#endif + #endif // __cplusplus #endif // _LIBCPP_CONFIG
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config_site b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config_site new file mode 100644 index 0000000..6962962 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__config_site
@@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_CONFIG_SITE +#define _LIBCPP_CONFIG_SITE + +/* #undef _LIBCPP_ABI_VERSION */ +/* #undef _LIBCPP_ABI_UNSTABLE */ +/* #undef _LIBCPP_ABI_FORCE_ITANIUM */ +/* #undef _LIBCPP_ABI_FORCE_MICROSOFT */ +/* #undef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT */ +/* #undef _LIBCPP_HAS_NO_THREADS */ +/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */ +/* #undef _LIBCPP_HAS_MUSL_LIBC */ +/* #undef _LIBCPP_HAS_THREAD_API_PTHREAD */ +/* #undef _LIBCPP_HAS_THREAD_API_EXTERNAL */ +/* #undef _LIBCPP_HAS_THREAD_API_WIN32 */ +/* #undef _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL */ +/* #undef _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS */ +#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS +/* #undef _LIBCPP_NO_VCRUNTIME */ +/* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */ +/* #undef _LIBCPP_ABI_NAMESPACE */ +/* #undef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY */ +/* #undef _LIBCPP_HAS_PARALLEL_ALGORITHMS */ +/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */ +/* #undef _LIBCPP_HAS_NO_LOCALIZATION */ +/* #undef _LIBCPP_HAS_NO_WIDE_CHARACTERS */ +/* #undef _LIBCPP_HAS_NO_INCOMPLETE_FORMAT */ +/* #undef _LIBCPP_HAS_NO_INCOMPLETE_RANGES */ + + + +#endif // _LIBCPP_CONFIG_SITE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_handle.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_handle.h new file mode 100644 index 0000000..64657c0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_handle.h
@@ -0,0 +1,202 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COROUTINE_COROUTINE_HANDLE_H +#define _LIBCPP___COROUTINE_COROUTINE_HANDLE_H + +#include <__config> +#include <__debug> +#include <__functional/hash.h> +#include <__memory/addressof.h> +#include <compare> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +_LIBCPP_BEGIN_NAMESPACE_STD + +// [coroutine.handle] +template <class _Promise = void> +struct _LIBCPP_TEMPLATE_VIS coroutine_handle; + +template <> +struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> { +public: + // [coroutine.handle.con], construct/reset + _LIBCPP_HIDE_FROM_ABI + constexpr coroutine_handle() noexcept = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr coroutine_handle(nullptr_t) noexcept {} + + _LIBCPP_HIDE_FROM_ABI + coroutine_handle& operator=(nullptr_t) noexcept { + __handle_ = nullptr; + return *this; + } + + // [coroutine.handle.export.import], export/import + _LIBCPP_HIDE_FROM_ABI + constexpr void* address() const noexcept { return __handle_; } + + _LIBCPP_HIDE_FROM_ABI + static constexpr coroutine_handle from_address(void* __addr) noexcept { + coroutine_handle __tmp; + __tmp.__handle_ = __addr; + return __tmp; + } + + // [coroutine.handle.observers], observers + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() const noexcept { + return __handle_ != nullptr; + } + + _LIBCPP_HIDE_FROM_ABI + bool done() const { + _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines"); + return __builtin_coro_done(__handle_); + } + + // [coroutine.handle.resumption], resumption + _LIBCPP_HIDE_FROM_ABI + void operator()() const { resume(); } + + _LIBCPP_HIDE_FROM_ABI + void resume() const { + _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines"); + _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done"); + __builtin_coro_resume(__handle_); + } + + _LIBCPP_HIDE_FROM_ABI + void destroy() const { + _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines"); + __builtin_coro_destroy(__handle_); + } + +private: + bool __is_suspended() const { + // FIXME actually implement a check for if the coro is suspended. + return __handle_ != nullptr; + } + + void* __handle_ = nullptr; +}; + +// [coroutine.handle.compare] +inline _LIBCPP_HIDE_FROM_ABI +constexpr bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept { + return __x.address() == __y.address(); +} +inline _LIBCPP_HIDE_FROM_ABI +constexpr strong_ordering operator<=>(coroutine_handle<> __x, coroutine_handle<> __y) noexcept { + return compare_three_way()(__x.address(), __y.address()); +} + +template <class _Promise> +struct _LIBCPP_TEMPLATE_VIS coroutine_handle { +public: + // [coroutine.handle.con], construct/reset + _LIBCPP_HIDE_FROM_ABI + constexpr coroutine_handle() noexcept = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr coroutine_handle(nullptr_t) noexcept {} + + _LIBCPP_HIDE_FROM_ABI + static coroutine_handle from_promise(_Promise& __promise) { + using _RawPromise = typename remove_cv<_Promise>::type; + coroutine_handle __tmp; + __tmp.__handle_ = + __builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + coroutine_handle& operator=(nullptr_t) noexcept { + __handle_ = nullptr; + return *this; + } + + // [coroutine.handle.export.import], export/import + _LIBCPP_HIDE_FROM_ABI + constexpr void* address() const noexcept { return __handle_; } + + _LIBCPP_HIDE_FROM_ABI + static constexpr coroutine_handle from_address(void* __addr) noexcept { + coroutine_handle __tmp; + __tmp.__handle_ = __addr; + return __tmp; + } + + // [coroutine.handle.conv], conversion + _LIBCPP_HIDE_FROM_ABI + constexpr operator coroutine_handle<>() const noexcept { + return coroutine_handle<>::from_address(address()); + } + + // [coroutine.handle.observers], observers + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() const noexcept { + return __handle_ != nullptr; + } + + _LIBCPP_HIDE_FROM_ABI + bool done() const { + _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines"); + return __builtin_coro_done(__handle_); + } + + // [coroutine.handle.resumption], resumption + _LIBCPP_HIDE_FROM_ABI + void operator()() const { resume(); } + + _LIBCPP_HIDE_FROM_ABI + void resume() const { + _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines"); + _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done"); + __builtin_coro_resume(__handle_); + } + + _LIBCPP_HIDE_FROM_ABI + void destroy() const { + _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines"); + __builtin_coro_destroy(__handle_); + } + + // [coroutine.handle.promise], promise access + _LIBCPP_HIDE_FROM_ABI + _Promise& promise() const { + return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false)); + } + +private: + bool __is_suspended() const { + // FIXME actually implement a check for if the coro is suspended. + return __handle_ != nullptr; + } + void* __handle_ = nullptr; +}; + +// [coroutine.handle.hash] +template <class _Tp> +struct hash<coroutine_handle<_Tp>> { + _LIBCPP_HIDE_FROM_ABI + size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept { return hash<void*>()(__v.address()); } +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +#endif // _LIBCPP___COROUTINE_COROUTINE_HANDLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_traits.h new file mode 100644 index 0000000..bfa6955 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/coroutine_traits.h
@@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COROUTINE_COROUTINE_TRAITS_H +#define _LIBCPP___COROUTINE_COROUTINE_TRAITS_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +_LIBCPP_BEGIN_NAMESPACE_STD + +// [coroutine.traits] +// [coroutine.traits.primary] +// The header <coroutine> defined the primary template coroutine_traits such that +// if ArgTypes is a parameter pack of types and if the qualified-id R::promise_type +// is valid and denotes a type ([temp.deduct]), then coroutine_traits<R, ArgTypes...> +// has the following publicly accessible memebr: +// +// using promise_type = typename R::promise_type; +// +// Otherwise, coroutine_traits<R, ArgTypes...> has no members. +template <class _Tp, class = void> +struct __coroutine_traits_sfinae {}; + +template <class _Tp> +struct __coroutine_traits_sfinae< + _Tp, typename __void_t<typename _Tp::promise_type>::type> +{ + using promise_type = typename _Tp::promise_type; +}; + +template <class _Ret, class... _Args> +struct coroutine_traits + : public __coroutine_traits_sfinae<_Ret> +{ +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +#endif // _LIBCPP___COROUTINE_COROUTINE_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/noop_coroutine_handle.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/noop_coroutine_handle.h new file mode 100644 index 0000000..9dbf21a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/noop_coroutine_handle.h
@@ -0,0 +1,86 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H +#define _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H + +#include <__config> +#include <__coroutine/coroutine_handle.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if __has_builtin(__builtin_coro_noop) +// [coroutine.noop] +// [coroutine.promise.noop] +struct noop_coroutine_promise {}; + +// [coroutine.handle.noop] +template <> +struct _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> { +public: + // [coroutine.handle.noop.conv], conversion + _LIBCPP_HIDE_FROM_ABI + constexpr operator coroutine_handle<>() const noexcept { + return coroutine_handle<>::from_address(address()); + } + + // [coroutine.handle.noop.observers], observers + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() const noexcept { return true; } + _LIBCPP_HIDE_FROM_ABI + constexpr bool done() const noexcept { return false; } + + // [coroutine.handle.noop.resumption], resumption + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()() const noexcept {} + _LIBCPP_HIDE_FROM_ABI + constexpr void resume() const noexcept {} + _LIBCPP_HIDE_FROM_ABI + constexpr void destroy() const noexcept {} + + // [coroutine.handle.noop.promise], promise access + _LIBCPP_HIDE_FROM_ABI + noop_coroutine_promise& promise() const noexcept { + return *static_cast<noop_coroutine_promise*>( + __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false)); + } + + // [coroutine.handle.noop.address], address + _LIBCPP_HIDE_FROM_ABI + constexpr void* address() const noexcept { return __handle_; } + +private: + _LIBCPP_HIDE_FROM_ABI + friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept; + + _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept { + this->__handle_ = __builtin_coro_noop(); + } + + void* __handle_ = nullptr; +}; + +using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; + +// [coroutine.noop.coroutine] +inline _LIBCPP_HIDE_FROM_ABI +noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); } + +#endif // __has_builtin(__builtin_coro_noop) + +_LIBCPP_END_NAMESPACE_STD + +#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +#endif // _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/trivial_awaitables.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/trivial_awaitables.h new file mode 100644 index 0000000..c434f83 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__coroutine/trivial_awaitables.h
@@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H +#define __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H + +#include <__config> +#include <__coroutine/coroutine_handle.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +_LIBCPP_BEGIN_NAMESPACE_STD + +// [coroutine.trivial.awaitables] +struct suspend_never { + _LIBCPP_HIDE_FROM_ABI + constexpr bool await_ready() const noexcept { return true; } + _LIBCPP_HIDE_FROM_ABI + constexpr void await_suspend(coroutine_handle<>) const noexcept {} + _LIBCPP_HIDE_FROM_ABI + constexpr void await_resume() const noexcept {} +}; + +struct suspend_always { + _LIBCPP_HIDE_FROM_ABI + constexpr bool await_ready() const noexcept { return false; } + _LIBCPP_HIDE_FROM_ABI + constexpr void await_suspend(coroutine_handle<>) const noexcept {} + _LIBCPP_HIDE_FROM_ABI + constexpr void await_resume() const noexcept {} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) + +#endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__cxxabi_config.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__cxxabi_config.h index 98f55b2..7bc39ad 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__cxxabi_config.h +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__cxxabi_config.h
@@ -1,4 +1,4 @@ -//===-------------------------- __cxxabi_config.h -------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -18,6 +18,19 @@ #define __has_attribute(_attribute_) 0 #endif +#if defined(__clang__) +# define _LIBCXXABI_COMPILER_CLANG +# ifndef __apple_build_version__ +# define _LIBCXXABI_CLANG_VER (__clang_major__ * 100 + __clang_minor__) +# endif +#elif defined(__GNUC__) +# define _LIBCXXABI_COMPILER_GCC +#elif defined(_MSC_VER) +# define _LIBCXXABI_COMPILER_MSVC +#elif defined(__IBMCPP__) +# define _LIBCXXABI_COMPILER_IBM +#endif + #if defined(_WIN32) #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS) #define _LIBCXXABI_HIDDEN @@ -53,7 +66,7 @@ #endif #endif -#if defined(_WIN32) +#if defined(_LIBCXXABI_COMPILER_MSVC) #define _LIBCXXABI_WEAK #else #define _LIBCXXABI_WEAK __attribute__((__weak__)) @@ -80,7 +93,7 @@ # if !__has_feature(cxx_exceptions) # define _LIBCXXABI_NO_EXCEPTIONS # endif -#elif defined(_LIBCXXABI_COMPILER_GCC) && !__EXCEPTIONS +#elif defined(_LIBCXXABI_COMPILER_GCC) && !defined(__EXCEPTIONS) # define _LIBCXXABI_NO_EXCEPTIONS #endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__debug b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__debug index 1829b32..e25039c 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__debug +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__debug
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- __debug ----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -54,7 +54,7 @@ __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m) : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {} - _LIBCPP_FUNC_VIS std::string what() const; + _LIBCPP_FUNC_VIS string what() const; const char* __file_; int __line_; @@ -221,7 +221,7 @@ template <class _Cont> _LIBCPP_INLINE_VISIBILITY static __c_node* __create_C_node(void *__mem, void *__c, __c_node *__next) { - return ::new(__mem) _C_node<_Cont>(__c, __next); + return ::new (__mem) _C_node<_Cont>(__c, __next); } template <class _Cont> @@ -270,4 +270,4 @@ _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP_DEBUG_H +#endif // _LIBCPP_DEBUG_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__errc b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__errc index a8ad29f..68d5fa3 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__errc +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__errc
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- __errc ----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -214,4 +214,4 @@ _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP___ERRC +#endif // _LIBCPP___ERRC
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_arg.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_arg.h new file mode 100644 index 0000000..a9a8c1f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_arg.h
@@ -0,0 +1,256 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_ARG_H +#define _LIBCPP___FORMAT_FORMAT_ARG_H + +#include <__concepts/arithmetic.h> +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__functional_base> +#include <__variant/monostate.h> +#include <string> +#include <string_view> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format { +/** The type stored in @ref basic_format_arg. */ +enum class _LIBCPP_ENUM_VIS __arg_t : uint8_t { + __none, + __boolean, + __char_type, + __int, + __long_long, +#ifndef _LIBCPP_HAS_NO_INT128 + __i128, +#endif + __unsigned, + __unsigned_long_long, +#ifndef _LIBCPP_HAS_NO_INT128 + __u128, +#endif + __float, + __double, + __long_double, + __const_char_type_ptr, + __string_view, + __ptr +}; +} // namespace __format + +template <class _Visitor, class _Context> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT decltype(auto) +visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) { + switch (__arg.__type_) { + case __format::__arg_t::__none: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), monostate{}); + case __format::__arg_t::__boolean: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__boolean); + case __format::__arg_t::__char_type: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__char_type); + case __format::__arg_t::__int: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__int); + case __format::__arg_t::__long_long: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__long_long); +#ifndef _LIBCPP_HAS_NO_INT128 + case __format::__arg_t::__i128: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__i128); +#endif + case __format::__arg_t::__unsigned: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__unsigned); + case __format::__arg_t::__unsigned_long_long: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), + __arg.__unsigned_long_long); +#ifndef _LIBCPP_HAS_NO_INT128 + case __format::__arg_t::__u128: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__u128); +#endif + case __format::__arg_t::__float: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__float); + case __format::__arg_t::__double: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__double); + case __format::__arg_t::__long_double: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__long_double); + case __format::__arg_t::__const_char_type_ptr: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), + __arg.__const_char_type_ptr); + case __format::__arg_t::__string_view: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__string_view); + case __format::__arg_t::__ptr: + return _VSTD::invoke(_VSTD::forward<_Visitor>(__vis), __arg.__ptr); + } + _LIBCPP_UNREACHABLE(); +} + +template <class _Context> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg { +public: + // TODO FMT Define the handle class. + class handle; + + _LIBCPP_HIDE_FROM_ABI basic_format_arg() noexcept + : __type_{__format::__arg_t::__none} {} + + _LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { + return __type_ != __format::__arg_t::__none; + } + +private: + using char_type = typename _Context::char_type; + + // TODO FMT Implement constrain [format.arg]/4 + // Constraints: The template specialization + // typename Context::template formatter_type<T> + // meets the Formatter requirements ([formatter.requirements]). The extent + // to which an implementation determines that the specialization meets the + // Formatter requirements is unspecified, except that as a minimum the + // expression + // typename Context::template formatter_type<T>() + // .format(declval<const T&>(), declval<Context&>()) + // shall be well-formed when treated as an unevaluated operand. + + template <class _Ctx, class... _Args> + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_AVAILABILITY_FORMAT friend __format_arg_store<_Ctx, _Args...> + _VSTD::make_format_args(const _Args&...); + + template <class _Visitor, class _Ctx> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT friend decltype(auto) + _VSTD::visit_format_arg(_Visitor&& __vis, basic_format_arg<_Ctx> __arg); + + union { + bool __boolean; + char_type __char_type; + int __int; + unsigned __unsigned; + long long __long_long; + unsigned long long __unsigned_long_long; +#ifndef _LIBCPP_HAS_NO_INT128 + __int128_t __i128; + __uint128_t __u128; +#endif + float __float; + double __double; + long double __long_double; + const char_type* __const_char_type_ptr; + basic_string_view<char_type> __string_view; + const void* __ptr; + // TODO FMT Add the handle. + }; + __format::__arg_t __type_; + + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(bool __v) noexcept + : __boolean(__v), __type_(__format::__arg_t::__boolean) {} + + template <class _Tp> + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(_Tp __v) noexcept + requires(same_as<_Tp, char_type> || + (same_as<_Tp, char> && same_as<char_type, wchar_t>)) + : __char_type(__v), __type_(__format::__arg_t::__char_type) {} + + template <__libcpp_signed_integer _Tp> + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(_Tp __v) noexcept { + if constexpr (sizeof(_Tp) <= sizeof(int)) { + __int = static_cast<int>(__v); + __type_ = __format::__arg_t::__int; + } else if constexpr (sizeof(_Tp) <= sizeof(long long)) { + __long_long = static_cast<long long>(__v); + __type_ = __format::__arg_t::__long_long; + } +#ifndef _LIBCPP_HAS_NO_INT128 + else if constexpr (sizeof(_Tp) == sizeof(__int128_t)) { + __i128 = __v; + __type_ = __format::__arg_t::__i128; + } +#endif + else + static_assert(sizeof(_Tp) == 0, "An unsupported signed integer was used"); + } + + template <__libcpp_unsigned_integer _Tp> + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(_Tp __v) noexcept { + if constexpr (sizeof(_Tp) <= sizeof(unsigned)) { + __unsigned = static_cast<unsigned>(__v); + __type_ = __format::__arg_t::__unsigned; + } else if constexpr (sizeof(_Tp) <= sizeof(unsigned long long)) { + __unsigned_long_long = static_cast<unsigned long long>(__v); + __type_ = __format::__arg_t::__unsigned_long_long; + } +#ifndef _LIBCPP_HAS_NO_INT128 + else if constexpr (sizeof(_Tp) == sizeof(__int128_t)) { + __u128 = __v; + __type_ = __format::__arg_t::__u128; + } +#endif + else + static_assert(sizeof(_Tp) == 0, + "An unsupported unsigned integer was used"); + } + + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(float __v) noexcept + : __float(__v), __type_(__format::__arg_t::__float) {} + + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(double __v) noexcept + : __double(__v), __type_(__format::__arg_t::__double) {} + + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(long double __v) noexcept + : __long_double(__v), __type_(__format::__arg_t::__long_double) {} + + // Note not a 'noexcept' function. + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg(const char_type* __s) + : __const_char_type_ptr(__s), + __type_(__format::__arg_t::__const_char_type_ptr) { + _LIBCPP_ASSERT(__s, "Used a nullptr argument to initialize a C-string"); + } + + template <class _Traits> + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg( + basic_string_view<char_type, _Traits> __s) noexcept + : __string_view{__s.data(), __s.size()}, + __type_(__format::__arg_t::__string_view) {} + + template <class _Traits, class _Allocator> + _LIBCPP_HIDE_FROM_ABI explicit basic_format_arg( + const basic_string<char_type, _Traits, _Allocator>& __s) noexcept + : __string_view{__s.data(), __s.size()}, + __type_(__format::__arg_t::__string_view) {} + + _LIBCPP_HIDE_FROM_ABI + explicit basic_format_arg(nullptr_t) noexcept + : __ptr(nullptr), __type_(__format::__arg_t::__ptr) {} + + // TODO FMT Implement the _Tp* constructor. +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMAT_ARG_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_args.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_args.h new file mode 100644 index 0000000..0a26b95 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_args.h
@@ -0,0 +1,71 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_ARGS_H +#define _LIBCPP___FORMAT_FORMAT_ARGS_H + +#include <__availability> +#include <__config> +#include <__format/format_fwd.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _Context> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args { +public: + // TODO FMT Implement [format.args]/5 + // [Note 1: Implementations are encouraged to optimize the representation of + // basic_format_args for small number of formatting arguments by storing + // indices of type alternatives separately from values and packing the + // former. - end note] + // Note: Change __format_arg_store to use a built-in array. + _LIBCPP_HIDE_FROM_ABI basic_format_args() noexcept = default; + + template <class... _Args> + _LIBCPP_HIDE_FROM_ABI basic_format_args( + const __format_arg_store<_Context, _Args...>& __store) noexcept + : __size_(sizeof...(_Args)), __data_(__store.__args.data()) {} + + _LIBCPP_HIDE_FROM_ABI + basic_format_arg<_Context> get(size_t __id) const noexcept { + return __id < __size_ ? __data_[__id] : basic_format_arg<_Context>{}; + } + + _LIBCPP_HIDE_FROM_ABI size_t __size() const noexcept { return __size_; } + +private: + size_t __size_{0}; + const basic_format_arg<_Context>* __data_{nullptr}; +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMAT_ARGS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_context.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_context.h new file mode 100644 index 0000000..b4fe5cc --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_context.h
@@ -0,0 +1,168 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_CONTEXT_H +#define _LIBCPP___FORMAT_FORMAT_CONTEXT_H + +#include <__availability> +#include <__config> +#include <__format/format_args.h> +#include <__format/format_fwd.h> +#include <__iterator/concepts.h> +#include <concepts> +#include <iterator> +#include <string> + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#include <locale> +#include <optional> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _OutIt, class _CharT> +requires output_iterator<_OutIt, const _CharT&> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_context; + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +/** + * Helper to create a basic_format_context. + * + * This is needed since the constructor is private. + */ +template <class _OutIt, class _CharT> +_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT> +__format_context_create( + _OutIt __out_it, + basic_format_args<basic_format_context<_OutIt, _CharT>> __args, + optional<_VSTD::locale>&& __loc = nullopt) { + return _VSTD::basic_format_context(_VSTD::move(__out_it), __args, + _VSTD::move(__loc)); +} +#else +template <class _OutIt, class _CharT> +_LIBCPP_HIDE_FROM_ABI basic_format_context<_OutIt, _CharT> +__format_context_create( + _OutIt __out_it, + basic_format_args<basic_format_context<_OutIt, _CharT>> __args) { + return _VSTD::basic_format_context(_VSTD::move(__out_it), __args); +} +#endif + +// TODO FMT Implement [format.context]/4 +// [Note 1: For a given type charT, implementations are encouraged to provide a +// single instantiation of basic_format_context for appending to +// basic_string<charT>, vector<charT>, or any other container with contiguous +// storage by wrapping those in temporary objects with a uniform interface +// (such as a span<charT>) and polymorphic reallocation. - end note] + +using format_context = basic_format_context<back_insert_iterator<string>, char>; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +using wformat_context = basic_format_context<back_insert_iterator<wstring>, wchar_t>; +#endif + +template <class _OutIt, class _CharT> +requires output_iterator<_OutIt, const _CharT&> +class + // clang-format off + _LIBCPP_TEMPLATE_VIS + _LIBCPP_AVAILABILITY_FORMAT + _LIBCPP_PREFERRED_NAME(format_context) + _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wformat_context)) + // clang-format on + basic_format_context { +public: + using iterator = _OutIt; + using char_type = _CharT; + template <class _Tp> + using formatter_type = formatter<_Tp, _CharT>; + + basic_format_context(const basic_format_context&) = delete; + basic_format_context& operator=(const basic_format_context&) = delete; + + _LIBCPP_HIDE_FROM_ABI basic_format_arg<basic_format_context> + arg(size_t __id) const { + return __args_.get(__id); + } +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + _LIBCPP_HIDE_FROM_ABI _VSTD::locale locale() { + if (!__loc_) + __loc_ = _VSTD::locale{}; + return *__loc_; + } +#endif + _LIBCPP_HIDE_FROM_ABI iterator out() { return __out_it_; } + _LIBCPP_HIDE_FROM_ABI void advance_to(iterator __it) { __out_it_ = __it; } + +private: + iterator __out_it_; + basic_format_args<basic_format_context> __args_; +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + + // The Standard doesn't specify how the locale is stored. + // [format.context]/6 + // std::locale locale(); + // Returns: The locale passed to the formatting function if the latter + // takes one, and std::locale() otherwise. + // This is done by storing the locale of the constructor in this optional. If + // locale() is called and the optional has no value the value will be created. + // This allows the implementation to lazily create the locale. + // TODO FMT Validate whether lazy creation is the best solution. + optional<_VSTD::locale> __loc_; + + template <class __OutIt, class __CharT> + friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT> + _VSTD::__format_context_create( + __OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>, + optional<_VSTD::locale>&&); + + // Note: the Standard doesn't specify the required constructors. + _LIBCPP_HIDE_FROM_ABI + explicit basic_format_context(_OutIt __out_it, + basic_format_args<basic_format_context> __args, + optional<_VSTD::locale>&& __loc) + : __out_it_(_VSTD::move(__out_it)), __args_(__args), + __loc_(_VSTD::move(__loc)) {} +#else + template <class __OutIt, class __CharT> + friend _LIBCPP_HIDE_FROM_ABI basic_format_context<__OutIt, __CharT> + _VSTD::__format_context_create( + __OutIt, basic_format_args<basic_format_context<__OutIt, __CharT>>); + + _LIBCPP_HIDE_FROM_ABI + explicit basic_format_context(_OutIt __out_it, + basic_format_args<basic_format_context> __args) + : __out_it_(_VSTD::move(__out_it)), __args_(__args) {} +#endif +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMAT_CONTEXT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_error.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_error.h new file mode 100644 index 0000000..ac1d708 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_error.h
@@ -0,0 +1,51 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_ERROR_H +#define _LIBCPP___FORMAT_FORMAT_ERROR_H + +#include <__config> +#include <stdexcept> + +#ifdef _LIBCPP_NO_EXCEPTIONS +#include <cstdlib> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +class _LIBCPP_EXCEPTION_ABI format_error : public runtime_error { +public: + _LIBCPP_HIDE_FROM_ABI explicit format_error(const string& __s) + : runtime_error(__s) {} + _LIBCPP_HIDE_FROM_ABI explicit format_error(const char* __s) + : runtime_error(__s) {} + virtual ~format_error() noexcept; +}; + +_LIBCPP_NORETURN inline _LIBCPP_HIDE_FROM_ABI void +__throw_format_error(const char* __s) { +#ifndef _LIBCPP_NO_EXCEPTIONS + throw format_error(__s); +#else + (void)__s; + _VSTD::abort(); +#endif +} + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMAT_ERROR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_fwd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_fwd.h new file mode 100644 index 0000000..7da30ae --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_fwd.h
@@ -0,0 +1,56 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_FWD_H +#define _LIBCPP___FORMAT_FORMAT_FWD_H + +#include <__availability> +#include <__config> +#include <__iterator/concepts.h> +#include <__utility/forward.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _Context> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_arg; + +template <class _Context, class... _Args> +struct _LIBCPP_TEMPLATE_VIS __format_arg_store; + +template <class _Ctx, class... _Args> +_LIBCPP_HIDE_FROM_ABI __format_arg_store<_Ctx, _Args...> +make_format_args(const _Args&...); + +template <class _Tp, class _CharT = char> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMAT_FWD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_parse_context.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_parse_context.h new file mode 100644 index 0000000..289cab9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_parse_context.h
@@ -0,0 +1,109 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H +#define _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H + +#include <__config> +#include <__format/format_error.h> +#include <string_view> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_parse_context { +public: + using char_type = _CharT; + using const_iterator = typename basic_string_view<_CharT>::const_iterator; + using iterator = const_iterator; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit basic_format_parse_context(basic_string_view<_CharT> __fmt, + size_t __num_args = 0) noexcept + : __begin_(__fmt.begin()), + __end_(__fmt.end()), + __indexing_(__unknown), + __next_arg_id_(0), + __num_args_(__num_args) {} + + basic_format_parse_context(const basic_format_parse_context&) = delete; + basic_format_parse_context& + operator=(const basic_format_parse_context&) = delete; + + _LIBCPP_HIDE_FROM_ABI constexpr const_iterator begin() const noexcept { + return __begin_; + } + _LIBCPP_HIDE_FROM_ABI constexpr const_iterator end() const noexcept { + return __end_; + } + _LIBCPP_HIDE_FROM_ABI constexpr void advance_to(const_iterator __it) { + __begin_ = __it; + } + + _LIBCPP_HIDE_FROM_ABI constexpr size_t next_arg_id() { + if (__indexing_ == __manual) + __throw_format_error("Using automatic argument numbering in manual " + "argument numbering mode"); + + if (__indexing_ == __unknown) + __indexing_ = __automatic; + return __next_arg_id_++; + } + _LIBCPP_HIDE_FROM_ABI constexpr void check_arg_id(size_t __id) { + if (__indexing_ == __automatic) + __throw_format_error("Using manual argument numbering in automatic " + "argument numbering mode"); + + if (__indexing_ == __unknown) + __indexing_ = __manual; + + // Throws an exception to make the expression a non core constant + // expression as required by: + // [format.parse.ctx]/11 + // Remarks: Call expressions where id >= num_args_ are not core constant + // expressions ([expr.const]). + // Note: the Throws clause [format.parse.ctx]/10 doesn't specify the + // behavior when id >= num_args_. + if (is_constant_evaluated() && __id >= __num_args_) + __throw_format_error("Argument index outside the valid range"); + } + +private: + iterator __begin_; + iterator __end_; + enum _Indexing { __unknown, __manual, __automatic }; + _Indexing __indexing_; + size_t __next_arg_id_; + size_t __num_args_; +}; + +using format_parse_context = basic_format_parse_context<char>; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +using wformat_parse_context = basic_format_parse_context<wchar_t>; +#endif + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_string.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_string.h new file mode 100644 index 0000000..885e572 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_string.h
@@ -0,0 +1,169 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_STRING_H +#define _LIBCPP___FORMAT_FORMAT_STRING_H + +#include <__config> +#include <__debug> +#include <__format/format_error.h> +#include <cstddef> +#include <cstdint> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format { + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __parse_number_result { + const _CharT* __ptr; + uint32_t __value; +}; + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_number(const _CharT* __begin, const _CharT* __end); + +/** + * The maximum value of a numeric argument. + * + * This is used for: + * * arg-id + * * width as value or arg-id. + * * precision as value or arg-id. + * + * The value is compatible with the maximum formatting width and precision + * using the `%*` syntax on a 32-bit system. + */ +inline constexpr uint32_t __number_max = INT32_MAX; + +namespace __detail { +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_zero(const _CharT* __begin, const _CharT*, auto& __parse_ctx) { + __parse_ctx.check_arg_id(0); + return {++__begin, 0}; // can never be larger than the maximum. +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_automatic(const _CharT* __begin, const _CharT*, auto& __parse_ctx) { + size_t __value = __parse_ctx.next_arg_id(); + _LIBCPP_ASSERT(__value <= __number_max, + "Compilers don't support this number of arguments"); + + return {__begin, uint32_t(__value)}; +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_manual(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { + __parse_number_result<_CharT> __r = __parse_number(__begin, __end); + __parse_ctx.check_arg_id(__r.__value); + return __r; +} + +} // namespace __detail + +/** + * Parses a number. + * + * The number is used for the 31-bit values @em width and @em precision. This + * allows a maximum value of 2147483647. + */ +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_number(const _CharT* __begin, const _CharT* __end_input) { + static_assert(__format::__number_max == INT32_MAX, + "The algorithm is implemented based on this value."); + /* + * Limit the input to 9 digits, otherwise we need two checks during every + * iteration: + * - Are we at the end of the input? + * - Does the value exceed width of an uint32_t? (Switching to uint64_t would + * have the same issue, but with a higher maximum.) + */ + const _CharT* __end = __end_input - __begin > 9 ? __begin + 9 : __end_input; + uint32_t __value = *__begin - _CharT('0'); + while (++__begin != __end) { + if (*__begin < _CharT('0') || *__begin > _CharT('9')) + return {__begin, __value}; + + __value = __value * 10 + *__begin - _CharT('0'); + } + + if (__begin != __end_input && *__begin >= _CharT('0') && + *__begin <= _CharT('9')) { + + /* + * There are more than 9 digits, do additional validations: + * - Does the 10th digit exceed the maximum allowed value? + * - Are there more than 10 digits? + * (More than 10 digits always overflows the maximum.) + */ + uint64_t __v = uint64_t(__value) * 10 + *__begin++ - _CharT('0'); + if (__v > __number_max || + (__begin != __end_input && *__begin >= _CharT('0') && + *__begin <= _CharT('9'))) + __throw_format_error("The numeric value of the format-spec is too large"); + + __value = __v; + } + + return {__begin, __value}; +} + +/** + * Multiplexer for all parse functions. + * + * The parser will return a pointer beyond the last consumed character. This + * should be the closing '}' of the arg-id. + */ +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_CharT> +__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { + switch (*__begin) { + case _CharT('0'): + return __detail::__parse_zero(__begin, __end, __parse_ctx); + + case _CharT(':'): + // This case is conditionally valid. It's allowed in an arg-id in the + // replacement-field, but not in the std-format-spec. The caller can + // provide a better diagnostic, so accept it here unconditionally. + case _CharT('}'): + return __detail::__parse_automatic(__begin, __end, __parse_ctx); + } + if (*__begin < _CharT('0') || *__begin > _CharT('9')) + __throw_format_error( + "The arg-id of the format-spec starts with an invalid character"); + + return __detail::__parse_manual(__begin, __end, __parse_ctx); +} + +} // namespace __format + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMAT_STRING_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_to_n_result.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_to_n_result.h new file mode 100644 index 0000000..b973dc5 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/format_to_n_result.h
@@ -0,0 +1,41 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H +#define _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H + +#include <__config> +#include <__iterator/incrementable_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _OutIt> +struct _LIBCPP_TEMPLATE_VIS format_to_n_result { + _OutIt out; + iter_difference_t<_OutIt> size; +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter.h new file mode 100644 index 0000000..1adce75 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter.h
@@ -0,0 +1,268 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_H +#define _LIBCPP___FORMAT_FORMATTER_H + +#include <__algorithm/copy.h> +#include <__algorithm/fill_n.h> +#include <__availability> +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/format_string.h> +#include <__format/parser_std_format_spec.h> +#include <concepts> +#include <string_view> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// Currently not implemented specializations throw an exception when used. This +// does not conform to the Standard. However not all Standard defined formatters +// have been implemented yet. Until that time the current behavior is intended. +// TODO FMT Disable the default template. +template <class _Tp, class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter { + _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI auto parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + __throw(); + } + + _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI auto format(_Tp, auto& __ctx) + -> decltype(__ctx.out()) { + __throw(); + } + +private: + _LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI void __throw() { + __throw_format_error("Argument type not implemented yet"); + } +}; + +namespace __format_spec { + +_LIBCPP_HIDE_FROM_ABI inline char* __insert_sign(char* __buf, bool __negative, + _Flags::_Sign __sign) { + if (__negative) + *__buf++ = '-'; + else + switch (__sign) { + case _Flags::_Sign::__default: + case _Flags::_Sign::__minus: + // No sign added. + break; + case _Flags::_Sign::__plus: + *__buf++ = '+'; + break; + case _Flags::_Sign::__space: + *__buf++ = ' '; + break; + } + + return __buf; +} + +_LIBCPP_HIDE_FROM_ABI constexpr char __hex_to_upper(char c) { + switch (c) { + case 'a': + return 'A'; + case 'b': + return 'B'; + case 'c': + return 'C'; + case 'd': + return 'D'; + case 'e': + return 'E'; + case 'f': + return 'F'; + } + return c; +} + +} // namespace __format_spec + +namespace __formatter { + +/** The character types that formatters are specialized for. */ +template <class _CharT> +concept __char_type = same_as<_CharT, char> || same_as<_CharT, wchar_t>; + +struct _LIBCPP_TEMPLATE_VIS __padding_size_result { + size_t __before; + size_t __after; +}; + +_LIBCPP_HIDE_FROM_ABI constexpr __padding_size_result +__padding_size(size_t __size, size_t __width, + __format_spec::_Flags::_Alignment __align) { + _LIBCPP_ASSERT(__width > __size, + "Don't call this function when no padding is required"); + _LIBCPP_ASSERT( + __align != __format_spec::_Flags::_Alignment::__default, + "Caller should adjust the default to the value required by the type"); + + size_t __fill = __width - __size; + switch (__align) { + case __format_spec::_Flags::_Alignment::__default: + _LIBCPP_UNREACHABLE(); + + case __format_spec::_Flags::_Alignment::__left: + return {0, __fill}; + + case __format_spec::_Flags::_Alignment::__center: { + // The extra padding is divided per [format.string.std]/3 + // __before = floor(__fill, 2); + // __after = ceil(__fill, 2); + size_t __before = __fill / 2; + size_t __after = __fill - __before; + return {__before, __after}; + } + case __format_spec::_Flags::_Alignment::__right: + return {__fill, 0}; + } + _LIBCPP_UNREACHABLE(); +} + +/** + * Writes the input to the output with the required padding. + * + * Since the output column width is specified the function can be used for + * ASCII and Unicode input. + * + * @pre [@a __first, @a __last) is a valid range. + * @pre @a __size <= @a __width. Using this function when this pre-condition + * doesn't hold incurs an unwanted overhead. + * + * @param __out_it The output iterator to write to. + * @param __first Pointer to the first element to write. + * @param __last Pointer beyond the last element to write. + * @param __size The (estimated) output column width. When the elements + * to be written are ASCII the following condition holds + * @a __size == @a __last - @a __first. + * @param __width The number of output columns to write. + * @param __fill The character used for the alignment of the output. + * TODO FMT Will probably change to support Unicode grapheme + * cluster. + * @param __alignment The requested alignment. + * + * @returns An iterator pointing beyond the last element written. + * + * @note The type of the elements in range [@a __first, @a __last) can differ + * from the type of @a __fill. Integer output uses @c std::to_chars for its + * conversion, which means the [@a __first, @a __last) always contains elements + * of the type @c char. + */ +template <class _CharT, class _Fill> +_LIBCPP_HIDE_FROM_ABI auto +__write(output_iterator<const _CharT&> auto __out_it, const _CharT* __first, + const _CharT* __last, size_t __size, size_t __width, _Fill __fill, + __format_spec::_Flags::_Alignment __alignment) -> decltype(__out_it) { + + _LIBCPP_ASSERT(__first <= __last, "Not a valid range"); + _LIBCPP_ASSERT(__size < __width, "Precondition failure"); + + __padding_size_result __padding = + __padding_size(__size, __width, __alignment); + __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before, __fill); + __out_it = _VSTD::copy(__first, __last, _VSTD::move(__out_it)); + return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after, __fill); +} + +/** + * @overload + * + * Uses a transformation operation before writing an element. + * + * TODO FMT Fill will probably change to support Unicode grapheme cluster. + */ +template <class _CharT, class _UnaryOperation, class _Fill> +_LIBCPP_HIDE_FROM_ABI auto +__write(output_iterator<const _CharT&> auto __out_it, const _CharT* __first, + const _CharT* __last, size_t __size, _UnaryOperation __op, + size_t __width, _Fill __fill, + __format_spec::_Flags::_Alignment __alignment) -> decltype(__out_it) { + + _LIBCPP_ASSERT(__first <= __last, "Not a valid range"); + _LIBCPP_ASSERT(__size < __width, "Precondition failure"); + + __padding_size_result __padding = + __padding_size(__size, __width, __alignment); + __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before, __fill); + __out_it = _VSTD::transform(__first, __last, _VSTD::move(__out_it), __op); + return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after, __fill); +} + +/** + * Writes Unicode input to the output with the required padding. + * + * This function does almost the same as the @ref __write function, but handles + * the width estimation of the Unicode input. + * + * @param __str The range [@a __first, @a __last). + * @param __precision The width to truncate the input string to, use @c -1 for + * no limit. + */ +template <class _CharT, class _Fill> +_LIBCPP_HIDE_FROM_ABI auto +__write_unicode(output_iterator<const _CharT&> auto __out_it, + basic_string_view<_CharT> __str, ptrdiff_t __width, + ptrdiff_t __precision, _Fill __fill, + __format_spec::_Flags::_Alignment __alignment) + -> decltype(__out_it) { + + // This value changes when there Unicode column width limits the output + // size. + auto __last = __str.end(); + if (__width != 0 || __precision != -1) { + __format_spec::__string_alignment<_CharT> __format_traits = + __format_spec::__get_string_alignment(__str.begin(), __str.end(), + __width, __precision); + + if (__format_traits.__align) + return __write(_VSTD::move(__out_it), __str.begin(), + __format_traits.__last, __format_traits.__size, __width, + __fill, __alignment); + + // No alignment required update the output based on the precision. + // This might be the same as __str.end(). + __last = __format_traits.__last; + } + + // Copy the input to the output. The output size might be limited by the + // precision. + return _VSTD::copy(__str.begin(), __last, _VSTD::move(__out_it)); +} + +} // namespace __formatter + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMATTER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_bool.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_bool.h new file mode 100644 index 0000000..fdd1d75 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_bool.h
@@ -0,0 +1,147 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_BOOL_H +#define _LIBCPP___FORMAT_FORMATTER_BOOL_H + +#include <__availability> +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/formatter.h> +#include <__format/formatter_integral.h> +#include <__format/parser_std_format_spec.h> +#include <string_view> + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#include <locale> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format_spec { + +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_bool : public __parser_integral<_CharT> { +public: + _LIBCPP_HIDE_FROM_ABI constexpr auto parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + auto __it = __parser_integral<_CharT>::__parse(__parse_ctx); + + switch (this->__type) { + case _Flags::_Type::__default: + this->__type = _Flags::_Type::__string; + [[fallthrough]]; + case _Flags::_Type::__string: + this->__handle_bool(); + break; + + case _Flags::_Type::__char: + this->__handle_char(); + break; + + case _Flags::_Type::__binary_lower_case: + case _Flags::_Type::__binary_upper_case: + case _Flags::_Type::__octal: + case _Flags::_Type::__decimal: + case _Flags::_Type::__hexadecimal_lower_case: + case _Flags::_Type::__hexadecimal_upper_case: + this->__handle_integer(); + break; + + default: + __throw_format_error( + "The format-spec type has a type not supported for a bool argument"); + } + + return __it; + } +}; + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __bool_strings; + +template <> +struct _LIBCPP_TEMPLATE_VIS __bool_strings<char> { + static constexpr string_view __true{"true"}; + static constexpr string_view __false{"false"}; +}; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template <> +struct _LIBCPP_TEMPLATE_VIS __bool_strings<wchar_t> { + static constexpr wstring_view __true{L"true"}; + static constexpr wstring_view __false{L"false"}; +}; +#endif + +template <class _CharT> +using __formatter_bool = __formatter_integral<__parser_bool<_CharT>>; + +} //namespace __format_spec + +// [format.formatter.spec]/2.3 +// For each charT, for each cv-unqualified arithmetic type ArithmeticT other +// than char, wchar_t, char8_t, char16_t, or char32_t, a specialization + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<bool, _CharT> + : public __format_spec::__formatter_bool<_CharT> { + using _Base = __format_spec::__formatter_bool<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(bool __value, auto& __ctx) + -> decltype(__ctx.out()) { + if (this->__type != __format_spec::_Flags::_Type::__string) + return _Base::format(static_cast<unsigned char>(__value), __ctx); + + if (this->__width_needs_substitution()) + this->__substitute_width_arg_id(__ctx.arg(this->__width)); + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + if (this->__locale_specific_form) { + const auto& __np = use_facet<numpunct<_CharT>>(__ctx.locale()); + basic_string<_CharT> __str = __value ? __np.truename() : __np.falsename(); + return __formatter::__write_unicode( + __ctx.out(), basic_string_view<_CharT>{__str}, this->__width, -1, + this->__fill, this->__alignment); + } +#endif + basic_string_view<_CharT> __str = + __value ? __format_spec::__bool_strings<_CharT>::__true + : __format_spec::__bool_strings<_CharT>::__false; + + // The output only uses ASCII so every character is one column. + unsigned __size = __str.size(); + if (__size >= this->__width) + return _VSTD::copy(__str.begin(), __str.end(), __ctx.out()); + + return __formatter::__write(__ctx.out(), __str.begin(), __str.end(), __size, + this->__width, this->__fill, this->__alignment); + } +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMATTER_BOOL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_char.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_char.h new file mode 100644 index 0000000..2131de0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_char.h
@@ -0,0 +1,104 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_CHAR_H +#define _LIBCPP___FORMAT_FORMATTER_CHAR_H + +#include <__availability> +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/formatter.h> +#include <__format/formatter_integral.h> +#include <__format/parser_std_format_spec.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format_spec { + +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_char : public __parser_integral<_CharT> { +public: + _LIBCPP_HIDE_FROM_ABI constexpr auto parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + auto __it = __parser_integral<_CharT>::__parse(__parse_ctx); + + switch (this->__type) { + case _Flags::_Type::__default: + this->__type = _Flags::_Type::__char; + [[fallthrough]]; + case _Flags::_Type::__char: + this->__handle_char(); + break; + + case _Flags::_Type::__binary_lower_case: + case _Flags::_Type::__binary_upper_case: + case _Flags::_Type::__octal: + case _Flags::_Type::__decimal: + case _Flags::_Type::__hexadecimal_lower_case: + case _Flags::_Type::__hexadecimal_upper_case: + this->__handle_integer(); + break; + + default: + __throw_format_error( + "The format-spec type has a type not supported for a char argument"); + } + + return __it; + } +}; + +template <class _CharT> +using __formatter_char = __formatter_integral<__parser_char<_CharT>>; + +} // namespace __format_spec + +// [format.formatter.spec]/2.1 The specializations + +template <> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, char> + : public __format_spec::__formatter_char<char> {}; + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +template <> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<char, wchar_t> + : public __format_spec::__formatter_char<wchar_t> { + using _Base = __format_spec::__formatter_char<wchar_t>; + + _LIBCPP_HIDE_FROM_ABI auto format(char __value, auto& __ctx) + -> decltype(__ctx.out()) { + return _Base::format(static_cast<wchar_t>(__value), __ctx); + } +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<wchar_t, wchar_t> + : public __format_spec::__formatter_char<wchar_t> {}; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FORMAT_FORMATTER_CHAR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integer.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integer.h new file mode 100644 index 0000000..767df36 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integer.h
@@ -0,0 +1,170 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGER_H +#define _LIBCPP___FORMAT_FORMATTER_INTEGER_H + +#include <__availability> +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/formatter.h> +#include <__format/formatter_integral.h> +#include <__format/parser_std_format_spec.h> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format_spec { + +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_integer : public __parser_integral<_CharT> { +public: + _LIBCPP_HIDE_FROM_ABI constexpr auto parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + auto __it = __parser_integral<_CharT>::__parse(__parse_ctx); + + switch (this->__type) { + case _Flags::_Type::__default: + this->__type = _Flags::_Type::__decimal; + [[fallthrough]]; + + case _Flags::_Type::__binary_lower_case: + case _Flags::_Type::__binary_upper_case: + case _Flags::_Type::__octal: + case _Flags::_Type::__decimal: + case _Flags::_Type::__hexadecimal_lower_case: + case _Flags::_Type::__hexadecimal_upper_case: + this->__handle_integer(); + break; + + case _Flags::_Type::__char: + this->__handle_char(); + break; + + default: + __throw_format_error("The format-spec type has a type not supported for " + "an integer argument"); + } + return __it; + } +}; + +template <class _CharT> +using __formatter_integer = __formatter_integral<__parser_integer<_CharT>>; + +} // namespace __format_spec + +// [format.formatter.spec]/2.3 +// For each charT, for each cv-unqualified arithmetic type ArithmeticT other +// than char, wchar_t, char8_t, char16_t, or char32_t, a specialization + +// Signed integral types. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<signed char, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<short, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<int, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<long, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<long long, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +#ifndef _LIBCPP_HAS_NO_INT128 +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<__int128_t, _CharT> + : public __format_spec::__formatter_integer<_CharT> { + using _Base = __format_spec::__formatter_integer<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(__int128_t __value, auto& __ctx) + -> decltype(__ctx.out()) { + // TODO FMT Implement full 128 bit support. + using _To = long long; + if (__value < numeric_limits<_To>::min() || + __value > numeric_limits<_To>::max()) + __throw_format_error("128-bit value is outside of implemented range"); + + return _Base::format(static_cast<_To>(__value), __ctx); + } +}; +#endif + +// Unsigned integral types. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<unsigned char, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<unsigned short, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<unsigned, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<unsigned long, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<unsigned long long, _CharT> + : public __format_spec::__formatter_integer<_CharT> {}; +#ifndef _LIBCPP_HAS_NO_INT128 +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<__uint128_t, _CharT> + : public __format_spec::__formatter_integer<_CharT> { + using _Base = __format_spec::__formatter_integer<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(__uint128_t __value, auto& __ctx) + -> decltype(__ctx.out()) { + // TODO FMT Implement full 128 bit support. + using _To = unsigned long long; + if (__value < numeric_limits<_To>::min() || + __value > numeric_limits<_To>::max()) + __throw_format_error("128-bit value is outside of implemented range"); + + return _Base::format(static_cast<_To>(__value), __ctx); + } +}; +#endif + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMATTER_INTEGER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integral.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integral.h new file mode 100644 index 0000000..5f1353e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_integral.h
@@ -0,0 +1,463 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H +#define _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H + +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/formatter.h> +#include <__format/parser_std_format_spec.h> +#include <__algorithm/copy.h> +#include <__algorithm/copy_n.h> +#include <__algorithm/fill_n.h> +#include <__algorithm/transform.h> +#include <array> +#include <charconv> +#include <concepts> +#include <limits> +#include <string> + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +#include <locale> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +/** + * Integral formatting classes. + * + * There are two types used here: + * * C++-type, the type as used in C++. + * * format-type, the output type specified in the std-format-spec. + * + * Design of the integral formatters consists of several layers. + * * @ref __parser_integral The basic std-format-spec parser for all integral + * classes. This parser does the basic sanity checks. It also contains some + * helper functions that are nice to have available for all parsers. + * * A C++-type specific parser. These parsers must derive from + * @ref __parser_integral. Their task is to validate whether the parsed + * std-format-spec is valid for the C++-type and selected format-type. After + * validation they need to make sure all members are properly set. For + * example, when the alignment hasn't changed it needs to set the proper + * default alignment for the format-type. The following parsers are available: + * - @ref __parser_integer + * - @ref __parser_char + * - @ref __parser_bool + * * A general formatter for all integral types @ref __formatter_integral. This + * formatter can handle all formatting of integers and characters. The class + * derives from the proper formatter. + * Note the boolean string format-type isn't supported in this class. + * * A typedef C++-type group combining the @ref __formatter_integral with a + * parser: + * * @ref __formatter_integer + * * @ref __formatter_char + * * @ref __formatter_bool + * * Then every C++-type has its own formatter specializations. They inherit + * from the C++-type group typedef. Most specializations need nothing else. + * Others need some additional specializations in this class. + */ +namespace __format_spec { + +/** Wrapper around @ref to_chars, returning the output pointer. */ +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, + _Tp __value, int __base) { + // TODO FMT Evaluate code overhead due to not calling the internal function + // directly. (Should be zero overhead.) + to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __base); + _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small"); + return __r.ptr; +} + +/** + * Helper to determine the buffer size to output a integer in Base @em x. + * + * There are several overloads for the supported bases. The function uses the + * base as template argument so it can be used in a constant expression. + */ +template <unsigned_integral _Tp, size_t _Base> +_LIBCPP_HIDE_FROM_ABI constexpr size_t __buffer_size() noexcept + requires(_Base == 2) { + return numeric_limits<_Tp>::digits // The number of binary digits. + + 2 // Reserve space for the '0[Bb]' prefix. + + 1; // Reserve space for the sign. +} + +template <unsigned_integral _Tp, size_t _Base> +_LIBCPP_HIDE_FROM_ABI constexpr size_t __buffer_size() noexcept + requires(_Base == 8) { + return numeric_limits<_Tp>::digits // The number of binary digits. + / 3 // Adjust to octal. + + 1 // Turn floor to ceil. + + 1 // Reserve space for the '0' prefix. + + 1; // Reserve space for the sign. +} + +template <unsigned_integral _Tp, size_t _Base> +_LIBCPP_HIDE_FROM_ABI constexpr size_t __buffer_size() noexcept + requires(_Base == 10) { + return numeric_limits<_Tp>::digits10 // The floored value. + + 1 // Turn floor to ceil. + + 1; // Reserve space for the sign. +} + +template <unsigned_integral _Tp, size_t _Base> +_LIBCPP_HIDE_FROM_ABI constexpr size_t __buffer_size() noexcept + requires(_Base == 16) { + return numeric_limits<_Tp>::digits // The number of binary digits. + / 4 // Adjust to hexadecimal. + + 2 // Reserve space for the '0[Xx]' prefix. + + 1; // Reserve space for the sign. +} + +/** + * Determines the required grouping based on the size of the input. + * + * The grouping's last element will be repeated. For simplicity this repeating + * is unwrapped based on the length of the input. (When the input is short some + * groups are not processed.) + * + * @returns The size of the groups to write. This means the number of + * separator characters written is size() - 1. + * + * @note Since zero-sized groups cause issues they are silently ignored. + * + * @note The grouping field of the locale is always a @c std::string, + * regardless whether the @c std::numpunct's type is @c char or @c wchar_t. + */ +_LIBCPP_HIDE_FROM_ABI inline string +__determine_grouping(ptrdiff_t __size, const string& __grouping) { + _LIBCPP_ASSERT(!__grouping.empty() && __size > __grouping[0], + "The slow grouping formatting is used while there will be no " + "separators written"); + string __r; + auto __end = __grouping.end() - 1; + auto __ptr = __grouping.begin(); + + while (true) { + __size -= *__ptr; + if (__size > 0) + __r.push_back(*__ptr); + else { + // __size <= 0 so the value pushed will be <= *__ptr. + __r.push_back(*__ptr + __size); + return __r; + } + + // Proceed to the next group. + if (__ptr != __end) { + do { + ++__ptr; + // Skip grouping with a width of 0. + } while (*__ptr == 0 && __ptr != __end); + } + } + + _LIBCPP_UNREACHABLE(); +} + +template <class _Parser> +requires __formatter::__char_type<typename _Parser::char_type> +class _LIBCPP_TEMPLATE_VIS __formatter_integral : public _Parser { +public: + using _CharT = typename _Parser::char_type; + + template <integral _Tp> + _LIBCPP_HIDE_FROM_ABI auto format(_Tp __value, auto& __ctx) + -> decltype(__ctx.out()) { + if (this->__width_needs_substitution()) + this->__substitute_width_arg_id(__ctx.arg(this->__width)); + + if (this->__type == _Flags::_Type::__char) + return __format_as_char(__value, __ctx); + + if constexpr (unsigned_integral<_Tp>) + return __format_unsigned_integral(__value, false, __ctx); + else { + // Depending on the std-format-spec string the sign and the value + // might not be outputted together: + // - alternate form may insert a prefix string. + // - zero-padding may insert additional '0' characters. + // Therefore the value is processed as a positive unsigned value. + // The function @ref __insert_sign will a '-' when the value was negative. + auto __r = __to_unsigned_like(__value); + bool __negative = __value < 0; + if (__negative) + __r = __complement(__r); + + return __format_unsigned_integral(__r, __negative, __ctx); + } + } + +private: + /** Generic formatting for format-type c. */ + _LIBCPP_HIDE_FROM_ABI auto __format_as_char(integral auto __value, + auto& __ctx) + -> decltype(__ctx.out()) { + if (this->__alignment == _Flags::_Alignment::__default) + this->__alignment = _Flags::_Alignment::__right; + + using _Tp = decltype(__value); + if constexpr (!same_as<_CharT, _Tp>) { + // cmp_less and cmp_greater can't be used for character types. + if constexpr (signed_integral<_CharT> == signed_integral<_Tp>) { + if (__value < numeric_limits<_CharT>::min() || + __value > numeric_limits<_CharT>::max()) + __throw_format_error( + "Integral value outside the range of the char type"); + } else if constexpr (signed_integral<_CharT>) { + // _CharT is signed _Tp is unsigned + if (__value > + static_cast<make_unsigned_t<_CharT>>(numeric_limits<_CharT>::max())) + __throw_format_error( + "Integral value outside the range of the char type"); + } else { + // _CharT is unsigned _Tp is signed + if (__value < 0 || static_cast<make_unsigned_t<_Tp>>(__value) > + numeric_limits<_CharT>::max()) + __throw_format_error( + "Integral value outside the range of the char type"); + } + } + + const auto __c = static_cast<_CharT>(__value); + return __write(_VSTD::addressof(__c), _VSTD::addressof(__c) + 1, + __ctx.out()); + } + + /** + * Generic formatting for format-type bBdoxX. + * + * This small wrapper allocates a buffer with the required size. Then calls + * the real formatter with the buffer and the prefix for the base. + */ + _LIBCPP_HIDE_FROM_ABI auto + __format_unsigned_integral(unsigned_integral auto __value, bool __negative, + auto& __ctx) -> decltype(__ctx.out()) { + switch (this->__type) { + case _Flags::_Type::__binary_lower_case: { + array<char, __buffer_size<decltype(__value), 2>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 2, __ctx, "0b"); + } + case _Flags::_Type::__binary_upper_case: { + array<char, __buffer_size<decltype(__value), 2>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 2, __ctx, "0B"); + } + case _Flags::_Type::__octal: { + // Octal is special; if __value == 0 there's no prefix. + array<char, __buffer_size<decltype(__value), 8>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 8, __ctx, + __value != 0 ? "0" : nullptr); + } + case _Flags::_Type::__decimal: { + array<char, __buffer_size<decltype(__value), 10>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 10, __ctx, nullptr); + } + case _Flags::_Type::__hexadecimal_lower_case: { + array<char, __buffer_size<decltype(__value), 16>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 16, __ctx, "0x"); + } + case _Flags::_Type::__hexadecimal_upper_case: { + array<char, __buffer_size<decltype(__value), 16>()> __array; + return __format_unsigned_integral(__array.begin(), __array.end(), __value, + __negative, 16, __ctx, "0X"); + } + default: + _LIBCPP_ASSERT(false, "The parser should have validated the type"); + _LIBCPP_UNREACHABLE(); + } + } + + template <class _Tp> + requires(same_as<char, _Tp> || same_as<wchar_t, _Tp>) _LIBCPP_HIDE_FROM_ABI + auto __write(const _Tp* __first, const _Tp* __last, auto __out_it) + -> decltype(__out_it) { + + unsigned __size = __last - __first; + if (this->__type != _Flags::_Type::__hexadecimal_upper_case) [[likely]] { + if (__size >= this->__width) + return _VSTD::copy(__first, __last, _VSTD::move(__out_it)); + + return __formatter::__write(_VSTD::move(__out_it), __first, __last, + __size, this->__width, this->__fill, + this->__alignment); + } + + // this->__type == _Flags::_Type::__hexadecimal_upper_case + // This means all characters in the range [a-f] need to be changed to their + // uppercase representation. The transformation is done as transformation + // in the output routine instead of before. This avoids another pass over + // the data. + // TODO FMT See whether it's possible to do this transformation during the + // conversion. (This probably requires changing std::to_chars' alphabet.) + if (__size >= this->__width) + return _VSTD::transform(__first, __last, _VSTD::move(__out_it), + __hex_to_upper); + + return __formatter::__write(_VSTD::move(__out_it), __first, __last, __size, + __hex_to_upper, this->__width, this->__fill, + this->__alignment); + } + + _LIBCPP_HIDE_FROM_ABI auto + __format_unsigned_integral(char* __begin, char* __end, + unsigned_integral auto __value, bool __negative, + int __base, auto& __ctx, const char* __prefix) + -> decltype(__ctx.out()) { + char* __first = __insert_sign(__begin, __negative, this->__sign); + if (this->__alternate_form && __prefix) + while (*__prefix) + *__first++ = *__prefix++; + + char* __last = __to_buffer(__first, __end, __value, __base); +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + if (this->__locale_specific_form) { + const auto& __np = use_facet<numpunct<_CharT>>(__ctx.locale()); + string __grouping = __np.grouping(); + ptrdiff_t __size = __last - __first; + // Writing the grouped form has more overhead than the normal output + // routines. If there will be no separators written the locale-specific + // form is identical to the normal routine. Test whether to grouped form + // is required. + if (!__grouping.empty() && __size > __grouping[0]) + return __format_grouping(__ctx.out(), __begin, __first, __last, + __determine_grouping(__size, __grouping), + __np.thousands_sep()); + } +#endif + auto __out_it = __ctx.out(); + if (this->__alignment != _Flags::_Alignment::__default) + __first = __begin; + else { + // __buf contains [sign][prefix]data + // ^ location of __first + // The zero padding is done like: + // - Write [sign][prefix] + // - Write data right aligned with '0' as fill character. + __out_it = _VSTD::copy(__begin, __first, _VSTD::move(__out_it)); + this->__alignment = _Flags::_Alignment::__right; + this->__fill = _CharT('0'); + uint32_t __size = __first - __begin; + this->__width -= _VSTD::min(__size, this->__width); + } + + return __write(__first, __last, _VSTD::move(__out_it)); + } + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION + /** Format's the locale-specific form's groupings. */ + template <class _OutIt, class _CharT> + _LIBCPP_HIDE_FROM_ABI _OutIt + __format_grouping(_OutIt __out_it, const char* __begin, const char* __first, + const char* __last, string&& __grouping, _CharT __sep) { + + // TODO FMT This function duplicates some functionality of the normal + // output routines. Evaluate whether these parts can be efficiently + // combined with the existing routines. + + unsigned __size = (__first - __begin) + // [sign][prefix] + (__last - __first) + // data + (__grouping.size() - 1); // number of separator characters + + __formatter::__padding_size_result __padding = {0, 0}; + if (this->__alignment == _Flags::_Alignment::__default) { + // Write [sign][prefix]. + __out_it = _VSTD::copy(__begin, __first, _VSTD::move(__out_it)); + + if (this->__width > __size) { + // Write zero padding. + __padding.__before = this->__width - __size; + __out_it = _VSTD::fill_n(_VSTD::move(__out_it), this->__width - __size, + _CharT('0')); + } + } else { + if (this->__width > __size) { + // Determine padding and write padding. + __padding = __formatter::__padding_size(__size, this->__width, + this->__alignment); + + __out_it = _VSTD::fill_n(_VSTD::move(__out_it), __padding.__before, + this->__fill); + } + // Write [sign][prefix]. + __out_it = _VSTD::copy(__begin, __first, _VSTD::move(__out_it)); + } + + auto __r = __grouping.rbegin(); + auto __e = __grouping.rend() - 1; + _LIBCPP_ASSERT(__r != __e, "The slow grouping formatting is used while " + "there will be no separators written."); + // The output is divided in small groups of numbers to write: + // - A group before the first separator. + // - A separator and a group, repeated for the number of separators. + // - A group after the last separator. + // This loop achieves that process by testing the termination condition + // midway in the loop. + // + // TODO FMT This loop evaluates the loop invariant `this->__type != + // _Flags::_Type::__hexadecimal_upper_case` for every iteration. (This test + // happens in the __write call.) Benchmark whether making two loops and + // hoisting the invariant is worth the effort. + while (true) { + if (this->__type == _Flags::_Type::__hexadecimal_upper_case) { + __last = __first + *__r; + __out_it = _VSTD::transform(__first, __last, _VSTD::move(__out_it), + __hex_to_upper); + __first = __last; + } else { + __out_it = _VSTD::copy_n(__first, *__r, _VSTD::move(__out_it)); + __first += *__r; + } + + if (__r == __e) + break; + + ++__r; + *__out_it++ = __sep; + } + + return _VSTD::fill_n(_VSTD::move(__out_it), __padding.__after, + this->__fill); + } +#endif // _LIBCPP_HAS_NO_LOCALIZATION +}; + +} // namespace __format_spec + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_string.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_string.h new file mode 100644 index 0000000..2be36a1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/formatter_string.h
@@ -0,0 +1,163 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_FORMATTER_STRING_H +#define _LIBCPP___FORMAT_FORMATTER_STRING_H + +#include <__config> +#include <__format/format_error.h> +#include <__format/format_fwd.h> +#include <__format/format_string.h> +#include <__format/formatter.h> +#include <__format/parser_std_format_spec.h> +#include <algorithm> +#include <string_view> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format_spec { + +template <__formatter::__char_type _CharT> +class _LIBCPP_TEMPLATE_VIS __formatter_string : public __parser_string<_CharT> { +public: + _LIBCPP_HIDE_FROM_ABI auto format(basic_string_view<_CharT> __str, + auto& __ctx) -> decltype(__ctx.out()) { + + _LIBCPP_ASSERT(this->__alignment != _Flags::_Alignment::__default, + "The parser should not use these defaults"); + + if (this->__width_needs_substitution()) + this->__substitute_width_arg_id(__ctx.arg(this->__width)); + + if (this->__precision_needs_substitution()) + this->__substitute_precision_arg_id(__ctx.arg(this->__precision)); + + return __formatter::__write_unicode( + __ctx.out(), __str, this->__width, + this->__has_precision_field() ? this->__precision : -1, this->__fill, + this->__alignment); + } +}; + +} //namespace __format_spec + +// [format.formatter.spec]/2.2 For each charT, the string type specializations + +// Formatter const char*. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<const _CharT*, _CharT> + : public __format_spec::__formatter_string<_CharT> { + using _Base = __format_spec::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(const _CharT* __str, auto& __ctx) + -> decltype(__ctx.out()) { + _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have " + "prevented an invalid pointer."); + + // When using a center or right alignment and the width option the length + // of __str must be known to add the padding upfront. This case is handled + // by the base class by converting the argument to a basic_string_view. + // + // When using left alignment and the width option the padding is added + // after outputting __str so the length can be determined while outputting + // __str. The same holds true for the precision, during outputting __str it + // can be validated whether the precision threshold has been reached. For + // now these optimizations aren't implemented. Instead the base class + // handles these options. + // TODO FMT Implement these improvements. + if (this->__has_width_field() || this->__has_precision_field()) + return _Base::format(__str, __ctx); + + // No formatting required, copy the string to the output. + auto __out_it = __ctx.out(); + while (*__str) + *__out_it++ = *__str++; + return __out_it; + } +}; + +// Formatter char*. +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<_CharT*, _CharT> : public formatter<const _CharT*, _CharT> { + using _Base = formatter<const _CharT*, _CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(_CharT* __str, auto& __ctx) + -> decltype(__ctx.out()) { + return _Base::format(__str, __ctx); + } +}; + +// Formatter const char[]. +template <class _CharT, size_t _Size> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<const _CharT[_Size], _CharT> + : public __format_spec::__formatter_string<_CharT> { + using _Base = __format_spec::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto format(const _CharT __str[_Size], auto& __ctx) + -> decltype(__ctx.out()) { + return _Base::format(basic_string_view<_CharT>(__str, _Size), __ctx); + } +}; + +// Formatter std::string. +template <class _CharT, class _Traits, class _Allocator> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT + formatter<basic_string<_CharT, _Traits, _Allocator>, _CharT> + : public __format_spec::__formatter_string<_CharT> { + using _Base = __format_spec::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto + format(const basic_string<_CharT, _Traits, _Allocator>& __str, auto& __ctx) + -> decltype(__ctx.out()) { + // drop _Traits and _Allocator + return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx); + } +}; + +// Formatter std::string_view. +template <class _CharT, class _Traits> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT formatter<basic_string_view<_CharT, _Traits>, _CharT> + : public __format_spec::__formatter_string<_CharT> { + using _Base = __format_spec::__formatter_string<_CharT>; + + _LIBCPP_HIDE_FROM_ABI auto + format(basic_string_view<_CharT, _Traits> __str, auto& __ctx) + -> decltype(__ctx.out()) { + // drop _Traits + return _Base::format(basic_string_view<_CharT>(__str.data(), __str.size()), __ctx); + } +}; + +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_FORMATTER_STRING_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/parser_std_format_spec.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/parser_std_format_spec.h new file mode 100644 index 0000000..9b713b8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__format/parser_std_format_spec.h
@@ -0,0 +1,1184 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H +#define _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H + +#include <__algorithm/find_if.h> +#include <__algorithm/min.h> +#include <__config> +#include <__debug> +#include <__format/format_arg.h> +#include <__format/format_error.h> +#include <__format/format_string.h> +#include <__variant/monostate.h> +#include <bit> +#include <concepts> +#include <cstdint> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +// TODO FMT Remove this once we require compilers with proper C++20 support. +// If the compiler has no concepts support, the format header will be disabled. +// Without concepts support enable_if needs to be used and that too much effort +// to support compilers with partial C++20 support. +# if !defined(_LIBCPP_HAS_NO_CONCEPTS) + +namespace __format_spec { + +/** + * Contains the flags for the std-format-spec. + * + * Some format-options can only be used for specific C++types and may depend on + * the selected format-type. + * * The C++type filtering can be done using the proper policies for + * @ref __parser_std. + * * The format-type filtering needs to be done post parsing in the parser + * derived from @ref __parser_std. + */ +class _LIBCPP_TYPE_VIS _Flags { +public: + enum class _LIBCPP_ENUM_VIS _Alignment : uint8_t { + /** + * No alignment is set in the format string. + * + * Zero-padding is ignored when an alignment is selected. + * The default alignment depends on the selected format-type. + */ + __default, + __left, + __center, + __right + }; + enum class _LIBCPP_ENUM_VIS _Sign : uint8_t { + /** + * No sign is set in the format string. + * + * The sign isn't allowed for certain format-types. By using this value + * it's possible to detect whether or not the user explicitly set the sign + * flag. For formatting purposes it behaves the same as @ref __minus. + */ + __default, + __minus, + __plus, + __space + }; + + _Alignment __alignment : 2 {_Alignment::__default}; + _Sign __sign : 2 {_Sign::__default}; + uint8_t __alternate_form : 1 {false}; + uint8_t __zero_padding : 1 {false}; + uint8_t __locale_specific_form : 1 {false}; + + enum class _LIBCPP_ENUM_VIS _Type : uint8_t { + __default, + __string, + __binary_lower_case, + __binary_upper_case, + __octal, + __decimal, + __hexadecimal_lower_case, + __hexadecimal_upper_case, + __pointer, + __char, + __float_hexadecimal_lower_case, + __float_hexadecimal_upper_case, + __scientific_lower_case, + __scientific_upper_case, + __fixed_lower_case, + __fixed_upper_case, + __general_lower_case, + __general_upper_case + }; + + _Type __type{_Type::__default}; +}; + +namespace __detail { +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr bool +__parse_alignment(_CharT __c, _Flags& __flags) noexcept { + switch (__c) { + case _CharT('<'): + __flags.__alignment = _Flags::_Alignment::__left; + return true; + + case _CharT('^'): + __flags.__alignment = _Flags::_Alignment::__center; + return true; + + case _CharT('>'): + __flags.__alignment = _Flags::_Alignment::__right; + return true; + } + return false; +} +} // namespace __detail + +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_fill_align { +public: + // TODO FMT The standard doesn't specify this character is a Unicode + // character. Validate what fmt and MSVC have implemented. + _CharT __fill{_CharT(' ')}; + +protected: + _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* + __parse(const _CharT* __begin, const _CharT* __end, _Flags& __flags) { + _LIBCPP_ASSERT(__begin != __end, + "When called with an empty input the function will cause " + "undefined behavior by evaluating data not in the input"); + if (__begin + 1 != __end) { + if (__detail::__parse_alignment(*(__begin + 1), __flags)) { + if (*__begin == _CharT('{') || *__begin == _CharT('}')) + __throw_format_error( + "The format-spec fill field contains an invalid character"); + __fill = *__begin; + return __begin + 2; + } + } + + if (__detail::__parse_alignment(*__begin, __flags)) + return __begin + 1; + + return __begin; + } +}; + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__parse_sign(const _CharT* __begin, _Flags& __flags) noexcept { + switch (*__begin) { + case _CharT('-'): + __flags.__sign = _Flags::_Sign::__minus; + break; + case _CharT('+'): + __flags.__sign = _Flags::_Sign::__plus; + break; + case _CharT(' '): + __flags.__sign = _Flags::_Sign::__space; + break; + default: + return __begin; + } + return __begin + 1; +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__parse_alternate_form(const _CharT* __begin, _Flags& __flags) noexcept { + if (*__begin == _CharT('#')) { + __flags.__alternate_form = true; + ++__begin; + } + + return __begin; +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__parse_zero_padding(const _CharT* __begin, _Flags& __flags) noexcept { + if (*__begin == _CharT('0')) { + __flags.__zero_padding = true; + ++__begin; + } + + return __begin; +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __format::__parse_number_result< _CharT> +__parse_arg_id(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { + // This function is a wrapper to call the real parser. But it does the + // validation for the pre-conditions and post-conditions. + if (__begin == __end) + __throw_format_error("End of input while parsing format-spec arg-id"); + + __format::__parse_number_result __r = + __format::__parse_arg_id(__begin, __end, __parse_ctx); + + if (__r.__ptr == __end || *__r.__ptr != _CharT('}')) + __throw_format_error("A format-spec arg-id should terminate at a '}'"); + + ++__r.__ptr; + return __r; +} + +template <class _Context> +_LIBCPP_HIDE_FROM_ABI constexpr uint32_t +__substitute_arg_id(basic_format_arg<_Context> __arg) { + return visit_format_arg( + [](auto __arg) -> uint32_t { + using _Type = decltype(__arg); + if constexpr (integral<_Type>) { + if constexpr (signed_integral<_Type>) { + if (__arg < 0) + __throw_format_error("A format-spec arg-id replacement shouldn't " + "have a negative value"); + } + + using _CT = common_type_t<_Type, decltype(__format::__number_max)>; + if (static_cast<_CT>(__arg) > + static_cast<_CT>(__format::__number_max)) + __throw_format_error("A format-spec arg-id replacement exceeds " + "the maximum supported value"); + + return __arg; + } else if constexpr (same_as<_Type, monostate>) + __throw_format_error("Argument index out of bounds"); + else + __throw_format_error("A format-spec arg-id replacement argument " + "isn't an integral type"); + }, + __arg); +} + +class _LIBCPP_TYPE_VIS __parser_width { +public: + /** Contains a width or an arg-id. */ + uint32_t __width : 31 {0}; + /** Determines whether the value stored is a width or an arg-id. */ + uint32_t __width_as_arg : 1 {0}; + +protected: + /** + * Does the supplied std-format-spec contain a width field? + * + * When the field isn't present there's no padding required. This can be used + * to optimize the formatting. + */ + constexpr bool __has_width_field() const noexcept { + return __width_as_arg || __width; + } + + /** + * Does the supplied width field contain an arg-id? + * + * If @c true the formatter needs to call @ref __substitute_width_arg_id. + */ + constexpr bool __width_needs_substitution() const noexcept { + return __width_as_arg; + } + + template <class _CharT> + _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* + __parse(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { + if (*__begin == _CharT('0')) + __throw_format_error( + "A format-spec width field shouldn't have a leading zero"); + + if (*__begin == _CharT('{')) { + __format::__parse_number_result __r = + __parse_arg_id(++__begin, __end, __parse_ctx); + __width = __r.__value; + __width_as_arg = 1; + return __r.__ptr; + } + + if (*__begin < _CharT('0') || *__begin > _CharT('9')) + return __begin; + + __format::__parse_number_result __r = + __format::__parse_number(__begin, __end); + __width = __r.__value; + _LIBCPP_ASSERT(__width != 0, + "A zero value isn't allowed and should be impossible, " + "due to validations in this function"); + return __r.__ptr; + } + + _LIBCPP_HIDE_FROM_ABI constexpr void __substitute_width_arg_id(auto __arg) { + _LIBCPP_ASSERT(__width_as_arg == 1, + "Substitute width called when no substitution is required"); + + // The clearing of the flag isn't required but looks better when debugging + // the code. + __width_as_arg = 0; + __width = __substitute_arg_id(__arg); + if (__width == 0) + __throw_format_error( + "A format-spec width field replacement should have a positive value"); + } +}; + +class _LIBCPP_TYPE_VIS __parser_precision { +public: + /** Contains a precision or an arg-id. */ + uint32_t __precision : 31 {__format::__number_max}; + /** + * Determines whether the value stored is a precision or an arg-id. + * + * @note Since @ref __precision == @ref __format::__number_max is a valid + * value, the default value contains an arg-id of INT32_MAX. (This number of + * arguments isn't supported by compilers.) This is used to detect whether + * the std-format-spec contains a precision field. + */ + uint32_t __precision_as_arg : 1 {1}; + +protected: + /** + * Does the supplied std-format-spec contain a precision field? + * + * When the field isn't present there's no truncating required. This can be + * used to optimize the formatting. + */ + constexpr bool __has_precision_field() const noexcept { + + return __precision_as_arg == 0 || // Contains a value? + __precision != __format::__number_max; // The arg-id is valid? + } + + /** + * Does the supplied precision field contain an arg-id? + * + * If @c true the formatter needs to call @ref __substitute_precision_arg_id. + */ + constexpr bool __precision_needs_substitution() const noexcept { + return __precision_as_arg && __precision != __format::__number_max; + } + + template <class _CharT> + _LIBCPP_HIDE_FROM_ABI constexpr const _CharT* + __parse(const _CharT* __begin, const _CharT* __end, auto& __parse_ctx) { + if (*__begin != _CharT('.')) + return __begin; + + ++__begin; + if (__begin == __end) + __throw_format_error("End of input while parsing format-spec precision"); + + if (*__begin == _CharT('0')) { + ++__begin; + if (__begin != __end && *__begin >= '0' && *__begin <= '9') + __throw_format_error( + "A format-spec precision field shouldn't have a leading zero"); + + __precision = 0; + __precision_as_arg = 0; + return __begin; + } + + if (*__begin == _CharT('{')) { + __format::__parse_number_result __arg_id = + __parse_arg_id(++__begin, __end, __parse_ctx); + _LIBCPP_ASSERT(__arg_id.__value != __format::__number_max, + "Unsupported number of arguments, since this number of " + "arguments is used a special value"); + __precision = __arg_id.__value; + return __arg_id.__ptr; + } + + if (*__begin < _CharT('0') || *__begin > _CharT('9')) + __throw_format_error( + "The format-spec precision field doesn't contain a value or arg-id"); + + __format::__parse_number_result __r = + __format::__parse_number(__begin, __end); + __precision = __r.__value; + __precision_as_arg = 0; + return __r.__ptr; + } + + _LIBCPP_HIDE_FROM_ABI constexpr void __substitute_precision_arg_id( + auto __arg) { + _LIBCPP_ASSERT( + __precision_as_arg == 1 && __precision != __format::__number_max, + "Substitute precision called when no substitution is required"); + + // The clearing of the flag isn't required but looks better when debugging + // the code. + __precision_as_arg = 0; + __precision = __substitute_arg_id(__arg); + } +}; + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__parse_locale_specific_form(const _CharT* __begin, _Flags& __flags) noexcept { + if (*__begin == _CharT('L')) { + __flags.__locale_specific_form = true; + ++__begin; + } + + return __begin; +} + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__parse_type(const _CharT* __begin, _Flags& __flags) { + + // Determines the type. It does not validate whether the selected type is + // valid. Most formatters have optional fields that are only allowed for + // certain types. These parsers need to do validation after the type has + // been parsed. So its easier to implement the validation for all types in + // the specific parse function. + switch (*__begin) { + case 'A': + __flags.__type = _Flags::_Type::__float_hexadecimal_upper_case; + break; + case 'B': + __flags.__type = _Flags::_Type::__binary_upper_case; + break; + case 'E': + __flags.__type = _Flags::_Type::__scientific_upper_case; + break; + case 'F': + __flags.__type = _Flags::_Type::__fixed_upper_case; + break; + case 'G': + __flags.__type = _Flags::_Type::__general_upper_case; + break; + case 'X': + __flags.__type = _Flags::_Type::__hexadecimal_upper_case; + break; + case 'a': + __flags.__type = _Flags::_Type::__float_hexadecimal_lower_case; + break; + case 'b': + __flags.__type = _Flags::_Type::__binary_lower_case; + break; + case 'c': + __flags.__type = _Flags::_Type::__char; + break; + case 'd': + __flags.__type = _Flags::_Type::__decimal; + break; + case 'e': + __flags.__type = _Flags::_Type::__scientific_lower_case; + break; + case 'f': + __flags.__type = _Flags::_Type::__fixed_lower_case; + break; + case 'g': + __flags.__type = _Flags::_Type::__general_lower_case; + break; + case 'o': + __flags.__type = _Flags::_Type::__octal; + break; + case 'p': + __flags.__type = _Flags::_Type::__pointer; + break; + case 's': + __flags.__type = _Flags::_Type::__string; + break; + case 'x': + __flags.__type = _Flags::_Type::__hexadecimal_lower_case; + break; + default: + return __begin; + } + return ++__begin; +} + +/** + * The parser for the std-format-spec. + * + * [format.string.std]/1 specifies the std-format-spec: + * fill-and-align sign # 0 width precision L type + * + * All these fields are optional. Whether these fields can be used depend on: + * - The type supplied to the format string. + * E.g. A string never uses the sign field so the field may not be set. + * This constrain is validated by the parsers in this file. + * - The supplied value for the optional type field. + * E.g. A int formatted as decimal uses the sign field. + * When formatted as a char the sign field may no longer be set. + * This constrain isn't validated by the parsers in this file. + * + * The base classes are ordered to minimize the amount of padding. + * + * This implements the parser for the string types. + */ +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_string + : public __parser_width, // provides __width(|as_arg) + public __parser_precision, // provides __precision(|as_arg) + public __parser_fill_align<_CharT>, // provides __fill and uses __flags + public _Flags // provides __flags +{ +public: + using char_type = _CharT; + + _LIBCPP_HIDE_FROM_ABI constexpr __parser_string() { + this->__alignment = _Flags::_Alignment::__left; + } + + /** + * The low-level std-format-spec parse function. + * + * @pre __begin points at the beginning of the std-format-spec. This means + * directly after the ':'. + * @pre The std-format-spec parses the entire input, or the first unmatched + * character is a '}'. + * + * @returns The iterator pointing at the last parsed character. + */ + _LIBCPP_HIDE_FROM_ABI constexpr auto parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + auto __it = __parse(__parse_ctx); + __process_display_type(); + return __it; + } + +private: + /** + * Parses the std-format-spec. + * + * @throws __throw_format_error When @a __parse_ctx contains an ill-formed + * std-format-spec. + * + * @returns An iterator to the end of input or point at the closing '}'. + */ + _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + + auto __begin = __parse_ctx.begin(); + auto __end = __parse_ctx.end(); + if (__begin == __end) + return __begin; + + __begin = __parser_fill_align<_CharT>::__parse(__begin, __end, + static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parser_width::__parse(__begin, __end, __parse_ctx); + if (__begin == __end) + return __begin; + + __begin = __parser_precision::__parse(__begin, __end, __parse_ctx); + if (__begin == __end) + return __begin; + + __begin = __parse_type(__begin, static_cast<_Flags&>(*this)); + + if (__begin != __end && *__begin != _CharT('}')) + __throw_format_error( + "The format-spec should consume the input or end with a '}'"); + + return __begin; + } + + /** Processes the parsed std-format-spec based on the parsed display type. */ + _LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type() { + switch (this->__type) { + case _Flags::_Type::__default: + case _Flags::_Type::__string: + break; + + default: + __throw_format_error("The format-spec type has a type not supported for " + "a string argument"); + } + } +}; + +/** + * The parser for the std-format-spec. + * + * This implements the parser for the integral types. This includes the + * character type and boolean type. + * + * See @ref __parser_string. + */ +template <class _CharT> +class _LIBCPP_TEMPLATE_VIS __parser_integral + : public __parser_width, // provides __width(|as_arg) + public __parser_fill_align<_CharT>, // provides __fill and uses __flags + public _Flags // provides __flags +{ +public: + using char_type = _CharT; + +protected: + /** + * The low-level std-format-spec parse function. + * + * @pre __begin points at the beginning of the std-format-spec. This means + * directly after the ':'. + * @pre The std-format-spec parses the entire input, or the first unmatched + * character is a '}'. + * + * @returns The iterator pointing at the last parsed character. + */ + _LIBCPP_HIDE_FROM_ABI constexpr auto __parse(auto& __parse_ctx) + -> decltype(__parse_ctx.begin()) { + auto __begin = __parse_ctx.begin(); + auto __end = __parse_ctx.end(); + if (__begin == __end) + return __begin; + + __begin = __parser_fill_align<_CharT>::__parse(__begin, __end, + static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parse_sign(__begin, static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parse_alternate_form(__begin, static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parse_zero_padding(__begin, static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parser_width::__parse(__begin, __end, __parse_ctx); + if (__begin == __end) + return __begin; + + __begin = + __parse_locale_specific_form(__begin, static_cast<_Flags&>(*this)); + if (__begin == __end) + return __begin; + + __begin = __parse_type(__begin, static_cast<_Flags&>(*this)); + + if (__begin != __end && *__begin != _CharT('}')) + __throw_format_error( + "The format-spec should consume the input or end with a '}'"); + + return __begin; + } + + /** + * Handles the post-parsing updates for the integer types. + * + * Updates the zero-padding and alignment for integer types. + * + * [format.string.std]/13 + * If the 0 character and an align option both appear, the 0 character is + * ignored. + * + * For the formatter a @ref __default alignment means zero-padding. Update + * the alignment based on parsed format string. + */ + _LIBCPP_HIDE_FROM_ABI constexpr void __handle_integer() noexcept { + this->__zero_padding &= this->__alignment == _Flags::_Alignment::__default; + if (!this->__zero_padding && + this->__alignment == _Flags::_Alignment::__default) + this->__alignment = _Flags::_Alignment::__right; + } + + /** + * Handles the post-parsing updates for the character types. + * + * Sets the alignment and validates the format flags set for a character type. + * + * At the moment the validation for a character and a Boolean behave the + * same, but this may change in the future. + * Specifically at the moment the locale-specific form is allowed for the + * char output type, but it has no effect on the output. + */ + _LIBCPP_HIDE_FROM_ABI constexpr void __handle_char() { __handle_bool(); } + + /** + * Handles the post-parsing updates for the Boolean types. + * + * Sets the alignment and validates the format flags set for a Boolean type. + */ + _LIBCPP_HIDE_FROM_ABI constexpr void __handle_bool() { + if (this->__sign != _Flags::_Sign::__default) + __throw_format_error("A sign field isn't allowed in this format-spec"); + + if (this->__alternate_form) + __throw_format_error( + "An alternate form field isn't allowed in this format-spec"); + + if (this->__zero_padding) + __throw_format_error( + "A zero-padding field isn't allowed in this format-spec"); + + if (this->__alignment == _Flags::_Alignment::__default) + this->__alignment = _Flags::_Alignment::__left; + } +}; + +// TODO FMT Add a parser for floating-point values. +// TODO FMT Add a parser for pointer values. + +/** Helper struct returned from @ref __get_string_alignment. */ +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __string_alignment { + /** Points beyond the last character to write to the output. */ + const _CharT* __last; + /** + * The estimated number of columns in the output or 0. + * + * Only when the output needs to be aligned it's required to know the exact + * number of columns in the output. So if the formatted output has only a + * minimum width the exact size isn't important. It's only important to know + * the minimum has been reached. The minimum width is the width specified in + * the format-spec. + * + * For example in this code @code std::format("{:10}", MyString); @endcode + * the width estimation can stop once the algorithm has determined the output + * width is 10 columns. + * + * So if: + * * @ref __align == @c true the @ref __size is the estimated number of + * columns required. + * * @ref __align == @c false the @ref __size is the estimated number of + * columns required or 0 when the estimation algorithm stopped prematurely. + */ + ptrdiff_t __size; + /** + * Does the output need to be aligned. + * + * When alignment is needed the output algorithm needs to add the proper + * padding. Else the output algorithm just needs to copy the input up to + * @ref __last. + */ + bool __align; +}; + +#ifndef _LIBCPP_HAS_NO_UNICODE +namespace __detail { + +/** + * Unicode column width estimates. + * + * Unicode can be stored in several formats: UTF-8, UTF-16, and UTF-32. + * Depending on format the relation between the number of code units stored and + * the number of output columns differs. The first relation is the number of + * code units forming a code point. (The text assumes the code units are + * unsigned.) + * - UTF-8 The number of code units is between one and four. The first 127 + * Unicode code points match the ASCII character set. When the highest bit is + * set it means the code point has more than one code unit. + * - UTF-16: The number of code units is between 1 and 2. When the first + * code unit is in the range [0xd800,0xdfff) it means the code point uses two + * code units. + * - UTF-32: The number of code units is always one. + * + * The code point to the number of columns isn't well defined. The code uses the + * estimations defined in [format.string.std]/11. This list might change in the + * future. + * + * The algorithm of @ref __get_string_alignment uses two different scanners: + * - The simple scanner @ref __estimate_column_width_fast. This scanner assumes + * 1 code unit is 1 column. This scanner stops when it can't be sure the + * assumption is valid: + * - UTF-8 when the code point is encoded in more than 1 code unit. + * - UTF-16 and UTF-32 when the first multi-column code point is encountered. + * (The code unit's value is lower than 0xd800 so the 2 code unit encoding + * is irrelevant for this scanner.) + * Due to these assumptions the scanner is faster than the full scanner. It + * can process all text only containing ASCII. For UTF-16/32 it can process + * most (all?) European languages. (Note the set it can process might be + * reduced in the future, due to updates in the scanning rules.) + * - The full scanner @ref __estimate_column_width. This scanner, if needed, + * converts multiple code units into one code point then converts the code + * point to a column width. + * + * See also: + * - [format.string.general]/11 + * - https://en.wikipedia.org/wiki/UTF-8#Encoding + * - https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF + */ + +/** + * The first 2 column code point. + * + * This is the point where the fast UTF-16/32 scanner needs to stop processing. + */ +inline constexpr uint32_t __two_column_code_point = 0x1100; + +/** Helper concept for an UTF-8 character type. */ +template <class _CharT> +concept __utf8_character = same_as<_CharT, char> || same_as<_CharT, char8_t>; + +/** Helper concept for an UTF-16 character type. */ +template <class _CharT> +concept __utf16_character = (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2) || same_as<_CharT, char16_t>; + +/** Helper concept for an UTF-32 character type. */ +template <class _CharT> +concept __utf32_character = (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4) || same_as<_CharT, char32_t>; + +/** Helper concept for an UTF-16 or UTF-32 character type. */ +template <class _CharT> +concept __utf16_or_32_character = __utf16_character<_CharT> || __utf32_character<_CharT>; + +/** + * Converts a code point to the column width. + * + * The estimations are conforming to [format.string.general]/11 + * + * This version expects a value less than 0x1'0000, which is a 3-byte UTF-8 + * character. + */ +_LIBCPP_HIDE_FROM_ABI inline constexpr int __column_width_3(uint32_t __c) noexcept { + _LIBCPP_ASSERT(__c < 0x1'0000, + "Use __column_width_4 or __column_width for larger values"); + + // clang-format off + return 1 + (__c >= 0x1100 && (__c <= 0x115f || + (__c >= 0x2329 && (__c <= 0x232a || + (__c >= 0x2e80 && (__c <= 0x303e || + (__c >= 0x3040 && (__c <= 0xa4cf || + (__c >= 0xac00 && (__c <= 0xd7a3 || + (__c >= 0xf900 && (__c <= 0xfaff || + (__c >= 0xfe10 && (__c <= 0xfe19 || + (__c >= 0xfe30 && (__c <= 0xfe6f || + (__c >= 0xff00 && (__c <= 0xff60 || + (__c >= 0xffe0 && (__c <= 0xffe6 + )))))))))))))))))))); + // clang-format on +} + +/** + * @overload + * + * This version expects a value greater than or equal to 0x1'0000, which is a + * 4-byte UTF-8 character. + */ +_LIBCPP_HIDE_FROM_ABI inline constexpr int __column_width_4(uint32_t __c) noexcept { + _LIBCPP_ASSERT(__c >= 0x1'0000, + "Use __column_width_3 or __column_width for smaller values"); + + // clang-format off + return 1 + (__c >= 0x1'f300 && (__c <= 0x1'f64f || + (__c >= 0x1'f900 && (__c <= 0x1'f9ff || + (__c >= 0x2'0000 && (__c <= 0x2'fffd || + (__c >= 0x3'0000 && (__c <= 0x3'fffd + )))))))); + // clang-format on +} + +/** + * @overload + * + * The general case, accepting all values. + */ +_LIBCPP_HIDE_FROM_ABI inline constexpr int __column_width(uint32_t __c) noexcept { + if (__c < 0x1'0000) + return __column_width_3(__c); + + return __column_width_4(__c); +} + +/** + * Estimate the column width for the UTF-8 sequence using the fast algorithm. + */ +template <__utf8_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__estimate_column_width_fast(const _CharT* __first, + const _CharT* __last) noexcept { + return _VSTD::find_if(__first, __last, + [](unsigned char __c) { return __c & 0x80; }); +} + +/** + * @overload + * + * The implementation for UTF-16/32. + */ +template <__utf16_or_32_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr const _CharT* +__estimate_column_width_fast(const _CharT* __first, + const _CharT* __last) noexcept { + return _VSTD::find_if(__first, __last, + [](uint32_t __c) { return __c >= 0x1100; }); +} + +template <class _CharT> +struct _LIBCPP_TEMPLATE_VIS __column_width_result { + /** The number of output columns. */ + size_t __width; + /** + * The last parsed element. + * + * This limits the original output to fit in the wanted number of columns. + */ + const _CharT* __ptr; +}; + +/** + * Small helper to determine the width of malformed Unicode. + * + * @note This function's only needed for UTF-8. During scanning UTF-8 there + * are multiple place where it can be detected that the Unicode is malformed. + * UTF-16 only requires 1 test and UTF-32 requires no testing. + */ +template <__utf8_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> +__estimate_column_width_malformed(const _CharT* __first, const _CharT* __last, + size_t __maximum, size_t __result) noexcept { + size_t __size = __last - __first; + size_t __n = _VSTD::min(__size, __maximum); + return {__result + __n, __first + __n}; +} + +/** + * Determines the number of output columns needed to render the input. + * + * @note When the scanner encounters malformed Unicode it acts as-if every code + * unit at the end of the input is one output column. It's expected the output + * terminal will replace these malformed code units with a one column + * replacement characters. + * + * @param __first Points to the first element of the input range. + * @param __last Points beyond the last element of the input range. + * @param __maximum The maximum number of output columns. The returned number + * of estimated output columns will not exceed this value. + */ +template <__utf8_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> +__estimate_column_width(const _CharT* __first, const _CharT* __last, + size_t __maximum) noexcept { + size_t __result = 0; + + while (__first != __last) { + // Based on the number of leading 1 bits the number of code units in the + // code point can be determined. See + // https://en.wikipedia.org/wiki/UTF-8#Encoding + switch (_VSTD::countl_one(static_cast<unsigned char>(*__first))) { + case 0: // 1-code unit encoding: all 1 column + ++__result; + ++__first; + break; + + case 2: // 2-code unit encoding: all 1 column + // Malformed Unicode. + if (__last - __first < 2) [[unlikely]] + return __estimate_column_width_malformed(__first, __last, __maximum, + __result); + __first += 2; + ++__result; + break; + + case 3: // 3-code unit encoding: either 1 or 2 columns + // Malformed Unicode. + if (__last - __first < 3) [[unlikely]] + return __estimate_column_width_malformed(__first, __last, __maximum, + __result); + { + uint32_t __c = static_cast<unsigned char>(*__first++) & 0x0f; + __c <<= 6; + __c |= static_cast<unsigned char>(*__first++) & 0x3f; + __c <<= 6; + __c |= static_cast<unsigned char>(*__first++) & 0x3f; + __result += __column_width_3(__c); + if (__result > __maximum) + return {__result - 2, __first - 3}; + } + break; + case 4: // 4-code unit encoding: either 1 or 2 columns + // Malformed Unicode. + if (__last - __first < 4) [[unlikely]] + return __estimate_column_width_malformed(__first, __last, __maximum, + __result); + { + uint32_t __c = static_cast<unsigned char>(*__first++) & 0x07; + __c <<= 6; + __c |= static_cast<unsigned char>(*__first++) & 0x3f; + __c <<= 6; + __c |= static_cast<unsigned char>(*__first++) & 0x3f; + __c <<= 6; + __c |= static_cast<unsigned char>(*__first++) & 0x3f; + __result += __column_width_4(__c); + if (__result > __maximum) + return {__result - 2, __first - 4}; + } + break; + default: + // Malformed Unicode. + return __estimate_column_width_malformed(__first, __last, __maximum, + __result); + } + + if (__result >= __maximum) + return {__result, __first}; + } + return {__result, __first}; +} + +template <__utf16_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> +__estimate_column_width(const _CharT* __first, const _CharT* __last, + size_t __maximum) noexcept { + size_t __result = 0; + + while (__first != __last) { + uint32_t __c = *__first; + // Is the code unit part of a surrogate pair? See + // https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF + if (__c >= 0xd800 && __c <= 0xDfff) { + // Malformed Unicode. + if (__last - __first < 2) [[unlikely]] + return {__result + 1, __first + 1}; + + __c -= 0xd800; + __c <<= 10; + __c += (*(__first + 1) - 0xdc00); + __c += 0x10'000; + + __result += __column_width_4(__c); + if (__result > __maximum) + return {__result - 2, __first}; + __first += 2; + } else { + __result += __column_width_3(__c); + if (__result > __maximum) + return {__result - 2, __first}; + ++__first; + } + + if (__result >= __maximum) + return {__result, __first}; + } + + return {__result, __first}; +} + +template <__utf32_character _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __column_width_result<_CharT> +__estimate_column_width(const _CharT* __first, const _CharT* __last, + size_t __maximum) noexcept { + size_t __result = 0; + + while (__first != __last) { + wchar_t __c = *__first; + __result += __column_width(__c); + + if (__result > __maximum) + return {__result - 2, __first}; + + ++__first; + if (__result >= __maximum) + return {__result, __first}; + } + + return {__result, __first}; +} + +} // namespace __detail + +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __string_alignment<_CharT> +__get_string_alignment(const _CharT* __first, const _CharT* __last, + ptrdiff_t __width, ptrdiff_t __precision) noexcept { + _LIBCPP_ASSERT(__width != 0 || __precision != -1, + "The function has no effect and shouldn't be used"); + + // TODO FMT There might be more optimizations possible: + // If __precision == __format::__number_max and the encoding is: + // * UTF-8 : 4 * (__last - __first) >= __width + // * UTF-16 : 2 * (__last - __first) >= __width + // * UTF-32 : (__last - __first) >= __width + // In these cases it's certain the output is at least the requested width. + // It's unknown how often this happens in practice. For now the improvement + // isn't implemented. + + /* + * First assume there are no special Unicode code units in the input. + * - Apply the precision (this may reduce the size of the input). When + * __precison == -1 this step is omitted. + * - Scan for special code units in the input. + * If our assumption was correct the __pos will be at the end of the input. + */ + const ptrdiff_t __length = __last - __first; + const _CharT* __limit = + __first + + (__precision == -1 ? __length : _VSTD::min(__length, __precision)); + ptrdiff_t __size = __limit - __first; + const _CharT* __pos = + __detail::__estimate_column_width_fast(__first, __limit); + + if (__pos == __limit) + return {__limit, __size, __size < __width}; + + /* + * Our assumption was wrong, there are special Unicode code units. + * The range [__first, __pos) contains a set of code units with the + * following property: + * Every _CharT in the range will be rendered in 1 column. + * + * If there's no maximum width and the parsed size already exceeds the + * minimum required width. The real size isn't important. So bail out. + */ + if (__precision == -1 && (__pos - __first) >= __width) + return {__last, 0, false}; + + /* If there's a __precision, truncate the output to that width. */ + ptrdiff_t __prefix = __pos - __first; + if (__precision != -1) { + _LIBCPP_ASSERT(__precision > __prefix, "Logic error."); + auto __lengh_info = __detail::__estimate_column_width( + __pos, __last, __precision - __prefix); + __size = __lengh_info.__width + __prefix; + return {__lengh_info.__ptr, __size, __size < __width}; + } + + /* Else use __width to determine the number of required padding characters. */ + _LIBCPP_ASSERT(__width > __prefix, "Logic error."); + /* + * The column width is always one or two columns. For the precision the wanted + * column width is the maximum, for the width it's the minimum. Using the + * width estimation with its truncating behavior will result in the wrong + * result in the following case: + * - The last code unit processed requires two columns and exceeds the + * maximum column width. + * By increasing the __maximum by one avoids this issue. (It means it may + * pass one code point more than required to determine the proper result; + * that however isn't a problem for the algorithm.) + */ + size_t __maximum = 1 + __width - __prefix; + auto __lengh_info = + __detail::__estimate_column_width(__pos, __last, __maximum); + if (__lengh_info.__ptr != __last) { + // Consumed the width number of code units. The exact size of the string + // is unknown. We only know we don't need to align the output. + _LIBCPP_ASSERT(static_cast<ptrdiff_t>(__lengh_info.__width + __prefix) >= + __width, + "Logic error"); + return {__last, 0, false}; + } + + __size = __lengh_info.__width + __prefix; + return {__last, __size, __size < __width}; +} +#else // _LIBCPP_HAS_NO_UNICODE +template <class _CharT> +_LIBCPP_HIDE_FROM_ABI constexpr __string_alignment<_CharT> +__get_string_alignment(const _CharT* __first, const _CharT* __last, + ptrdiff_t __width, ptrdiff_t __precision) noexcept { + const ptrdiff_t __length = __last - __first; + const _CharT* __limit = + __first + + (__precision == -1 ? __length : _VSTD::min(__length, __precision)); + ptrdiff_t __size = __limit - __first; + return {__limit, __size, __size < __width}; +} +#endif // _LIBCPP_HAS_NO_UNICODE + +} // namespace __format_spec + +# endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) + +#endif //_LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__function_like.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__function_like.h new file mode 100644 index 0000000..4075355 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__function_like.h
@@ -0,0 +1,51 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_FUNCTION_LIKE_H +#define _LIBCPP___ITERATOR_FUNCTION_LIKE_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +// Per [range.iter.ops.general] and [algorithms.requirements], functions in namespace std::ranges +// can't be found by ADL and inhibit ADL when found by unqualified lookup. The easiest way to +// facilitate this is to use function objects. +// +// Since these are still standard library functions, we use `__function_like` to eliminate most of +// the properties that function objects get by default (e.g. semiregularity, addressability), to +// limit the surface area of the unintended public interface, so as to curb the effect of Hyrum's +// law. +struct __function_like { + __function_like() = delete; + __function_like(__function_like const&) = delete; + __function_like& operator=(__function_like const&) = delete; + + void operator&() const = delete; + + struct __tag { }; + +protected: + constexpr explicit __function_like(__tag) noexcept {} + ~__function_like() = default; +}; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_FUNCTION_LIKE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_function.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_function.h new file mode 100644 index 0000000..8ca7b06 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_function.h
@@ -0,0 +1,31 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H +#define _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Arg1, class _Arg2, class _Result> +struct _LIBCPP_TEMPLATE_VIS binary_function +{ + typedef _Arg1 first_argument_type; + typedef _Arg2 second_argument_type; + typedef _Result result_type; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_negate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_negate.h new file mode 100644 index 0000000..4fc3f1b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binary_negate.h
@@ -0,0 +1,50 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H +#define _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H + +#include <__config> +#include <__functional/binary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) + +template <class _Predicate> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 binary_negate + : public binary_function<typename _Predicate::first_argument_type, + typename _Predicate::second_argument_type, + bool> +{ + _Predicate __pred_; +public: + _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR_AFTER_CXX11 + binary_negate(const _Predicate& __pred) : __pred_(__pred) {} + + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const typename _Predicate::first_argument_type& __x, + const typename _Predicate::second_argument_type& __y) const + {return !__pred_(__x, __y);} +}; + +template <class _Predicate> +_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY +binary_negate<_Predicate> +not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);} + +#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind.h new file mode 100644 index 0000000..0b74d91 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind.h
@@ -0,0 +1,386 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BIND_H +#define _LIBCPP___FUNCTIONAL_BIND_H + +#include <__config> +#include <__functional/weak_result_type.h> +#include <__functional/invoke.h> +#include <cstddef> +#include <tuple> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Tp> struct __is_bind_expression : public false_type {}; +template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression + : public __is_bind_expression<typename remove_cv<_Tp>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template <class _Tp> +inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value; +#endif + +template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {}; +template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder + : public __is_placeholder<typename remove_cv<_Tp>::type> {}; + +#if _LIBCPP_STD_VER > 14 +template <class _Tp> +inline constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value; +#endif + +namespace placeholders +{ + +template <int _Np> struct __ph {}; + +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY) +_LIBCPP_FUNC_VIS extern const __ph<1> _1; +_LIBCPP_FUNC_VIS extern const __ph<2> _2; +_LIBCPP_FUNC_VIS extern const __ph<3> _3; +_LIBCPP_FUNC_VIS extern const __ph<4> _4; +_LIBCPP_FUNC_VIS extern const __ph<5> _5; +_LIBCPP_FUNC_VIS extern const __ph<6> _6; +_LIBCPP_FUNC_VIS extern const __ph<7> _7; +_LIBCPP_FUNC_VIS extern const __ph<8> _8; +_LIBCPP_FUNC_VIS extern const __ph<9> _9; +_LIBCPP_FUNC_VIS extern const __ph<10> _10; +#else +/* inline */ constexpr __ph<1> _1{}; +/* inline */ constexpr __ph<2> _2{}; +/* inline */ constexpr __ph<3> _3{}; +/* inline */ constexpr __ph<4> _4{}; +/* inline */ constexpr __ph<5> _5{}; +/* inline */ constexpr __ph<6> _6{}; +/* inline */ constexpr __ph<7> _7{}; +/* inline */ constexpr __ph<8> _8{}; +/* inline */ constexpr __ph<9> _9{}; +/* inline */ constexpr __ph<10> _10{}; +#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY) + +} // placeholders + +template<int _Np> +struct __is_placeholder<placeholders::__ph<_Np> > + : public integral_constant<int, _Np> {}; + + +#ifndef _LIBCPP_CXX03_LANG + +template <class _Tp, class _Uj> +inline _LIBCPP_INLINE_VISIBILITY +_Tp& +__mu(reference_wrapper<_Tp> __t, _Uj&) +{ + return __t.get(); +} + +template <class _Ti, class ..._Uj, size_t ..._Indx> +inline _LIBCPP_INLINE_VISIBILITY +typename __invoke_of<_Ti&, _Uj...>::type +__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) +{ + return __ti(_VSTD::forward<_Uj>(_VSTD::get<_Indx>(__uj))...); +} + +template <class _Ti, class ..._Uj> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_if_t +< + is_bind_expression<_Ti>::value, + __invoke_of<_Ti&, _Uj...> +>::type +__mu(_Ti& __ti, tuple<_Uj...>& __uj) +{ + typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices; + return _VSTD::__mu_expand(__ti, __uj, __indices()); +} + +template <bool IsPh, class _Ti, class _Uj> +struct __mu_return2 {}; + +template <class _Ti, class _Uj> +struct __mu_return2<true, _Ti, _Uj> +{ + typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type; +}; + +template <class _Ti, class _Uj> +inline _LIBCPP_INLINE_VISIBILITY +typename enable_if +< + 0 < is_placeholder<_Ti>::value, + typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type +>::type +__mu(_Ti&, _Uj& __uj) +{ + const size_t _Indx = is_placeholder<_Ti>::value - 1; + return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(_VSTD::get<_Indx>(__uj)); +} + +template <class _Ti, class _Uj> +inline _LIBCPP_INLINE_VISIBILITY +typename enable_if +< + !is_bind_expression<_Ti>::value && + is_placeholder<_Ti>::value == 0 && + !__is_reference_wrapper<_Ti>::value, + _Ti& +>::type +__mu(_Ti& __ti, _Uj&) +{ + return __ti; +} + +template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh, + class _TupleUj> +struct __mu_return_impl; + +template <bool _Invokable, class _Ti, class ..._Uj> +struct __mu_return_invokable // false +{ + typedef __nat type; +}; + +template <class _Ti, class ..._Uj> +struct __mu_return_invokable<true, _Ti, _Uj...> +{ + typedef typename __invoke_of<_Ti&, _Uj...>::type type; +}; + +template <class _Ti, class ..._Uj> +struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> > + : public __mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...> +{ +}; + +template <class _Ti, class _TupleUj> +struct __mu_return_impl<_Ti, false, false, true, _TupleUj> +{ + typedef typename tuple_element<is_placeholder<_Ti>::value - 1, + _TupleUj>::type&& type; +}; + +template <class _Ti, class _TupleUj> +struct __mu_return_impl<_Ti, true, false, false, _TupleUj> +{ + typedef typename _Ti::type& type; +}; + +template <class _Ti, class _TupleUj> +struct __mu_return_impl<_Ti, false, false, false, _TupleUj> +{ + typedef _Ti& type; +}; + +template <class _Ti, class _TupleUj> +struct __mu_return + : public __mu_return_impl<_Ti, + __is_reference_wrapper<_Ti>::value, + is_bind_expression<_Ti>::value, + 0 < is_placeholder<_Ti>::value && + is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value, + _TupleUj> +{ +}; + +template <class _Fp, class _BoundArgs, class _TupleUj> +struct __is_valid_bind_return +{ + static const bool value = false; +}; + +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj> +{ + static const bool value = __invokable<_Fp, + typename __mu_return<_BoundArgs, _TupleUj>::type...>::value; +}; + +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj> +{ + static const bool value = __invokable<_Fp, + typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value; +}; + +template <class _Fp, class _BoundArgs, class _TupleUj, + bool = __is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value> +struct __bind_return; + +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true> +{ + typedef typename __invoke_of + < + _Fp&, + typename __mu_return + < + _BoundArgs, + _TupleUj + >::type... + >::type type; +}; + +template <class _Fp, class ..._BoundArgs, class _TupleUj> +struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> +{ + typedef typename __invoke_of + < + _Fp&, + typename __mu_return + < + const _BoundArgs, + _TupleUj + >::type... + >::type type; +}; + +template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args> +inline _LIBCPP_INLINE_VISIBILITY +typename __bind_return<_Fp, _BoundArgs, _Args>::type +__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, + _Args&& __args) +{ + return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...); +} + +template<class _Fp, class ..._BoundArgs> +class __bind +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public __weak_result_type<typename decay<_Fp>::type> +#endif +{ +protected: + typedef typename decay<_Fp>::type _Fd; + typedef tuple<typename decay<_BoundArgs>::type...> _Td; +private: + _Fd __f_; + _Td __bound_args_; + + typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices; +public: + template <class _Gp, class ..._BA, + class = typename enable_if + < + is_constructible<_Fd, _Gp>::value && + !is_same<typename remove_reference<_Gp>::type, + __bind>::value + >::type> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + explicit __bind(_Gp&& __f, _BA&& ...__bound_args) + : __f_(_VSTD::forward<_Gp>(__f)), + __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {} + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type + operator()(_Args&& ...__args) + { + return _VSTD::__apply_functor(__f_, __bound_args_, __indices(), + tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...)); + } + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type + operator()(_Args&& ...__args) const + { + return _VSTD::__apply_functor(__f_, __bound_args_, __indices(), + tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...)); + } +}; + +template<class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {}; + +template<class _Rp, class _Fp, class ..._BoundArgs> +class __bind_r + : public __bind<_Fp, _BoundArgs...> +{ + typedef __bind<_Fp, _BoundArgs...> base; + typedef typename base::_Fd _Fd; + typedef typename base::_Td _Td; +public: + typedef _Rp result_type; + + + template <class _Gp, class ..._BA, + class = typename enable_if + < + is_constructible<_Fd, _Gp>::value && + !is_same<typename remove_reference<_Gp>::type, + __bind_r>::value + >::type> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args) + : base(_VSTD::forward<_Gp>(__f), + _VSTD::forward<_BA>(__bound_args)...) {} + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename enable_if + < + is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type, + result_type>::value || is_void<_Rp>::value, + result_type + >::type + operator()(_Args&& ...__args) + { + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...); + } + + template <class ..._Args> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename enable_if + < + is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type, + result_type>::value || is_void<_Rp>::value, + result_type + >::type + operator()(_Args&& ...__args) const + { + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(static_cast<base const&>(*this), _VSTD::forward<_Args>(__args)...); + } +}; + +template<class _Rp, class _Fp, class ..._BoundArgs> +struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {}; + +template<class _Fp, class ..._BoundArgs> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +__bind<_Fp, _BoundArgs...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) +{ + typedef __bind<_Fp, _BoundArgs...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); +} + +template<class _Rp, class _Fp, class ..._BoundArgs> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +__bind_r<_Rp, _Fp, _BoundArgs...> +bind(_Fp&& __f, _BoundArgs&&... __bound_args) +{ + typedef __bind_r<_Rp, _Fp, _BoundArgs...> type; + return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BIND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_back.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_back.h new file mode 100644 index 0000000..a0089e1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_back.h
@@ -0,0 +1,65 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BIND_BACK_H +#define _LIBCPP___FUNCTIONAL_BIND_BACK_H + +#include <__config> +#include <__functional/invoke.h> +#include <__functional/perfect_forward.h> +#include <__utility/forward.h> +#include <__utility/integer_sequence.h> +#include <tuple> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +template <size_t _NBound, class = make_index_sequence<_NBound>> +struct __bind_back_op; + +template <size_t _NBound, size_t ..._Ip> +struct __bind_back_op<_NBound, index_sequence<_Ip...>> { + template <class _Fn, class _Bound, class ..._Args> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Fn&& __f, _Bound&& __bound, _Args&& ...__args) const + noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_Bound>(__bound))...))) + -> decltype( _VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_Bound>(__bound))...)) + { return _VSTD::invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)..., _VSTD::get<_Ip>(_VSTD::forward<_Bound>(__bound))...); } +}; + +template <class _Fn, class _BoundArgs> +struct __bind_back_t : __perfect_forward<__bind_back_op<tuple_size_v<_BoundArgs>>, _Fn, _BoundArgs> { + using __perfect_forward<__bind_back_op<tuple_size_v<_BoundArgs>>, _Fn, _BoundArgs>::__perfect_forward; +}; + +template <class _Fn, class ..._Args, class = enable_if_t< + _And< + is_constructible<decay_t<_Fn>, _Fn>, + is_move_constructible<decay_t<_Fn>>, + is_constructible<decay_t<_Args>, _Args>..., + is_move_constructible<decay_t<_Args>>... + >::value +>> +_LIBCPP_HIDE_FROM_ABI +constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) + noexcept(noexcept(__bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)))) + -> decltype( __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...))) + { return __bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(_VSTD::forward<_Fn>(__f), _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)); } + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BIND_BACK_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_front.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_front.h new file mode 100644 index 0000000..86d4594 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/bind_front.h
@@ -0,0 +1,58 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BIND_FRONT_H +#define _LIBCPP___FUNCTIONAL_BIND_FRONT_H + +#include <__config> +#include <__functional/perfect_forward.h> +#include <__functional/invoke.h> +#include <type_traits> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +struct __bind_front_op { + template <class ..._Args> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Args&& ...__args) const + noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Args>(__args)...))) + -> decltype( _VSTD::invoke(_VSTD::forward<_Args>(__args)...)) + { return _VSTD::invoke(_VSTD::forward<_Args>(__args)...); } +}; + +template <class _Fn, class ..._BoundArgs> +struct __bind_front_t : __perfect_forward<__bind_front_op, _Fn, _BoundArgs...> { + using __perfect_forward<__bind_front_op, _Fn, _BoundArgs...>::__perfect_forward; +}; + +template <class _Fn, class... _Args, class = enable_if_t< + _And< + is_constructible<decay_t<_Fn>, _Fn>, + is_move_constructible<decay_t<_Fn>>, + is_constructible<decay_t<_Args>, _Args>..., + is_move_constructible<decay_t<_Args>>... + >::value +>> +_LIBCPP_HIDE_FROM_ABI +constexpr auto bind_front(_Fn&& __f, _Args&&... __args) { + return __bind_front_t<decay_t<_Fn>, decay_t<_Args>...>(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...); +} + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BIND_FRONT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder1st.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder1st.h new file mode 100644 index 0000000..5dd8f5c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder1st.h
@@ -0,0 +1,54 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BINDER1ST_H +#define _LIBCPP___FUNCTIONAL_BINDER1ST_H + +#include <__config> +#include <__functional/unary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +template <class __Operation> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder1st + : public unary_function<typename __Operation::second_argument_type, + typename __Operation::result_type> +{ +protected: + __Operation op; + typename __Operation::first_argument_type value; +public: + _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x, + const typename __Operation::first_argument_type __y) + : op(__x), value(__y) {} + _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator() + (typename __Operation::second_argument_type& __x) const + {return op(value, __x);} + _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator() + (const typename __Operation::second_argument_type& __x) const + {return op(value, __x);} +}; + +template <class __Operation, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +binder1st<__Operation> +bind1st(const __Operation& __op, const _Tp& __x) + {return binder1st<__Operation>(__op, __x);} + +#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BINDER1ST_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder2nd.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder2nd.h new file mode 100644 index 0000000..3ed5f5b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/binder2nd.h
@@ -0,0 +1,54 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_BINDER2ND_H +#define _LIBCPP___FUNCTIONAL_BINDER2ND_H + +#include <__config> +#include <__functional/unary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +template <class __Operation> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd + : public unary_function<typename __Operation::first_argument_type, + typename __Operation::result_type> +{ +protected: + __Operation op; + typename __Operation::second_argument_type value; +public: + _LIBCPP_INLINE_VISIBILITY + binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y) + : op(__x), value(__y) {} + _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator() + ( typename __Operation::first_argument_type& __x) const + {return op(__x, value);} + _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator() + (const typename __Operation::first_argument_type& __x) const + {return op(__x, value);} +}; + +template <class __Operation, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +binder2nd<__Operation> +bind2nd(const __Operation& __op, const _Tp& __x) + {return binder2nd<__Operation>(__op, __x);} + +#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/compose.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/compose.h new file mode 100644 index 0000000..d9d7587 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/compose.h
@@ -0,0 +1,52 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_COMPOSE_H +#define _LIBCPP___FUNCTIONAL_COMPOSE_H + +#include <__config> +#include <__functional/invoke.h> +#include <__functional/perfect_forward.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +struct __compose_op { + template<class _Fn1, class _Fn2, class ..._Args> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Fn1&& __f1, _Fn2&& __f2, _Args&&... __args) const + noexcept(noexcept(_VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...)))) + -> decltype( _VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...))) + { return _VSTD::invoke(_VSTD::forward<_Fn1>(__f1), _VSTD::invoke(_VSTD::forward<_Fn2>(__f2), _VSTD::forward<_Args>(__args)...)); } +}; + +template <class _Fn1, class _Fn2> +struct __compose_t : __perfect_forward<__compose_op, _Fn1, _Fn2> { + using __perfect_forward<__compose_op, _Fn1, _Fn2>::__perfect_forward; +}; + +template <class _Fn1, class _Fn2> +_LIBCPP_HIDE_FROM_ABI +constexpr auto __compose(_Fn1&& __f1, _Fn2&& __f2) + noexcept(noexcept(__compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)))) + -> decltype( __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2))) + { return __compose_t<decay_t<_Fn1>, decay_t<_Fn2>>(_VSTD::forward<_Fn1>(__f1), _VSTD::forward<_Fn2>(__f2)); } + +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_COMPOSE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/default_searcher.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/default_searcher.h new file mode 100644 index 0000000..1acbc18 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/default_searcher.h
@@ -0,0 +1,56 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H +#define _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H + +#include <__algorithm/search.h> +#include <__config> +#include <__functional/operations.h> +#include <__iterator/iterator_traits.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +// default searcher +template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> +class _LIBCPP_TEMPLATE_VIS default_searcher { +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + default_searcher(_ForwardIterator __f, _ForwardIterator __l, + _BinaryPredicate __p = _BinaryPredicate()) + : __first_(__f), __last_(__l), __pred_(__p) {} + + template <typename _ForwardIterator2> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair<_ForwardIterator2, _ForwardIterator2> + operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const + { + return _VSTD::__search(__f, __l, __first_, __last_, __pred_, + typename iterator_traits<_ForwardIterator>::iterator_category(), + typename iterator_traits<_ForwardIterator2>::iterator_category()); + } + +private: + _ForwardIterator __first_; + _ForwardIterator __last_; + _BinaryPredicate __pred_; + }; + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/function.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/function.h new file mode 100644 index 0000000..83fd7c1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/function.h
@@ -0,0 +1,2817 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_FUNCTION_H +#define _LIBCPP___FUNCTIONAL_FUNCTION_H + +#include <__config> +#include <__debug> +#include <__functional/binary_function.h> +#include <__functional/invoke.h> +#include <__functional/unary_function.h> +#include <__iterator/iterator_traits.h> +#include <__memory/allocator_traits.h> +#include <__memory/compressed_pair.h> +#include <__memory/shared_ptr.h> +#include <exception> +#include <memory> // TODO: replace with <__memory/__builtin_new_allocator.h> +#include <type_traits> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// bad_function_call + +class _LIBCPP_EXCEPTION_ABI bad_function_call + : public exception +{ +public: +// Note that when a key function is not used, every translation unit that uses +// bad_function_call will end up containing a weak definition of the vtable and +// typeinfo. +#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION + virtual ~bad_function_call() _NOEXCEPT; +#else + virtual ~bad_function_call() _NOEXCEPT {} +#endif + +#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE + virtual const char* what() const _NOEXCEPT; +#endif +}; + +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY +void __throw_bad_function_call() +{ +#ifndef _LIBCPP_NO_EXCEPTIONS + throw bad_function_call(); +#else + _VSTD::abort(); +#endif +} + +#if defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated) +# define _LIBCPP_DEPRECATED_CXX03_FUNCTION \ + __attribute__((deprecated("Using std::function in C++03 is not supported anymore. Please upgrade to C++11 or later, or use a different type"))) +#else +# define _LIBCPP_DEPRECATED_CXX03_FUNCTION /* nothing */ +#endif + +template<class _Fp> class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function; // undefined + +namespace __function +{ + +template<class _Rp> +struct __maybe_derive_from_unary_function +{ +}; + +template<class _Rp, class _A1> +struct __maybe_derive_from_unary_function<_Rp(_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template<class _Rp> +struct __maybe_derive_from_binary_function +{ +}; + +template<class _Rp, class _A1, class _A2> +struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template <class _Fp> +_LIBCPP_INLINE_VISIBILITY +bool __not_null(_Fp const&) { return true; } + +template <class _Fp> +_LIBCPP_INLINE_VISIBILITY +bool __not_null(_Fp* __ptr) { return __ptr; } + +template <class _Ret, class _Class> +_LIBCPP_INLINE_VISIBILITY +bool __not_null(_Ret _Class::*__ptr) { return __ptr; } + +template <class _Fp> +_LIBCPP_INLINE_VISIBILITY +bool __not_null(function<_Fp> const& __f) { return !!__f; } + +#ifdef _LIBCPP_HAS_EXTENSION_BLOCKS +template <class _Rp, class ..._Args> +_LIBCPP_INLINE_VISIBILITY +bool __not_null(_Rp (^__p)(_Args...)) { return __p; } +#endif + +} // namespace __function + +#ifndef _LIBCPP_CXX03_LANG + +namespace __function { + +// __alloc_func holds a functor and an allocator. + +template <class _Fp, class _Ap, class _FB> class __alloc_func; +template <class _Fp, class _FB> +class __default_alloc_func; + +template <class _Fp, class _Ap, class _Rp, class... _ArgTypes> +class __alloc_func<_Fp, _Ap, _Rp(_ArgTypes...)> +{ + __compressed_pair<_Fp, _Ap> __f_; + + public: + typedef _LIBCPP_NODEBUG _Fp _Target; + typedef _LIBCPP_NODEBUG _Ap _Alloc; + + _LIBCPP_INLINE_VISIBILITY + const _Target& __target() const { return __f_.first(); } + + // WIN32 APIs may define __allocator, so use __get_allocator instead. + _LIBCPP_INLINE_VISIBILITY + const _Alloc& __get_allocator() const { return __f_.second(); } + + _LIBCPP_INLINE_VISIBILITY + explicit __alloc_func(_Target&& __f) + : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)), + _VSTD::forward_as_tuple()) + { + } + + _LIBCPP_INLINE_VISIBILITY + explicit __alloc_func(const _Target& __f, const _Alloc& __a) + : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f), + _VSTD::forward_as_tuple(__a)) + { + } + + _LIBCPP_INLINE_VISIBILITY + explicit __alloc_func(const _Target& __f, _Alloc&& __a) + : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f), + _VSTD::forward_as_tuple(_VSTD::move(__a))) + { + } + + _LIBCPP_INLINE_VISIBILITY + explicit __alloc_func(_Target&& __f, _Alloc&& __a) + : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)), + _VSTD::forward_as_tuple(_VSTD::move(__a))) + { + } + + _LIBCPP_INLINE_VISIBILITY + _Rp operator()(_ArgTypes&&... __arg) + { + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), + _VSTD::forward<_ArgTypes>(__arg)...); + } + + _LIBCPP_INLINE_VISIBILITY + __alloc_func* __clone() const + { + typedef allocator_traits<_Alloc> __alloc_traits; + typedef + typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type + _AA; + _AA __a(__f_.second()); + typedef __allocator_destructor<_AA> _Dp; + unique_ptr<__alloc_func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __alloc_func(__f_.first(), _Alloc(__a)); + return __hold.release(); + } + + _LIBCPP_INLINE_VISIBILITY + void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); } + + static void __destroy_and_delete(__alloc_func* __f) { + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __alloc_func>::type + _FunAlloc; + _FunAlloc __a(__f->__get_allocator()); + __f->destroy(); + __a.deallocate(__f, 1); + } +}; + +template <class _Fp, class _Rp, class... _ArgTypes> +class __default_alloc_func<_Fp, _Rp(_ArgTypes...)> { + _Fp __f_; + +public: + typedef _LIBCPP_NODEBUG _Fp _Target; + + _LIBCPP_INLINE_VISIBILITY + const _Target& __target() const { return __f_; } + + _LIBCPP_INLINE_VISIBILITY + explicit __default_alloc_func(_Target&& __f) : __f_(_VSTD::move(__f)) {} + + _LIBCPP_INLINE_VISIBILITY + explicit __default_alloc_func(const _Target& __f) : __f_(__f) {} + + _LIBCPP_INLINE_VISIBILITY + _Rp operator()(_ArgTypes&&... __arg) { + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_, _VSTD::forward<_ArgTypes>(__arg)...); + } + + _LIBCPP_INLINE_VISIBILITY + __default_alloc_func* __clone() const { + __builtin_new_allocator::__holder_t __hold = + __builtin_new_allocator::__allocate_type<__default_alloc_func>(1); + __default_alloc_func* __res = + ::new ((void*)__hold.get()) __default_alloc_func(__f_); + (void)__hold.release(); + return __res; + } + + _LIBCPP_INLINE_VISIBILITY + void destroy() _NOEXCEPT { __f_.~_Target(); } + + static void __destroy_and_delete(__default_alloc_func* __f) { + __f->destroy(); + __builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1); + } +}; + +// __base provides an abstract interface for copyable functors. + +template<class _Fp> class _LIBCPP_TEMPLATE_VIS __base; + +template<class _Rp, class ..._ArgTypes> +class __base<_Rp(_ArgTypes...)> +{ + __base(const __base&); + __base& operator=(const __base&); +public: + _LIBCPP_INLINE_VISIBILITY __base() {} + _LIBCPP_INLINE_VISIBILITY virtual ~__base() {} + virtual __base* __clone() const = 0; + virtual void __clone(__base*) const = 0; + virtual void destroy() _NOEXCEPT = 0; + virtual void destroy_deallocate() _NOEXCEPT = 0; + virtual _Rp operator()(_ArgTypes&& ...) = 0; +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const _NOEXCEPT = 0; + virtual const std::type_info& target_type() const _NOEXCEPT = 0; +#endif // _LIBCPP_NO_RTTI +}; + +// __func implements __base for a given functor type. + +template<class _FD, class _Alloc, class _FB> class __func; + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +class __func<_Fp, _Alloc, _Rp(_ArgTypes...)> + : public __base<_Rp(_ArgTypes...)> +{ + __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> __f_; +public: + _LIBCPP_INLINE_VISIBILITY + explicit __func(_Fp&& __f) + : __f_(_VSTD::move(__f)) {} + + _LIBCPP_INLINE_VISIBILITY + explicit __func(const _Fp& __f, const _Alloc& __a) + : __f_(__f, __a) {} + + _LIBCPP_INLINE_VISIBILITY + explicit __func(const _Fp& __f, _Alloc&& __a) + : __f_(__f, _VSTD::move(__a)) {} + + _LIBCPP_INLINE_VISIBILITY + explicit __func(_Fp&& __f, _Alloc&& __a) + : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + + virtual __base<_Rp(_ArgTypes...)>* __clone() const; + virtual void __clone(__base<_Rp(_ArgTypes...)>*) const; + virtual void destroy() _NOEXCEPT; + virtual void destroy_deallocate() _NOEXCEPT; + virtual _Rp operator()(_ArgTypes&&... __arg); +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const _NOEXCEPT; + virtual const std::type_info& target_type() const _NOEXCEPT; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +__base<_Rp(_ArgTypes...)>* +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.__get_allocator()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __func(__f_.__target(), _Alloc(__a)); + return __hold.release(); +} + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +void +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone(__base<_Rp(_ArgTypes...)>* __p) const +{ + ::new ((void*)__p) __func(__f_.__target(), __f_.__get_allocator()); +} + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +void +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy() _NOEXCEPT +{ + __f_.destroy(); +} + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +void +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.__get_allocator()); + __f_.destroy(); + __a.deallocate(this, 1); +} + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +_Rp +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg) +{ + return __f_(_VSTD::forward<_ArgTypes>(__arg)...); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +const void* +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT +{ + if (__ti == typeid(_Fp)) + return &__f_.__target(); + return nullptr; +} + +template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes> +const std::type_info& +__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT +{ + return typeid(_Fp); +} + +#endif // _LIBCPP_NO_RTTI + +// __value_func creates a value-type from a __func. + +template <class _Fp> class __value_func; + +template <class _Rp, class... _ArgTypes> class __value_func<_Rp(_ArgTypes...)> +{ + typename aligned_storage<3 * sizeof(void*)>::type __buf_; + + typedef __base<_Rp(_ArgTypes...)> __func; + __func* __f_; + + _LIBCPP_NO_CFI static __func* __as_base(void* p) + { + return reinterpret_cast<__func*>(p); + } + + public: + _LIBCPP_INLINE_VISIBILITY + __value_func() _NOEXCEPT : __f_(nullptr) {} + + template <class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY __value_func(_Fp&& __f, const _Alloc& __a) + : __f_(nullptr) + { + typedef allocator_traits<_Alloc> __alloc_traits; + typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun; + typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type + _FunAlloc; + + if (__function::__not_null(__f)) + { + _FunAlloc __af(__a); + if (sizeof(_Fun) <= sizeof(__buf_) && + is_nothrow_copy_constructible<_Fp>::value && + is_nothrow_copy_constructible<_FunAlloc>::value) + { + __f_ = + ::new ((void*)&__buf_) _Fun(_VSTD::move(__f), _Alloc(__af)); + } + else + { + typedef __allocator_destructor<_FunAlloc> _Dp; + unique_ptr<__func, _Dp> __hold(__af.allocate(1), _Dp(__af, 1)); + ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f), _Alloc(__a)); + __f_ = __hold.release(); + } + } + } + + template <class _Fp, + class = typename enable_if<!is_same<typename decay<_Fp>::type, __value_func>::value>::type> + _LIBCPP_INLINE_VISIBILITY explicit __value_func(_Fp&& __f) + : __value_func(_VSTD::forward<_Fp>(__f), allocator<_Fp>()) {} + + _LIBCPP_INLINE_VISIBILITY + __value_func(const __value_func& __f) + { + if (__f.__f_ == nullptr) + __f_ = nullptr; + else if ((void*)__f.__f_ == &__f.__buf_) + { + __f_ = __as_base(&__buf_); + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); + } + + _LIBCPP_INLINE_VISIBILITY + __value_func(__value_func&& __f) _NOEXCEPT + { + if (__f.__f_ == nullptr) + __f_ = nullptr; + else if ((void*)__f.__f_ == &__f.__buf_) + { + __f_ = __as_base(&__buf_); + __f.__f_->__clone(__f_); + } + else + { + __f_ = __f.__f_; + __f.__f_ = nullptr; + } + } + + _LIBCPP_INLINE_VISIBILITY + ~__value_func() + { + if ((void*)__f_ == &__buf_) + __f_->destroy(); + else if (__f_) + __f_->destroy_deallocate(); + } + + _LIBCPP_INLINE_VISIBILITY + __value_func& operator=(__value_func&& __f) + { + *this = nullptr; + if (__f.__f_ == nullptr) + __f_ = nullptr; + else if ((void*)__f.__f_ == &__f.__buf_) + { + __f_ = __as_base(&__buf_); + __f.__f_->__clone(__f_); + } + else + { + __f_ = __f.__f_; + __f.__f_ = nullptr; + } + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + __value_func& operator=(nullptr_t) + { + __func* __f = __f_; + __f_ = nullptr; + if ((void*)__f == &__buf_) + __f->destroy(); + else if (__f) + __f->destroy_deallocate(); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + _Rp operator()(_ArgTypes&&... __args) const + { + if (__f_ == nullptr) + __throw_bad_function_call(); + return (*__f_)(_VSTD::forward<_ArgTypes>(__args)...); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(__value_func& __f) _NOEXCEPT + { + if (&__f == this) + return; + if ((void*)__f_ == &__buf_ && (void*)__f.__f_ == &__f.__buf_) + { + typename aligned_storage<sizeof(__buf_)>::type __tempbuf; + __func* __t = __as_base(&__tempbuf); + __f_->__clone(__t); + __f_->destroy(); + __f_ = nullptr; + __f.__f_->__clone(__as_base(&__buf_)); + __f.__f_->destroy(); + __f.__f_ = nullptr; + __f_ = __as_base(&__buf_); + __t->__clone(__as_base(&__f.__buf_)); + __t->destroy(); + __f.__f_ = __as_base(&__f.__buf_); + } + else if ((void*)__f_ == &__buf_) + { + __f_->__clone(__as_base(&__f.__buf_)); + __f_->destroy(); + __f_ = __f.__f_; + __f.__f_ = __as_base(&__f.__buf_); + } + else if ((void*)__f.__f_ == &__f.__buf_) + { + __f.__f_->__clone(__as_base(&__buf_)); + __f.__f_->destroy(); + __f.__f_ = __f_; + __f_ = __as_base(&__buf_); + } + else + _VSTD::swap(__f_, __f.__f_); + } + + _LIBCPP_INLINE_VISIBILITY + explicit operator bool() const _NOEXCEPT { return __f_ != nullptr; } + +#ifndef _LIBCPP_NO_RTTI + _LIBCPP_INLINE_VISIBILITY + const std::type_info& target_type() const _NOEXCEPT + { + if (__f_ == nullptr) + return typeid(void); + return __f_->target_type(); + } + + template <typename _Tp> + _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT + { + if (__f_ == nullptr) + return nullptr; + return (const _Tp*)__f_->target(typeid(_Tp)); + } +#endif // _LIBCPP_NO_RTTI +}; + +// Storage for a functor object, to be used with __policy to manage copy and +// destruction. +union __policy_storage +{ + mutable char __small[sizeof(void*) * 2]; + void* __large; +}; + +// True if _Fun can safely be held in __policy_storage.__small. +template <typename _Fun> +struct __use_small_storage + : public integral_constant< + bool, sizeof(_Fun) <= sizeof(__policy_storage) && + _LIBCPP_ALIGNOF(_Fun) <= _LIBCPP_ALIGNOF(__policy_storage) && + is_trivially_copy_constructible<_Fun>::value && + is_trivially_destructible<_Fun>::value> {}; + +// Policy contains information about how to copy, destroy, and move the +// underlying functor. You can think of it as a vtable of sorts. +struct __policy +{ + // Used to copy or destroy __large values. null for trivial objects. + void* (*const __clone)(const void*); + void (*const __destroy)(void*); + + // True if this is the null policy (no value). + const bool __is_null; + + // The target type. May be null if RTTI is disabled. + const std::type_info* const __type_info; + + // Returns a pointer to a static policy object suitable for the functor + // type. + template <typename _Fun> + _LIBCPP_INLINE_VISIBILITY static const __policy* __create() + { + return __choose_policy<_Fun>(__use_small_storage<_Fun>()); + } + + _LIBCPP_INLINE_VISIBILITY + static const __policy* __create_empty() + { + static const _LIBCPP_CONSTEXPR __policy __policy_ = {nullptr, nullptr, + true, +#ifndef _LIBCPP_NO_RTTI + &typeid(void) +#else + nullptr +#endif + }; + return &__policy_; + } + + private: + template <typename _Fun> static void* __large_clone(const void* __s) + { + const _Fun* __f = static_cast<const _Fun*>(__s); + return __f->__clone(); + } + + template <typename _Fun> + static void __large_destroy(void* __s) { + _Fun::__destroy_and_delete(static_cast<_Fun*>(__s)); + } + + template <typename _Fun> + _LIBCPP_INLINE_VISIBILITY static const __policy* + __choose_policy(/* is_small = */ false_type) { + static const _LIBCPP_CONSTEXPR __policy __policy_ = { + &__large_clone<_Fun>, &__large_destroy<_Fun>, false, +#ifndef _LIBCPP_NO_RTTI + &typeid(typename _Fun::_Target) +#else + nullptr +#endif + }; + return &__policy_; + } + + template <typename _Fun> + _LIBCPP_INLINE_VISIBILITY static const __policy* + __choose_policy(/* is_small = */ true_type) + { + static const _LIBCPP_CONSTEXPR __policy __policy_ = { + nullptr, nullptr, false, +#ifndef _LIBCPP_NO_RTTI + &typeid(typename _Fun::_Target) +#else + nullptr +#endif + }; + return &__policy_; + } +}; + +// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is +// faster for types that can be passed in registers. +template <typename _Tp> +using __fast_forward = + typename conditional<is_scalar<_Tp>::value, _Tp, _Tp&&>::type; + +// __policy_invoker calls an instance of __alloc_func held in __policy_storage. + +template <class _Fp> struct __policy_invoker; + +template <class _Rp, class... _ArgTypes> +struct __policy_invoker<_Rp(_ArgTypes...)> +{ + typedef _Rp (*__Call)(const __policy_storage*, + __fast_forward<_ArgTypes>...); + + __Call __call_; + + // Creates an invoker that throws bad_function_call. + _LIBCPP_INLINE_VISIBILITY + __policy_invoker() : __call_(&__call_empty) {} + + // Creates an invoker that calls the given instance of __func. + template <typename _Fun> + _LIBCPP_INLINE_VISIBILITY static __policy_invoker __create() + { + return __policy_invoker(&__call_impl<_Fun>); + } + + private: + _LIBCPP_INLINE_VISIBILITY + explicit __policy_invoker(__Call __c) : __call_(__c) {} + + static _Rp __call_empty(const __policy_storage*, + __fast_forward<_ArgTypes>...) + { + __throw_bad_function_call(); + } + + template <typename _Fun> + static _Rp __call_impl(const __policy_storage* __buf, + __fast_forward<_ArgTypes>... __args) + { + _Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value + ? &__buf->__small + : __buf->__large); + return (*__f)(_VSTD::forward<_ArgTypes>(__args)...); + } +}; + +// __policy_func uses a __policy and __policy_invoker to create a type-erased, +// copyable functor. + +template <class _Fp> class __policy_func; + +template <class _Rp, class... _ArgTypes> class __policy_func<_Rp(_ArgTypes...)> +{ + // Inline storage for small objects. + __policy_storage __buf_; + + // Calls the value stored in __buf_. This could technically be part of + // policy, but storing it here eliminates a level of indirection inside + // operator(). + typedef __function::__policy_invoker<_Rp(_ArgTypes...)> __invoker; + __invoker __invoker_; + + // The policy that describes how to move / copy / destroy __buf_. Never + // null, even if the function is empty. + const __policy* __policy_; + + public: + _LIBCPP_INLINE_VISIBILITY + __policy_func() : __policy_(__policy::__create_empty()) {} + + template <class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY __policy_func(_Fp&& __f, const _Alloc& __a) + : __policy_(__policy::__create_empty()) + { + typedef __alloc_func<_Fp, _Alloc, _Rp(_ArgTypes...)> _Fun; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, _Fun>::type + _FunAlloc; + + if (__function::__not_null(__f)) + { + __invoker_ = __invoker::template __create<_Fun>(); + __policy_ = __policy::__create<_Fun>(); + + _FunAlloc __af(__a); + if (__use_small_storage<_Fun>()) + { + ::new ((void*)&__buf_.__small) + _Fun(_VSTD::move(__f), _Alloc(__af)); + } + else + { + typedef __allocator_destructor<_FunAlloc> _Dp; + unique_ptr<_Fun, _Dp> __hold(__af.allocate(1), _Dp(__af, 1)); + ::new ((void*)__hold.get()) + _Fun(_VSTD::move(__f), _Alloc(__af)); + __buf_.__large = __hold.release(); + } + } + } + + template <class _Fp, class = typename enable_if<!is_same<typename decay<_Fp>::type, __policy_func>::value>::type> + _LIBCPP_INLINE_VISIBILITY explicit __policy_func(_Fp&& __f) + : __policy_(__policy::__create_empty()) { + typedef __default_alloc_func<_Fp, _Rp(_ArgTypes...)> _Fun; + + if (__function::__not_null(__f)) { + __invoker_ = __invoker::template __create<_Fun>(); + __policy_ = __policy::__create<_Fun>(); + if (__use_small_storage<_Fun>()) { + ::new ((void*)&__buf_.__small) _Fun(_VSTD::move(__f)); + } else { + __builtin_new_allocator::__holder_t __hold = + __builtin_new_allocator::__allocate_type<_Fun>(1); + __buf_.__large = ::new ((void*)__hold.get()) _Fun(_VSTD::move(__f)); + (void)__hold.release(); + } + } + } + + _LIBCPP_INLINE_VISIBILITY + __policy_func(const __policy_func& __f) + : __buf_(__f.__buf_), __invoker_(__f.__invoker_), + __policy_(__f.__policy_) + { + if (__policy_->__clone) + __buf_.__large = __policy_->__clone(__f.__buf_.__large); + } + + _LIBCPP_INLINE_VISIBILITY + __policy_func(__policy_func&& __f) + : __buf_(__f.__buf_), __invoker_(__f.__invoker_), + __policy_(__f.__policy_) + { + if (__policy_->__destroy) + { + __f.__policy_ = __policy::__create_empty(); + __f.__invoker_ = __invoker(); + } + } + + _LIBCPP_INLINE_VISIBILITY + ~__policy_func() + { + if (__policy_->__destroy) + __policy_->__destroy(__buf_.__large); + } + + _LIBCPP_INLINE_VISIBILITY + __policy_func& operator=(__policy_func&& __f) + { + *this = nullptr; + __buf_ = __f.__buf_; + __invoker_ = __f.__invoker_; + __policy_ = __f.__policy_; + __f.__policy_ = __policy::__create_empty(); + __f.__invoker_ = __invoker(); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + __policy_func& operator=(nullptr_t) + { + const __policy* __p = __policy_; + __policy_ = __policy::__create_empty(); + __invoker_ = __invoker(); + if (__p->__destroy) + __p->__destroy(__buf_.__large); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + _Rp operator()(_ArgTypes&&... __args) const + { + return __invoker_.__call_(_VSTD::addressof(__buf_), + _VSTD::forward<_ArgTypes>(__args)...); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(__policy_func& __f) + { + _VSTD::swap(__invoker_, __f.__invoker_); + _VSTD::swap(__policy_, __f.__policy_); + _VSTD::swap(__buf_, __f.__buf_); + } + + _LIBCPP_INLINE_VISIBILITY + explicit operator bool() const _NOEXCEPT + { + return !__policy_->__is_null; + } + +#ifndef _LIBCPP_NO_RTTI + _LIBCPP_INLINE_VISIBILITY + const std::type_info& target_type() const _NOEXCEPT + { + return *__policy_->__type_info; + } + + template <typename _Tp> + _LIBCPP_INLINE_VISIBILITY const _Tp* target() const _NOEXCEPT + { + if (__policy_->__is_null || typeid(_Tp) != *__policy_->__type_info) + return nullptr; + if (__policy_->__clone) // Out of line storage. + return reinterpret_cast<const _Tp*>(__buf_.__large); + else + return reinterpret_cast<const _Tp*>(&__buf_.__small); + } +#endif // _LIBCPP_NO_RTTI +}; + +#if defined(_LIBCPP_HAS_BLOCKS_RUNTIME) && !defined(_LIBCPP_HAS_OBJC_ARC) + +extern "C" void *_Block_copy(const void *); +extern "C" void _Block_release(const void *); + +template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, class ..._ArgTypes> +class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)> + : public __base<_Rp(_ArgTypes...)> +{ + typedef _Rp1(^__block_type)(_ArgTypes1...); + __block_type __f_; + +public: + _LIBCPP_INLINE_VISIBILITY + explicit __func(__block_type const& __f) + : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) + { } + + // [TODO] add && to save on a retain + + _LIBCPP_INLINE_VISIBILITY + explicit __func(__block_type __f, const _Alloc& /* unused */) + : __f_(reinterpret_cast<__block_type>(__f ? _Block_copy(__f) : nullptr)) + { } + + virtual __base<_Rp(_ArgTypes...)>* __clone() const { + _LIBCPP_ASSERT(false, + "Block pointers are just pointers, so they should always fit into " + "std::function's small buffer optimization. This function should " + "never be invoked."); + return nullptr; + } + + virtual void __clone(__base<_Rp(_ArgTypes...)>* __p) const { + ::new ((void*)__p) __func(__f_); + } + + virtual void destroy() _NOEXCEPT { + if (__f_) + _Block_release(__f_); + __f_ = 0; + } + + virtual void destroy_deallocate() _NOEXCEPT { + _LIBCPP_ASSERT(false, + "Block pointers are just pointers, so they should always fit into " + "std::function's small buffer optimization. This function should " + "never be invoked."); + } + + virtual _Rp operator()(_ArgTypes&& ... __arg) { + return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__arg)...); + } + +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(type_info const& __ti) const _NOEXCEPT { + if (__ti == typeid(__func::__block_type)) + return &__f_; + return (const void*)nullptr; + } + + virtual const std::type_info& target_type() const _NOEXCEPT { + return typeid(__func::__block_type); + } +#endif // _LIBCPP_NO_RTTI +}; + +#endif // _LIBCPP_HAS_EXTENSION_BLOCKS && !_LIBCPP_HAS_OBJC_ARC + +} // __function + +template<class _Rp, class ..._ArgTypes> +class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)> +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>, + public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)> +#endif +{ +#ifndef _LIBCPP_ABI_OPTIMIZED_FUNCTION + typedef __function::__value_func<_Rp(_ArgTypes...)> __func; +#else + typedef __function::__policy_func<_Rp(_ArgTypes...)> __func; +#endif + + __func __f_; + + template <class _Fp, bool = _And< + _IsNotSame<__uncvref_t<_Fp>, function>, + __invokable<_Fp, _ArgTypes...> + >::value> + struct __callable; + template <class _Fp> + struct __callable<_Fp, true> + { + static const bool value = is_void<_Rp>::value || + __is_core_convertible<typename __invoke_of<_Fp, _ArgTypes...>::type, + _Rp>::value; + }; + template <class _Fp> + struct __callable<_Fp, false> + { + static const bool value = false; + }; + + template <class _Fp> + using _EnableIfLValueCallable = typename enable_if<__callable<_Fp&>::value>::type; +public: + typedef _Rp result_type; + + // construct/copy/destroy: + _LIBCPP_INLINE_VISIBILITY + function() _NOEXCEPT { } + _LIBCPP_INLINE_VISIBILITY + function(nullptr_t) _NOEXCEPT {} + function(const function&); + function(function&&) _NOEXCEPT; + template<class _Fp, class = _EnableIfLValueCallable<_Fp>> + function(_Fp); + +#if _LIBCPP_STD_VER <= 14 + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&) _NOEXCEPT {} + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT {} + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, const function&); + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, function&&); + template<class _Fp, class _Alloc, class = _EnableIfLValueCallable<_Fp>> + function(allocator_arg_t, const _Alloc& __a, _Fp __f); +#endif + + function& operator=(const function&); + function& operator=(function&&) _NOEXCEPT; + function& operator=(nullptr_t) _NOEXCEPT; + template<class _Fp, class = _EnableIfLValueCallable<typename decay<_Fp>::type>> + function& operator=(_Fp&&); + + ~function(); + + // function modifiers: + void swap(function&) _NOEXCEPT; + +#if _LIBCPP_STD_VER <= 14 + template<class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY + void assign(_Fp&& __f, const _Alloc& __a) + {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);} +#endif + + // function capacity: + _LIBCPP_INLINE_VISIBILITY + explicit operator bool() const _NOEXCEPT { + return static_cast<bool>(__f_); + } + + // deleted overloads close possible hole in the type system + template<class _R2, class... _ArgTypes2> + bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete; + template<class _R2, class... _ArgTypes2> + bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete; +public: + // function invocation: + _Rp operator()(_ArgTypes...) const; + +#ifndef _LIBCPP_NO_RTTI + // function target access: + const std::type_info& target_type() const _NOEXCEPT; + template <typename _Tp> _Tp* target() _NOEXCEPT; + template <typename _Tp> const _Tp* target() const _NOEXCEPT; +#endif // _LIBCPP_NO_RTTI +}; + +#if _LIBCPP_STD_VER >= 17 +template<class _Rp, class ..._Ap> +function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>; + +template<class _Fp> +struct __strip_signature; + +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...)> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile> { using type = _Rp(_Ap...); }; + +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) &> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const &> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile &> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile &> { using type = _Rp(_Ap...); }; + +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile noexcept> { using type = _Rp(_Ap...); }; + +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) & noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const & noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) volatile & noexcept> { using type = _Rp(_Ap...); }; +template<class _Rp, class _Gp, class ..._Ap> +struct __strip_signature<_Rp (_Gp::*) (_Ap...) const volatile & noexcept> { using type = _Rp(_Ap...); }; + +template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type> +function(_Fp) -> function<_Stripped>; +#endif // _LIBCPP_STD_VER >= 17 + +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {} + +#if _LIBCPP_STD_VER <= 14 +template<class _Rp, class ..._ArgTypes> +template <class _Alloc> +function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, + const function& __f) : __f_(__f.__f_) {} +#endif + +template <class _Rp, class... _ArgTypes> +function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT + : __f_(_VSTD::move(__f.__f_)) {} + +#if _LIBCPP_STD_VER <= 14 +template<class _Rp, class ..._ArgTypes> +template <class _Alloc> +function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&, + function&& __f) + : __f_(_VSTD::move(__f.__f_)) {} +#endif + +template <class _Rp, class... _ArgTypes> +template <class _Fp, class> +function<_Rp(_ArgTypes...)>::function(_Fp __f) : __f_(_VSTD::move(__f)) {} + +#if _LIBCPP_STD_VER <= 14 +template <class _Rp, class... _ArgTypes> +template <class _Fp, class _Alloc, class> +function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a, + _Fp __f) + : __f_(_VSTD::move(__f), __a) {} +#endif + +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(const function& __f) +{ + function(__f).swap(*this); + return *this; +} + +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT +{ + __f_ = _VSTD::move(__f.__f_); + return *this; +} + +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT +{ + __f_ = nullptr; + return *this; +} + +template<class _Rp, class ..._ArgTypes> +template <class _Fp, class> +function<_Rp(_ArgTypes...)>& +function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f) +{ + function(_VSTD::forward<_Fp>(__f)).swap(*this); + return *this; +} + +template<class _Rp, class ..._ArgTypes> +function<_Rp(_ArgTypes...)>::~function() {} + +template<class _Rp, class ..._ArgTypes> +void +function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT +{ + __f_.swap(__f.__f_); +} + +template<class _Rp, class ..._ArgTypes> +_Rp +function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const +{ + return __f_(_VSTD::forward<_ArgTypes>(__arg)...); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Rp, class ..._ArgTypes> +const std::type_info& +function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT +{ + return __f_.target_type(); +} + +template<class _Rp, class ..._ArgTypes> +template <typename _Tp> +_Tp* +function<_Rp(_ArgTypes...)>::target() _NOEXCEPT +{ + return (_Tp*)(__f_.template target<_Tp>()); +} + +template<class _Rp, class ..._ArgTypes> +template <typename _Tp> +const _Tp* +function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT +{ + return __f_.template target<_Tp>(); +} + +#endif // _LIBCPP_NO_RTTI + +template <class _Rp, class... _ArgTypes> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;} + +template <class _Rp, class... _ArgTypes> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;} + +template <class _Rp, class... _ArgTypes> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;} + +template <class _Rp, class... _ArgTypes> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;} + +template <class _Rp, class... _ArgTypes> +inline _LIBCPP_INLINE_VISIBILITY +void +swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT +{return __x.swap(__y);} + +#else // _LIBCPP_CXX03_LANG + +namespace __function { + +template<class _Fp> class __base; + +template<class _Rp> +class __base<_Rp()> +{ + __base(const __base&); + __base& operator=(const __base&); +public: + __base() {} + virtual ~__base() {} + virtual __base* __clone() const = 0; + virtual void __clone(__base*) const = 0; + virtual void destroy() = 0; + virtual void destroy_deallocate() = 0; + virtual _Rp operator()() = 0; +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const = 0; + virtual const std::type_info& target_type() const = 0; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0> +class __base<_Rp(_A0)> +{ + __base(const __base&); + __base& operator=(const __base&); +public: + __base() {} + virtual ~__base() {} + virtual __base* __clone() const = 0; + virtual void __clone(__base*) const = 0; + virtual void destroy() = 0; + virtual void destroy_deallocate() = 0; + virtual _Rp operator()(_A0) = 0; +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const = 0; + virtual const std::type_info& target_type() const = 0; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0, class _A1> +class __base<_Rp(_A0, _A1)> +{ + __base(const __base&); + __base& operator=(const __base&); +public: + __base() {} + virtual ~__base() {} + virtual __base* __clone() const = 0; + virtual void __clone(__base*) const = 0; + virtual void destroy() = 0; + virtual void destroy_deallocate() = 0; + virtual _Rp operator()(_A0, _A1) = 0; +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const = 0; + virtual const std::type_info& target_type() const = 0; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0, class _A1, class _A2> +class __base<_Rp(_A0, _A1, _A2)> +{ + __base(const __base&); + __base& operator=(const __base&); +public: + __base() {} + virtual ~__base() {} + virtual __base* __clone() const = 0; + virtual void __clone(__base*) const = 0; + virtual void destroy() = 0; + virtual void destroy_deallocate() = 0; + virtual _Rp operator()(_A0, _A1, _A2) = 0; +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const = 0; + virtual const std::type_info& target_type() const = 0; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _FD, class _Alloc, class _FB> class __func; + +template<class _Fp, class _Alloc, class _Rp> +class __func<_Fp, _Alloc, _Rp()> + : public __base<_Rp()> +{ + __compressed_pair<_Fp, _Alloc> __f_; +public: + explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} + explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp()>* __clone() const; + virtual void __clone(__base<_Rp()>*) const; + virtual void destroy(); + virtual void destroy_deallocate(); + virtual _Rp operator()(); +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const; + virtual const std::type_info& target_type() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Fp, class _Alloc, class _Rp> +__base<_Rp()>* +__func<_Fp, _Alloc, _Rp()>::__clone() const +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a)); + return __hold.release(); +} + +template<class _Fp, class _Alloc, class _Rp> +void +__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const +{ + ::new ((void*)__p) __func(__f_.first(), __f_.second()); +} + +template<class _Fp, class _Alloc, class _Rp> +void +__func<_Fp, _Alloc, _Rp()>::destroy() +{ + __f_.~__compressed_pair<_Fp, _Alloc>(); +} + +template<class _Fp, class _Alloc, class _Rp> +void +__func<_Fp, _Alloc, _Rp()>::destroy_deallocate() +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); + __a.deallocate(this, 1); +} + +template<class _Fp, class _Alloc, class _Rp> +_Rp +__func<_Fp, _Alloc, _Rp()>::operator()() +{ + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first()); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp> +const void* +__func<_Fp, _Alloc, _Rp()>::target(const type_info& __ti) const +{ + if (__ti == typeid(_Fp)) + return &__f_.first(); + return (const void*)0; +} + +template<class _Fp, class _Alloc, class _Rp> +const std::type_info& +__func<_Fp, _Alloc, _Rp()>::target_type() const +{ + return typeid(_Fp); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0> +class __func<_Fp, _Alloc, _Rp(_A0)> + : public __base<_Rp(_A0)> +{ + __compressed_pair<_Fp, _Alloc> __f_; +public: + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) + : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp(_A0)>* __clone() const; + virtual void __clone(__base<_Rp(_A0)>*) const; + virtual void destroy(); + virtual void destroy_deallocate(); + virtual _Rp operator()(_A0); +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const; + virtual const std::type_info& target_type() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Fp, class _Alloc, class _Rp, class _A0> +__base<_Rp(_A0)>* +__func<_Fp, _Alloc, _Rp(_A0)>::__clone() const +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a)); + return __hold.release(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0> +void +__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const +{ + ::new ((void*)__p) __func(__f_.first(), __f_.second()); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0> +void +__func<_Fp, _Alloc, _Rp(_A0)>::destroy() +{ + __f_.~__compressed_pair<_Fp, _Alloc>(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0> +void +__func<_Fp, _Alloc, _Rp(_A0)>::destroy_deallocate() +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); + __a.deallocate(this, 1); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0> +_Rp +__func<_Fp, _Alloc, _Rp(_A0)>::operator()(_A0 __a0) +{ + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0> +const void* +__func<_Fp, _Alloc, _Rp(_A0)>::target(const type_info& __ti) const +{ + if (__ti == typeid(_Fp)) + return &__f_.first(); + return (const void*)0; +} + +template<class _Fp, class _Alloc, class _Rp, class _A0> +const std::type_info& +__func<_Fp, _Alloc, _Rp(_A0)>::target_type() const +{ + return typeid(_Fp); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +class __func<_Fp, _Alloc, _Rp(_A0, _A1)> + : public __base<_Rp(_A0, _A1)> +{ + __compressed_pair<_Fp, _Alloc> __f_; +public: + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) + : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp(_A0, _A1)>* __clone() const; + virtual void __clone(__base<_Rp(_A0, _A1)>*) const; + virtual void destroy(); + virtual void destroy_deallocate(); + virtual _Rp operator()(_A0, _A1); +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const; + virtual const std::type_info& target_type() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +__base<_Rp(_A0, _A1)>* +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a)); + return __hold.release(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const +{ + ::new ((void*)__p) __func(__f_.first(), __f_.second()); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy() +{ + __f_.~__compressed_pair<_Fp, _Alloc>(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy_deallocate() +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); + __a.deallocate(this, 1); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +_Rp +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) +{ + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0, __a1); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +const void* +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target(const type_info& __ti) const +{ + if (__ti == typeid(_Fp)) + return &__f_.first(); + return (const void*)0; +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> +const std::type_info& +__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target_type() const +{ + return typeid(_Fp); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> + : public __base<_Rp(_A0, _A1, _A2)> +{ + __compressed_pair<_Fp, _Alloc> __f_; +public: + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} + _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) + : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} + virtual __base<_Rp(_A0, _A1, _A2)>* __clone() const; + virtual void __clone(__base<_Rp(_A0, _A1, _A2)>*) const; + virtual void destroy(); + virtual void destroy_deallocate(); + virtual _Rp operator()(_A0, _A1, _A2); +#ifndef _LIBCPP_NO_RTTI + virtual const void* target(const type_info&) const; + virtual const std::type_info& target_type() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +__base<_Rp(_A0, _A1, _A2)>* +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) __func(__f_.first(), _Alloc(__a)); + return __hold.release(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const +{ + ::new ((void*)__p) __func(__f_.first(), __f_.second()); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy() +{ + __f_.~__compressed_pair<_Fp, _Alloc>(); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +void +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy_deallocate() +{ + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; + _Ap __a(__f_.second()); + __f_.~__compressed_pair<_Fp, _Alloc>(); + __a.deallocate(this, 1); +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +_Rp +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) +{ + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0, __a1, __a2); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +const void* +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target(const type_info& __ti) const +{ + if (__ti == typeid(_Fp)) + return &__f_.first(); + return (const void*)0; +} + +template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> +const std::type_info& +__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const +{ + return typeid(_Fp); +} + +#endif // _LIBCPP_NO_RTTI + +} // __function + +template<class _Rp> +class _LIBCPP_TEMPLATE_VIS function<_Rp()> +{ + typedef __function::__base<_Rp()> __base; + aligned_storage<3*sizeof(void*)>::type __buf_; + __base* __f_; + +public: + typedef _Rp result_type; + + // 20.7.16.2.1, construct/copy/destroy: + _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} + _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} + function(const function&); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&) : __f_(0) {} + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, const function&); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + function& operator=(const function&); + function& operator=(nullptr_t); + template<class _Fp> + typename enable_if + < + !is_integral<_Fp>::value, + function& + >::type + operator=(_Fp); + + ~function(); + + // 20.7.16.2.2, function modifiers: + void swap(function&); + template<class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY + void assign(_Fp __f, const _Alloc& __a) + {function(allocator_arg, __a, __f).swap(*this);} + + // 20.7.16.2.3, function capacity: + _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} + +private: + // deleted overloads close possible hole in the type system + template<class _R2> + bool operator==(const function<_R2()>&) const;// = delete; + template<class _R2> + bool operator!=(const function<_R2()>&) const;// = delete; +public: + // 20.7.16.2.4, function invocation: + _Rp operator()() const; + +#ifndef _LIBCPP_NO_RTTI + // 20.7.16.2.5, function target access: + const std::type_info& target_type() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp> +function<_Rp()>::function(const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp> +template<class _Alloc> +function<_Rp()>::function(allocator_arg_t, const _Alloc&, const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp> +template <class _Fp> +function<_Rp()>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f); + } + else + { + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp> +template <class _Fp, class _Alloc> +function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + typedef allocator_traits<_Alloc> __alloc_traits; + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, _Alloc, _Rp()> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f, __a0); + } + else + { + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp> +function<_Rp()>& +function<_Rp()>::operator=(const function& __f) +{ + if (__f) + function(__f).swap(*this); + else + *this = nullptr; + return *this; +} + +template<class _Rp> +function<_Rp()>& +function<_Rp()>::operator=(nullptr_t) +{ + __base* __t = __f_; + __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); + return *this; +} + +template<class _Rp> +template <class _Fp> +typename enable_if +< + !is_integral<_Fp>::value, + function<_Rp()>& +>::type +function<_Rp()>::operator=(_Fp __f) +{ + function(_VSTD::move(__f)).swap(*this); + return *this; +} + +template<class _Rp> +function<_Rp()>::~function() +{ + if (__f_ == (__base*)&__buf_) + __f_->destroy(); + else if (__f_) + __f_->destroy_deallocate(); +} + +template<class _Rp> +void +function<_Rp()>::swap(function& __f) +{ + if (_VSTD::addressof(__f) == this) + return; + if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) + { + typename aligned_storage<sizeof(__buf_)>::type __tempbuf; + __base* __t = (__base*)&__tempbuf; + __f_->__clone(__t); + __f_->destroy(); + __f_ = 0; + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = 0; + __f_ = (__base*)&__buf_; + __t->__clone((__base*)&__f.__buf_); + __t->destroy(); + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f_ == (__base*)&__buf_) + { + __f_->__clone((__base*)&__f.__buf_); + __f_->destroy(); + __f_ = __f.__f_; + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f.__f_ == (__base*)&__f.__buf_) + { + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = __f_; + __f_ = (__base*)&__buf_; + } + else + _VSTD::swap(__f_, __f.__f_); +} + +template<class _Rp> +_Rp +function<_Rp()>::operator()() const +{ + if (__f_ == 0) + __throw_bad_function_call(); + return (*__f_)(); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Rp> +const std::type_info& +function<_Rp()>::target_type() const +{ + if (__f_ == 0) + return typeid(void); + return __f_->target_type(); +} + +template<class _Rp> +template <typename _Tp> +_Tp* +function<_Rp()>::target() +{ + if (__f_ == 0) + return (_Tp*)0; + return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); +} + +template<class _Rp> +template <typename _Tp> +const _Tp* +function<_Rp()>::target() const +{ + if (__f_ == 0) + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Rp, class _A0> +class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)> + : public unary_function<_A0, _Rp> +{ + typedef __function::__base<_Rp(_A0)> __base; + aligned_storage<3*sizeof(void*)>::type __buf_; + __base* __f_; + +public: + typedef _Rp result_type; + + // 20.7.16.2.1, construct/copy/destroy: + _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} + _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} + function(const function&); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&) : __f_(0) {} + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, const function&); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + function& operator=(const function&); + function& operator=(nullptr_t); + template<class _Fp> + typename enable_if + < + !is_integral<_Fp>::value, + function& + >::type + operator=(_Fp); + + ~function(); + + // 20.7.16.2.2, function modifiers: + void swap(function&); + template<class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY + void assign(_Fp __f, const _Alloc& __a) + {function(allocator_arg, __a, __f).swap(*this);} + + // 20.7.16.2.3, function capacity: + _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} + +private: + // deleted overloads close possible hole in the type system + template<class _R2, class _B0> + bool operator==(const function<_R2(_B0)>&) const;// = delete; + template<class _R2, class _B0> + bool operator!=(const function<_R2(_B0)>&) const;// = delete; +public: + // 20.7.16.2.4, function invocation: + _Rp operator()(_A0) const; + +#ifndef _LIBCPP_NO_RTTI + // 20.7.16.2.5, function target access: + const std::type_info& target_type() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0> +function<_Rp(_A0)>::function(const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0> +template<class _Alloc> +function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0> +template <class _Fp> +function<_Rp(_A0)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f); + } + else + { + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0> +template <class _Fp, class _Alloc> +function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + typedef allocator_traits<_Alloc> __alloc_traits; + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f, __a0); + } + else + { + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0> +function<_Rp(_A0)>& +function<_Rp(_A0)>::operator=(const function& __f) +{ + if (__f) + function(__f).swap(*this); + else + *this = nullptr; + return *this; +} + +template<class _Rp, class _A0> +function<_Rp(_A0)>& +function<_Rp(_A0)>::operator=(nullptr_t) +{ + __base* __t = __f_; + __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); + return *this; +} + +template<class _Rp, class _A0> +template <class _Fp> +typename enable_if +< + !is_integral<_Fp>::value, + function<_Rp(_A0)>& +>::type +function<_Rp(_A0)>::operator=(_Fp __f) +{ + function(_VSTD::move(__f)).swap(*this); + return *this; +} + +template<class _Rp, class _A0> +function<_Rp(_A0)>::~function() +{ + if (__f_ == (__base*)&__buf_) + __f_->destroy(); + else if (__f_) + __f_->destroy_deallocate(); +} + +template<class _Rp, class _A0> +void +function<_Rp(_A0)>::swap(function& __f) +{ + if (_VSTD::addressof(__f) == this) + return; + if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) + { + typename aligned_storage<sizeof(__buf_)>::type __tempbuf; + __base* __t = (__base*)&__tempbuf; + __f_->__clone(__t); + __f_->destroy(); + __f_ = 0; + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = 0; + __f_ = (__base*)&__buf_; + __t->__clone((__base*)&__f.__buf_); + __t->destroy(); + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f_ == (__base*)&__buf_) + { + __f_->__clone((__base*)&__f.__buf_); + __f_->destroy(); + __f_ = __f.__f_; + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f.__f_ == (__base*)&__f.__buf_) + { + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = __f_; + __f_ = (__base*)&__buf_; + } + else + _VSTD::swap(__f_, __f.__f_); +} + +template<class _Rp, class _A0> +_Rp +function<_Rp(_A0)>::operator()(_A0 __a0) const +{ + if (__f_ == 0) + __throw_bad_function_call(); + return (*__f_)(__a0); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Rp, class _A0> +const std::type_info& +function<_Rp(_A0)>::target_type() const +{ + if (__f_ == 0) + return typeid(void); + return __f_->target_type(); +} + +template<class _Rp, class _A0> +template <typename _Tp> +_Tp* +function<_Rp(_A0)>::target() +{ + if (__f_ == 0) + return (_Tp*)0; + return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); +} + +template<class _Rp, class _A0> +template <typename _Tp> +const _Tp* +function<_Rp(_A0)>::target() const +{ + if (__f_ == 0) + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Rp, class _A0, class _A1> +class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)> + : public binary_function<_A0, _A1, _Rp> +{ + typedef __function::__base<_Rp(_A0, _A1)> __base; + aligned_storage<3*sizeof(void*)>::type __buf_; + __base* __f_; + +public: + typedef _Rp result_type; + + // 20.7.16.2.1, construct/copy/destroy: + _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} + _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} + function(const function&); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&) : __f_(0) {} + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, const function&); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + function& operator=(const function&); + function& operator=(nullptr_t); + template<class _Fp> + typename enable_if + < + !is_integral<_Fp>::value, + function& + >::type + operator=(_Fp); + + ~function(); + + // 20.7.16.2.2, function modifiers: + void swap(function&); + template<class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY + void assign(_Fp __f, const _Alloc& __a) + {function(allocator_arg, __a, __f).swap(*this);} + + // 20.7.16.2.3, function capacity: + _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} + +private: + // deleted overloads close possible hole in the type system + template<class _R2, class _B0, class _B1> + bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete; + template<class _R2, class _B0, class _B1> + bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete; +public: + // 20.7.16.2.4, function invocation: + _Rp operator()(_A0, _A1) const; + +#ifndef _LIBCPP_NO_RTTI + // 20.7.16.2.5, function target access: + const std::type_info& target_type() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>::function(const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0, class _A1> +template<class _Alloc> +function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0, class _A1> +template <class _Fp> +function<_Rp(_A0, _A1)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f); + } + else + { + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0, class _A1> +template <class _Fp, class _Alloc> +function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + typedef allocator_traits<_Alloc> __alloc_traits; + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f, __a0); + } + else + { + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>& +function<_Rp(_A0, _A1)>::operator=(const function& __f) +{ + if (__f) + function(__f).swap(*this); + else + *this = nullptr; + return *this; +} + +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>& +function<_Rp(_A0, _A1)>::operator=(nullptr_t) +{ + __base* __t = __f_; + __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); + return *this; +} + +template<class _Rp, class _A0, class _A1> +template <class _Fp> +typename enable_if +< + !is_integral<_Fp>::value, + function<_Rp(_A0, _A1)>& +>::type +function<_Rp(_A0, _A1)>::operator=(_Fp __f) +{ + function(_VSTD::move(__f)).swap(*this); + return *this; +} + +template<class _Rp, class _A0, class _A1> +function<_Rp(_A0, _A1)>::~function() +{ + if (__f_ == (__base*)&__buf_) + __f_->destroy(); + else if (__f_) + __f_->destroy_deallocate(); +} + +template<class _Rp, class _A0, class _A1> +void +function<_Rp(_A0, _A1)>::swap(function& __f) +{ + if (_VSTD::addressof(__f) == this) + return; + if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) + { + typename aligned_storage<sizeof(__buf_)>::type __tempbuf; + __base* __t = (__base*)&__tempbuf; + __f_->__clone(__t); + __f_->destroy(); + __f_ = 0; + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = 0; + __f_ = (__base*)&__buf_; + __t->__clone((__base*)&__f.__buf_); + __t->destroy(); + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f_ == (__base*)&__buf_) + { + __f_->__clone((__base*)&__f.__buf_); + __f_->destroy(); + __f_ = __f.__f_; + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f.__f_ == (__base*)&__f.__buf_) + { + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = __f_; + __f_ = (__base*)&__buf_; + } + else + _VSTD::swap(__f_, __f.__f_); +} + +template<class _Rp, class _A0, class _A1> +_Rp +function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const +{ + if (__f_ == 0) + __throw_bad_function_call(); + return (*__f_)(__a0, __a1); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Rp, class _A0, class _A1> +const std::type_info& +function<_Rp(_A0, _A1)>::target_type() const +{ + if (__f_ == 0) + return typeid(void); + return __f_->target_type(); +} + +template<class _Rp, class _A0, class _A1> +template <typename _Tp> +_Tp* +function<_Rp(_A0, _A1)>::target() +{ + if (__f_ == 0) + return (_Tp*)0; + return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); +} + +template<class _Rp, class _A0, class _A1> +template <typename _Tp> +const _Tp* +function<_Rp(_A0, _A1)>::target() const +{ + if (__f_ == 0) + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Rp, class _A0, class _A1, class _A2> +class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)> +{ + typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; + aligned_storage<3*sizeof(void*)>::type __buf_; + __base* __f_; + +public: + typedef _Rp result_type; + + // 20.7.16.2.1, construct/copy/destroy: + _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} + _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} + function(const function&); + template<class _Fp> + function(_Fp, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&) : __f_(0) {} + template<class _Alloc> + _LIBCPP_INLINE_VISIBILITY + function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} + template<class _Alloc> + function(allocator_arg_t, const _Alloc&, const function&); + template<class _Fp, class _Alloc> + function(allocator_arg_t, const _Alloc& __a, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type* = 0); + + function& operator=(const function&); + function& operator=(nullptr_t); + template<class _Fp> + typename enable_if + < + !is_integral<_Fp>::value, + function& + >::type + operator=(_Fp); + + ~function(); + + // 20.7.16.2.2, function modifiers: + void swap(function&); + template<class _Fp, class _Alloc> + _LIBCPP_INLINE_VISIBILITY + void assign(_Fp __f, const _Alloc& __a) + {function(allocator_arg, __a, __f).swap(*this);} + + // 20.7.16.2.3, function capacity: + _LIBCPP_INLINE_VISIBILITY explicit operator bool() const {return __f_;} + +private: + // deleted overloads close possible hole in the type system + template<class _R2, class _B0, class _B1, class _B2> + bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; + template<class _R2, class _B0, class _B1, class _B2> + bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; +public: + // 20.7.16.2.4, function invocation: + _Rp operator()(_A0, _A1, _A2) const; + +#ifndef _LIBCPP_NO_RTTI + // 20.7.16.2.5, function target access: + const std::type_info& target_type() const; + template <typename _Tp> _Tp* target(); + template <typename _Tp> const _Tp* target() const; +#endif // _LIBCPP_NO_RTTI +}; + +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>::function(const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0, class _A1, class _A2> +template<class _Alloc> +function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&, + const function& __f) +{ + if (__f.__f_ == 0) + __f_ = 0; + else if (__f.__f_ == (const __base*)&__f.__buf_) + { + __f_ = (__base*)&__buf_; + __f.__f_->__clone(__f_); + } + else + __f_ = __f.__f_->__clone(); +} + +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp> +function<_Rp(_A0, _A1, _A2)>::function(_Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f); + } + else + { + typedef allocator<_FF> _Ap; + _Ap __a; + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, allocator<_Fp>(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp, class _Alloc> +function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, + typename enable_if<!is_integral<_Fp>::value>::type*) + : __f_(0) +{ + typedef allocator_traits<_Alloc> __alloc_traits; + if (__function::__not_null(__f)) + { + typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF; + if (sizeof(_FF) <= sizeof(__buf_)) + { + __f_ = (__base*)&__buf_; + ::new ((void*)__f_) _FF(__f, __a0); + } + else + { + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; + _Ap __a(__a0); + typedef __allocator_destructor<_Ap> _Dp; + unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); + ::new ((void*)__hold.get()) _FF(__f, _Alloc(__a)); + __f_ = __hold.release(); + } + } +} + +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>& +function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f) +{ + if (__f) + function(__f).swap(*this); + else + *this = nullptr; + return *this; +} + +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>& +function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t) +{ + __base* __t = __f_; + __f_ = 0; + if (__t == (__base*)&__buf_) + __t->destroy(); + else if (__t) + __t->destroy_deallocate(); + return *this; +} + +template<class _Rp, class _A0, class _A1, class _A2> +template <class _Fp> +typename enable_if +< + !is_integral<_Fp>::value, + function<_Rp(_A0, _A1, _A2)>& +>::type +function<_Rp(_A0, _A1, _A2)>::operator=(_Fp __f) +{ + function(_VSTD::move(__f)).swap(*this); + return *this; +} + +template<class _Rp, class _A0, class _A1, class _A2> +function<_Rp(_A0, _A1, _A2)>::~function() +{ + if (__f_ == (__base*)&__buf_) + __f_->destroy(); + else if (__f_) + __f_->destroy_deallocate(); +} + +template<class _Rp, class _A0, class _A1, class _A2> +void +function<_Rp(_A0, _A1, _A2)>::swap(function& __f) +{ + if (_VSTD::addressof(__f) == this) + return; + if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) + { + typename aligned_storage<sizeof(__buf_)>::type __tempbuf; + __base* __t = (__base*)&__tempbuf; + __f_->__clone(__t); + __f_->destroy(); + __f_ = 0; + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = 0; + __f_ = (__base*)&__buf_; + __t->__clone((__base*)&__f.__buf_); + __t->destroy(); + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f_ == (__base*)&__buf_) + { + __f_->__clone((__base*)&__f.__buf_); + __f_->destroy(); + __f_ = __f.__f_; + __f.__f_ = (__base*)&__f.__buf_; + } + else if (__f.__f_ == (__base*)&__f.__buf_) + { + __f.__f_->__clone((__base*)&__buf_); + __f.__f_->destroy(); + __f.__f_ = __f_; + __f_ = (__base*)&__buf_; + } + else + _VSTD::swap(__f_, __f.__f_); +} + +template<class _Rp, class _A0, class _A1, class _A2> +_Rp +function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const +{ + if (__f_ == 0) + __throw_bad_function_call(); + return (*__f_)(__a0, __a1, __a2); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Rp, class _A0, class _A1, class _A2> +const std::type_info& +function<_Rp(_A0, _A1, _A2)>::target_type() const +{ + if (__f_ == 0) + return typeid(void); + return __f_->target_type(); +} + +template<class _Rp, class _A0, class _A1, class _A2> +template <typename _Tp> +_Tp* +function<_Rp(_A0, _A1, _A2)>::target() +{ + if (__f_ == 0) + return (_Tp*)0; + return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); +} + +template<class _Rp, class _A0, class _A1, class _A2> +template <typename _Tp> +const _Tp* +function<_Rp(_A0, _A1, _A2)>::target() const +{ + if (__f_ == 0) + return (const _Tp*)0; + return (const _Tp*)__f_->target(typeid(_Tp)); +} + +#endif // _LIBCPP_NO_RTTI + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const function<_Fp>& __f, nullptr_t) {return !__f;} + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(nullptr_t, const function<_Fp>& __f) {return !__f;} + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const function<_Fp>& __f, nullptr_t) {return (bool)__f;} + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(nullptr_t, const function<_Fp>& __f) {return (bool)__f;} + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +void +swap(function<_Fp>& __x, function<_Fp>& __y) +{return __x.swap(__y);} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_FUNCTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/hash.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/hash.h new file mode 100644 index 0000000..b1a3ad9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/hash.h
@@ -0,0 +1,870 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_HASH_H +#define _LIBCPP___FUNCTIONAL_HASH_H + +#include <__config> +#include <__functional/unary_function.h> +#include <__tuple> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/pair.h> +#include <__utility/swap.h> +#include <cstdint> +#include <cstring> +#include <cstddef> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Size> +inline _LIBCPP_INLINE_VISIBILITY +_Size +__loadword(const void* __p) +{ + _Size __r; + _VSTD::memcpy(&__r, __p, sizeof(__r)); + return __r; +} + +// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t +// is 64 bits. This is because cityhash64 uses 64bit x 64bit +// multiplication, which can be very slow on 32-bit systems. +template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__> +struct __murmur2_or_cityhash; + +template <class _Size> +struct __murmur2_or_cityhash<_Size, 32> +{ + inline _Size operator()(const void* __key, _Size __len) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK; +}; + +// murmur2 +template <class _Size> +_Size +__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len) +{ + const _Size __m = 0x5bd1e995; + const _Size __r = 24; + _Size __h = __len; + const unsigned char* __data = static_cast<const unsigned char*>(__key); + for (; __len >= 4; __data += 4, __len -= 4) + { + _Size __k = __loadword<_Size>(__data); + __k *= __m; + __k ^= __k >> __r; + __k *= __m; + __h *= __m; + __h ^= __k; + } + switch (__len) + { + case 3: + __h ^= static_cast<_Size>(__data[2] << 16); + _LIBCPP_FALLTHROUGH(); + case 2: + __h ^= static_cast<_Size>(__data[1] << 8); + _LIBCPP_FALLTHROUGH(); + case 1: + __h ^= __data[0]; + __h *= __m; + } + __h ^= __h >> 13; + __h *= __m; + __h ^= __h >> 15; + return __h; +} + +template <class _Size> +struct __murmur2_or_cityhash<_Size, 64> +{ + inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK; + + private: + // Some primes between 2^63 and 2^64. + static const _Size __k0 = 0xc3a5c85c97cb3127ULL; + static const _Size __k1 = 0xb492b66fbe98f273ULL; + static const _Size __k2 = 0x9ae16a3b2f90404fULL; + static const _Size __k3 = 0xc949d7c7509e6557ULL; + + static _Size __rotate(_Size __val, int __shift) { + return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift))); + } + + static _Size __rotate_by_at_least_1(_Size __val, int __shift) { + return (__val >> __shift) | (__val << (64 - __shift)); + } + + static _Size __shift_mix(_Size __val) { + return __val ^ (__val >> 47); + } + + static _Size __hash_len_16(_Size __u, _Size __v) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + const _Size __mul = 0x9ddfea08eb382d69ULL; + _Size __a = (__u ^ __v) * __mul; + __a ^= (__a >> 47); + _Size __b = (__v ^ __a) * __mul; + __b ^= (__b >> 47); + __b *= __mul; + return __b; + } + + static _Size __hash_len_0_to_16(const char* __s, _Size __len) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + if (__len > 8) { + const _Size __a = __loadword<_Size>(__s); + const _Size __b = __loadword<_Size>(__s + __len - 8); + return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b; + } + if (__len >= 4) { + const uint32_t __a = __loadword<uint32_t>(__s); + const uint32_t __b = __loadword<uint32_t>(__s + __len - 4); + return __hash_len_16(__len + (__a << 3), __b); + } + if (__len > 0) { + const unsigned char __a = static_cast<unsigned char>(__s[0]); + const unsigned char __b = static_cast<unsigned char>(__s[__len >> 1]); + const unsigned char __c = static_cast<unsigned char>(__s[__len - 1]); + const uint32_t __y = static_cast<uint32_t>(__a) + + (static_cast<uint32_t>(__b) << 8); + const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2); + return __shift_mix(__y * __k2 ^ __z * __k3) * __k2; + } + return __k2; + } + + static _Size __hash_len_17_to_32(const char *__s, _Size __len) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + const _Size __a = __loadword<_Size>(__s) * __k1; + const _Size __b = __loadword<_Size>(__s + 8); + const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2; + const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0; + return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d, + __a + __rotate(__b ^ __k3, 20) - __c + __len); + } + + // Return a 16-byte hash for 48 bytes. Quick and dirty. + // Callers do best to use "random-looking" values for a and b. + static pair<_Size, _Size> __weak_hash_len_32_with_seeds( + _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + __a += __w; + __b = __rotate(__b + __a + __z, 21); + const _Size __c = __a; + __a += __x; + __a += __y; + __b += __rotate(__a, 44); + return pair<_Size, _Size>(__a + __z, __b + __c); + } + + // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. + static pair<_Size, _Size> __weak_hash_len_32_with_seeds( + const char* __s, _Size __a, _Size __b) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s), + __loadword<_Size>(__s + 8), + __loadword<_Size>(__s + 16), + __loadword<_Size>(__s + 24), + __a, + __b); + } + + // Return an 8-byte hash for 33 to 64 bytes. + static _Size __hash_len_33_to_64(const char *__s, size_t __len) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK + { + _Size __z = __loadword<_Size>(__s + 24); + _Size __a = __loadword<_Size>(__s) + + (__len + __loadword<_Size>(__s + __len - 16)) * __k0; + _Size __b = __rotate(__a + __z, 52); + _Size __c = __rotate(__a, 37); + __a += __loadword<_Size>(__s + 8); + __c += __rotate(__a, 7); + __a += __loadword<_Size>(__s + 16); + _Size __vf = __a + __z; + _Size __vs = __b + __rotate(__a, 31) + __c; + __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32); + __z += __loadword<_Size>(__s + __len - 8); + __b = __rotate(__a + __z, 52); + __c = __rotate(__a, 37); + __a += __loadword<_Size>(__s + __len - 24); + __c += __rotate(__a, 7); + __a += __loadword<_Size>(__s + __len - 16); + _Size __wf = __a + __z; + _Size __ws = __b + __rotate(__a, 31) + __c; + _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0); + return __shift_mix(__r * __k0 + __vs) * __k2; + } +}; + +// cityhash64 +template <class _Size> +_Size +__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len) +{ + const char* __s = static_cast<const char*>(__key); + if (__len <= 32) { + if (__len <= 16) { + return __hash_len_0_to_16(__s, __len); + } else { + return __hash_len_17_to_32(__s, __len); + } + } else if (__len <= 64) { + return __hash_len_33_to_64(__s, __len); + } + + // For strings over 64 bytes we hash the end first, and then as we + // loop we keep 56 bytes of state: v, w, x, y, and z. + _Size __x = __loadword<_Size>(__s + __len - 40); + _Size __y = __loadword<_Size>(__s + __len - 16) + + __loadword<_Size>(__s + __len - 56); + _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len, + __loadword<_Size>(__s + __len - 24)); + pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z); + pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x); + __x = __x * __k1 + __loadword<_Size>(__s); + + // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks. + __len = (__len - 1) & ~static_cast<_Size>(63); + do { + __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1; + __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1; + __x ^= __w.second; + __y += __v.first + __loadword<_Size>(__s + 40); + __z = __rotate(__z + __w.first, 33) * __k1; + __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first); + __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second, + __y + __loadword<_Size>(__s + 16)); + _VSTD::swap(__z, __x); + __s += 64; + __len -= 64; + } while (__len != 0); + return __hash_len_16( + __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z, + __hash_len_16(__v.second, __w.second) + __x); +} + +template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)> +struct __scalar_hash; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct __scalar_hash<_Tp, 0> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + union + { + _Tp __t; + size_t __a; + } __u; + __u.__a = 0; + __u.__t = __v; + return __u.__a; + } +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct __scalar_hash<_Tp, 1> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + union + { + _Tp __t; + size_t __a; + } __u; + __u.__t = __v; + return __u.__a; + } +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct __scalar_hash<_Tp, 2> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + union + { + _Tp __t; + struct + { + size_t __a; + size_t __b; + } __s; + } __u; + __u.__t = __v; + return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); + } +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct __scalar_hash<_Tp, 3> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + union + { + _Tp __t; + struct + { + size_t __a; + size_t __b; + size_t __c; + } __s; + } __u; + __u.__t = __v; + return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); + } +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct __scalar_hash<_Tp, 4> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + union + { + _Tp __t; + struct + { + size_t __a; + size_t __b; + size_t __c; + size_t __d; + } __s; + } __u; + __u.__t = __v; + return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); + } +}; + +struct _PairT { + size_t first; + size_t second; +}; + +_LIBCPP_INLINE_VISIBILITY +inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT { + typedef __scalar_hash<_PairT> _HashT; + const _PairT __p = {__lhs, __rhs}; + return _HashT()(__p); +} + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template<class _Tp> +struct _LIBCPP_TEMPLATE_VIS hash<_Tp*> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp*, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp* __v) const _NOEXCEPT + { + union + { + _Tp* __t; + size_t __a; + } __u; + __u.__t = __v; + return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u)); + } +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<bool> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<bool, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<char> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<char, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef char argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<signed char> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<signed char, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef signed char argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<unsigned char> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<unsigned char, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned char argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +#ifndef _LIBCPP_HAS_NO_CHAR8_T +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<char8_t> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<char8_t, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef char8_t argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(char8_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; +#endif // !_LIBCPP_HAS_NO_CHAR8_T + +#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<char16_t> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<char16_t, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef char16_t argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<char32_t> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<char32_t, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef char32_t argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +#endif // _LIBCPP_HAS_NO_UNICODE_CHARS + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<wchar_t> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<wchar_t, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef wchar_t argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<short> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<short, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef short argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<unsigned short> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<unsigned short, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned short argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<int> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<int, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef int argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<unsigned int> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<unsigned int, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned int argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<long> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<long, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef long argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<unsigned long> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<unsigned long, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef unsigned long argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);} +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<long long> + : public __scalar_hash<long long> +{ +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<unsigned long long> + : public __scalar_hash<unsigned long long> +{ +}; + +#ifndef _LIBCPP_HAS_NO_INT128 + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<__int128_t> + : public __scalar_hash<__int128_t> +{ +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t> + : public __scalar_hash<__uint128_t> +{ +}; + +#endif + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<float> + : public __scalar_hash<float> +{ + _LIBCPP_INLINE_VISIBILITY + size_t operator()(float __v) const _NOEXCEPT + { + // -0.0 and 0.0 should return same hash + if (__v == 0.0f) + return 0; + return __scalar_hash<float>::operator()(__v); + } +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<double> + : public __scalar_hash<double> +{ + _LIBCPP_INLINE_VISIBILITY + size_t operator()(double __v) const _NOEXCEPT + { + // -0.0 and 0.0 should return same hash + if (__v == 0.0) + return 0; + return __scalar_hash<double>::operator()(__v); + } +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<long double> + : public __scalar_hash<long double> +{ + _LIBCPP_INLINE_VISIBILITY + size_t operator()(long double __v) const _NOEXCEPT + { + // -0.0 and 0.0 should return same hash + if (__v == 0.0L) + return 0; +#if defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__)) + // Zero out padding bits + union + { + long double __t; + struct + { + size_t __a; + size_t __b; + size_t __c; + size_t __d; + } __s; + } __u; + __u.__s.__a = 0; + __u.__s.__b = 0; + __u.__s.__c = 0; + __u.__s.__d = 0; + __u.__t = __v; + return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d; +#elif defined(__x86_64__) + // Zero out padding bits + union + { + long double __t; + struct + { + size_t __a; + size_t __b; + } __s; + } __u; + __u.__s.__a = 0; + __u.__s.__b = 0; + __u.__t = __v; + return __u.__s.__a ^ __u.__s.__b; +#else + return __scalar_hash<long double>::operator()(__v); +#endif + } +}; + +#if _LIBCPP_STD_VER > 11 + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp, bool = is_enum<_Tp>::value> +struct _LIBCPP_TEMPLATE_VIS __enum_hash +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<_Tp, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(_Tp __v) const _NOEXCEPT + { + typedef typename underlying_type<_Tp>::type type; + return hash<type>{}(static_cast<type>(__v)); + } +}; +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> { + __enum_hash() = delete; + __enum_hash(__enum_hash const&) = delete; + __enum_hash& operator=(__enum_hash const&) = delete; +}; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp> +{ +}; +#endif + +#if _LIBCPP_STD_VER > 14 + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <> +struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t> +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public unary_function<nullptr_t, size_t> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef nullptr_t argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + size_t operator()(nullptr_t) const _NOEXCEPT { + return 662607004ull; + } +}; +#endif + +#ifndef _LIBCPP_CXX03_LANG +template <class _Key, class _Hash> +using __check_hash_requirements _LIBCPP_NODEBUG = integral_constant<bool, + is_copy_constructible<_Hash>::value && + is_move_constructible<_Hash>::value && + __invokable_r<size_t, _Hash, _Key const&>::value +>; + +template <class _Key, class _Hash = hash<_Key> > +using __has_enabled_hash _LIBCPP_NODEBUG = integral_constant<bool, + __check_hash_requirements<_Key, _Hash>::value && + is_default_constructible<_Hash>::value +>; + +#if _LIBCPP_STD_VER > 14 +template <class _Type, class> +using __enable_hash_helper_imp _LIBCPP_NODEBUG = _Type; + +template <class _Type, class ..._Keys> +using __enable_hash_helper _LIBCPP_NODEBUG = __enable_hash_helper_imp<_Type, + typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type +>; +#else +template <class _Type, class ...> +using __enable_hash_helper _LIBCPP_NODEBUG = _Type; +#endif + +#endif // !_LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_HASH_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/identity.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/identity.h new file mode 100644 index 0000000..6b8346b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/identity.h
@@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_IDENTITY_H +#define _LIBCPP___FUNCTIONAL_IDENTITY_H + +#include <__config> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 + +struct identity { + template<class _Tp> + _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept + { + return _VSTD::forward<_Tp>(__t); + } + + using is_transparent = void; +}; +#endif // _LIBCPP_STD_VER > 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_IDENTITY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/invoke.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/invoke.h new file mode 100644 index 0000000..0e167c7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/invoke.h
@@ -0,0 +1,100 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_INVOKE_H +#define _LIBCPP___FUNCTIONAL_INVOKE_H + +#include <__config> +#include <__functional/weak_result_type.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Ret, bool = is_void<_Ret>::value> +struct __invoke_void_return_wrapper +{ +#ifndef _LIBCPP_CXX03_LANG + template <class ..._Args> + static _Ret __call(_Args&&... __args) { + return _VSTD::__invoke(_VSTD::forward<_Args>(__args)...); + } +#else + template <class _Fn> + static _Ret __call(_Fn __f) { + return _VSTD::__invoke(__f); + } + + template <class _Fn, class _A0> + static _Ret __call(_Fn __f, _A0& __a0) { + return _VSTD::__invoke(__f, __a0); + } + + template <class _Fn, class _A0, class _A1> + static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) { + return _VSTD::__invoke(__f, __a0, __a1); + } + + template <class _Fn, class _A0, class _A1, class _A2> + static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){ + return _VSTD::__invoke(__f, __a0, __a1, __a2); + } +#endif +}; + +template <class _Ret> +struct __invoke_void_return_wrapper<_Ret, true> +{ +#ifndef _LIBCPP_CXX03_LANG + template <class ..._Args> + static void __call(_Args&&... __args) { + _VSTD::__invoke(_VSTD::forward<_Args>(__args)...); + } +#else + template <class _Fn> + static void __call(_Fn __f) { + _VSTD::__invoke(__f); + } + + template <class _Fn, class _A0> + static void __call(_Fn __f, _A0& __a0) { + _VSTD::__invoke(__f, __a0); + } + + template <class _Fn, class _A0, class _A1> + static void __call(_Fn __f, _A0& __a0, _A1& __a1) { + _VSTD::__invoke(__f, __a0, __a1); + } + + template <class _Fn, class _A0, class _A1, class _A2> + static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) { + _VSTD::__invoke(__f, __a0, __a1, __a2); + } +#endif +}; + +#if _LIBCPP_STD_VER > 14 + +template <class _Fn, class ..._Args> +_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...> +invoke(_Fn&& __f, _Args&&... __args) + noexcept(is_nothrow_invocable_v<_Fn, _Args...>) +{ + return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...); +} + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_INVOKE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/is_transparent.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/is_transparent.h new file mode 100644 index 0000000..4a72aa8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/is_transparent.h
@@ -0,0 +1,36 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_IS_TRANSPARENT +#define _LIBCPP___FUNCTIONAL_IS_TRANSPARENT + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 11 + +template <class _Tp, class, class = void> +struct __is_transparent : false_type {}; + +template <class _Tp, class _Up> +struct __is_transparent<_Tp, _Up, + typename __void_t<typename _Tp::is_transparent>::type> + : true_type {}; + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_IS_TRANSPARENT
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fn.h new file mode 100644 index 0000000..1fa070a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fn.h
@@ -0,0 +1,161 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_MEM_FN_H +#define _LIBCPP___FUNCTIONAL_MEM_FN_H + +#include <__config> +#include <__functional/weak_result_type.h> +#include <__functional/binary_function.h> +#include <__functional/invoke.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +class __mem_fn +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public __weak_result_type<_Tp> +#endif +{ +public: + // types + typedef _Tp type; +private: + type __f_; + +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + __mem_fn(type __f) _NOEXCEPT : __f_(__f) {} + +#ifndef _LIBCPP_CXX03_LANG + // invoke + template <class... _ArgTypes> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename __invoke_return<type, _ArgTypes...>::type + operator() (_ArgTypes&&... __args) const { + return _VSTD::__invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...); + } +#else + + template <class _A0> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return0<type, _A0>::type + operator() (_A0& __a0) const { + return _VSTD::__invoke(__f_, __a0); + } + + template <class _A0> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return0<type, _A0 const>::type + operator() (_A0 const& __a0) const { + return _VSTD::__invoke(__f_, __a0); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0, _A1>::type + operator() (_A0& __a0, _A1& __a1) const { + return _VSTD::__invoke(__f_, __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0 const, _A1>::type + operator() (_A0 const& __a0, _A1& __a1) const { + return _VSTD::__invoke(__f_, __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0, _A1 const>::type + operator() (_A0& __a0, _A1 const& __a1) const { + return _VSTD::__invoke(__f_, __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0 const, _A1 const>::type + operator() (_A0 const& __a0, _A1 const& __a1) const { + return _VSTD::__invoke(__f_, __a0, __a1); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1, _A2>::type + operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1, _A2>::type + operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1 const, _A2>::type + operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1, _A2 const>::type + operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type + operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type + operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type + operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type + operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(__f_, __a0, __a1, __a2); + } +#endif +}; + +template<class _Rp, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +__mem_fn<_Rp _Tp::*> +mem_fn(_Rp _Tp::* __pm) _NOEXCEPT +{ + return __mem_fn<_Rp _Tp::*>(__pm); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_MEM_FN_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fun_ref.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fun_ref.h new file mode 100644 index 0000000..4616da0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/mem_fun_ref.h
@@ -0,0 +1,173 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H +#define _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H + +#include <__config> +#include <__functional/unary_function.h> +#include <__functional/binary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +template<class _Sp, class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t + : public unary_function<_Tp*, _Sp> +{ + _Sp (_Tp::*__p_)(); +public: + _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)()) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const + {return (__p->*__p_)();} +}; + +template<class _Sp, class _Tp, class _Ap> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_t + : public binary_function<_Tp*, _Ap, _Sp> +{ + _Sp (_Tp::*__p_)(_Ap); +public: + _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap)) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const + {return (__p->*__p_)(__x);} +}; + +template<class _Sp, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +mem_fun_t<_Sp,_Tp> +mem_fun(_Sp (_Tp::*__f)()) + {return mem_fun_t<_Sp,_Tp>(__f);} + +template<class _Sp, class _Tp, class _Ap> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +mem_fun1_t<_Sp,_Tp,_Ap> +mem_fun(_Sp (_Tp::*__f)(_Ap)) + {return mem_fun1_t<_Sp,_Tp,_Ap>(__f);} + +template<class _Sp, class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_ref_t + : public unary_function<_Tp, _Sp> +{ + _Sp (_Tp::*__p_)(); +public: + _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)()) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const + {return (__p.*__p_)();} +}; + +template<class _Sp, class _Tp, class _Ap> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_ref_t + : public binary_function<_Tp, _Ap, _Sp> +{ + _Sp (_Tp::*__p_)(_Ap); +public: + _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap)) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const + {return (__p.*__p_)(__x);} +}; + +template<class _Sp, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +mem_fun_ref_t<_Sp,_Tp> +mem_fun_ref(_Sp (_Tp::*__f)()) + {return mem_fun_ref_t<_Sp,_Tp>(__f);} + +template<class _Sp, class _Tp, class _Ap> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +mem_fun1_ref_t<_Sp,_Tp,_Ap> +mem_fun_ref(_Sp (_Tp::*__f)(_Ap)) + {return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);} + +template <class _Sp, class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_t + : public unary_function<const _Tp*, _Sp> +{ + _Sp (_Tp::*__p_)() const; +public: + _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const + {return (__p->*__p_)();} +}; + +template <class _Sp, class _Tp, class _Ap> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t + : public binary_function<const _Tp*, _Ap, _Sp> +{ + _Sp (_Tp::*__p_)(_Ap) const; +public: + _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const + {return (__p->*__p_)(__x);} +}; + +template <class _Sp, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +const_mem_fun_t<_Sp,_Tp> +mem_fun(_Sp (_Tp::*__f)() const) + {return const_mem_fun_t<_Sp,_Tp>(__f);} + +template <class _Sp, class _Tp, class _Ap> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +const_mem_fun1_t<_Sp,_Tp,_Ap> +mem_fun(_Sp (_Tp::*__f)(_Ap) const) + {return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);} + +template <class _Sp, class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_ref_t + : public unary_function<_Tp, _Sp> +{ + _Sp (_Tp::*__p_)() const; +public: + _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const + {return (__p.*__p_)();} +}; + +template <class _Sp, class _Tp, class _Ap> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t + : public binary_function<_Tp, _Ap, _Sp> +{ + _Sp (_Tp::*__p_)(_Ap) const; +public: + _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const + {return (__p.*__p_)(__x);} +}; + +template <class _Sp, class _Tp> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +const_mem_fun_ref_t<_Sp,_Tp> +mem_fun_ref(_Sp (_Tp::*__f)() const) + {return const_mem_fun_ref_t<_Sp,_Tp>(__f);} + +template <class _Sp, class _Tp, class _Ap> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +const_mem_fun1_ref_t<_Sp,_Tp,_Ap> +mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) + {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);} + +#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/not_fn.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/not_fn.h new file mode 100644 index 0000000..81fe112 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/not_fn.h
@@ -0,0 +1,53 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_NOT_FN_H +#define _LIBCPP___FUNCTIONAL_NOT_FN_H + +#include <__config> +#include <__functional/perfect_forward.h> +#include <__functional/invoke.h> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +struct __not_fn_op { + template <class... _Args> + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR_AFTER_CXX17 auto operator()(_Args&&... __args) const + noexcept(noexcept(!_VSTD::invoke(_VSTD::forward<_Args>(__args)...))) + -> decltype( !_VSTD::invoke(_VSTD::forward<_Args>(__args)...)) + { return !_VSTD::invoke(_VSTD::forward<_Args>(__args)...); } +}; + +template <class _Fn> +struct __not_fn_t : __perfect_forward<__not_fn_op, _Fn> { + using __perfect_forward<__not_fn_op, _Fn>::__perfect_forward; +}; + +template <class _Fn, class = enable_if_t< + is_constructible_v<decay_t<_Fn>, _Fn> && + is_move_constructible_v<decay_t<_Fn>> +>> +_LIBCPP_HIDE_FROM_ABI +_LIBCPP_CONSTEXPR_AFTER_CXX17 auto not_fn(_Fn&& __f) { + return __not_fn_t<decay_t<_Fn>>(_VSTD::forward<_Fn>(__f)); +} + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_NOT_FN_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/operations.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/operations.h new file mode 100644 index 0000000..0c7c6d4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/operations.h
@@ -0,0 +1,729 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_OPERATIONS_H +#define _LIBCPP___FUNCTIONAL_OPERATIONS_H + +#include <__config> +#include <__functional/binary_function.h> +#include <__functional/unary_function.h> +#include <__utility/forward.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Arithmetic operations + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS plus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x + __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS plus<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS minus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x - __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS minus<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS multiplies +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x * __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS multiplies<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS divides +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x / __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS divides<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS modulus +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x % __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS modulus<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS negate +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x) const + {return -__x;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS negate<void> +{ + template <class _Tp> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_Tp&& __x) const + noexcept(noexcept(- _VSTD::forward<_Tp>(__x))) + -> decltype( - _VSTD::forward<_Tp>(__x)) + { return - _VSTD::forward<_Tp>(__x); } + typedef void is_transparent; +}; +#endif + +// Bitwise operations + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS bit_and +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x & __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS bit_and<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +#if _LIBCPP_STD_VER > 11 +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp = void> +struct _LIBCPP_TEMPLATE_VIS bit_not +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x) const + {return ~__x;} +}; + +template <> +struct _LIBCPP_TEMPLATE_VIS bit_not<void> +{ + template <class _Tp> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_Tp&& __x) const + noexcept(noexcept(~_VSTD::forward<_Tp>(__x))) + -> decltype( ~_VSTD::forward<_Tp>(__x)) + { return ~_VSTD::forward<_Tp>(__x); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS bit_or +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x | __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS bit_or<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS bit_xor +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, _Tp> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef _Tp __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + _Tp operator()(const _Tp& __x, const _Tp& __y) const + {return __x ^ __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS bit_xor<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) ^ _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +// Comparison operations + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS equal_to +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x == __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS equal_to<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS not_equal_to +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x != __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS not_equal_to<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS less +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x < __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS less<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS less_equal +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x <= __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS less_equal<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) <= _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS greater_equal +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x >= __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS greater_equal<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) >= _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS greater +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x > __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS greater<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) > _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +// Logical operations + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS logical_and +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x && __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS logical_and<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) && _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS logical_not +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : unary_function<_Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x) const + {return !__x;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS logical_not<void> +{ + template <class _Tp> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_Tp&& __x) const + noexcept(noexcept(!_VSTD::forward<_Tp>(__x))) + -> decltype( !_VSTD::forward<_Tp>(__x)) + { return !_VSTD::forward<_Tp>(__x); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +#if _LIBCPP_STD_VER > 11 +template <class _Tp = void> +#else +template <class _Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS logical_or +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<_Tp, _Tp, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP + typedef bool __result_type; // used by valarray +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp second_argument_type; +#endif + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const _Tp& __x, const _Tp& __y) const + {return __x || __y;} +}; + +#if _LIBCPP_STD_VER > 11 +template <> +struct _LIBCPP_TEMPLATE_VIS logical_or<void> +{ + template <class _T1, class _T2> + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + auto operator()(_T1&& __t, _T2&& __u) const + noexcept(noexcept(_VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u))) + -> decltype( _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u); } + typedef void is_transparent; +}; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_OPERATIONS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/perfect_forward.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/perfect_forward.h new file mode 100644 index 0000000..308b304 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/perfect_forward.h
@@ -0,0 +1,95 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H +#define _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H + +#include <__config> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <tuple> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +template <class _Op, class _Indices, class ..._Bound> +struct __perfect_forward_impl; + +template <class _Op, size_t ..._Idx, class ..._Bound> +struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _Bound...> { +private: + tuple<_Bound...> __bound_; + +public: + template <class ..._BoundArgs, class = enable_if_t< + is_constructible_v<tuple<_Bound...>, _BoundArgs&&...> + >> + explicit constexpr __perfect_forward_impl(_BoundArgs&& ...__bound) + : __bound_(_VSTD::forward<_BoundArgs>(__bound)...) + { } + + __perfect_forward_impl(__perfect_forward_impl const&) = default; + __perfect_forward_impl(__perfect_forward_impl&&) = default; + + __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default; + __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default; + + template <class ..._Args, class = enable_if_t<is_invocable_v<_Op, _Bound&..., _Args...>>> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) & + noexcept(noexcept(_Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...))) + -> decltype( _Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...)) + { return _Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...); } + + template <class ..._Args, class = enable_if_t<!is_invocable_v<_Op, _Bound&..., _Args...>>> + auto operator()(_Args&&...) & = delete; + + template <class ..._Args, class = enable_if_t<is_invocable_v<_Op, _Bound const&..., _Args...>>> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const& + noexcept(noexcept(_Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...))) + -> decltype( _Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...)) + { return _Op()(_VSTD::get<_Idx>(__bound_)..., _VSTD::forward<_Args>(__args)...); } + + template <class ..._Args, class = enable_if_t<!is_invocable_v<_Op, _Bound const&..., _Args...>>> + auto operator()(_Args&&...) const& = delete; + + template <class ..._Args, class = enable_if_t<is_invocable_v<_Op, _Bound..., _Args...>>> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) && + noexcept(noexcept(_Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...))) + -> decltype( _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...)) + { return _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...); } + + template <class ..._Args, class = enable_if_t<!is_invocable_v<_Op, _Bound..., _Args...>>> + auto operator()(_Args&&...) && = delete; + + template <class ..._Args, class = enable_if_t<is_invocable_v<_Op, _Bound const..., _Args...>>> + _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&& + noexcept(noexcept(_Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...))) + -> decltype( _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...)) + { return _Op()(_VSTD::get<_Idx>(_VSTD::move(__bound_))..., _VSTD::forward<_Args>(__args)...); } + + template <class ..._Args, class = enable_if_t<!is_invocable_v<_Op, _Bound const..., _Args...>>> + auto operator()(_Args&&...) const&& = delete; +}; + +// __perfect_forward implements a perfect-forwarding call wrapper as explained in [func.require]. +template <class _Op, class ..._Args> +using __perfect_forward = __perfect_forward_impl<_Op, index_sequence_for<_Args...>, _Args...>; + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_binary_function.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_binary_function.h new file mode 100644 index 0000000..d4a6c16 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_binary_function.h
@@ -0,0 +1,46 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H +#define _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H + +#include <__config> +#include <__functional/binary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +template <class _Arg1, class _Arg2, class _Result> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function + : public binary_function<_Arg1, _Arg2, _Result> +{ + _Result (*__f_)(_Arg1, _Arg2); +public: + _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2)) + : __f_(__f) {} + _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const + {return __f_(__x, __y);} +}; + +template <class _Arg1, class _Arg2, class _Result> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +pointer_to_binary_function<_Arg1,_Arg2,_Result> +ptr_fun(_Result (*__f)(_Arg1,_Arg2)) + {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_unary_function.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_unary_function.h new file mode 100644 index 0000000..0ac4561 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/pointer_to_unary_function.h
@@ -0,0 +1,46 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H +#define _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H + +#include <__config> +#include <__functional/unary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +template <class _Arg, class _Result> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function + : public unary_function<_Arg, _Result> +{ + _Result (*__f_)(_Arg); +public: + _LIBCPP_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg)) + : __f_(__f) {} + _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg __x) const + {return __f_(__x);} +}; + +template <class _Arg, class _Result> +_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY +pointer_to_unary_function<_Arg,_Result> +ptr_fun(_Result (*__f)(_Arg)) + {return pointer_to_unary_function<_Arg,_Result>(__f);} + +#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/ranges_operations.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/ranges_operations.h new file mode 100644 index 0000000..777c535 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/ranges_operations.h
@@ -0,0 +1,97 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H +#define _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H + +#include <__config> +#include <concepts> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) +namespace ranges { + +struct equal_to { + template <class _Tp, class _Up> + requires equality_comparable_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)))) { + return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u); + } + + using is_transparent = void; +}; + +struct not_equal_to { + template <class _Tp, class _Up> + requires equality_comparable_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u))))) { + return !(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)); + } + + using is_transparent = void; +}; + +struct less { + template <class _Tp, class _Up> + requires totally_ordered_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)))) { + return _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u); + } + + using is_transparent = void; +}; + +struct less_equal { + template <class _Tp, class _Up> + requires totally_ordered_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(!(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t))))) { + return !(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)); + } + + using is_transparent = void; +}; + +struct greater { + template <class _Tp, class _Up> + requires totally_ordered_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)))) { + return _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t); + } + + using is_transparent = void; +}; + +struct greater_equal { + template <class _Tp, class _Up> + requires totally_ordered_with<_Tp, _Up> + [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u))))) { + return !(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)); + } + + using is_transparent = void; +}; + +} // namespace ranges +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/reference_wrapper.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/reference_wrapper.h new file mode 100644 index 0000000..e1e4abd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/reference_wrapper.h
@@ -0,0 +1,223 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H +#define _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H + +#include <__config> +#include <__functional/weak_result_type.h> +#include <__memory/addressof.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +class _LIBCPP_TEMPLATE_VIS reference_wrapper +#if _LIBCPP_STD_VER <= 17 || !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : public __weak_result_type<_Tp> +#endif +{ +public: + // types + typedef _Tp type; +private: + type* __f_; + +#ifndef _LIBCPP_CXX03_LANG + static void __fun(_Tp&) _NOEXCEPT; + static void __fun(_Tp&&) = delete; +#endif + +public: + // construct/copy/destroy +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + reference_wrapper(type& __f) _NOEXCEPT + : __f_(_VSTD::addressof(__f)) {} +#else + template <class _Up, class = __enable_if_t<!__is_same_uncvref<_Up, reference_wrapper>::value, decltype(__fun(declval<_Up>())) >> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + reference_wrapper(_Up&& __u) _NOEXCEPT_(noexcept(__fun(declval<_Up>()))) { + type& __f = static_cast<_Up&&>(__u); + __f_ = _VSTD::addressof(__f); + } +#endif + + // access + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + operator type&() const _NOEXCEPT {return *__f_;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + type& get() const _NOEXCEPT {return *__f_;} + +#ifndef _LIBCPP_CXX03_LANG + // invoke + template <class... _ArgTypes> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + typename __invoke_of<type&, _ArgTypes...>::type + operator() (_ArgTypes&&... __args) const { + return _VSTD::__invoke(get(), _VSTD::forward<_ArgTypes>(__args)...); + } +#else + + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return<type>::type + operator() () const { + return _VSTD::__invoke(get()); + } + + template <class _A0> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return0<type, _A0>::type + operator() (_A0& __a0) const { + return _VSTD::__invoke(get(), __a0); + } + + template <class _A0> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return0<type, _A0 const>::type + operator() (_A0 const& __a0) const { + return _VSTD::__invoke(get(), __a0); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0, _A1>::type + operator() (_A0& __a0, _A1& __a1) const { + return _VSTD::__invoke(get(), __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0 const, _A1>::type + operator() (_A0 const& __a0, _A1& __a1) const { + return _VSTD::__invoke(get(), __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0, _A1 const>::type + operator() (_A0& __a0, _A1 const& __a1) const { + return _VSTD::__invoke(get(), __a0, __a1); + } + + template <class _A0, class _A1> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return1<type, _A0 const, _A1 const>::type + operator() (_A0 const& __a0, _A1 const& __a1) const { + return _VSTD::__invoke(get(), __a0, __a1); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1, _A2>::type + operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1, _A2>::type + operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1 const, _A2>::type + operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1, _A2 const>::type + operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type + operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type + operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type + operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } + + template <class _A0, class _A1, class _A2> + _LIBCPP_INLINE_VISIBILITY + typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type + operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const { + return _VSTD::__invoke(get(), __a0, __a1, __a2); + } +#endif // _LIBCPP_CXX03_LANG +}; + +#if _LIBCPP_STD_VER >= 17 +template <class _Tp> +reference_wrapper(_Tp&) -> reference_wrapper<_Tp>; +#endif + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +reference_wrapper<_Tp> +ref(_Tp& __t) _NOEXCEPT +{ + return reference_wrapper<_Tp>(__t); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +reference_wrapper<_Tp> +ref(reference_wrapper<_Tp> __t) _NOEXCEPT +{ + return _VSTD::ref(__t.get()); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +reference_wrapper<const _Tp> +cref(const _Tp& __t) _NOEXCEPT +{ + return reference_wrapper<const _Tp>(__t); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +reference_wrapper<const _Tp> +cref(reference_wrapper<_Tp> __t) _NOEXCEPT +{ + return _VSTD::cref(__t.get()); +} + +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp> void ref(const _Tp&&) = delete; +template <class _Tp> void cref(const _Tp&&) = delete; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_function.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_function.h new file mode 100644 index 0000000..499f996 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_function.h
@@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H +#define _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Arg, class _Result> +struct _LIBCPP_TEMPLATE_VIS unary_function +{ + typedef _Arg argument_type; + typedef _Result result_type; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_negate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_negate.h new file mode 100644 index 0000000..71257cf --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unary_negate.h
@@ -0,0 +1,47 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H +#define _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H + +#include <__config> +#include <__functional/unary_function.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) + +template <class _Predicate> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 unary_negate + : public unary_function<typename _Predicate::argument_type, bool> +{ + _Predicate __pred_; +public: + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + explicit unary_negate(const _Predicate& __pred) + : __pred_(__pred) {} + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + bool operator()(const typename _Predicate::argument_type& __x) const + {return !__pred_(__x);} +}; + +template <class _Predicate> +_LIBCPP_DEPRECATED_IN_CXX17 inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY +unary_negate<_Predicate> +not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);} + +#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unwrap_ref.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unwrap_ref.h new file mode 100644 index 0000000..dc309ad --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/unwrap_ref.h
@@ -0,0 +1,57 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_UNWRAP_REF_H +#define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +struct __unwrap_reference { typedef _LIBCPP_NODEBUG _Tp type; }; + +template <class _Tp> +class reference_wrapper; + +template <class _Tp> +struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG _Tp& type; }; + +template <class _Tp> +struct decay; + +#if _LIBCPP_STD_VER > 17 +template <class _Tp> +struct unwrap_reference : __unwrap_reference<_Tp> { }; + +template <class _Tp> +using unwrap_reference_t = typename unwrap_reference<_Tp>::type; + +template <class _Tp> +struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { }; + +template <class _Tp> +using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type; +#endif // > C++17 + +template <class _Tp> +struct __unwrap_ref_decay +#if _LIBCPP_STD_VER > 17 + : unwrap_ref_decay<_Tp> +#else + : __unwrap_reference<typename decay<_Tp>::type> +#endif +{ }; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/weak_result_type.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/weak_result_type.h new file mode 100644 index 0000000..32b1e0b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional/weak_result_type.h
@@ -0,0 +1,481 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H +#define _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H + +#include <__config> +#include <__functional/binary_function.h> +#include <__functional/unary_function.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +struct __has_result_type +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Up> static __two __test(...); + template <class _Up> static char __test(typename _Up::result_type* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + +// __weak_result_type + +template <class _Tp> +struct __derives_from_unary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template <class _Ap, class _Rp> + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); +public: + static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template <class _Tp> +struct __derives_from_binary_function +{ +private: + struct __two {char __lx; char __lxx;}; + static __two __test(...); + template <class _A1, class _A2, class _Rp> + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); +public: + static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; + typedef decltype(__test((_Tp*)0)) type; +}; + +template <class _Tp, bool = __derives_from_unary_function<_Tp>::value> +struct __maybe_derive_from_unary_function // bool is true + : public __derives_from_unary_function<_Tp>::type +{ +}; + +template <class _Tp> +struct __maybe_derive_from_unary_function<_Tp, false> +{ +}; + +template <class _Tp, bool = __derives_from_binary_function<_Tp>::value> +struct __maybe_derive_from_binary_function // bool is true + : public __derives_from_binary_function<_Tp>::type +{ +}; + +template <class _Tp> +struct __maybe_derive_from_binary_function<_Tp, false> +{ +}; + +template <class _Tp, bool = __has_result_type<_Tp>::value> +struct __weak_result_type_imp // bool is true + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ + typedef _LIBCPP_NODEBUG typename _Tp::result_type result_type; +}; + +template <class _Tp> +struct __weak_result_type_imp<_Tp, false> + : public __maybe_derive_from_unary_function<_Tp>, + public __maybe_derive_from_binary_function<_Tp> +{ +}; + +template <class _Tp> +struct __weak_result_type + : public __weak_result_type_imp<_Tp> +{ +}; + +// 0 argument case + +template <class _Rp> +struct __weak_result_type<_Rp ()> +{ + typedef _LIBCPP_NODEBUG _Rp result_type; +}; + +template <class _Rp> +struct __weak_result_type<_Rp (&)()> +{ + typedef _LIBCPP_NODEBUG _Rp result_type; +}; + +template <class _Rp> +struct __weak_result_type<_Rp (*)()> +{ + typedef _LIBCPP_NODEBUG _Rp result_type; +}; + +// 1 argument case + +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (&)(_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template <class _Rp, class _A1> +struct __weak_result_type<_Rp (*)(_A1)> + : public unary_function<_A1, _Rp> +{ +}; + +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)()> + : public unary_function<_Cp*, _Rp> +{ +}; + +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const> + : public unary_function<const _Cp*, _Rp> +{ +}; + +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() volatile> + : public unary_function<volatile _Cp*, _Rp> +{ +}; + +template <class _Rp, class _Cp> +struct __weak_result_type<_Rp (_Cp::*)() const volatile> + : public unary_function<const volatile _Cp*, _Rp> +{ +}; + +// 2 argument case + +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (*)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template <class _Rp, class _A1, class _A2> +struct __weak_result_type<_Rp (&)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> +{ +}; + +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1)> + : public binary_function<_Cp*, _A1, _Rp> +{ +}; + +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const> + : public binary_function<const _Cp*, _A1, _Rp> +{ +}; + +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> + : public binary_function<volatile _Cp*, _A1, _Rp> +{ +}; + +template <class _Rp, class _Cp, class _A1> +struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> + : public binary_function<const volatile _Cp*, _A1, _Rp> +{ +}; + + +#ifndef _LIBCPP_CXX03_LANG +// 3 or more arguments + +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> +struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> +{ + typedef _Rp result_type; +}; + +template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> +{ + typedef _Rp result_type; +}; + +template <class _Tp, class ..._Args> +struct __invoke_return +{ + typedef decltype(_VSTD::__invoke(declval<_Tp>(), declval<_Args>()...)) type; +}; + +#else // defined(_LIBCPP_CXX03_LANG) + +template <class _Ret, class _T1, bool _IsFunc, bool _IsBase> +struct __enable_invoke_imp; + +template <class _Ret, class _T1> +struct __enable_invoke_imp<_Ret, _T1, true, true> { + typedef _Ret _Bullet1; + typedef _Bullet1 type; +}; + +template <class _Ret, class _T1> +struct __enable_invoke_imp<_Ret, _T1, true, false> { + typedef _Ret _Bullet2; + typedef _Bullet2 type; +}; + +template <class _Ret, class _T1> +struct __enable_invoke_imp<_Ret, _T1, false, true> { + typedef typename add_lvalue_reference< + typename __apply_cv<_T1, _Ret>::type + >::type _Bullet3; + typedef _Bullet3 type; +}; + +template <class _Ret, class _T1> +struct __enable_invoke_imp<_Ret, _T1, false, false> { + typedef typename add_lvalue_reference< + typename __apply_cv<decltype(*declval<_T1>()), _Ret>::type + >::type _Bullet4; + typedef _Bullet4 type; +}; + +template <class _Ret, class _T1> +struct __enable_invoke_imp<_Ret, _T1*, false, false> { + typedef typename add_lvalue_reference< + typename __apply_cv<_T1, _Ret>::type + >::type _Bullet4; + typedef _Bullet4 type; +}; + +template <class _Fn, class _T1, + class _Traits = __member_pointer_traits<_Fn>, + class _Ret = typename _Traits::_ReturnType, + class _Class = typename _Traits::_ClassType> +struct __enable_invoke : __enable_invoke_imp< + _Ret, _T1, + is_member_function_pointer<_Fn>::value, + is_base_of<_Class, typename remove_reference<_T1>::type>::value> +{ +}; + +__nat __invoke(__any, ...); + +// first bullet + +template <class _Fn, class _T1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet1 +__invoke(_Fn __f, _T1& __t1) { + return (__t1.*__f)(); +} + +template <class _Fn, class _T1, class _A0> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet1 +__invoke(_Fn __f, _T1& __t1, _A0& __a0) { + return (__t1.*__f)(__a0); +} + +template <class _Fn, class _T1, class _A0, class _A1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet1 +__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) { + return (__t1.*__f)(__a0, __a1); +} + +template <class _Fn, class _T1, class _A0, class _A1, class _A2> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet1 +__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { + return (__t1.*__f)(__a0, __a1, __a2); +} + +template <class _Fn, class _T1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet2 +__invoke(_Fn __f, _T1& __t1) { + return ((*__t1).*__f)(); +} + +template <class _Fn, class _T1, class _A0> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet2 +__invoke(_Fn __f, _T1& __t1, _A0& __a0) { + return ((*__t1).*__f)(__a0); +} + +template <class _Fn, class _T1, class _A0, class _A1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet2 +__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) { + return ((*__t1).*__f)(__a0, __a1); +} + +template <class _Fn, class _T1, class _A0, class _A1, class _A2> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet2 +__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { + return ((*__t1).*__f)(__a0, __a1, __a2); +} + +template <class _Fn, class _T1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet3 +__invoke(_Fn __f, _T1& __t1) { + return __t1.*__f; +} + +template <class _Fn, class _T1> +inline _LIBCPP_INLINE_VISIBILITY +typename __enable_invoke<_Fn, _T1>::_Bullet4 +__invoke(_Fn __f, _T1& __t1) { + return (*__t1).*__f; +} + +// fifth bullet + +template <class _Fp> +inline _LIBCPP_INLINE_VISIBILITY +decltype(declval<_Fp&>()()) +__invoke(_Fp& __f) +{ + return __f(); +} + +template <class _Fp, class _A0> +inline _LIBCPP_INLINE_VISIBILITY +decltype(declval<_Fp&>()(declval<_A0&>())) +__invoke(_Fp& __f, _A0& __a0) +{ + return __f(__a0); +} + +template <class _Fp, class _A0, class _A1> +inline _LIBCPP_INLINE_VISIBILITY +decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>())) +__invoke(_Fp& __f, _A0& __a0, _A1& __a1) +{ + return __f(__a0, __a1); +} + +template <class _Fp, class _A0, class _A1, class _A2> +inline _LIBCPP_INLINE_VISIBILITY +decltype(declval<_Fp&>()(declval<_A0&>(), declval<_A1&>(), declval<_A2&>())) +__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2) +{ + return __f(__a0, __a1, __a2); +} + +template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value> +struct __invoke_return +{ + typedef typename __weak_result_type<_Fp>::result_type type; +}; + +template <class _Fp> +struct __invoke_return<_Fp, false> +{ + typedef decltype(_VSTD::__invoke(declval<_Fp&>())) type; +}; + +template <class _Tp, class _A0> +struct __invoke_return0 +{ + typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>())) type; +}; + +template <class _Rp, class _Tp, class _A0> +struct __invoke_return0<_Rp _Tp::*, _A0> +{ + typedef typename __enable_invoke<_Rp _Tp::*, _A0>::type type; +}; + +template <class _Tp, class _A0, class _A1> +struct __invoke_return1 +{ + typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(), + declval<_A1&>())) type; +}; + +template <class _Rp, class _Class, class _A0, class _A1> +struct __invoke_return1<_Rp _Class::*, _A0, _A1> { + typedef typename __enable_invoke<_Rp _Class::*, _A0>::type type; +}; + +template <class _Tp, class _A0, class _A1, class _A2> +struct __invoke_return2 +{ + typedef decltype(_VSTD::__invoke(declval<_Tp&>(), declval<_A0&>(), + declval<_A1&>(), + declval<_A2&>())) type; +}; + +template <class _Ret, class _Class, class _A0, class _A1, class _A2> +struct __invoke_return2<_Ret _Class::*, _A0, _A1, _A2> { + typedef typename __enable_invoke<_Ret _Class::*, _A0>::type type; +}; + +#endif // !defined(_LIBCPP_CXX03_LANG) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_03 b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_03 deleted file mode 100644 index bf86428..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_03 +++ /dev/null
@@ -1,1591 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_FUNCTIONAL_03 -#define _LIBCPP_FUNCTIONAL_03 - -// manual variadic expansion for <functional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -namespace __function { - -template<class _Fp> class __base; - -template<class _Rp> -class __base<_Rp()> -{ - __base(const __base&); - __base& operator=(const __base&); -public: - __base() {} - virtual ~__base() {} - virtual __base* __clone() const = 0; - virtual void __clone(__base*) const = 0; - virtual void destroy() = 0; - virtual void destroy_deallocate() = 0; - virtual _Rp operator()() = 0; -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const = 0; - virtual const std::type_info& target_type() const = 0; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0> -class __base<_Rp(_A0)> -{ - __base(const __base&); - __base& operator=(const __base&); -public: - __base() {} - virtual ~__base() {} - virtual __base* __clone() const = 0; - virtual void __clone(__base*) const = 0; - virtual void destroy() = 0; - virtual void destroy_deallocate() = 0; - virtual _Rp operator()(_A0) = 0; -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const = 0; - virtual const std::type_info& target_type() const = 0; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0, class _A1> -class __base<_Rp(_A0, _A1)> -{ - __base(const __base&); - __base& operator=(const __base&); -public: - __base() {} - virtual ~__base() {} - virtual __base* __clone() const = 0; - virtual void __clone(__base*) const = 0; - virtual void destroy() = 0; - virtual void destroy_deallocate() = 0; - virtual _Rp operator()(_A0, _A1) = 0; -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const = 0; - virtual const std::type_info& target_type() const = 0; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0, class _A1, class _A2> -class __base<_Rp(_A0, _A1, _A2)> -{ - __base(const __base&); - __base& operator=(const __base&); -public: - __base() {} - virtual ~__base() {} - virtual __base* __clone() const = 0; - virtual void __clone(__base*) const = 0; - virtual void destroy() = 0; - virtual void destroy_deallocate() = 0; - virtual _Rp operator()(_A0, _A1, _A2) = 0; -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const = 0; - virtual const std::type_info& target_type() const = 0; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _FD, class _Alloc, class _FB> class __func; - -template<class _Fp, class _Alloc, class _Rp> -class __func<_Fp, _Alloc, _Rp()> - : public __base<_Rp()> -{ - __compressed_pair<_Fp, _Alloc> __f_; -public: - explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} - explicit __func(_Fp __f, _Alloc __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_Rp()>* __clone() const; - virtual void __clone(__base<_Rp()>*) const; - virtual void destroy(); - virtual void destroy_deallocate(); - virtual _Rp operator()(); -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const; - virtual const std::type_info& target_type() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Fp, class _Alloc, class _Rp> -__base<_Rp()>* -__func<_Fp, _Alloc, _Rp()>::__clone() const -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); - return __hold.release(); -} - -template<class _Fp, class _Alloc, class _Rp> -void -__func<_Fp, _Alloc, _Rp()>::__clone(__base<_Rp()>* __p) const -{ - ::new (__p) __func(__f_.first(), __f_.second()); -} - -template<class _Fp, class _Alloc, class _Rp> -void -__func<_Fp, _Alloc, _Rp()>::destroy() -{ - __f_.~__compressed_pair<_Fp, _Alloc>(); -} - -template<class _Fp, class _Alloc, class _Rp> -void -__func<_Fp, _Alloc, _Rp()>::destroy_deallocate() -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - __f_.~__compressed_pair<_Fp, _Alloc>(); - __a.deallocate(this, 1); -} - -template<class _Fp, class _Alloc, class _Rp> -_Rp -__func<_Fp, _Alloc, _Rp()>::operator()() -{ - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(__f_.first()); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp> -const void* -__func<_Fp, _Alloc, _Rp()>::target(const type_info& __ti) const -{ - if (__ti == typeid(_Fp)) - return &__f_.first(); - return (const void*)0; -} - -template<class _Fp, class _Alloc, class _Rp> -const std::type_info& -__func<_Fp, _Alloc, _Rp()>::target_type() const -{ - return typeid(_Fp); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0> -class __func<_Fp, _Alloc, _Rp(_A0)> - : public __base<_Rp(_A0)> -{ - __compressed_pair<_Fp, _Alloc> __f_; -public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) - : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_Rp(_A0)>* __clone() const; - virtual void __clone(__base<_Rp(_A0)>*) const; - virtual void destroy(); - virtual void destroy_deallocate(); - virtual _Rp operator()(_A0); -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const; - virtual const std::type_info& target_type() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Fp, class _Alloc, class _Rp, class _A0> -__base<_Rp(_A0)>* -__func<_Fp, _Alloc, _Rp(_A0)>::__clone() const -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); - return __hold.release(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0> -void -__func<_Fp, _Alloc, _Rp(_A0)>::__clone(__base<_Rp(_A0)>* __p) const -{ - ::new (__p) __func(__f_.first(), __f_.second()); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0> -void -__func<_Fp, _Alloc, _Rp(_A0)>::destroy() -{ - __f_.~__compressed_pair<_Fp, _Alloc>(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0> -void -__func<_Fp, _Alloc, _Rp(_A0)>::destroy_deallocate() -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - __f_.~__compressed_pair<_Fp, _Alloc>(); - __a.deallocate(this, 1); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0> -_Rp -__func<_Fp, _Alloc, _Rp(_A0)>::operator()(_A0 __a0) -{ - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(__f_.first(), __a0); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0> -const void* -__func<_Fp, _Alloc, _Rp(_A0)>::target(const type_info& __ti) const -{ - if (__ti == typeid(_Fp)) - return &__f_.first(); - return (const void*)0; -} - -template<class _Fp, class _Alloc, class _Rp, class _A0> -const std::type_info& -__func<_Fp, _Alloc, _Rp(_A0)>::target_type() const -{ - return typeid(_Fp); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -class __func<_Fp, _Alloc, _Rp(_A0, _A1)> - : public __base<_Rp(_A0, _A1)> -{ - __compressed_pair<_Fp, _Alloc> __f_; -public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) - : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_Rp(_A0, _A1)>* __clone() const; - virtual void __clone(__base<_Rp(_A0, _A1)>*) const; - virtual void destroy(); - virtual void destroy_deallocate(); - virtual _Rp operator()(_A0, _A1); -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const; - virtual const std::type_info& target_type() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -__base<_Rp(_A0, _A1)>* -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); - return __hold.release(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone(__base<_Rp(_A0, _A1)>* __p) const -{ - ::new (__p) __func(__f_.first(), __f_.second()); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy() -{ - __f_.~__compressed_pair<_Fp, _Alloc>(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::destroy_deallocate() -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - __f_.~__compressed_pair<_Fp, _Alloc>(); - __a.deallocate(this, 1); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -_Rp -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) -{ - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(__f_.first(), __a0, __a1); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -const void* -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target(const type_info& __ti) const -{ - if (__ti == typeid(_Fp)) - return &__f_.first(); - return (const void*)0; -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1> -const std::type_info& -__func<_Fp, _Alloc, _Rp(_A0, _A1)>::target_type() const -{ - return typeid(_Fp); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -class __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> - : public __base<_Rp(_A0, _A1, _A2)> -{ - __compressed_pair<_Fp, _Alloc> __f_; -public: - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f) : __f_(_VSTD::move(__f), __default_init_tag()) {} - _LIBCPP_INLINE_VISIBILITY explicit __func(_Fp __f, _Alloc __a) - : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_Rp(_A0, _A1, _A2)>* __clone() const; - virtual void __clone(__base<_Rp(_A0, _A1, _A2)>*) const; - virtual void destroy(); - virtual void destroy_deallocate(); - virtual _Rp operator()(_A0, _A1, _A2); -#ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const; - virtual const std::type_info& target_type() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -__base<_Rp(_A0, _A1, _A2)>* -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) __func(__f_.first(), _Alloc(__a)); - return __hold.release(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone(__base<_Rp(_A0, _A1, _A2)>* __p) const -{ - ::new (__p) __func(__f_.first(), __f_.second()); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy() -{ - __f_.~__compressed_pair<_Fp, _Alloc>(); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -void -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::destroy_deallocate() -{ - typedef allocator_traits<_Alloc> __alloc_traits; - typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; - _Ap __a(__f_.second()); - __f_.~__compressed_pair<_Fp, _Alloc>(); - __a.deallocate(this, 1); -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -_Rp -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) -{ - typedef __invoke_void_return_wrapper<_Rp> _Invoker; - return _Invoker::__call(__f_.first(), __a0, __a1, __a2); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -const void* -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target(const type_info& __ti) const -{ - if (__ti == typeid(_Fp)) - return &__f_.first(); - return (const void*)0; -} - -template<class _Fp, class _Alloc, class _Rp, class _A0, class _A1, class _A2> -const std::type_info& -__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const -{ - return typeid(_Fp); -} - -#endif // _LIBCPP_NO_RTTI - -} // __function - -template<class _Rp> -class _LIBCPP_TEMPLATE_VIS function<_Rp()> -{ - typedef __function::__base<_Rp()> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; - __base* __f_; - -public: - typedef _Rp result_type; - - // 20.7.16.2.1, construct/copy/destroy: - _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} - _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} - function(const function&); - template<class _Fp> - function(_Fp, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&) : __f_(0) {} - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} - template<class _Alloc> - function(allocator_arg_t, const _Alloc&, const function&); - template<class _Fp, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - function& operator=(const function&); - function& operator=(nullptr_t); - template<class _Fp> - typename enable_if - < - !is_integral<_Fp>::value, - function& - >::type - operator=(_Fp); - - ~function(); - - // 20.7.16.2.2, function modifiers: - void swap(function&); - template<class _Fp, class _Alloc> - _LIBCPP_INLINE_VISIBILITY - void assign(_Fp __f, const _Alloc& __a) - {function(allocator_arg, __a, __f).swap(*this);} - - // 20.7.16.2.3, function capacity: - _LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;} - -private: - // deleted overloads close possible hole in the type system - template<class _R2> - bool operator==(const function<_R2()>&) const;// = delete; - template<class _R2> - bool operator!=(const function<_R2()>&) const;// = delete; -public: - // 20.7.16.2.4, function invocation: - _Rp operator()() const; - -#ifndef _LIBCPP_NO_RTTI - // 20.7.16.2.5, function target access: - const std::type_info& target_type() const; - template <typename _Tp> _Tp* target(); - template <typename _Tp> const _Tp* target() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp> -function<_Rp()>::function(const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp> -template<class _Alloc> -function<_Rp()>::function(allocator_arg_t, const _Alloc&, const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp> -template <class _Fp> -function<_Rp()>::function(_Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, allocator<_Fp>, _Rp()> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); - } - else - { - typedef allocator<_FF> _Ap; - _Ap __a; - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp> -template <class _Fp, class _Alloc> -function<_Rp()>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - typedef allocator_traits<_Alloc> __alloc_traits; - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, _Alloc, _Rp()> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f, __a0); - } - else - { - typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; - _Ap __a(__a0); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, _Alloc(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp> -function<_Rp()>& -function<_Rp()>::operator=(const function& __f) -{ - if (__f) - function(__f).swap(*this); - else - *this = nullptr; - return *this; -} - -template<class _Rp> -function<_Rp()>& -function<_Rp()>::operator=(nullptr_t) -{ - __base* __t = __f_; - __f_ = 0; - if (__t == (__base*)&__buf_) - __t->destroy(); - else if (__t) - __t->destroy_deallocate(); - return *this; -} - -template<class _Rp> -template <class _Fp> -typename enable_if -< - !is_integral<_Fp>::value, - function<_Rp()>& ->::type -function<_Rp()>::operator=(_Fp __f) -{ - function(_VSTD::move(__f)).swap(*this); - return *this; -} - -template<class _Rp> -function<_Rp()>::~function() -{ - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); -} - -template<class _Rp> -void -function<_Rp()>::swap(function& __f) -{ - if (_VSTD::addressof(__f) == this) - return; - if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) - { - typename aligned_storage<sizeof(__buf_)>::type __tempbuf; - __base* __t = (__base*)&__tempbuf; - __f_->__clone(__t); - __f_->destroy(); - __f_ = 0; - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = 0; - __f_ = (__base*)&__buf_; - __t->__clone((__base*)&__f.__buf_); - __t->destroy(); - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f_ == (__base*)&__buf_) - { - __f_->__clone((__base*)&__f.__buf_); - __f_->destroy(); - __f_ = __f.__f_; - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f.__f_ == (__base*)&__f.__buf_) - { - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = __f_; - __f_ = (__base*)&__buf_; - } - else - _VSTD::swap(__f_, __f.__f_); -} - -template<class _Rp> -_Rp -function<_Rp()>::operator()() const -{ - if (__f_ == 0) - __throw_bad_function_call(); - return (*__f_)(); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Rp> -const std::type_info& -function<_Rp()>::target_type() const -{ - if (__f_ == 0) - return typeid(void); - return __f_->target_type(); -} - -template<class _Rp> -template <typename _Tp> -_Tp* -function<_Rp()>::target() -{ - if (__f_ == 0) - return (_Tp*)0; - return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); -} - -template<class _Rp> -template <typename _Tp> -const _Tp* -function<_Rp()>::target() const -{ - if (__f_ == 0) - return (const _Tp*)0; - return (const _Tp*)__f_->target(typeid(_Tp)); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Rp, class _A0> -class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)> - : public unary_function<_A0, _Rp> -{ - typedef __function::__base<_Rp(_A0)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; - __base* __f_; - -public: - typedef _Rp result_type; - - // 20.7.16.2.1, construct/copy/destroy: - _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} - _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} - function(const function&); - template<class _Fp> - function(_Fp, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&) : __f_(0) {} - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} - template<class _Alloc> - function(allocator_arg_t, const _Alloc&, const function&); - template<class _Fp, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - function& operator=(const function&); - function& operator=(nullptr_t); - template<class _Fp> - typename enable_if - < - !is_integral<_Fp>::value, - function& - >::type - operator=(_Fp); - - ~function(); - - // 20.7.16.2.2, function modifiers: - void swap(function&); - template<class _Fp, class _Alloc> - _LIBCPP_INLINE_VISIBILITY - void assign(_Fp __f, const _Alloc& __a) - {function(allocator_arg, __a, __f).swap(*this);} - - // 20.7.16.2.3, function capacity: - _LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;} - -private: - // deleted overloads close possible hole in the type system - template<class _R2, class _B0> - bool operator==(const function<_R2(_B0)>&) const;// = delete; - template<class _R2, class _B0> - bool operator!=(const function<_R2(_B0)>&) const;// = delete; -public: - // 20.7.16.2.4, function invocation: - _Rp operator()(_A0) const; - -#ifndef _LIBCPP_NO_RTTI - // 20.7.16.2.5, function target access: - const std::type_info& target_type() const; - template <typename _Tp> _Tp* target(); - template <typename _Tp> const _Tp* target() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0> -function<_Rp(_A0)>::function(const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0> -template<class _Alloc> -function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc&, const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0> -template <class _Fp> -function<_Rp(_A0)>::function(_Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); - } - else - { - typedef allocator<_FF> _Ap; - _Ap __a; - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0> -template <class _Fp, class _Alloc> -function<_Rp(_A0)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - typedef allocator_traits<_Alloc> __alloc_traits; - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, _Alloc, _Rp(_A0)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f, __a0); - } - else - { - typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; - _Ap __a(__a0); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, _Alloc(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0> -function<_Rp(_A0)>& -function<_Rp(_A0)>::operator=(const function& __f) -{ - if (__f) - function(__f).swap(*this); - else - *this = nullptr; - return *this; -} - -template<class _Rp, class _A0> -function<_Rp(_A0)>& -function<_Rp(_A0)>::operator=(nullptr_t) -{ - __base* __t = __f_; - __f_ = 0; - if (__t == (__base*)&__buf_) - __t->destroy(); - else if (__t) - __t->destroy_deallocate(); - return *this; -} - -template<class _Rp, class _A0> -template <class _Fp> -typename enable_if -< - !is_integral<_Fp>::value, - function<_Rp(_A0)>& ->::type -function<_Rp(_A0)>::operator=(_Fp __f) -{ - function(_VSTD::move(__f)).swap(*this); - return *this; -} - -template<class _Rp, class _A0> -function<_Rp(_A0)>::~function() -{ - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); -} - -template<class _Rp, class _A0> -void -function<_Rp(_A0)>::swap(function& __f) -{ - if (_VSTD::addressof(__f) == this) - return; - if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) - { - typename aligned_storage<sizeof(__buf_)>::type __tempbuf; - __base* __t = (__base*)&__tempbuf; - __f_->__clone(__t); - __f_->destroy(); - __f_ = 0; - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = 0; - __f_ = (__base*)&__buf_; - __t->__clone((__base*)&__f.__buf_); - __t->destroy(); - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f_ == (__base*)&__buf_) - { - __f_->__clone((__base*)&__f.__buf_); - __f_->destroy(); - __f_ = __f.__f_; - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f.__f_ == (__base*)&__f.__buf_) - { - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = __f_; - __f_ = (__base*)&__buf_; - } - else - _VSTD::swap(__f_, __f.__f_); -} - -template<class _Rp, class _A0> -_Rp -function<_Rp(_A0)>::operator()(_A0 __a0) const -{ - if (__f_ == 0) - __throw_bad_function_call(); - return (*__f_)(__a0); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Rp, class _A0> -const std::type_info& -function<_Rp(_A0)>::target_type() const -{ - if (__f_ == 0) - return typeid(void); - return __f_->target_type(); -} - -template<class _Rp, class _A0> -template <typename _Tp> -_Tp* -function<_Rp(_A0)>::target() -{ - if (__f_ == 0) - return (_Tp*)0; - return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); -} - -template<class _Rp, class _A0> -template <typename _Tp> -const _Tp* -function<_Rp(_A0)>::target() const -{ - if (__f_ == 0) - return (const _Tp*)0; - return (const _Tp*)__f_->target(typeid(_Tp)); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Rp, class _A0, class _A1> -class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)> - : public binary_function<_A0, _A1, _Rp> -{ - typedef __function::__base<_Rp(_A0, _A1)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; - __base* __f_; - -public: - typedef _Rp result_type; - - // 20.7.16.2.1, construct/copy/destroy: - _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} - _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} - function(const function&); - template<class _Fp> - function(_Fp, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&) : __f_(0) {} - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} - template<class _Alloc> - function(allocator_arg_t, const _Alloc&, const function&); - template<class _Fp, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - function& operator=(const function&); - function& operator=(nullptr_t); - template<class _Fp> - typename enable_if - < - !is_integral<_Fp>::value, - function& - >::type - operator=(_Fp); - - ~function(); - - // 20.7.16.2.2, function modifiers: - void swap(function&); - template<class _Fp, class _Alloc> - _LIBCPP_INLINE_VISIBILITY - void assign(_Fp __f, const _Alloc& __a) - {function(allocator_arg, __a, __f).swap(*this);} - - // 20.7.16.2.3, function capacity: - operator bool() const {return __f_;} - -private: - // deleted overloads close possible hole in the type system - template<class _R2, class _B0, class _B1> - bool operator==(const function<_R2(_B0, _B1)>&) const;// = delete; - template<class _R2, class _B0, class _B1> - bool operator!=(const function<_R2(_B0, _B1)>&) const;// = delete; -public: - // 20.7.16.2.4, function invocation: - _Rp operator()(_A0, _A1) const; - -#ifndef _LIBCPP_NO_RTTI - // 20.7.16.2.5, function target access: - const std::type_info& target_type() const; - template <typename _Tp> _Tp* target(); - template <typename _Tp> const _Tp* target() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0, class _A1> -function<_Rp(_A0, _A1)>::function(const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0, class _A1> -template<class _Alloc> -function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc&, const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0, class _A1> -template <class _Fp> -function<_Rp(_A0, _A1)>::function(_Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); - } - else - { - typedef allocator<_FF> _Ap; - _Ap __a; - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0, class _A1> -template <class _Fp, class _Alloc> -function<_Rp(_A0, _A1)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - typedef allocator_traits<_Alloc> __alloc_traits; - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f, __a0); - } - else - { - typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; - _Ap __a(__a0); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, _Alloc(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0, class _A1> -function<_Rp(_A0, _A1)>& -function<_Rp(_A0, _A1)>::operator=(const function& __f) -{ - if (__f) - function(__f).swap(*this); - else - *this = nullptr; - return *this; -} - -template<class _Rp, class _A0, class _A1> -function<_Rp(_A0, _A1)>& -function<_Rp(_A0, _A1)>::operator=(nullptr_t) -{ - __base* __t = __f_; - __f_ = 0; - if (__t == (__base*)&__buf_) - __t->destroy(); - else if (__t) - __t->destroy_deallocate(); - return *this; -} - -template<class _Rp, class _A0, class _A1> -template <class _Fp> -typename enable_if -< - !is_integral<_Fp>::value, - function<_Rp(_A0, _A1)>& ->::type -function<_Rp(_A0, _A1)>::operator=(_Fp __f) -{ - function(_VSTD::move(__f)).swap(*this); - return *this; -} - -template<class _Rp, class _A0, class _A1> -function<_Rp(_A0, _A1)>::~function() -{ - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); -} - -template<class _Rp, class _A0, class _A1> -void -function<_Rp(_A0, _A1)>::swap(function& __f) -{ - if (_VSTD::addressof(__f) == this) - return; - if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) - { - typename aligned_storage<sizeof(__buf_)>::type __tempbuf; - __base* __t = (__base*)&__tempbuf; - __f_->__clone(__t); - __f_->destroy(); - __f_ = 0; - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = 0; - __f_ = (__base*)&__buf_; - __t->__clone((__base*)&__f.__buf_); - __t->destroy(); - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f_ == (__base*)&__buf_) - { - __f_->__clone((__base*)&__f.__buf_); - __f_->destroy(); - __f_ = __f.__f_; - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f.__f_ == (__base*)&__f.__buf_) - { - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = __f_; - __f_ = (__base*)&__buf_; - } - else - _VSTD::swap(__f_, __f.__f_); -} - -template<class _Rp, class _A0, class _A1> -_Rp -function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const -{ - if (__f_ == 0) - __throw_bad_function_call(); - return (*__f_)(__a0, __a1); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Rp, class _A0, class _A1> -const std::type_info& -function<_Rp(_A0, _A1)>::target_type() const -{ - if (__f_ == 0) - return typeid(void); - return __f_->target_type(); -} - -template<class _Rp, class _A0, class _A1> -template <typename _Tp> -_Tp* -function<_Rp(_A0, _A1)>::target() -{ - if (__f_ == 0) - return (_Tp*)0; - return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); -} - -template<class _Rp, class _A0, class _A1> -template <typename _Tp> -const _Tp* -function<_Rp(_A0, _A1)>::target() const -{ - if (__f_ == 0) - return (const _Tp*)0; - return (const _Tp*)__f_->target(typeid(_Tp)); -} - -#endif // _LIBCPP_NO_RTTI - -template<class _Rp, class _A0, class _A1, class _A2> -class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)> -{ - typedef __function::__base<_Rp(_A0, _A1, _A2)> __base; - aligned_storage<3*sizeof(void*)>::type __buf_; - __base* __f_; - -public: - typedef _Rp result_type; - - // 20.7.16.2.1, construct/copy/destroy: - _LIBCPP_INLINE_VISIBILITY explicit function() : __f_(0) {} - _LIBCPP_INLINE_VISIBILITY function(nullptr_t) : __f_(0) {} - function(const function&); - template<class _Fp> - function(_Fp, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&) : __f_(0) {} - template<class _Alloc> - _LIBCPP_INLINE_VISIBILITY - function(allocator_arg_t, const _Alloc&, nullptr_t) : __f_(0) {} - template<class _Alloc> - function(allocator_arg_t, const _Alloc&, const function&); - template<class _Fp, class _Alloc> - function(allocator_arg_t, const _Alloc& __a, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type* = 0); - - function& operator=(const function&); - function& operator=(nullptr_t); - template<class _Fp> - typename enable_if - < - !is_integral<_Fp>::value, - function& - >::type - operator=(_Fp); - - ~function(); - - // 20.7.16.2.2, function modifiers: - void swap(function&); - template<class _Fp, class _Alloc> - _LIBCPP_INLINE_VISIBILITY - void assign(_Fp __f, const _Alloc& __a) - {function(allocator_arg, __a, __f).swap(*this);} - - // 20.7.16.2.3, function capacity: - _LIBCPP_INLINE_VISIBILITY operator bool() const {return __f_;} - -private: - // deleted overloads close possible hole in the type system - template<class _R2, class _B0, class _B1, class _B2> - bool operator==(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; - template<class _R2, class _B0, class _B1, class _B2> - bool operator!=(const function<_R2(_B0, _B1, _B2)>&) const;// = delete; -public: - // 20.7.16.2.4, function invocation: - _Rp operator()(_A0, _A1, _A2) const; - -#ifndef _LIBCPP_NO_RTTI - // 20.7.16.2.5, function target access: - const std::type_info& target_type() const; - template <typename _Tp> _Tp* target(); - template <typename _Tp> const _Tp* target() const; -#endif // _LIBCPP_NO_RTTI -}; - -template<class _Rp, class _A0, class _A1, class _A2> -function<_Rp(_A0, _A1, _A2)>::function(const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0, class _A1, class _A2> -template<class _Alloc> -function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc&, - const function& __f) -{ - if (__f.__f_ == 0) - __f_ = 0; - else if (__f.__f_ == (const __base*)&__f.__buf_) - { - __f_ = (__base*)&__buf_; - __f.__f_->__clone(__f_); - } - else - __f_ = __f.__f_->__clone(); -} - -template<class _Rp, class _A0, class _A1, class _A2> -template <class _Fp> -function<_Rp(_A0, _A1, _A2)>::function(_Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_A0, _A1, _A2)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); - } - else - { - typedef allocator<_FF> _Ap; - _Ap __a; - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, allocator<_Fp>(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0, class _A1, class _A2> -template <class _Fp, class _Alloc> -function<_Rp(_A0, _A1, _A2)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f, - typename enable_if<!is_integral<_Fp>::value>::type*) - : __f_(0) -{ - typedef allocator_traits<_Alloc> __alloc_traits; - if (__function::__not_null(__f)) - { - typedef __function::__func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)> _FF; - if (sizeof(_FF) <= sizeof(__buf_)) - { - __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f, __a0); - } - else - { - typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; - _Ap __a(__a0); - typedef __allocator_destructor<_Ap> _Dp; - unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); - ::new (__hold.get()) _FF(__f, _Alloc(__a)); - __f_ = __hold.release(); - } - } -} - -template<class _Rp, class _A0, class _A1, class _A2> -function<_Rp(_A0, _A1, _A2)>& -function<_Rp(_A0, _A1, _A2)>::operator=(const function& __f) -{ - if (__f) - function(__f).swap(*this); - else - *this = nullptr; - return *this; -} - -template<class _Rp, class _A0, class _A1, class _A2> -function<_Rp(_A0, _A1, _A2)>& -function<_Rp(_A0, _A1, _A2)>::operator=(nullptr_t) -{ - __base* __t = __f_; - __f_ = 0; - if (__t == (__base*)&__buf_) - __t->destroy(); - else if (__t) - __t->destroy_deallocate(); - return *this; -} - -template<class _Rp, class _A0, class _A1, class _A2> -template <class _Fp> -typename enable_if -< - !is_integral<_Fp>::value, - function<_Rp(_A0, _A1, _A2)>& ->::type -function<_Rp(_A0, _A1, _A2)>::operator=(_Fp __f) -{ - function(_VSTD::move(__f)).swap(*this); - return *this; -} - -template<class _Rp, class _A0, class _A1, class _A2> -function<_Rp(_A0, _A1, _A2)>::~function() -{ - if (__f_ == (__base*)&__buf_) - __f_->destroy(); - else if (__f_) - __f_->destroy_deallocate(); -} - -template<class _Rp, class _A0, class _A1, class _A2> -void -function<_Rp(_A0, _A1, _A2)>::swap(function& __f) -{ - if (_VSTD::addressof(__f) == this) - return; - if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_) - { - typename aligned_storage<sizeof(__buf_)>::type __tempbuf; - __base* __t = (__base*)&__tempbuf; - __f_->__clone(__t); - __f_->destroy(); - __f_ = 0; - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = 0; - __f_ = (__base*)&__buf_; - __t->__clone((__base*)&__f.__buf_); - __t->destroy(); - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f_ == (__base*)&__buf_) - { - __f_->__clone((__base*)&__f.__buf_); - __f_->destroy(); - __f_ = __f.__f_; - __f.__f_ = (__base*)&__f.__buf_; - } - else if (__f.__f_ == (__base*)&__f.__buf_) - { - __f.__f_->__clone((__base*)&__buf_); - __f.__f_->destroy(); - __f.__f_ = __f_; - __f_ = (__base*)&__buf_; - } - else - _VSTD::swap(__f_, __f.__f_); -} - -template<class _Rp, class _A0, class _A1, class _A2> -_Rp -function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const -{ - if (__f_ == 0) - __throw_bad_function_call(); - return (*__f_)(__a0, __a1, __a2); -} - -#ifndef _LIBCPP_NO_RTTI - -template<class _Rp, class _A0, class _A1, class _A2> -const std::type_info& -function<_Rp(_A0, _A1, _A2)>::target_type() const -{ - if (__f_ == 0) - return typeid(void); - return __f_->target_type(); -} - -template<class _Rp, class _A0, class _A1, class _A2> -template <typename _Tp> -_Tp* -function<_Rp(_A0, _A1, _A2)>::target() -{ - if (__f_ == 0) - return (_Tp*)0; - return (_Tp*) const_cast<void *>(__f_->target(typeid(_Tp))); -} - -template<class _Rp, class _A0, class _A1, class _A2> -template <typename _Tp> -const _Tp* -function<_Rp(_A0, _A1, _A2)>::target() const -{ - if (__f_ == 0) - return (const _Tp*)0; - return (const _Tp*)__f_->target(typeid(_Tp)); -} - -#endif // _LIBCPP_NO_RTTI - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator==(const function<_Fp>& __f, nullptr_t) {return !__f;} - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator==(nullptr_t, const function<_Fp>& __f) {return !__f;} - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const function<_Fp>& __f, nullptr_t) {return (bool)__f;} - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(nullptr_t, const function<_Fp>& __f) {return (bool)__f;} - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(function<_Fp>& __x, function<_Fp>& __y) -{return __x.swap(__y);} - -#endif // _LIBCPP_FUNCTIONAL_03
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base index f591bf5..ccc3f3a 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base
@@ -11,642 +11,22 @@ #define _LIBCPP_FUNCTIONAL_BASE #include <__config> -#include <type_traits> -#include <typeinfo> +#include <__functional/binary_function.h> +#include <__functional/invoke.h> +#include <__functional/operations.h> +#include <__functional/reference_wrapper.h> +#include <__functional/unary_function.h> +#include <__functional/weak_result_type.h> +#include <__memory/allocator_arg_t.h> +#include <__memory/uses_allocator.h> #include <exception> #include <new> +#include <type_traits> +#include <typeinfo> #include <utility> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Arg1, class _Arg2, class _Result> -struct _LIBCPP_TEMPLATE_VIS binary_function -{ - typedef _Arg1 first_argument_type; - typedef _Arg2 second_argument_type; - typedef _Result result_type; -}; - -template <class _Tp> -struct __has_result_type -{ -private: - struct __two {char __lx; char __lxx;}; - template <class _Up> static __two __test(...); - template <class _Up> static char __test(typename _Up::result_type* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; - -#if _LIBCPP_STD_VER > 11 -template <class _Tp = void> -#else -template <class _Tp> -#endif -struct _LIBCPP_TEMPLATE_VIS less : binary_function<_Tp, _Tp, bool> -{ - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Tp& __x, const _Tp& __y) const - {return __x < __y;} -}; - -#if _LIBCPP_STD_VER > 11 -template <> -struct _LIBCPP_TEMPLATE_VIS less<void> -{ - template <class _T1, class _T2> - _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY - auto operator()(_T1&& __t, _T2&& __u) const - _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))) - -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)) - { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } - typedef void is_transparent; -}; -#endif - -// __weak_result_type - -template <class _Tp> -struct __derives_from_unary_function -{ -private: - struct __two {char __lx; char __lxx;}; - static __two __test(...); - template <class _Ap, class _Rp> - static unary_function<_Ap, _Rp> - __test(const volatile unary_function<_Ap, _Rp>*); -public: - static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; - typedef decltype(__test((_Tp*)0)) type; -}; - -template <class _Tp> -struct __derives_from_binary_function -{ -private: - struct __two {char __lx; char __lxx;}; - static __two __test(...); - template <class _A1, class _A2, class _Rp> - static binary_function<_A1, _A2, _Rp> - __test(const volatile binary_function<_A1, _A2, _Rp>*); -public: - static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; - typedef decltype(__test((_Tp*)0)) type; -}; - -template <class _Tp, bool = __derives_from_unary_function<_Tp>::value> -struct __maybe_derive_from_unary_function // bool is true - : public __derives_from_unary_function<_Tp>::type -{ -}; - -template <class _Tp> -struct __maybe_derive_from_unary_function<_Tp, false> -{ -}; - -template <class _Tp, bool = __derives_from_binary_function<_Tp>::value> -struct __maybe_derive_from_binary_function // bool is true - : public __derives_from_binary_function<_Tp>::type -{ -}; - -template <class _Tp> -struct __maybe_derive_from_binary_function<_Tp, false> -{ -}; - -template <class _Tp, bool = __has_result_type<_Tp>::value> -struct __weak_result_type_imp // bool is true - : public __maybe_derive_from_unary_function<_Tp>, - public __maybe_derive_from_binary_function<_Tp> -{ - typedef _LIBCPP_NODEBUG_TYPE typename _Tp::result_type result_type; -}; - -template <class _Tp> -struct __weak_result_type_imp<_Tp, false> - : public __maybe_derive_from_unary_function<_Tp>, - public __maybe_derive_from_binary_function<_Tp> -{ -}; - -template <class _Tp> -struct __weak_result_type - : public __weak_result_type_imp<_Tp> -{ -}; - -// 0 argument case - -template <class _Rp> -struct __weak_result_type<_Rp ()> -{ - typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; -}; - -template <class _Rp> -struct __weak_result_type<_Rp (&)()> -{ - typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; -}; - -template <class _Rp> -struct __weak_result_type<_Rp (*)()> -{ - typedef _LIBCPP_NODEBUG_TYPE _Rp result_type; -}; - -// 1 argument case - -template <class _Rp, class _A1> -struct __weak_result_type<_Rp (_A1)> - : public unary_function<_A1, _Rp> -{ -}; - -template <class _Rp, class _A1> -struct __weak_result_type<_Rp (&)(_A1)> - : public unary_function<_A1, _Rp> -{ -}; - -template <class _Rp, class _A1> -struct __weak_result_type<_Rp (*)(_A1)> - : public unary_function<_A1, _Rp> -{ -}; - -template <class _Rp, class _Cp> -struct __weak_result_type<_Rp (_Cp::*)()> - : public unary_function<_Cp*, _Rp> -{ -}; - -template <class _Rp, class _Cp> -struct __weak_result_type<_Rp (_Cp::*)() const> - : public unary_function<const _Cp*, _Rp> -{ -}; - -template <class _Rp, class _Cp> -struct __weak_result_type<_Rp (_Cp::*)() volatile> - : public unary_function<volatile _Cp*, _Rp> -{ -}; - -template <class _Rp, class _Cp> -struct __weak_result_type<_Rp (_Cp::*)() const volatile> - : public unary_function<const volatile _Cp*, _Rp> -{ -}; - -// 2 argument case - -template <class _Rp, class _A1, class _A2> -struct __weak_result_type<_Rp (_A1, _A2)> - : public binary_function<_A1, _A2, _Rp> -{ -}; - -template <class _Rp, class _A1, class _A2> -struct __weak_result_type<_Rp (*)(_A1, _A2)> - : public binary_function<_A1, _A2, _Rp> -{ -}; - -template <class _Rp, class _A1, class _A2> -struct __weak_result_type<_Rp (&)(_A1, _A2)> - : public binary_function<_A1, _A2, _Rp> -{ -}; - -template <class _Rp, class _Cp, class _A1> -struct __weak_result_type<_Rp (_Cp::*)(_A1)> - : public binary_function<_Cp*, _A1, _Rp> -{ -}; - -template <class _Rp, class _Cp, class _A1> -struct __weak_result_type<_Rp (_Cp::*)(_A1) const> - : public binary_function<const _Cp*, _A1, _Rp> -{ -}; - -template <class _Rp, class _Cp, class _A1> -struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> - : public binary_function<volatile _Cp*, _A1, _Rp> -{ -}; - -template <class _Rp, class _Cp, class _A1> -struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> - : public binary_function<const volatile _Cp*, _A1, _Rp> -{ -}; - - -#ifndef _LIBCPP_CXX03_LANG -// 3 or more arguments - -template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> -struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> -{ - typedef _Rp result_type; -}; - -template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> -struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> -{ - typedef _Rp result_type; -}; - -template <class _Tp, class ..._Args> -struct __invoke_return -{ - typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type; -}; - -#else // defined(_LIBCPP_CXX03_LANG) - -#include <__functional_base_03> - -#endif // !defined(_LIBCPP_CXX03_LANG) - - -template <class _Ret> -struct __invoke_void_return_wrapper -{ -#ifndef _LIBCPP_CXX03_LANG - template <class ..._Args> - static _Ret __call(_Args&&... __args) { - return __invoke(_VSTD::forward<_Args>(__args)...); - } -#else - template <class _Fn> - static _Ret __call(_Fn __f) { - return __invoke(__f); - } - - template <class _Fn, class _A0> - static _Ret __call(_Fn __f, _A0& __a0) { - return __invoke(__f, __a0); - } - - template <class _Fn, class _A0, class _A1> - static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) { - return __invoke(__f, __a0, __a1); - } - - template <class _Fn, class _A0, class _A1, class _A2> - static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){ - return __invoke(__f, __a0, __a1, __a2); - } -#endif -}; - -template <> -struct __invoke_void_return_wrapper<void> -{ -#ifndef _LIBCPP_CXX03_LANG - template <class ..._Args> - static void __call(_Args&&... __args) { - __invoke(_VSTD::forward<_Args>(__args)...); - } -#else - template <class _Fn> - static void __call(_Fn __f) { - __invoke(__f); - } - - template <class _Fn, class _A0> - static void __call(_Fn __f, _A0& __a0) { - __invoke(__f, __a0); - } - - template <class _Fn, class _A0, class _A1> - static void __call(_Fn __f, _A0& __a0, _A1& __a1) { - __invoke(__f, __a0, __a1); - } - - template <class _Fn, class _A0, class _A1, class _A2> - static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) { - __invoke(__f, __a0, __a1, __a2); - } -#endif -}; - -template <class _Tp> -class _LIBCPP_TEMPLATE_VIS reference_wrapper - : public __weak_result_type<_Tp> -{ -public: - // types - typedef _Tp type; -private: - type* __f_; - -public: - // construct/copy/destroy - _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT - : __f_(_VSTD::addressof(__f)) {} -#ifndef _LIBCPP_CXX03_LANG - private: reference_wrapper(type&&); public: // = delete; // do not bind to temps -#endif - - // access - _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;} - _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;} - -#ifndef _LIBCPP_CXX03_LANG - // invoke - template <class... _ArgTypes> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_of<type&, _ArgTypes...>::type - operator() (_ArgTypes&&... __args) const { - return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...); - } -#else - - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return<type>::type - operator() () const { - return __invoke(get()); - } - - template <class _A0> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return0<type, _A0>::type - operator() (_A0& __a0) const { - return __invoke(get(), __a0); - } - - template <class _A0> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return0<type, _A0 const>::type - operator() (_A0 const& __a0) const { - return __invoke(get(), __a0); - } - - template <class _A0, class _A1> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return1<type, _A0, _A1>::type - operator() (_A0& __a0, _A1& __a1) const { - return __invoke(get(), __a0, __a1); - } - - template <class _A0, class _A1> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return1<type, _A0 const, _A1>::type - operator() (_A0 const& __a0, _A1& __a1) const { - return __invoke(get(), __a0, __a1); - } - - template <class _A0, class _A1> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return1<type, _A0, _A1 const>::type - operator() (_A0& __a0, _A1 const& __a1) const { - return __invoke(get(), __a0, __a1); - } - - template <class _A0, class _A1> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return1<type, _A0 const, _A1 const>::type - operator() (_A0 const& __a0, _A1 const& __a1) const { - return __invoke(get(), __a0, __a1); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0, _A1, _A2>::type - operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0 const, _A1, _A2>::type - operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0, _A1 const, _A2>::type - operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0, _A1, _A2 const>::type - operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type - operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type - operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type - operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } - - template <class _A0, class _A1, class _A2> - _LIBCPP_INLINE_VISIBILITY - typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type - operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const { - return __invoke(get(), __a0, __a1, __a2); - } -#endif // _LIBCPP_CXX03_LANG -}; - - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -reference_wrapper<_Tp> -ref(_Tp& __t) _NOEXCEPT -{ - return reference_wrapper<_Tp>(__t); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -reference_wrapper<_Tp> -ref(reference_wrapper<_Tp> __t) _NOEXCEPT -{ - return _VSTD::ref(__t.get()); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -reference_wrapper<const _Tp> -cref(const _Tp& __t) _NOEXCEPT -{ - return reference_wrapper<const _Tp>(__t); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -reference_wrapper<const _Tp> -cref(reference_wrapper<_Tp> __t) _NOEXCEPT -{ - return _VSTD::cref(__t.get()); -} - -#ifndef _LIBCPP_CXX03_LANG -template <class _Tp> void ref(const _Tp&&) = delete; -template <class _Tp> void cref(const _Tp&&) = delete; -#endif - -#if _LIBCPP_STD_VER > 11 -template <class _Tp, class, class = void> -struct __is_transparent : false_type {}; - -template <class _Tp, class _Up> -struct __is_transparent<_Tp, _Up, - typename __void_t<typename _Tp::is_transparent>::type> - : true_type {}; -#endif - -// allocator_arg_t - -struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; }; - -#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY) -extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg; -#else -/* _LIBCPP_INLINE_VAR */ constexpr allocator_arg_t allocator_arg = allocator_arg_t(); -#endif - -// uses_allocator - -template <class _Tp> -struct __has_allocator_type -{ -private: - struct __two {char __lx; char __lxx;}; - template <class _Up> static __two __test(...); - template <class _Up> static char __test(typename _Up::allocator_type* = 0); -public: - static const bool value = sizeof(__test<_Tp>(0)) == 1; -}; - -template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value> -struct __uses_allocator - : public integral_constant<bool, - is_convertible<_Alloc, typename _Tp::allocator_type>::value> -{ -}; - -template <class _Tp, class _Alloc> -struct __uses_allocator<_Tp, _Alloc, false> - : public false_type -{ -}; - -template <class _Tp, class _Alloc> -struct _LIBCPP_TEMPLATE_VIS uses_allocator - : public __uses_allocator<_Tp, _Alloc> -{ -}; - -#if _LIBCPP_STD_VER > 14 -template <class _Tp, class _Alloc> -_LIBCPP_INLINE_VAR constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; -#endif - -#ifndef _LIBCPP_CXX03_LANG - -// allocator construction - -template <class _Tp, class _Alloc, class ..._Args> -struct __uses_alloc_ctor_imp -{ - typedef _LIBCPP_NODEBUG_TYPE typename __uncvref<_Alloc>::type _RawAlloc; - static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; - static const bool __ic = - is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; - static const int value = __ua ? 2 - __ic : 0; -}; - -template <class _Tp, class _Alloc, class ..._Args> -struct __uses_alloc_ctor - : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value> - {}; - -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args ) -{ - new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); -} - -// FIXME: This should have a version which takes a non-const alloc. -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) -{ - new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); -} - -// FIXME: This should have a version which takes a non-const alloc. -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) -{ - new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); -} - -#endif // _LIBCPP_CXX03_LANG - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_FUNCTIONAL_BASE +#endif // _LIBCPP_FUNCTIONAL_BASE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base_03 b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base_03 deleted file mode 100644 index e6dac90..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__functional_base_03 +++ /dev/null
@@ -1,223 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_FUNCTIONAL_BASE_03 -#define _LIBCPP_FUNCTIONAL_BASE_03 - -// manual variadic expansion for <functional> - -// __invoke - -template <class _Ret, class _T1, bool _IsFunc, bool _IsBase> -struct __enable_invoke_imp; - -template <class _Ret, class _T1> -struct __enable_invoke_imp<_Ret, _T1, true, true> { - typedef _Ret _Bullet1; - typedef _Bullet1 type; -}; - -template <class _Ret, class _T1> -struct __enable_invoke_imp<_Ret, _T1, true, false> { - typedef _Ret _Bullet2; - typedef _Bullet2 type; -}; - -template <class _Ret, class _T1> -struct __enable_invoke_imp<_Ret, _T1, false, true> { - typedef typename add_lvalue_reference< - typename __apply_cv<_T1, _Ret>::type - >::type _Bullet3; - typedef _Bullet3 type; -}; - -template <class _Ret, class _T1> -struct __enable_invoke_imp<_Ret, _T1, false, false> { - typedef typename add_lvalue_reference< - typename __apply_cv<decltype(*_VSTD::declval<_T1>()), _Ret>::type - >::type _Bullet4; - typedef _Bullet4 type; -}; - -template <class _Ret, class _T1> -struct __enable_invoke_imp<_Ret, _T1*, false, false> { - typedef typename add_lvalue_reference< - typename __apply_cv<_T1, _Ret>::type - >::type _Bullet4; - typedef _Bullet4 type; -}; - -template <class _Fn, class _T1, - class _Traits = __member_pointer_traits<_Fn>, - class _Ret = typename _Traits::_ReturnType, - class _Class = typename _Traits::_ClassType> -struct __enable_invoke : __enable_invoke_imp< - _Ret, _T1, - is_member_function_pointer<_Fn>::value, - is_base_of<_Class, typename remove_reference<_T1>::type>::value> -{ -}; - -__nat __invoke(__any, ...); - -// first bullet - -template <class _Fn, class _T1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet1 -__invoke(_Fn __f, _T1& __t1) { - return (__t1.*__f)(); -} - -template <class _Fn, class _T1, class _A0> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet1 -__invoke(_Fn __f, _T1& __t1, _A0& __a0) { - return (__t1.*__f)(__a0); -} - -template <class _Fn, class _T1, class _A0, class _A1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet1 -__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) { - return (__t1.*__f)(__a0, __a1); -} - -template <class _Fn, class _T1, class _A0, class _A1, class _A2> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet1 -__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { - return (__t1.*__f)(__a0, __a1, __a2); -} - -template <class _Fn, class _T1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet2 -__invoke(_Fn __f, _T1& __t1) { - return ((*__t1).*__f)(); -} - -template <class _Fn, class _T1, class _A0> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet2 -__invoke(_Fn __f, _T1& __t1, _A0& __a0) { - return ((*__t1).*__f)(__a0); -} - -template <class _Fn, class _T1, class _A0, class _A1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet2 -__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1) { - return ((*__t1).*__f)(__a0, __a1); -} - -template <class _Fn, class _T1, class _A0, class _A1, class _A2> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet2 -__invoke(_Fn __f, _T1& __t1, _A0& __a0, _A1& __a1, _A2& __a2) { - return ((*__t1).*__f)(__a0, __a1, __a2); -} - -template <class _Fn, class _T1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet3 -__invoke(_Fn __f, _T1& __t1) { - return __t1.*__f; -} - -template <class _Fn, class _T1> -inline _LIBCPP_INLINE_VISIBILITY -typename __enable_invoke<_Fn, _T1>::_Bullet4 -__invoke(_Fn __f, _T1& __t1) { - return (*__t1).*__f; -} - -// fifth bullet - -template <class _Fp> -inline _LIBCPP_INLINE_VISIBILITY -decltype(_VSTD::declval<_Fp&>()()) -__invoke(_Fp& __f) -{ - return __f(); -} - -template <class _Fp, class _A0> -inline _LIBCPP_INLINE_VISIBILITY -decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>())) -__invoke(_Fp& __f, _A0& __a0) -{ - return __f(__a0); -} - -template <class _Fp, class _A0, class _A1> -inline _LIBCPP_INLINE_VISIBILITY -decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>())) -__invoke(_Fp& __f, _A0& __a0, _A1& __a1) -{ - return __f(__a0, __a1); -} - -template <class _Fp, class _A0, class _A1, class _A2> -inline _LIBCPP_INLINE_VISIBILITY -decltype(_VSTD::declval<_Fp&>()(_VSTD::declval<_A0&>(), _VSTD::declval<_A1&>(), _VSTD::declval<_A2&>())) -__invoke(_Fp& __f, _A0& __a0, _A1& __a1, _A2& __a2) -{ - return __f(__a0, __a1, __a2); -} - -template <class _Fp, bool = __has_result_type<__weak_result_type<_Fp> >::value> -struct __invoke_return -{ - typedef typename __weak_result_type<_Fp>::result_type type; -}; - -template <class _Fp> -struct __invoke_return<_Fp, false> -{ - typedef decltype(__invoke(_VSTD::declval<_Fp&>())) type; -}; - -template <class _Tp, class _A0> -struct __invoke_return0 -{ - typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>())) type; -}; - -template <class _Rp, class _Tp, class _A0> -struct __invoke_return0<_Rp _Tp::*, _A0> -{ - typedef typename __enable_invoke<_Rp _Tp::*, _A0>::type type; -}; - -template <class _Tp, class _A0, class _A1> -struct __invoke_return1 -{ - typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(), - _VSTD::declval<_A1&>())) type; -}; - -template <class _Rp, class _Class, class _A0, class _A1> -struct __invoke_return1<_Rp _Class::*, _A0, _A1> { - typedef typename __enable_invoke<_Rp _Class::*, _A0>::type type; -}; - -template <class _Tp, class _A0, class _A1, class _A2> -struct __invoke_return2 -{ - typedef decltype(__invoke(_VSTD::declval<_Tp&>(), _VSTD::declval<_A0&>(), - _VSTD::declval<_A1&>(), - _VSTD::declval<_A2&>())) type; -}; - -template <class _Ret, class _Class, class _A0, class _A1, class _A2> -struct __invoke_return2<_Ret _Class::*, _A0, _A1, _A2> { - typedef typename __enable_invoke<_Ret _Class::*, _A0>::type type; -}; -#endif // _LIBCPP_FUNCTIONAL_BASE_03
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__hash_table b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__hash_table index 4e615d4..126e188 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__hash_table +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__hash_table
@@ -10,16 +10,16 @@ #ifndef _LIBCPP__HASH_TABLE #define _LIBCPP__HASH_TABLE +#include <__bits> // __libcpp_clz #include <__config> -#include <initializer_list> -#include <memory> -#include <iterator> +#include <__debug> #include <algorithm> #include <cmath> -#include <utility> +#include <initializer_list> +#include <iterator> +#include <memory> #include <type_traits> - -#include <__debug> +#include <utility> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -89,7 +89,7 @@ }; template <class _Tp, class _VoidPtr> -struct __hash_node +struct _LIBCPP_STANDALONE_DEBUG __hash_node : public __hash_node_base < typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type @@ -120,7 +120,7 @@ size_t __next_hash_pow2(size_t __n) { - return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __libcpp_clz(__n-1))); + return __n < 2 ? __n : (size_t(1) << (numeric_limits<size_t>::digits - __libcpp_clz(__n-1))); } @@ -298,7 +298,7 @@ __hash_iterator(const __hash_iterator& __i) : __node_(__i.__node_) { - __get_db()->__iterator_copy(this, &__i); + __get_db()->__iterator_copy(this, _VSTD::addressof(__i)); } _LIBCPP_INLINE_VISIBILITY @@ -317,7 +317,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -336,7 +336,7 @@ _LIBCPP_INLINE_VISIBILITY __hash_iterator& operator++() { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment non-incrementable unordered container iterator"); + "Attempted to increment a non-incrementable unordered container iterator"); __node_ = __node_->__next_; return *this; } @@ -438,7 +438,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -456,7 +456,7 @@ _LIBCPP_INLINE_VISIBILITY __hash_const_iterator& operator++() { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment non-incrementable unordered container const_iterator"); + "Attempted to increment a non-incrementable unordered container const_iterator"); __node_ = __node_->__next_; return *this; } @@ -550,7 +550,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -569,7 +569,7 @@ _LIBCPP_INLINE_VISIBILITY __hash_local_iterator& operator++() { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment non-incrementable unordered container local_iterator"); + "Attempted to increment a non-incrementable unordered container local_iterator"); __node_ = __node_->__next_; if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_) __node_ = nullptr; @@ -695,7 +695,7 @@ } return *this; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY reference operator*() const { @@ -714,7 +714,7 @@ _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator& operator++() { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this), - "Attempted to increment non-incrementable unordered container const_local_iterator"); + "Attempted to increment a non-incrementable unordered container const_local_iterator"); __node_ = __node_->__next_; if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_) __node_ = nullptr; @@ -741,9 +741,9 @@ private: #if _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_INLINE_VISIBILITY - __hash_const_local_iterator(__next_pointer __node, size_t __bucket, + __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket, size_t __bucket_count, const void* __c) _NOEXCEPT - : __node_(__node), + : __node_(__node_ptr), __bucket_(__bucket), __bucket_count_(__bucket_count) { @@ -753,9 +753,9 @@ } #else _LIBCPP_INLINE_VISIBILITY - __hash_const_local_iterator(__next_pointer __node, size_t __bucket, + __hash_const_local_iterator(__next_pointer __node_ptr, size_t __bucket, size_t __bucket_count) _NOEXCEPT - : __node_(__node), + : __node_(__node_ptr), __bucket_(__bucket), __bucket_count_(__bucket_count) { @@ -1036,7 +1036,7 @@ _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT { - return std::min<size_type>( + return _VSTD::min<size_type>( __node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max() ); @@ -1337,7 +1337,7 @@ bool __addable(const const_iterator* __i, ptrdiff_t __n) const; bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 private: void __rehash(size_type __n); @@ -1541,7 +1541,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>& __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u) { - if (this != &__u) + if (this != _VSTD::addressof(__u)) { __copy_assign_alloc(__u); hash_function() = __u.hash_function(); @@ -1571,7 +1571,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -1645,7 +1645,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS try { -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS const_iterator __i = __u.begin(); while (__cache != nullptr && __u.size() != 0) { @@ -1662,7 +1662,7 @@ __deallocate_node(__cache); throw; } -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS __deallocate_node(__cache); } const_iterator __i = __u.begin(); @@ -1707,7 +1707,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS try { -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS for (; __cache != nullptr && __first != __last; ++__first) { __cache->__upcast()->__value_ = *__first; @@ -1722,7 +1722,7 @@ __deallocate_node(__cache); throw; } -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS __deallocate_node(__cache); } for (; __first != __last; ++__first) @@ -1747,7 +1747,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS try { -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS for (; __cache != nullptr && __first != __last; ++__first) { __cache->__upcast()->__value_ = *__first; @@ -1762,7 +1762,7 @@ __deallocate_node(__cache); throw; } -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS __deallocate_node(__cache); } for (; __first != __last; ++__first) @@ -1929,7 +1929,7 @@ // Prepare the container for an insertion of the value __cp_val with the hash // __cp_hash. This does a lookup into the container to see if __cp_value is // already present, and performs a rehash if necessary. Returns a pointer to the -// last occurance of __cp_val in the map. +// last occurrence of __cp_val in the map. // // Note that this function does forward exceptions if key_eq() throws, and never // mutates __value or actually inserts into the map. @@ -2299,7 +2299,7 @@ __node_insert_multi_perform(__src_ptr, __pn); } } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER > 14 template <class _Tp, class _Hash, class _Equal, class _Alloc> void @@ -2348,7 +2348,7 @@ size_type __chash = __constrain_hash(__cp->__hash(), __nbc); __bucket_list_[__chash] = __pp; size_type __phash = __chash; - for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr; + for (__pp = __cp, void(), __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) { __chash = __constrain_hash(__cp->__hash(), __nbc); @@ -2506,11 +2506,11 @@ { #if _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this, - "unodered container::erase(iterator, iterator) called with an iterator not" - " referring to this unodered container"); + "unordered container::erase(iterator, iterator) called with an iterator not" + " referring to this container"); _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this, - "unodered container::erase(iterator, iterator) called with an iterator not" - " referring to this unodered container"); + "unordered container::erase(iterator, iterator) called with an iterator not" + " referring to this container"); #endif for (const_iterator __p = __first; __first != __last; __p = __first) { @@ -2599,7 +2599,7 @@ { (*__dp)->__c_ = nullptr; if (--__c->end_ != __dp) - memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*)); + _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -2728,9 +2728,9 @@ __u.__bucket_list_.reset(__npp); } _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size()); - __swap_allocator(__bucket_list_.get_deleter().__alloc(), + _VSTD::__swap_allocator(__bucket_list_.get_deleter().__alloc(), __u.__bucket_list_.get_deleter().__alloc()); - __swap_allocator(__node_alloc(), __u.__node_alloc()); + _VSTD::__swap_allocator(__node_alloc(), __u.__node_alloc()); _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_); __p2_.swap(__u.__p2_); __p3_.swap(__u.__p3_); @@ -2758,7 +2758,7 @@ { for (__np = __np->__next_; __np != nullptr && __constrain_hash(__np->__hash(), __bc) == __n; - __np = __np->__next_, ++__r) + __np = __np->__next_, (void) ++__r) ; } return __r; @@ -2804,10 +2804,10 @@ return false; } -#endif // _LIBCPP_DEBUG_LEVEL == 2 +#endif // _LIBCPP_DEBUG_LEVEL == 2 _LIBCPP_END_NAMESPACE_STD _LIBCPP_POP_MACROS -#endif // _LIBCPP__HASH_TABLE +#endif // _LIBCPP__HASH_TABLE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/access.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/access.h new file mode 100644 index 0000000..5e0d6b3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/access.h
@@ -0,0 +1,129 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ACCESS_H +#define _LIBCPP___ITERATOR_ACCESS_H + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp, size_t _Np> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp* +begin(_Tp (&__array)[_Np]) +{ + return __array; +} + +template <class _Tp, size_t _Np> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +_Tp* +end(_Tp (&__array)[_Np]) +{ + return __array + _Np; +} + +#if !defined(_LIBCPP_CXX03_LANG) + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +begin(_Cp& __c) -> decltype(__c.begin()) +{ + return __c.begin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +begin(const _Cp& __c) -> decltype(__c.begin()) +{ + return __c.begin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +end(_Cp& __c) -> decltype(__c.end()) +{ + return __c.end(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +end(const _Cp& __c) -> decltype(__c.end()) +{ + return __c.end(); +} + +#if _LIBCPP_STD_VER > 11 + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c)) +{ + return _VSTD::begin(__c); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c)) +{ + return _VSTD::end(__c); +} + +#endif + + +#else // defined(_LIBCPP_CXX03_LANG) + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY +typename _Cp::iterator +begin(_Cp& __c) +{ + return __c.begin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY +typename _Cp::const_iterator +begin(const _Cp& __c) +{ + return __c.begin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY +typename _Cp::iterator +end(_Cp& __c) +{ + return __c.end(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY +typename _Cp::const_iterator +end(const _Cp& __c) +{ + return __c.end(); +} + +#endif // !defined(_LIBCPP_CXX03_LANG) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ACCESS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/advance.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/advance.h new file mode 100644 index 0000000..a60052a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/advance.h
@@ -0,0 +1,195 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ADVANCE_H +#define _LIBCPP___ITERATOR_ADVANCE_H + +#include <__config> +#include <__debug> +#include <__function_like.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__utility/move.h> +#include <cstdlib> +#include <concepts> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIter> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +void __advance(_InputIter& __i, typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag) { + for (; __n > 0; --__n) + ++__i; +} + +template <class _BiDirIter> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +void __advance(_BiDirIter& __i, typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag) { + if (__n >= 0) + for (; __n > 0; --__n) + ++__i; + else + for (; __n < 0; ++__n) + --__i; +} + +template <class _RandIter> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +void __advance(_RandIter& __i, typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag) { + __i += __n; +} + +template < + class _InputIter, class _Distance, + class _IntegralDistance = decltype(_VSTD::__convert_to_integral(declval<_Distance>())), + class = __enable_if_t<is_integral<_IntegralDistance>::value> > +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 +void advance(_InputIter& __i, _Distance __orig_n) { + typedef typename iterator_traits<_InputIter>::difference_type _Difference; + _Difference __n = static_cast<_Difference>(_VSTD::__convert_to_integral(__orig_n)); + _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value, + "Attempt to advance(it, n) with negative n on a non-bidirectional iterator"); + _VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category()); +} + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +// [range.iter.op.advance] +struct __advance_fn final : private __function_like { +private: + template <class _Tp> + _LIBCPP_HIDE_FROM_ABI + static constexpr _Tp __magnitude_geq(_Tp __a, _Tp __b) noexcept { + return __a < 0 ? (__a <= __b) : (__a >= __b); + } + + template <class _Ip> + _LIBCPP_HIDE_FROM_ABI + static constexpr void __advance_forward(_Ip& __i, iter_difference_t<_Ip> __n) { + while (__n > 0) { + --__n; + ++__i; + } + } + + template <class _Ip> + _LIBCPP_HIDE_FROM_ABI + static constexpr void __advance_backward(_Ip& __i, iter_difference_t<_Ip> __n) { + while (__n < 0) { + ++__n; + --__i; + } + } + +public: + constexpr explicit __advance_fn(__tag __x) noexcept : __function_like(__x) {} + + // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative. + template <input_or_output_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const { + _LIBCPP_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>, + "If `n < 0`, then `bidirectional_iterator<I>` must be true."); + + // If `I` models `random_access_iterator`, equivalent to `i += n`. + if constexpr (random_access_iterator<_Ip>) { + __i += __n; + return; + } else if constexpr (bidirectional_iterator<_Ip>) { + // Otherwise, if `n` is non-negative, increments `i` by `n`. + __advance_forward(__i, __n); + // Otherwise, decrements `i` by `-n`. + __advance_backward(__i, __n); + return; + } else { + // Otherwise, if `n` is non-negative, increments `i` by `n`. + __advance_forward(__i, __n); + return; + } + } + + // Preconditions: Either `assignable_from<I&, S> || sized_sentinel_for<S, I>` is modeled, or [i, bound) denotes a range. + template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp> + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()(_Ip& __i, _Sp __bound) const { + // If `I` and `S` model `assignable_from<I&, S>`, equivalent to `i = std::move(bound)`. + if constexpr (assignable_from<_Ip&, _Sp>) { + __i = _VSTD::move(__bound); + } + // Otherwise, if `S` and `I` model `sized_sentinel_for<S, I>`, equivalent to `ranges::advance(i, bound - i)`. + else if constexpr (sized_sentinel_for<_Sp, _Ip>) { + (*this)(__i, __bound - __i); + } + // Otherwise, while `bool(i != bound)` is true, increments `i`. + else { + while (__i != __bound) { + ++__i; + } + } + } + + // Preconditions: + // * If `n > 0`, [i, bound) denotes a range. + // * If `n == 0`, [i, bound) or [bound, i) denotes a range. + // * If `n < 0`, [bound, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model `same_as<I, S>`. + // Returns: `n - M`, where `M` is the difference between the the ending and starting position. + template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp> + _LIBCPP_HIDE_FROM_ABI + constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound) const { + _LIBCPP_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>), + "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true."); + // If `S` and `I` model `sized_sentinel_for<S, I>`: + if constexpr (sized_sentinel_for<_Sp, _Ip>) { + // If |n| >= |bound - i|, equivalent to `ranges::advance(i, bound)`. + if (const auto __M = __bound - __i; __magnitude_geq(__n, __M)) { + (*this)(__i, __bound); + return __n - __M; + } + + // Otherwise, equivalent to `ranges::advance(i, n)`. + (*this)(__i, __n); + return 0; + } else { + // Otherwise, if `n` is non-negative, while `bool(i != bound)` is true, increments `i` but at + // most `n` times. + while (__i != __bound && __n > 0) { + ++__i; + --__n; + } + + // Otherwise, while `bool(i != bound)` is true, decrements `i` but at most `-n` times. + if constexpr (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>) { + while (__i != __bound && __n < 0) { + --__i; + ++__n; + } + } + return __n; + } + + _LIBCPP_UNREACHABLE(); + } +}; + +inline constexpr auto advance = __advance_fn(__function_like::__tag()); +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ADVANCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/back_insert_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/back_insert_iterator.h new file mode 100644 index 0000000..844babe --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/back_insert_iterator.h
@@ -0,0 +1,70 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H +#define _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__utility/move.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Container> +class _LIBCPP_TEMPLATE_VIS back_insert_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +protected: + _Container* container; +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + typedef _Container container_type; + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(const typename _Container::value_type& __value_) + {container->push_back(__value_); return *this;} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator=(typename _Container::value_type&& __value_) + {container->push_back(_VSTD::move(__value_)); return *this;} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator*() {return *this;} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator& operator++() {return *this;} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 back_insert_iterator operator++(int) {return *this;} +}; + +template <class _Container> +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +back_insert_iterator<_Container> +back_inserter(_Container& __x) +{ + return back_insert_iterator<_Container>(__x); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/common_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/common_iterator.h new file mode 100644 index 0000000..9a14276 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/common_iterator.h
@@ -0,0 +1,296 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_COMMON_ITERATOR_H +#define _LIBCPP___ITERATOR_COMMON_ITERATOR_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iter_move.h> +#include <__iterator/iter_swap.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/readable_traits.h> +#include <concepts> +#include <variant> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> + requires (!same_as<_Iter, _Sent> && copyable<_Iter>) +class common_iterator { + class __proxy { + friend common_iterator; + + iter_value_t<_Iter> __value; + // We can move __x because the only caller verifies that __x is not a reference. + constexpr __proxy(iter_reference_t<_Iter>&& __x) + : __value(_VSTD::move(__x)) {} + + public: + const iter_value_t<_Iter>* operator->() const { + return _VSTD::addressof(__value); + } + }; + + class __postfix_proxy { + friend common_iterator; + + iter_value_t<_Iter> __value; + constexpr __postfix_proxy(iter_reference_t<_Iter>&& __x) + : __value(_VSTD::forward<iter_reference_t<_Iter>>(__x)) {} + + public: + constexpr static bool __valid_for_iter = + constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>> && + move_constructible<iter_value_t<_Iter>>; + + const iter_value_t<_Iter>& operator*() const { + return __value; + } + }; + +public: + variant<_Iter, _Sent> __hold_; + + common_iterator() requires default_initializable<_Iter> = default; + + constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {} + constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {} + + template<class _I2, class _S2> + requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> + constexpr common_iterator(const common_iterator<_I2, _S2>& __other) + : __hold_([&]() -> variant<_Iter, _Sent> { + _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Constructed from valueless iterator."); + if (__other.__hold_.index() == 0) + return variant<_Iter, _Sent>{in_place_index<0>, _VSTD::__unchecked_get<0>(__other.__hold_)}; + return variant<_Iter, _Sent>{in_place_index<1>, _VSTD::__unchecked_get<1>(__other.__hold_)}; + }()) {} + + template<class _I2, class _S2> + requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> && + assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&> + common_iterator& operator=(const common_iterator<_I2, _S2>& __other) { + _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Assigned from valueless iterator."); + + auto __idx = __hold_.index(); + auto __other_idx = __other.__hold_.index(); + + // If they're the same index, just assign. + if (__idx == 0 && __other_idx == 0) + _VSTD::__unchecked_get<0>(__hold_) = _VSTD::__unchecked_get<0>(__other.__hold_); + else if (__idx == 1 && __other_idx == 1) + _VSTD::__unchecked_get<1>(__hold_) = _VSTD::__unchecked_get<1>(__other.__hold_); + + // Otherwise replace with the oposite element. + else if (__other_idx == 1) + __hold_.template emplace<1>(_VSTD::__unchecked_get<1>(__other.__hold_)); + else if (__other_idx == 0) + __hold_.template emplace<0>(_VSTD::__unchecked_get<0>(__other.__hold_)); + + return *this; + } + + decltype(auto) operator*() + { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), + "Cannot dereference sentinel. Common iterator not holding an iterator."); + return *_VSTD::__unchecked_get<_Iter>(__hold_); + } + + decltype(auto) operator*() const + requires __dereferenceable<const _Iter> + { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), + "Cannot dereference sentinel. Common iterator not holding an iterator."); + return *_VSTD::__unchecked_get<_Iter>(__hold_); + } + + template<class _I2 = _Iter> + decltype(auto) operator->() const + requires indirectly_readable<const _I2> && + (requires(const _I2& __i) { __i.operator->(); } || + is_reference_v<iter_reference_t<_I2>> || + constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>) + { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), + "Cannot dereference sentinel. Common iterator not holding an iterator."); + + if constexpr (is_pointer_v<_Iter> || requires(const _Iter& __i) { __i.operator->(); }) { + return _VSTD::__unchecked_get<_Iter>(__hold_); + } else if constexpr (is_reference_v<iter_reference_t<_Iter>>) { + auto&& __tmp = *_VSTD::__unchecked_get<_Iter>(__hold_); + return _VSTD::addressof(__tmp); + } else { + return __proxy(*_VSTD::__unchecked_get<_Iter>(__hold_)); + } + } + + common_iterator& operator++() { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), + "Cannot increment sentinel. Common iterator not holding an iterator."); + ++_VSTD::__unchecked_get<_Iter>(__hold_); return *this; + } + + decltype(auto) operator++(int) { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__hold_), + "Cannot increment sentinel. Common iterator not holding an iterator."); + + if constexpr (forward_iterator<_Iter>) { + auto __tmp = *this; + ++*this; + return __tmp; + } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __referenceable; } || + !__postfix_proxy::__valid_for_iter) { + return _VSTD::__unchecked_get<_Iter>(__hold_)++; + } else { + __postfix_proxy __p(**this); + ++*this; + return __p; + } + } + + template<class _I2, sentinel_for<_Iter> _S2> + requires sentinel_for<_Sent, _I2> + friend bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { + _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() && + !__y.__hold_.valueless_by_exception(), + "One or both common_iterators are valueless. (Cannot compare valueless iterators.)"); + + auto __x_index = __x.__hold_.index(); + auto __y_index = __y.__hold_.index(); + + if (__x_index == __y_index) + return true; + + if (__x_index == 0) + return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_); + + return _VSTD::__unchecked_get<_Sent>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_); + } + + template<class _I2, sentinel_for<_Iter> _S2> + requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2> + friend bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { + _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() && + !__y.__hold_.valueless_by_exception(), + "One or both common_iterators are valueless. (Cannot compare valueless iterators.)"); + + auto __x_index = __x.__hold_.index(); + auto __y_index = __y.__hold_.index(); + + if (__x_index == 1 && __y_index == 1) + return true; + + if (__x_index == 0 && __y_index == 0) + return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_); + + if (__x_index == 0) + return _VSTD::__unchecked_get<_Iter>(__x.__hold_) == _VSTD::__unchecked_get<_S2>(__y.__hold_); + + return _VSTD::__unchecked_get<_Sent>(__x.__hold_) == _VSTD::__unchecked_get<_I2>(__y.__hold_); + } + + template<sized_sentinel_for<_Iter> _I2, sized_sentinel_for<_Iter> _S2> + requires sized_sentinel_for<_Sent, _I2> + friend iter_difference_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { + _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception() && + !__y.__hold_.valueless_by_exception(), + "One or both common_iterators are valueless. (Cannot subtract valueless iterators.)"); + + auto __x_index = __x.__hold_.index(); + auto __y_index = __y.__hold_.index(); + + if (__x_index == 1 && __y_index == 1) + return 0; + + if (__x_index == 0 && __y_index == 0) + return _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_); + + if (__x_index == 0) + return _VSTD::__unchecked_get<_Iter>(__x.__hold_) - _VSTD::__unchecked_get<_S2>(__y.__hold_); + + return _VSTD::__unchecked_get<_Sent>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_); + } + + friend iter_rvalue_reference_t<_Iter> iter_move(const common_iterator& __i) + noexcept(noexcept(ranges::iter_move(declval<const _Iter&>()))) + requires input_iterator<_Iter> + { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__i.__hold_), + "Cannot iter_move a sentinel. Common iterator not holding an iterator."); + return ranges::iter_move( _VSTD::__unchecked_get<_Iter>(__i.__hold_)); + } + + template<indirectly_swappable<_Iter> _I2, class _S2> + friend void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) + noexcept(noexcept(ranges::iter_swap(declval<const _Iter&>(), declval<const _I2&>()))) + { + _LIBCPP_ASSERT(holds_alternative<_Iter>(__x.__hold_), + "Cannot swap __y with a sentinel. Common iterator (__x) not holding an iterator."); + _LIBCPP_ASSERT(holds_alternative<_Iter>(__y.__hold_), + "Cannot swap __x with a sentinel. Common iterator (__y) not holding an iterator."); + return ranges::iter_swap( _VSTD::__unchecked_get<_Iter>(__x.__hold_), _VSTD::__unchecked_get<_Iter>(__y.__hold_)); + } +}; + +template<class _Iter, class _Sent> +struct incrementable_traits<common_iterator<_Iter, _Sent>> { + using difference_type = iter_difference_t<_Iter>; +}; + +template<class _Iter> +concept __denotes_forward_iter = + requires { typename iterator_traits<_Iter>::iterator_category; } && + derived_from<typename iterator_traits<_Iter>::iterator_category, forward_iterator_tag>; + +template<class _Iter, class _Sent> +concept __common_iter_has_ptr_op = requires(const common_iterator<_Iter, _Sent>& __a) { + __a.operator->(); +}; + +template<class, class> +struct __arrow_type_or_void { + using type = void; +}; + +template<class _Iter, class _Sent> + requires __common_iter_has_ptr_op<_Iter, _Sent> +struct __arrow_type_or_void<_Iter, _Sent> { + using type = decltype(declval<const common_iterator<_Iter, _Sent>>().operator->()); +}; + +template<class _Iter, class _Sent> +struct iterator_traits<common_iterator<_Iter, _Sent>> { + using iterator_concept = _If<forward_iterator<_Iter>, + forward_iterator_tag, + input_iterator_tag>; + using iterator_category = _If<__denotes_forward_iter<_Iter>, + forward_iterator_tag, + input_iterator_tag>; + using pointer = typename __arrow_type_or_void<_Iter, _Sent>::type; + using value_type = iter_value_t<_Iter>; + using difference_type = iter_difference_t<_Iter>; + using reference = iter_reference_t<_Iter>; +}; + + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_COMMON_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/concepts.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/concepts.h new file mode 100644 index 0000000..531acdf --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/concepts.h
@@ -0,0 +1,268 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_CONCEPTS_H +#define _LIBCPP___ITERATOR_CONCEPTS_H + +#include <__config> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iter_move.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/readable_traits.h> +#include <__memory/pointer_traits.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format off + +// [iterator.concept.readable] +template<class _In> +concept __indirectly_readable_impl = + requires(const _In __i) { + typename iter_value_t<_In>; + typename iter_reference_t<_In>; + typename iter_rvalue_reference_t<_In>; + { *__i } -> same_as<iter_reference_t<_In>>; + { ranges::iter_move(__i) } -> same_as<iter_rvalue_reference_t<_In>>; + } && + common_reference_with<iter_reference_t<_In>&&, iter_value_t<_In>&> && + common_reference_with<iter_reference_t<_In>&&, iter_rvalue_reference_t<_In>&&> && + common_reference_with<iter_rvalue_reference_t<_In>&&, const iter_value_t<_In>&>; + +template<class _In> +concept indirectly_readable = __indirectly_readable_impl<remove_cvref_t<_In>>; + +template<indirectly_readable _Tp> +using iter_common_reference_t = common_reference_t<iter_reference_t<_Tp>, iter_value_t<_Tp>&>; + +// [iterator.concept.writable] +template<class _Out, class _Tp> +concept indirectly_writable = + requires(_Out&& __o, _Tp&& __t) { + *__o = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving + *_VSTD::forward<_Out>(__o) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving + const_cast<const iter_reference_t<_Out>&&>(*__o) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving + const_cast<const iter_reference_t<_Out>&&>(*_VSTD::forward<_Out>(__o)) = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving + }; + +// [iterator.concept.winc] +template<class _Tp> +concept __integer_like = integral<_Tp> && !same_as<_Tp, bool>; + +template<class _Tp> +concept __signed_integer_like = signed_integral<_Tp>; + +template<class _Ip> +concept weakly_incrementable = + // TODO: remove this once the clang bug is fixed (bugs.llvm.org/PR48173). + !same_as<_Ip, bool> && // Currently, clang does not handle bool correctly. + movable<_Ip> && + requires(_Ip __i) { + typename iter_difference_t<_Ip>; + requires __signed_integer_like<iter_difference_t<_Ip>>; + { ++__i } -> same_as<_Ip&>; // not required to be equality-preserving + __i++; // not required to be equality-preserving + }; + +// [iterator.concept.inc] +template<class _Ip> +concept incrementable = + regular<_Ip> && + weakly_incrementable<_Ip> && + requires(_Ip __i) { + { __i++ } -> same_as<_Ip>; + }; + +// [iterator.concept.iterator] +template<class _Ip> +concept input_or_output_iterator = + requires(_Ip __i) { + { *__i } -> __referenceable; + } && + weakly_incrementable<_Ip>; + +// [iterator.concept.sentinel] +template<class _Sp, class _Ip> +concept sentinel_for = + semiregular<_Sp> && + input_or_output_iterator<_Ip> && + __weakly_equality_comparable_with<_Sp, _Ip>; + +template<class, class> +inline constexpr bool disable_sized_sentinel_for = false; + +template<class _Sp, class _Ip> +concept sized_sentinel_for = + sentinel_for<_Sp, _Ip> && + !disable_sized_sentinel_for<remove_cv_t<_Sp>, remove_cv_t<_Ip>> && + requires(const _Ip& __i, const _Sp& __s) { + { __s - __i } -> same_as<iter_difference_t<_Ip>>; + { __i - __s } -> same_as<iter_difference_t<_Ip>>; + }; + +// [iterator.concept.input] +template<class _Ip> +concept input_iterator = + input_or_output_iterator<_Ip> && + indirectly_readable<_Ip> && + requires { typename _ITER_CONCEPT<_Ip>; } && + derived_from<_ITER_CONCEPT<_Ip>, input_iterator_tag>; + +// [iterator.concept.output] +template<class _Ip, class _Tp> +concept output_iterator = + input_or_output_iterator<_Ip> && + indirectly_writable<_Ip, _Tp> && + requires (_Ip __it, _Tp&& __t) { + *__it++ = _VSTD::forward<_Tp>(__t); // not required to be equality-preserving + }; + +// [iterator.concept.forward] +template<class _Ip> +concept forward_iterator = + input_iterator<_Ip> && + derived_from<_ITER_CONCEPT<_Ip>, forward_iterator_tag> && + incrementable<_Ip> && + sentinel_for<_Ip, _Ip>; + +// [iterator.concept.bidir] +template<class _Ip> +concept bidirectional_iterator = + forward_iterator<_Ip> && + derived_from<_ITER_CONCEPT<_Ip>, bidirectional_iterator_tag> && + requires(_Ip __i) { + { --__i } -> same_as<_Ip&>; + { __i-- } -> same_as<_Ip>; + }; + +template<class _Ip> +concept random_access_iterator = + bidirectional_iterator<_Ip> && + derived_from<_ITER_CONCEPT<_Ip>, random_access_iterator_tag> && + totally_ordered<_Ip> && + sized_sentinel_for<_Ip, _Ip> && + requires(_Ip __i, const _Ip __j, const iter_difference_t<_Ip> __n) { + { __i += __n } -> same_as<_Ip&>; + { __j + __n } -> same_as<_Ip>; + { __n + __j } -> same_as<_Ip>; + { __i -= __n } -> same_as<_Ip&>; + { __j - __n } -> same_as<_Ip>; + { __j[__n] } -> same_as<iter_reference_t<_Ip>>; + }; + +template<class _Ip> +concept contiguous_iterator = + random_access_iterator<_Ip> && + derived_from<_ITER_CONCEPT<_Ip>, contiguous_iterator_tag> && + is_lvalue_reference_v<iter_reference_t<_Ip>> && + same_as<iter_value_t<_Ip>, remove_cvref_t<iter_reference_t<_Ip>>> && + requires(const _Ip& __i) { + { _VSTD::to_address(__i) } -> same_as<add_pointer_t<iter_reference_t<_Ip>>>; + }; + +template<class _Ip> +concept __has_arrow = input_iterator<_Ip> && (is_pointer_v<_Ip> || requires(_Ip __i) { __i.operator->(); }); + +// [indirectcallable.indirectinvocable] +template<class _Fp, class _It> +concept indirectly_unary_invocable = + indirectly_readable<_It> && + copy_constructible<_Fp> && + invocable<_Fp&, iter_value_t<_It>&> && + invocable<_Fp&, iter_reference_t<_It>> && + invocable<_Fp&, iter_common_reference_t<_It>> && + common_reference_with< + invoke_result_t<_Fp&, iter_value_t<_It>&>, + invoke_result_t<_Fp&, iter_reference_t<_It>>>; + +template<class _Fp, class _It> +concept indirectly_regular_unary_invocable = + indirectly_readable<_It> && + copy_constructible<_Fp> && + regular_invocable<_Fp&, iter_value_t<_It>&> && + regular_invocable<_Fp&, iter_reference_t<_It>> && + regular_invocable<_Fp&, iter_common_reference_t<_It>> && + common_reference_with< + invoke_result_t<_Fp&, iter_value_t<_It>&>, + invoke_result_t<_Fp&, iter_reference_t<_It>>>; + +template<class _Fp, class _It> +concept indirect_unary_predicate = + indirectly_readable<_It> && + copy_constructible<_Fp> && + predicate<_Fp&, iter_value_t<_It>&> && + predicate<_Fp&, iter_reference_t<_It>> && + predicate<_Fp&, iter_common_reference_t<_It>>; + +template<class _Fp, class _It1, class _It2> +concept indirect_binary_predicate = + indirectly_readable<_It1> && indirectly_readable<_It2> && + copy_constructible<_Fp> && + predicate<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> && + predicate<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> && + predicate<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> && + predicate<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> && + predicate<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>; + +template<class _Fp, class _It1, class _It2 = _It1> +concept indirect_equivalence_relation = + indirectly_readable<_It1> && indirectly_readable<_It2> && + copy_constructible<_Fp> && + equivalence_relation<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> && + equivalence_relation<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> && + equivalence_relation<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> && + equivalence_relation<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> && + equivalence_relation<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>; + +template<class _Fp, class _It1, class _It2 = _It1> +concept indirect_strict_weak_order = + indirectly_readable<_It1> && indirectly_readable<_It2> && + copy_constructible<_Fp> && + strict_weak_order<_Fp&, iter_value_t<_It1>&, iter_value_t<_It2>&> && + strict_weak_order<_Fp&, iter_value_t<_It1>&, iter_reference_t<_It2>> && + strict_weak_order<_Fp&, iter_reference_t<_It1>, iter_value_t<_It2>&> && + strict_weak_order<_Fp&, iter_reference_t<_It1>, iter_reference_t<_It2>> && + strict_weak_order<_Fp&, iter_common_reference_t<_It1>, iter_common_reference_t<_It2>>; + +template<class _Fp, class... _Its> + requires (indirectly_readable<_Its> && ...) && invocable<_Fp, iter_reference_t<_Its>...> +using indirect_result_t = invoke_result_t<_Fp, iter_reference_t<_Its>...>; + +template<class _In, class _Out> +concept indirectly_movable = + indirectly_readable<_In> && + indirectly_writable<_Out, iter_rvalue_reference_t<_In>>; + +template<class _In, class _Out> +concept indirectly_movable_storable = + indirectly_movable<_In, _Out> && + indirectly_writable<_Out, iter_value_t<_In>> && + movable<iter_value_t<_In>> && + constructible_from<iter_value_t<_In>, iter_rvalue_reference_t<_In>> && + assignable_from<iter_value_t<_In>&, iter_rvalue_reference_t<_In>>; + +// Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle +// (both iter_swap and indirectly_swappable require indirectly_readable). + +// clang-format on + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_CONCEPTS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/counted_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/counted_iterator.h new file mode 100644 index 0000000..55979fe --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/counted_iterator.h
@@ -0,0 +1,303 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___ITERATOR_COUNTED_ITERATOR_H +#define _LIBCPP___ITERATOR_COUNTED_ITERATOR_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/default_sentinel.h> +#include <__iterator/iter_move.h> +#include <__iterator/iter_swap.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/readable_traits.h> +#include <__memory/pointer_traits.h> +#include <__utility/move.h> +#include <compare> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +template<class> +struct __counted_iterator_concept {}; + +template<class _Iter> + requires requires { typename _Iter::iterator_concept; } +struct __counted_iterator_concept<_Iter> { + using iterator_concept = typename _Iter::iterator_concept; +}; + +template<class> +struct __counted_iterator_category {}; + +template<class _Iter> + requires requires { typename _Iter::iterator_category; } +struct __counted_iterator_category<_Iter> { + using iterator_category = typename _Iter::iterator_category; +}; + +template<class> +struct __counted_iterator_value_type {}; + +template<indirectly_readable _Iter> +struct __counted_iterator_value_type<_Iter> { + using value_type = iter_value_t<_Iter>; +}; + +template<input_or_output_iterator _Iter> +class counted_iterator + : public __counted_iterator_concept<_Iter> + , public __counted_iterator_category<_Iter> + , public __counted_iterator_value_type<_Iter> +{ +public: + [[no_unique_address]] _Iter __current_ = _Iter(); + iter_difference_t<_Iter> __count_ = 0; + + using iterator_type = _Iter; + using difference_type = iter_difference_t<_Iter>; + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator() requires default_initializable<_Iter> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator(_Iter __iter, iter_difference_t<_Iter> __n) + : __current_(_VSTD::move(__iter)), __count_(__n) { + _LIBCPP_ASSERT(__n >= 0, "__n must not be negative."); + } + + template<class _I2> + requires convertible_to<const _I2&, _Iter> + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator(const counted_iterator<_I2>& __other) + : __current_(__other.__current_), __count_(__other.__count_) {} + + template<class _I2> + requires assignable_from<_Iter&, const _I2&> + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator& operator=(const counted_iterator<_I2>& __other) { + __current_ = __other.__current_; + __count_ = __other.__count_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Iter& base() const& { return __current_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Iter base() && { return _VSTD::move(__current_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr iter_difference_t<_Iter> count() const noexcept { return __count_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() { + _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end."); + return *__current_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() const + requires __dereferenceable<const _Iter> + { + _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end."); + return *__current_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator->() const noexcept + requires contiguous_iterator<_Iter> + { + return _VSTD::to_address(__current_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator& operator++() { + _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end."); + ++__current_; + --__count_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + decltype(auto) operator++(int) { + _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end."); + --__count_; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { return __current_++; } + catch(...) { ++__count_; throw; } +#else + return __current_++; +#endif // _LIBCPP_NO_EXCEPTIONS + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator operator++(int) + requires forward_iterator<_Iter> + { + _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end."); + counted_iterator __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator& operator--() + requires bidirectional_iterator<_Iter> + { + --__current_; + ++__count_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator operator--(int) + requires bidirectional_iterator<_Iter> + { + counted_iterator __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator operator+(iter_difference_t<_Iter> __n) const + requires random_access_iterator<_Iter> + { + return counted_iterator(__current_ + __n, __count_ - __n); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr counted_iterator operator+( + iter_difference_t<_Iter> __n, const counted_iterator& __x) + requires random_access_iterator<_Iter> + { + return __x + __n; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator& operator+=(iter_difference_t<_Iter> __n) + requires random_access_iterator<_Iter> + { + _LIBCPP_ASSERT(__n <= __count_, "Cannot advance iterator past end."); + __current_ += __n; + __count_ -= __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator operator-(iter_difference_t<_Iter> __n) const + requires random_access_iterator<_Iter> + { + return counted_iterator(__current_ - __n, __count_ + __n); + } + + template<common_with<_Iter> _I2> + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_I2> operator-( + const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) + { + return __rhs.__count_ - __lhs.__count_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Iter> operator-( + const counted_iterator& __lhs, default_sentinel_t) + { + return -__lhs.__count_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Iter> operator-( + default_sentinel_t, const counted_iterator& __rhs) + { + return __rhs.__count_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr counted_iterator& operator-=(iter_difference_t<_Iter> __n) + requires random_access_iterator<_Iter> + { + _LIBCPP_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: " + "counted_iterator would be decremented before the " + "first element of its range."); + __current_ -= __n; + __count_ += __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const + requires random_access_iterator<_Iter> + { + _LIBCPP_ASSERT(__n < __count_, "Subscript argument must be less than size."); + return __current_[__n]; + } + + template<common_with<_Iter> _I2> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==( + const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) + { + return __lhs.__count_ == __rhs.__count_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==( + const counted_iterator& __lhs, default_sentinel_t) + { + return __lhs.__count_ == 0; + } + + template<common_with<_Iter> _I2> + friend constexpr strong_ordering operator<=>( + const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) + { + return __rhs.__count_ <=> __lhs.__count_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const counted_iterator& __i) + noexcept(noexcept(ranges::iter_move(__i.__current_))) + requires input_iterator<_Iter> + { + _LIBCPP_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range."); + return ranges::iter_move(__i.__current_); + } + + template<indirectly_swappable<_Iter> _I2> + _LIBCPP_HIDE_FROM_ABI + friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_I2>& __y) + noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_))) + { + _LIBCPP_ASSERT(__x.__count_ > 0 && __y.__count_ > 0, + "Iterators must not be past end of range."); + return ranges::iter_swap(__x.__current_, __y.__current_); + } +}; + +template<input_iterator _Iter> + requires same_as<_ITER_TRAITS<_Iter>, iterator_traits<_Iter>> +struct iterator_traits<counted_iterator<_Iter>> : iterator_traits<_Iter> { + using pointer = conditional_t<contiguous_iterator<_Iter>, + add_pointer_t<iter_reference_t<_Iter>>, void>; +}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_COUNTED_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/data.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/data.h new file mode 100644 index 0000000..5e4946c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/data.h
@@ -0,0 +1,51 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_DATA_H +#define _LIBCPP___ITERATOR_DATA_H + +#include <__config> +#include <cstddef> +#include <initializer_list> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +template <class _Cont> constexpr +_LIBCPP_INLINE_VISIBILITY +auto data(_Cont& __c) +_NOEXCEPT_(noexcept(__c.data())) +-> decltype (__c.data()) +{ return __c.data(); } + +template <class _Cont> constexpr +_LIBCPP_INLINE_VISIBILITY +auto data(const _Cont& __c) +_NOEXCEPT_(noexcept(__c.data())) +-> decltype (__c.data()) +{ return __c.data(); } + +template <class _Tp, size_t _Sz> +_LIBCPP_INLINE_VISIBILITY +constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; } + +template <class _Ep> +_LIBCPP_INLINE_VISIBILITY +constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); } + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_DATA_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/default_sentinel.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/default_sentinel.h new file mode 100644 index 0000000..7172a74 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/default_sentinel.h
@@ -0,0 +1,30 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H +#define _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +struct default_sentinel_t { }; +inline constexpr default_sentinel_t default_sentinel{}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/distance.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/distance.h new file mode 100644 index 0000000..70e8e52 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/distance.h
@@ -0,0 +1,51 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_DISTANCE_H +#define _LIBCPP___ITERATOR_DISTANCE_H + +#include <__config> +#include <__iterator/iterator_traits.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +typename iterator_traits<_InputIter>::difference_type +__distance(_InputIter __first, _InputIter __last, input_iterator_tag) +{ + typename iterator_traits<_InputIter>::difference_type __r(0); + for (; __first != __last; ++__first) + ++__r; + return __r; +} + +template <class _RandIter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +typename iterator_traits<_RandIter>::difference_type +__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag) +{ + return __last - __first; +} + +template <class _InputIter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +typename iterator_traits<_InputIter>::difference_type +distance(_InputIter __first, _InputIter __last) +{ + return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category()); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_DISTANCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/empty.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/empty.h new file mode 100644 index 0000000..39cd560a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/empty.h
@@ -0,0 +1,44 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_EMPTY_H +#define _LIBCPP___ITERATOR_EMPTY_H + +#include <__config> +#include <cstddef> +#include <initializer_list> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +template <class _Cont> +_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY +constexpr auto empty(const _Cont& __c) +_NOEXCEPT_(noexcept(__c.empty())) +-> decltype (__c.empty()) +{ return __c.empty(); } + +template <class _Tp, size_t _Sz> +_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY +constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; } + +template <class _Ep> +_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY +constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; } + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_EMPTY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/erase_if_container.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/erase_if_container.h new file mode 100644 index 0000000..08f6e22 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/erase_if_container.h
@@ -0,0 +1,40 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H +#define _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Container, class _Predicate> +_LIBCPP_HIDE_FROM_ABI +typename _Container::size_type +__libcpp_erase_if_container(_Container& __c, _Predicate& __pred) { + typename _Container::size_type __old_size = __c.size(); + + const typename _Container::iterator __last = __c.end(); + for (typename _Container::iterator __iter = __c.begin(); __iter != __last;) { + if (__pred(*__iter)) + __iter = __c.erase(__iter); + else + ++__iter; + } + + return __old_size - __c.size(); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/front_insert_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/front_insert_iterator.h new file mode 100644 index 0000000..b229a99 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/front_insert_iterator.h
@@ -0,0 +1,70 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H +#define _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__utility/move.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Container> +class _LIBCPP_TEMPLATE_VIS front_insert_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +protected: + _Container* container; +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + typedef _Container container_type; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(const typename _Container::value_type& __value_) + {container->push_front(__value_); return *this;} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator=(typename _Container::value_type&& __value_) + {container->push_front(_VSTD::move(__value_)); return *this;} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator*() {return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator& operator++() {return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 front_insert_iterator operator++(int) {return *this;} +}; + +template <class _Container> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +front_insert_iterator<_Container> +front_inserter(_Container& __x) +{ + return front_insert_iterator<_Container>(__x); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/incrementable_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/incrementable_traits.h new file mode 100644 index 0000000..fd5015d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/incrementable_traits.h
@@ -0,0 +1,72 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H +#define _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H + +#include <__config> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// [incrementable.traits] +template<class> struct incrementable_traits {}; + +template<class _Tp> +requires is_object_v<_Tp> +struct incrementable_traits<_Tp*> { + using difference_type = ptrdiff_t; +}; + +template<class _Ip> +struct incrementable_traits<const _Ip> : incrementable_traits<_Ip> {}; + +template<class _Tp> +concept __has_member_difference_type = requires { typename _Tp::difference_type; }; + +template<__has_member_difference_type _Tp> +struct incrementable_traits<_Tp> { + using difference_type = typename _Tp::difference_type; +}; + +template<class _Tp> +concept __has_integral_minus = + requires(const _Tp& __x, const _Tp& __y) { + { __x - __y } -> integral; + }; + +template<__has_integral_minus _Tp> +requires (!__has_member_difference_type<_Tp>) +struct incrementable_traits<_Tp> { + using difference_type = make_signed_t<decltype(declval<_Tp>() - declval<_Tp>())>; +}; + +template <class> +struct iterator_traits; + +// Let `RI` be `remove_cvref_t<I>`. The type `iter_difference_t<I>` denotes +// `incrementable_traits<RI>::difference_type` if `iterator_traits<RI>` names a specialization +// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise. +template <class _Ip> +using iter_difference_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value, + incrementable_traits<remove_cvref_t<_Ip> >, + iterator_traits<remove_cvref_t<_Ip> > >::difference_type; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/insert_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/insert_iterator.h new file mode 100644 index 0000000..3311741 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/insert_iterator.h
@@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_INSERT_ITERATOR_H +#define _LIBCPP___ITERATOR_INSERT_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__ranges/access.h> +#include <__utility/move.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) +template <class _Container> +using __insert_iterator_iter_t = ranges::iterator_t<_Container>; +#else +template <class _Container> +using __insert_iterator_iter_t = typename _Container::iterator; +#endif + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Container> +class _LIBCPP_TEMPLATE_VIS insert_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +protected: + _Container* container; + __insert_iterator_iter_t<_Container> iter; +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + typedef _Container container_type; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator(_Container& __x, __insert_iterator_iter_t<_Container> __i) + : container(_VSTD::addressof(__x)), iter(__i) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(const typename _Container::value_type& __value_) + {iter = container->insert(iter, __value_); ++iter; return *this;} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator=(typename _Container::value_type&& __value_) + {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator*() {return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++() {return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 insert_iterator& operator++(int) {return *this;} +}; + +template <class _Container> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +insert_iterator<_Container> +inserter(_Container& __x, __insert_iterator_iter_t<_Container> __i) +{ + return insert_iterator<_Container>(__x, __i); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_INSERT_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istream_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istream_iterator.h new file mode 100644 index 0000000..979d714 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istream_iterator.h
@@ -0,0 +1,92 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H +#define _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <iosfwd> // for forward declarations of char_traits and basic_istream + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp, class _CharT = char, + class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t> +class _LIBCPP_TEMPLATE_VIS istream_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +public: + typedef input_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef const _Tp* pointer; + typedef const _Tp& reference; + typedef _CharT char_type; + typedef _Traits traits_type; + typedef basic_istream<_CharT,_Traits> istream_type; +private: + istream_type* __in_stream_; + _Tp __value_; +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(nullptr), __value_() {} + _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s)) + { + if (!(*__in_stream_ >> __value_)) + __in_stream_ = nullptr; + } + + _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;} + _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));} + _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++() + { + if (!(*__in_stream_ >> __value_)) + __in_stream_ = nullptr; + return *this; + } + _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int) + {istream_iterator __t(*this); ++(*this); return __t;} + + template <class _Up, class _CharU, class _TraitsU, class _DistanceU> + friend _LIBCPP_INLINE_VISIBILITY + bool + operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x, + const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y); +}; + +template <class _Tp, class _CharT, class _Traits, class _Distance> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x, + const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y) +{ + return __x.__in_stream_ == __y.__in_stream_; +} + +template <class _Tp, class _CharT, class _Traits, class _Distance> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x, + const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y) +{ + return !(__x == __y); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istreambuf_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istreambuf_iterator.h new file mode 100644 index 0000000..0c7676f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/istreambuf_iterator.h
@@ -0,0 +1,105 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H +#define _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <iosfwd> // for forward declaration of basic_streambuf + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template<class _CharT, class _Traits> +class _LIBCPP_TEMPLATE_VIS istreambuf_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<input_iterator_tag, _CharT, + typename _Traits::off_type, _CharT*, + _CharT> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +public: + typedef input_iterator_tag iterator_category; + typedef _CharT value_type; + typedef typename _Traits::off_type difference_type; + typedef _CharT* pointer; + typedef _CharT reference; + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename _Traits::int_type int_type; + typedef basic_streambuf<_CharT,_Traits> streambuf_type; + typedef basic_istream<_CharT,_Traits> istream_type; +private: + mutable streambuf_type* __sbuf_; + + class __proxy + { + char_type __keep_; + streambuf_type* __sbuf_; + _LIBCPP_INLINE_VISIBILITY __proxy(char_type __c, streambuf_type* __s) + : __keep_(__c), __sbuf_(__s) {} + friend class istreambuf_iterator; + public: + _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;} + }; + + _LIBCPP_INLINE_VISIBILITY + bool __test_for_eof() const + { + if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof())) + __sbuf_ = nullptr; + return __sbuf_ == nullptr; + } +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(nullptr) {} + _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT + : __sbuf_(__s.rdbuf()) {} + _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT + : __sbuf_(__s) {} + _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT + : __sbuf_(__p.__sbuf_) {} + + _LIBCPP_INLINE_VISIBILITY char_type operator*() const + {return static_cast<char_type>(__sbuf_->sgetc());} + _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++() + { + __sbuf_->sbumpc(); + return *this; + } + _LIBCPP_INLINE_VISIBILITY __proxy operator++(int) + { + return __proxy(__sbuf_->sbumpc(), __sbuf_); + } + + _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const + {return __test_for_eof() == __b.__test_for_eof();} +}; + +template <class _CharT, class _Traits> +inline _LIBCPP_INLINE_VISIBILITY +bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a, + const istreambuf_iterator<_CharT,_Traits>& __b) + {return __a.equal(__b);} + +template <class _CharT, class _Traits> +inline _LIBCPP_INLINE_VISIBILITY +bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a, + const istreambuf_iterator<_CharT,_Traits>& __b) + {return !__a.equal(__b);} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_move.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_move.h new file mode 100644 index 0000000..a2951f7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_move.h
@@ -0,0 +1,86 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ITER_MOVE_H +#define _LIBCPP___ITERATOR_ITER_MOVE_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <__utility/forward.h> +#include <concepts> // __class_or_enum +#include <type_traits> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges::__iter_move { +void iter_move(); + +template<class _Ip> +concept __unqualified_iter_move = requires(_Ip&& __i) { + iter_move(_VSTD::forward<_Ip>(__i)); +}; + +// [iterator.cust.move]/1 +// The name ranges::iter_move denotes a customization point object. +// The expression ranges::iter_move(E) for a subexpression E is +// expression-equivalent to: +struct __fn { + // [iterator.cust.move]/1.1 + // iter_move(E), if E has class or enumeration type and iter_move(E) is a + // well-formed expression when treated as an unevaluated operand, [...] + template<class _Ip> + requires __class_or_enum<remove_cvref_t<_Ip>> && __unqualified_iter_move<_Ip> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const + noexcept(noexcept(iter_move(_VSTD::forward<_Ip>(__i)))) + { + return iter_move(_VSTD::forward<_Ip>(__i)); + } + + // [iterator.cust.move]/1.2 + // Otherwise, if the expression *E is well-formed: + // 1.2.1 if *E is an lvalue, std::move(*E); + // 1.2.2 otherwise, *E. + template<class _Ip> + requires (!(__class_or_enum<remove_cvref_t<_Ip>> && __unqualified_iter_move<_Ip>)) && + requires(_Ip&& __i) { *_VSTD::forward<_Ip>(__i); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const + noexcept(noexcept(*_VSTD::forward<_Ip>(__i))) + { + if constexpr (is_lvalue_reference_v<decltype(*_VSTD::forward<_Ip>(__i))>) { + return _VSTD::move(*_VSTD::forward<_Ip>(__i)); + } else { + return *_VSTD::forward<_Ip>(__i); + } + } + + // [iterator.cust.move]/1.3 + // Otherwise, ranges::iter_move(E) is ill-formed. +}; +} // namespace ranges::__iter_move + +namespace ranges::inline __cpo { + inline constexpr auto iter_move = __iter_move::__fn{}; +} + +template<__dereferenceable _Tp> +requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; } +using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>())); + +#endif // !_LIBCPP_HAS_NO_RANGES + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ITER_MOVE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_swap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_swap.h new file mode 100644 index 0000000..a6c3bc8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iter_swap.h
@@ -0,0 +1,104 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___ITERATOR_ITER_SWAP_H +#define _LIBCPP___ITERATOR_ITER_SWAP_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iter_move.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/readable_traits.h> +#include <__ranges/access.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +namespace __iter_swap { + template<class _I1, class _I2> + void iter_swap(_I1, _I2) = delete; + + template<class _T1, class _T2> + concept __unqualified_iter_swap = requires(_T1&& __x, _T2&& __y) { + iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y)); + }; + + template<class _T1, class _T2> + concept __readable_swappable = + indirectly_readable<_T1> && indirectly_readable<_T2> && + swappable_with<iter_reference_t<_T1>, iter_reference_t<_T2>>; + + struct __fn { + template <class _T1, class _T2> + requires __unqualified_iter_swap<_T1, _T2> + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()(_T1&& __x, _T2&& __y) const + noexcept(noexcept(iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y)))) + { + (void)iter_swap(_VSTD::forward<_T1>(__x), _VSTD::forward<_T2>(__y)); + } + + template <class _T1, class _T2> + requires (!__unqualified_iter_swap<_T1, _T2>) && + __readable_swappable<_T1, _T2> + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()(_T1&& __x, _T2&& __y) const + noexcept(noexcept(ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y)))) + { + ranges::swap(*_VSTD::forward<_T1>(__x), *_VSTD::forward<_T2>(__y)); + } + + template <class _T1, class _T2> + requires (!__unqualified_iter_swap<_T1, _T2> && + !__readable_swappable<_T1, _T2>) && + indirectly_movable_storable<_T1, _T2> && + indirectly_movable_storable<_T2, _T1> + _LIBCPP_HIDE_FROM_ABI + constexpr void operator()(_T1&& __x, _T2&& __y) const + noexcept(noexcept(iter_value_t<_T2>(ranges::iter_move(__y))) && + noexcept(*__y = ranges::iter_move(__x)) && + noexcept(*_VSTD::forward<_T1>(__x) = declval<iter_value_t<_T2>>())) + { + iter_value_t<_T2> __old(ranges::iter_move(__y)); + *__y = ranges::iter_move(__x); + *_VSTD::forward<_T1>(__x) = _VSTD::move(__old); + } + }; +} // end namespace __iter_swap + +inline namespace __cpo { + inline constexpr auto iter_swap = __iter_swap::__fn{}; +} // namespace __cpo + +} // namespace ranges + +template<class _I1, class _I2 = _I1> +concept indirectly_swappable = + indirectly_readable<_I1> && indirectly_readable<_I2> && + requires(const _I1 __i1, const _I2 __i2) { + ranges::iter_swap(__i1, __i1); + ranges::iter_swap(__i2, __i2); + ranges::iter_swap(__i1, __i2); + ranges::iter_swap(__i2, __i1); + }; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ITER_SWAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator.h new file mode 100644 index 0000000..be298ee --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator.h
@@ -0,0 +1,35 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ITERATOR_H +#define _LIBCPP___ITERATOR_ITERATOR_H + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Category, class _Tp, class _Distance = ptrdiff_t, + class _Pointer = _Tp*, class _Reference = _Tp&> +struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator +{ + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Pointer pointer; + typedef _Reference reference; + typedef _Category iterator_category; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator_traits.h new file mode 100644 index 0000000..54c3e11 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/iterator_traits.h
@@ -0,0 +1,495 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_ITERATOR_TRAITS_H +#define _LIBCPP___ITERATOR_ITERATOR_TRAITS_H + +#include <__config> +#include <__iterator/incrementable_traits.h> +#include <__iterator/readable_traits.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +template <class _Tp> +using __with_reference = _Tp&; + +template <class _Tp> +concept __referenceable = requires { + typename __with_reference<_Tp>; +}; + +template <class _Tp> +concept __dereferenceable = requires(_Tp& __t) { + { *__t } -> __referenceable; // not required to be equality-preserving +}; + +// [iterator.traits] +template<__dereferenceable _Tp> +using iter_reference_t = decltype(*declval<_Tp&>()); + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +template <class _Iter> +struct _LIBCPP_TEMPLATE_VIS iterator_traits; + +struct _LIBCPP_TEMPLATE_VIS input_iterator_tag {}; +struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {}; +struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {}; +struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {}; +struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {}; +#if _LIBCPP_STD_VER > 17 +struct _LIBCPP_TEMPLATE_VIS contiguous_iterator_tag : public random_access_iterator_tag {}; +#endif + +template <class _Iter> +struct __iter_traits_cache { + using type = _If< + __is_primary_template<iterator_traits<_Iter> >::value, + _Iter, + iterator_traits<_Iter> + >; +}; +template <class _Iter> +using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type; + +struct __iter_concept_concept_test { + template <class _Iter> + using _Apply = typename _ITER_TRAITS<_Iter>::iterator_concept; +}; +struct __iter_concept_category_test { + template <class _Iter> + using _Apply = typename _ITER_TRAITS<_Iter>::iterator_category; +}; +struct __iter_concept_random_fallback { + template <class _Iter> + using _Apply = __enable_if_t< + __is_primary_template<iterator_traits<_Iter> >::value, + random_access_iterator_tag + >; +}; + +template <class _Iter, class _Tester> struct __test_iter_concept + : _IsValidExpansion<_Tester::template _Apply, _Iter>, + _Tester +{ +}; + +template <class _Iter> +struct __iter_concept_cache { + using type = _Or< + __test_iter_concept<_Iter, __iter_concept_concept_test>, + __test_iter_concept<_Iter, __iter_concept_category_test>, + __test_iter_concept<_Iter, __iter_concept_random_fallback> + >; +}; + +template <class _Iter> +using _ITER_CONCEPT = typename __iter_concept_cache<_Iter>::type::template _Apply<_Iter>; + + +template <class _Tp> +struct __has_iterator_typedefs +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Up> static __two __test(...); + template <class _Up> static char __test(typename __void_t<typename _Up::iterator_category>::type* = 0, + typename __void_t<typename _Up::difference_type>::type* = 0, + typename __void_t<typename _Up::value_type>::type* = 0, + typename __void_t<typename _Up::reference>::type* = 0, + typename __void_t<typename _Up::pointer>::type* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0,0,0,0,0)) == 1; +}; + + +template <class _Tp> +struct __has_iterator_category +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Up> static __two __test(...); + template <class _Up> static char __test(typename _Up::iterator_category* = nullptr); +public: + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; +}; + +template <class _Tp> +struct __has_iterator_concept +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Up> static __two __test(...); + template <class _Up> static char __test(typename _Up::iterator_concept* = nullptr); +public: + static const bool value = sizeof(__test<_Tp>(nullptr)) == 1; +}; + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// The `cpp17-*-iterator` exposition-only concepts are easily confused with the Cpp17*Iterator tables, +// so they've been banished to a namespace that makes it obvious they have a niche use-case. +namespace __iterator_traits_detail { +template<class _Ip> +concept __cpp17_iterator = + requires(_Ip __i) { + { *__i } -> __referenceable; + { ++__i } -> same_as<_Ip&>; + { *__i++ } -> __referenceable; + } && + copyable<_Ip>; + +template<class _Ip> +concept __cpp17_input_iterator = + __cpp17_iterator<_Ip> && + equality_comparable<_Ip> && + requires(_Ip __i) { + typename incrementable_traits<_Ip>::difference_type; + typename indirectly_readable_traits<_Ip>::value_type; + typename common_reference_t<iter_reference_t<_Ip>&&, + typename indirectly_readable_traits<_Ip>::value_type&>; + typename common_reference_t<decltype(*__i++)&&, + typename indirectly_readable_traits<_Ip>::value_type&>; + requires signed_integral<typename incrementable_traits<_Ip>::difference_type>; + }; + +template<class _Ip> +concept __cpp17_forward_iterator = + __cpp17_input_iterator<_Ip> && + constructible_from<_Ip> && + is_lvalue_reference_v<iter_reference_t<_Ip>> && + same_as<remove_cvref_t<iter_reference_t<_Ip>>, + typename indirectly_readable_traits<_Ip>::value_type> && + requires(_Ip __i) { + { __i++ } -> convertible_to<_Ip const&>; + { *__i++ } -> same_as<iter_reference_t<_Ip>>; + }; + +template<class _Ip> +concept __cpp17_bidirectional_iterator = + __cpp17_forward_iterator<_Ip> && + requires(_Ip __i) { + { --__i } -> same_as<_Ip&>; + { __i-- } -> convertible_to<_Ip const&>; + { *__i-- } -> same_as<iter_reference_t<_Ip>>; + }; + +template<class _Ip> +concept __cpp17_random_access_iterator = + __cpp17_bidirectional_iterator<_Ip> && + totally_ordered<_Ip> && + requires(_Ip __i, typename incrementable_traits<_Ip>::difference_type __n) { + { __i += __n } -> same_as<_Ip&>; + { __i -= __n } -> same_as<_Ip&>; + { __i + __n } -> same_as<_Ip>; + { __n + __i } -> same_as<_Ip>; + { __i - __n } -> same_as<_Ip>; + { __i - __i } -> same_as<decltype(__n)>; + { __i[__n] } -> convertible_to<iter_reference_t<_Ip>>; + }; +} // namespace __iterator_traits_detail + +template<class _Ip> +concept __has_member_reference = requires { typename _Ip::reference; }; + +template<class _Ip> +concept __has_member_pointer = requires { typename _Ip::pointer; }; + +template<class _Ip> +concept __has_member_iterator_category = requires { typename _Ip::iterator_category; }; + +template<class _Ip> +concept __specifies_members = requires { + typename _Ip::value_type; + typename _Ip::difference_type; + requires __has_member_reference<_Ip>; + requires __has_member_iterator_category<_Ip>; + }; + +template<class> +struct __iterator_traits_member_pointer_or_void { + using type = void; +}; + +template<__has_member_pointer _Tp> +struct __iterator_traits_member_pointer_or_void<_Tp> { + using type = typename _Tp::pointer; +}; + +template<class _Tp> +concept __cpp17_iterator_missing_members = + !__specifies_members<_Tp> && + __iterator_traits_detail::__cpp17_iterator<_Tp>; + +template<class _Tp> +concept __cpp17_input_iterator_missing_members = + __cpp17_iterator_missing_members<_Tp> && + __iterator_traits_detail::__cpp17_input_iterator<_Tp>; + +// Otherwise, `pointer` names `void`. +template<class> +struct __iterator_traits_member_pointer_or_arrow_or_void { using type = void; }; + +// [iterator.traits]/3.2.1 +// If the qualified-id `I::pointer` is valid and denotes a type, `pointer` names that type. +template<__has_member_pointer _Ip> +struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> { using type = typename _Ip::pointer; }; + +// Otherwise, if `decltype(declval<I&>().operator->())` is well-formed, then `pointer` names that +// type. +template<class _Ip> + requires requires(_Ip& __i) { __i.operator->(); } && (!__has_member_pointer<_Ip>) +struct __iterator_traits_member_pointer_or_arrow_or_void<_Ip> { + using type = decltype(declval<_Ip&>().operator->()); +}; + +// Otherwise, `reference` names `iter-reference-t<I>`. +template<class _Ip> +struct __iterator_traits_member_reference { using type = iter_reference_t<_Ip>; }; + +// [iterator.traits]/3.2.2 +// If the qualified-id `I::reference` is valid and denotes a type, `reference` names that type. +template<__has_member_reference _Ip> +struct __iterator_traits_member_reference<_Ip> { using type = typename _Ip::reference; }; + +// [iterator.traits]/3.2.3.4 +// input_iterator_tag +template<class _Ip> +struct __deduce_iterator_category { + using type = input_iterator_tag; +}; + +// [iterator.traits]/3.2.3.1 +// `random_access_iterator_tag` if `I` satisfies `cpp17-random-access-iterator`, or otherwise +template<__iterator_traits_detail::__cpp17_random_access_iterator _Ip> +struct __deduce_iterator_category<_Ip> { + using type = random_access_iterator_tag; +}; + +// [iterator.traits]/3.2.3.2 +// `bidirectional_iterator_tag` if `I` satisfies `cpp17-bidirectional-iterator`, or otherwise +template<__iterator_traits_detail::__cpp17_bidirectional_iterator _Ip> +struct __deduce_iterator_category<_Ip> { + using type = bidirectional_iterator_tag; +}; + +// [iterator.traits]/3.2.3.3 +// `forward_iterator_tag` if `I` satisfies `cpp17-forward-iterator`, or otherwise +template<__iterator_traits_detail::__cpp17_forward_iterator _Ip> +struct __deduce_iterator_category<_Ip> { + using type = forward_iterator_tag; +}; + +template<class _Ip> +struct __iterator_traits_iterator_category : __deduce_iterator_category<_Ip> {}; + +// [iterator.traits]/3.2.3 +// If the qualified-id `I::iterator-category` is valid and denotes a type, `iterator-category` names +// that type. +template<__has_member_iterator_category _Ip> +struct __iterator_traits_iterator_category<_Ip> { + using type = typename _Ip::iterator_category; +}; + +// otherwise, it names void. +template<class> +struct __iterator_traits_difference_type { using type = void; }; + +// If the qualified-id `incrementable_traits<I>::difference_type` is valid and denotes a type, then +// `difference_type` names that type; +template<class _Ip> +requires requires { typename incrementable_traits<_Ip>::difference_type; } +struct __iterator_traits_difference_type<_Ip> { + using type = typename incrementable_traits<_Ip>::difference_type; +}; + +// [iterator.traits]/3.4 +// Otherwise, `iterator_traits<I>` has no members by any of the above names. +template<class> +struct __iterator_traits {}; + +// [iterator.traits]/3.1 +// If `I` has valid ([temp.deduct]) member types `difference-type`, `value-type`, `reference`, and +// `iterator-category`, then `iterator-traits<I>` has the following publicly accessible members: +template<__specifies_members _Ip> +struct __iterator_traits<_Ip> { + using iterator_category = typename _Ip::iterator_category; + using value_type = typename _Ip::value_type; + using difference_type = typename _Ip::difference_type; + using pointer = typename __iterator_traits_member_pointer_or_void<_Ip>::type; + using reference = typename _Ip::reference; +}; + +// [iterator.traits]/3.2 +// Otherwise, if `I` satisfies the exposition-only concept `cpp17-input-iterator`, +// `iterator-traits<I>` has the following publicly accessible members: +template<__cpp17_input_iterator_missing_members _Ip> +struct __iterator_traits<_Ip> { + using iterator_category = typename __iterator_traits_iterator_category<_Ip>::type; + using value_type = typename indirectly_readable_traits<_Ip>::value_type; + using difference_type = typename incrementable_traits<_Ip>::difference_type; + using pointer = typename __iterator_traits_member_pointer_or_arrow_or_void<_Ip>::type; + using reference = typename __iterator_traits_member_reference<_Ip>::type; +}; + +// Otherwise, if `I` satisfies the exposition-only concept `cpp17-iterator`, then +// `iterator_traits<I>` has the following publicly accessible members: +template<__cpp17_iterator_missing_members _Ip> +struct __iterator_traits<_Ip> { + using iterator_category = output_iterator_tag; + using value_type = void; + using difference_type = typename __iterator_traits_difference_type<_Ip>::type; + using pointer = void; + using reference = void; +}; + +template<class _Ip> +struct iterator_traits : __iterator_traits<_Ip> { + using __primary_template = iterator_traits; +}; + +#else // !defined(_LIBCPP_HAS_NO_RANGES) + +template <class _Iter, bool> struct __iterator_traits {}; + +template <class _Iter, bool> struct __iterator_traits_impl {}; + +template <class _Iter> +struct __iterator_traits_impl<_Iter, true> +{ + typedef typename _Iter::difference_type difference_type; + typedef typename _Iter::value_type value_type; + typedef typename _Iter::pointer pointer; + typedef typename _Iter::reference reference; + typedef typename _Iter::iterator_category iterator_category; +}; + +template <class _Iter> +struct __iterator_traits<_Iter, true> + : __iterator_traits_impl + < + _Iter, + is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value || + is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value + > +{}; + +// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category +// exists. Else iterator_traits<Iterator> will be an empty class. This is a +// conforming extension which allows some programs to compile and behave as +// the client expects instead of failing at compile time. + +template <class _Iter> +struct _LIBCPP_TEMPLATE_VIS iterator_traits + : __iterator_traits<_Iter, __has_iterator_typedefs<_Iter>::value> { + + using __primary_template = iterator_traits; +}; +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +template<class _Tp> +#if !defined(_LIBCPP_HAS_NO_RANGES) +requires is_object_v<_Tp> +#endif +struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*> +{ + typedef ptrdiff_t difference_type; + typedef typename remove_cv<_Tp>::type value_type; + typedef _Tp* pointer; + typedef _Tp& reference; + typedef random_access_iterator_tag iterator_category; +#if _LIBCPP_STD_VER > 17 + typedef contiguous_iterator_tag iterator_concept; +#endif +}; + +template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value> +struct __has_iterator_category_convertible_to + : is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up> +{}; + +template <class _Tp, class _Up> +struct __has_iterator_category_convertible_to<_Tp, _Up, false> : false_type {}; + +template <class _Tp, class _Up, bool = __has_iterator_concept<_Tp>::value> +struct __has_iterator_concept_convertible_to + : is_convertible<typename _Tp::iterator_concept, _Up> +{}; + +template <class _Tp, class _Up> +struct __has_iterator_concept_convertible_to<_Tp, _Up, false> : false_type {}; + +template <class _Tp> +struct __is_cpp17_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {}; + +template <class _Tp> +struct __is_cpp17_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {}; + +template <class _Tp> +struct __is_cpp17_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {}; + +template <class _Tp> +struct __is_cpp17_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {}; + +// __is_cpp17_contiguous_iterator determines if an iterator is known by +// libc++ to be contiguous, either because it advertises itself as such +// (in C++20) or because it is a pointer type or a known trivial wrapper +// around a (possibly fancy) pointer type, such as __wrap_iter<T*>. +// Such iterators receive special "contiguous" optimizations in +// std::copy and std::sort. +// +#if _LIBCPP_STD_VER > 17 +template <class _Tp> +struct __is_cpp17_contiguous_iterator : _Or< + __has_iterator_category_convertible_to<_Tp, contiguous_iterator_tag>, + __has_iterator_concept_convertible_to<_Tp, contiguous_iterator_tag> +> {}; +#else +template <class _Tp> +struct __is_cpp17_contiguous_iterator : false_type {}; +#endif + +// Any native pointer which is an iterator is also a contiguous iterator. +template <class _Up> +struct __is_cpp17_contiguous_iterator<_Up*> : true_type {}; + + +template <class _Tp> +struct __is_exactly_cpp17_input_iterator + : public integral_constant<bool, + __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value && + !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {}; + +#if _LIBCPP_STD_VER >= 17 +template<class _InputIterator> +using __iter_value_type = typename iterator_traits<_InputIterator>::value_type; + +template<class _InputIterator> +using __iter_key_type = remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>; + +template<class _InputIterator> +using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type; + +template<class _InputIterator> +using __iter_to_alloc_type = pair< + add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>, + typename iterator_traits<_InputIterator>::value_type::second_type>; +#endif // _LIBCPP_STD_VER >= 17 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_ITERATOR_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/move_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/move_iterator.h new file mode 100644 index 0000000..eac9264 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/move_iterator.h
@@ -0,0 +1,184 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_MOVE_ITERATOR_H +#define _LIBCPP___ITERATOR_MOVE_ITERATOR_H + +#include <__config> +#include <__iterator/iterator_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Iter> +class _LIBCPP_TEMPLATE_VIS move_iterator +{ +private: + _Iter __i; +public: + typedef _Iter iterator_type; + typedef typename iterator_traits<iterator_type>::value_type value_type; + typedef typename iterator_traits<iterator_type>::difference_type difference_type; + typedef iterator_type pointer; + typedef _If<__is_cpp17_random_access_iterator<_Iter>::value, + random_access_iterator_tag, + typename iterator_traits<_Iter>::iterator_category> iterator_category; +#if _LIBCPP_STD_VER > 17 + typedef input_iterator_tag iterator_concept; +#endif + +#ifndef _LIBCPP_CXX03_LANG + typedef typename iterator_traits<iterator_type>::reference __reference; + typedef typename conditional< + is_reference<__reference>::value, + typename remove_reference<__reference>::type&&, + __reference + >::type reference; +#else + typedef typename iterator_traits<iterator_type>::reference reference; +#endif + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator() : __i() {} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + explicit move_iterator(_Iter __x) : __i(__x) {} + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {} + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && + is_convertible<_Up const&, _Iter>::value && + is_assignable<_Iter&, _Up const&>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator=(const move_iterator<_Up>& __u) { + __i = __u.base(); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator*() const { return static_cast<reference>(*__i); } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + pointer operator->() const { return __i;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator++() {++__i; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator--() {--__i; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator+=(difference_type __n) {__i += __n; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); } +}; + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() == __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() < __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() != __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() > __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() >= __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() <= __y.base(); +} + +#ifndef _LIBCPP_CXX03_LANG +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +-> decltype(__x.base() - __y.base()) +{ + return __x.base() - __y.base(); +} +#else +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY +typename move_iterator<_Iter1>::difference_type +operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) +{ + return __x.base() - __y.base(); +} +#endif + +template <class _Iter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +move_iterator<_Iter> +operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x) +{ + return move_iterator<_Iter>(__x.base() + __n); +} + +template <class _Iter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +move_iterator<_Iter> +make_move_iterator(_Iter __i) +{ + return move_iterator<_Iter>(__i); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_MOVE_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/next.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/next.h new file mode 100644 index 0000000..0464708 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/next.h
@@ -0,0 +1,82 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_NEXT_H +#define _LIBCPP___ITERATOR_NEXT_H + +#include <__config> +#include <__debug> +#include <__function_like.h> +#include <__iterator/advance.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type + next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) { + _LIBCPP_ASSERT(__n >= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value, + "Attempt to next(it, n) with negative n on a non-bidirectional iterator"); + + _VSTD::advance(__x, __n); + return __x; +} + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +struct __next_fn final : private __function_like { + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __next_fn(__tag __x) noexcept : __function_like(__x) {} + + template <input_or_output_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x) const { + ++__x; + return __x; + } + + template <input_or_output_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { + ranges::advance(__x, __n); + return __x; + } + + template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x, _Sp __bound) const { + ranges::advance(__x, __bound); + return __x; + } + + template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Sp __bound) const { + ranges::advance(__x, __n, __bound); + return __x; + } +}; + +inline constexpr auto next = __next_fn(__function_like::__tag()); +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_PRIMITIVES_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostream_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostream_iterator.h new file mode 100644 index 0000000..20a3674 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostream_iterator.h
@@ -0,0 +1,70 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H +#define _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <iosfwd> // for forward declarations of char_traits and basic_ostream + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> > +class _LIBCPP_TEMPLATE_VIS ostream_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + typedef _CharT char_type; + typedef _Traits traits_type; + typedef basic_ostream<_CharT, _Traits> ostream_type; + +private: + ostream_type* __out_stream_; + const char_type* __delim_; +public: + _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT + : __out_stream_(_VSTD::addressof(__s)), __delim_(nullptr) {} + _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT + : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {} + _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_) + { + *__out_stream_ << __value_; + if (__delim_) + *__out_stream_ << __delim_; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*() {return *this;} + _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++() {return *this;} + _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostreambuf_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostreambuf_iterator.h new file mode 100644 index 0000000..3272f6c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/ostreambuf_iterator.h
@@ -0,0 +1,76 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H +#define _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H + +#include <__config> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <iosfwd> // for forward declaration of basic_streambuf + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _CharT, class _Traits> +class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + typedef _CharT char_type; + typedef _Traits traits_type; + typedef basic_streambuf<_CharT, _Traits> streambuf_type; + typedef basic_ostream<_CharT, _Traits> ostream_type; + +private: + streambuf_type* __sbuf_; +public: + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT + : __sbuf_(__s.rdbuf()) {} + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT + : __sbuf_(__s) {} + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c) + { + if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof())) + __sbuf_ = nullptr; + return *this; + } + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;} + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;} + _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;} + _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == nullptr;} + + template <class _Ch, class _Tr> + friend + _LIBCPP_HIDDEN + ostreambuf_iterator<_Ch, _Tr> + __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s, + const _Ch* __ob, const _Ch* __op, const _Ch* __oe, + ios_base& __iob, _Ch __fl); +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/prev.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/prev.h new file mode 100644 index 0000000..cbe1e87 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/prev.h
@@ -0,0 +1,74 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_PREV_H +#define _LIBCPP___ITERATOR_PREV_H + +#include <__config> +#include <__debug> +#include <__function_like.h> +#include <__iterator/advance.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + typename enable_if<__is_cpp17_input_iterator<_InputIter>::value, _InputIter>::type + prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) { + _LIBCPP_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value, + "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator"); + _VSTD::advance(__x, -__n); + return __x; +} + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +struct __prev_fn final : private __function_like { + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __prev_fn(__tag __x) noexcept : __function_like(__x) {} + + template <bidirectional_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x) const { + --__x; + return __x; + } + + template <bidirectional_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { + ranges::advance(__x, -__n); + return __x; + } + + template <bidirectional_iterator _Ip> + _LIBCPP_HIDE_FROM_ABI + constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Ip __bound) const { + ranges::advance(__x, -__n, __bound); + return __x; + } +}; + +inline constexpr auto prev = __prev_fn(__function_like::__tag()); +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_PREV_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/projected.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/projected.h new file mode 100644 index 0000000..c24c86b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/projected.h
@@ -0,0 +1,40 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___ITERATOR_PROJECTED_H +#define _LIBCPP___ITERATOR_PROJECTED_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +template<indirectly_readable _It, indirectly_regular_unary_invocable<_It> _Proj> +struct projected { + using value_type = remove_cvref_t<indirect_result_t<_Proj&, _It>>; + indirect_result_t<_Proj&, _It> operator*() const; // not defined +}; + +template<weakly_incrementable _It, class _Proj> +struct incrementable_traits<projected<_It, _Proj>> { + using difference_type = iter_difference_t<_It>; +}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_PROJECTED_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/readable_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/readable_traits.h new file mode 100644 index 0000000..90121be --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/readable_traits.h
@@ -0,0 +1,86 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_READABLE_TRAITS_H +#define _LIBCPP___ITERATOR_READABLE_TRAITS_H + +#include <__config> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// [readable.traits] +template<class> struct __cond_value_type {}; + +template<class _Tp> +requires is_object_v<_Tp> +struct __cond_value_type<_Tp> { using value_type = remove_cv_t<_Tp>; }; + +template<class _Tp> +concept __has_member_value_type = requires { typename _Tp::value_type; }; + +template<class _Tp> +concept __has_member_element_type = requires { typename _Tp::element_type; }; + +template<class> struct indirectly_readable_traits {}; + +template<class _Ip> +requires is_array_v<_Ip> +struct indirectly_readable_traits<_Ip> { + using value_type = remove_cv_t<remove_extent_t<_Ip>>; +}; + +template<class _Ip> +struct indirectly_readable_traits<const _Ip> : indirectly_readable_traits<_Ip> {}; + +template<class _Tp> +struct indirectly_readable_traits<_Tp*> : __cond_value_type<_Tp> {}; + +template<__has_member_value_type _Tp> +struct indirectly_readable_traits<_Tp> + : __cond_value_type<typename _Tp::value_type> {}; + +template<__has_member_element_type _Tp> +struct indirectly_readable_traits<_Tp> + : __cond_value_type<typename _Tp::element_type> {}; + +// Pre-emptively applies LWG3541 +template<__has_member_value_type _Tp> +requires __has_member_element_type<_Tp> +struct indirectly_readable_traits<_Tp> {}; +template<__has_member_value_type _Tp> +requires __has_member_element_type<_Tp> && + same_as<remove_cv_t<typename _Tp::element_type>, + remove_cv_t<typename _Tp::value_type>> +struct indirectly_readable_traits<_Tp> + : __cond_value_type<typename _Tp::value_type> {}; + +template <class> +struct iterator_traits; + +// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes +// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization +// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise. +template <class _Ip> +using iter_value_t = typename conditional_t<__is_primary_template<iterator_traits<remove_cvref_t<_Ip> > >::value, + indirectly_readable_traits<remove_cvref_t<_Ip> >, + iterator_traits<remove_cvref_t<_Ip> > >::value_type; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_READABLE_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_access.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_access.h new file mode 100644 index 0000000..643aede --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_access.h
@@ -0,0 +1,104 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_REVERSE_ACCESS_H +#define _LIBCPP___ITERATOR_REVERSE_ACCESS_H + +#include <__config> +#include <__iterator/reverse_iterator.h> +#include <cstddef> +#include <initializer_list> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_CXX03_LANG) + +#if _LIBCPP_STD_VER > 11 + +template <class _Tp, size_t _Np> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) +{ + return reverse_iterator<_Tp*>(__array + _Np); +} + +template <class _Tp, size_t _Np> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) +{ + return reverse_iterator<_Tp*>(__array); +} + +template <class _Ep> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) +{ + return reverse_iterator<const _Ep*>(__il.end()); +} + +template <class _Ep> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) +{ + return reverse_iterator<const _Ep*>(__il.begin()); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) +{ + return __c.rbegin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) +{ + return __c.rbegin(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto rend(_Cp& __c) -> decltype(__c.rend()) +{ + return __c.rend(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto rend(const _Cp& __c) -> decltype(__c.rend()) +{ + return __c.rend(); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c)) +{ + return _VSTD::rbegin(__c); +} + +template <class _Cp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c)) +{ + return _VSTD::rend(__c); +} + +#endif + +#endif // !defined(_LIBCPP_CXX03_LANG) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_iterator.h new file mode 100644 index 0000000..d06859e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/reverse_iterator.h
@@ -0,0 +1,246 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_REVERSE_ITERATOR_H +#define _LIBCPP___ITERATOR_REVERSE_ITERATOR_H + +#include <__config> +#include <__compare/compare_three_way_result.h> +#include <__compare/three_way_comparable.h> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp, class = void> +struct __is_stashing_iterator : false_type {}; + +template <class _Tp> +struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type> + : true_type {}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Iter> +class _LIBCPP_TEMPLATE_VIS reverse_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<typename iterator_traits<_Iter>::iterator_category, + typename iterator_traits<_Iter>::value_type, + typename iterator_traits<_Iter>::difference_type, + typename iterator_traits<_Iter>::pointer, + typename iterator_traits<_Iter>::reference> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +private: +#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES + _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break +#endif + + static_assert(!__is_stashing_iterator<_Iter>::value, + "The specified iterator type cannot be used with reverse_iterator; " + "Using stashing iterators with reverse_iterator causes undefined behavior"); + +protected: + _Iter current; +public: + typedef _Iter iterator_type; + typedef typename iterator_traits<_Iter>::difference_type difference_type; + typedef typename iterator_traits<_Iter>::reference reference; + typedef typename iterator_traits<_Iter>::pointer pointer; + typedef _If<__is_cpp17_random_access_iterator<_Iter>::value, + random_access_iterator_tag, + typename iterator_traits<_Iter>::iterator_category> iterator_category; + typedef typename iterator_traits<_Iter>::value_type value_type; + +#if _LIBCPP_STD_VER > 17 + typedef _If<__is_cpp17_random_access_iterator<_Iter>::value, + random_access_iterator_tag, + bidirectional_iterator_tag> iterator_concept; +#endif + +#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator() : __t(), current() {} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {} + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator(const reverse_iterator<_Up>& __u) + : __t(__u.base()), current(__u.base()) + { } + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && + is_convertible<_Up const&, _Iter>::value && + is_assignable<_Iter, _Up const&>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator=(const reverse_iterator<_Up>& __u) { + __t = current = __u.base(); + return *this; + } +#else + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator() : current() {} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + explicit reverse_iterator(_Iter __x) : current(__x) {} + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator(const reverse_iterator<_Up>& __u) + : current(__u.base()) + { } + + template <class _Up, class = __enable_if_t< + !is_same<_Up, _Iter>::value && + is_convertible<_Up const&, _Iter>::value && + is_assignable<_Iter, _Up const&>::value + > > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator=(const reverse_iterator<_Up>& __u) { + current = __u.base(); + return *this; + } +#endif + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _Iter base() const {return current;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator*() const {_Iter __tmp = current; return *--__tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + pointer operator->() const {return _VSTD::addressof(operator*());} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator++() {--current; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator--() {++current; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + reference operator[](difference_type __n) const {return *(*this + __n);} +}; + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() == __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() > __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() != __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() < __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() <= __y.base(); +} + +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +bool +operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __x.base() >= __y.base(); +} + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) +template <class _Iter1, three_way_comparable_with<_Iter1> _Iter2> +_LIBCPP_HIDE_FROM_ABI constexpr +compare_three_way_result_t<_Iter1, _Iter2> +operator<=>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __y.base() <=> __x.base(); +} +#endif + +#ifndef _LIBCPP_CXX03_LANG +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +auto +operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +-> decltype(__y.base() - __x.base()) +{ + return __y.base() - __x.base(); +} +#else +template <class _Iter1, class _Iter2> +inline _LIBCPP_INLINE_VISIBILITY +typename reverse_iterator<_Iter1>::difference_type +operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) +{ + return __y.base() - __x.base(); +} +#endif + +template <class _Iter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<_Iter> +operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x) +{ + return reverse_iterator<_Iter>(__x.base() - __n); +} + +#if _LIBCPP_STD_VER > 11 +template <class _Iter> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 +reverse_iterator<_Iter> make_reverse_iterator(_Iter __i) +{ + return reverse_iterator<_Iter>(__i); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_REVERSE_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/size.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/size.h new file mode 100644 index 0000000..2e6a7d3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/size.h
@@ -0,0 +1,53 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_SIZE_H +#define _LIBCPP___ITERATOR_SIZE_H + +#include <__config> +#include <cstddef> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +template <class _Cont> +_LIBCPP_INLINE_VISIBILITY +constexpr auto size(const _Cont& __c) +_NOEXCEPT_(noexcept(__c.size())) +-> decltype (__c.size()) +{ return __c.size(); } + +template <class _Tp, size_t _Sz> +_LIBCPP_INLINE_VISIBILITY +constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; } + +#if _LIBCPP_STD_VER > 17 +template <class _Cont> +_LIBCPP_INLINE_VISIBILITY +constexpr auto ssize(const _Cont& __c) +_NOEXCEPT_(noexcept(static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()))) +-> common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>> +{ return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(__c.size())>>>(__c.size()); } + +template <class _Tp, ptrdiff_t _Sz> +_LIBCPP_INLINE_VISIBILITY +constexpr ptrdiff_t ssize(const _Tp (&)[_Sz]) noexcept { return _Sz; } +#endif + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_SIZE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/unreachable_sentinel.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/unreachable_sentinel.h new file mode 100644 index 0000000..cbbccd7 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/unreachable_sentinel.h
@@ -0,0 +1,38 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H +#define _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H + +#include <__config> +#include <__iterator/concepts.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +struct unreachable_sentinel_t { + template<weakly_incrementable _Iter> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(unreachable_sentinel_t, const _Iter&) noexcept { + return false; + } +}; + +inline constexpr unreachable_sentinel_t unreachable_sentinel{}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/wrap_iter.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/wrap_iter.h new file mode 100644 index 0000000..28872f9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__iterator/wrap_iter.h
@@ -0,0 +1,302 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ITERATOR_WRAP_ITER_H +#define _LIBCPP___ITERATOR_WRAP_ITER_H + +#include <__config> +#include <__debug> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__memory/pointer_traits.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Iter> +class __wrap_iter +{ +public: + typedef _Iter iterator_type; + typedef typename iterator_traits<iterator_type>::value_type value_type; + typedef typename iterator_traits<iterator_type>::difference_type difference_type; + typedef typename iterator_traits<iterator_type>::pointer pointer; + typedef typename iterator_traits<iterator_type>::reference reference; + typedef typename iterator_traits<iterator_type>::iterator_category iterator_category; +#if _LIBCPP_STD_VER > 17 + typedef contiguous_iterator_tag iterator_concept; +#endif + +private: + iterator_type __i; +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter() _NOEXCEPT +#if _LIBCPP_STD_VER > 11 + : __i{} +#endif + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__insert_i(this); +#endif + } + template <class _Up> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG + __wrap_iter(const __wrap_iter<_Up>& __u, + typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT + : __i(__u.base()) + { +#if _LIBCPP_DEBUG_LEVEL == 2 + __get_db()->__iterator_copy(this, _VSTD::addressof(__u)); +#endif + } +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG + __wrap_iter(const __wrap_iter& __x) + : __i(__x.base()) + { + __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG + __wrap_iter& operator=(const __wrap_iter& __x) + { + if (this != _VSTD::addressof(__x)) + { + __get_db()->__iterator_copy(this, _VSTD::addressof(__x)); + __i = __x.__i; + } + return *this; + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG + ~__wrap_iter() + { + __get_db()->__erase_i(this); + } +#endif + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator*() const _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable iterator"); +#endif + return *__i; + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG pointer operator->() const _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to dereference a non-dereferenceable iterator"); +#endif + return _VSTD::__to_address(__i); + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator++() _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this), + "Attempted to increment a non-incrementable iterator"); +#endif + ++__i; + return *this; + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator++(int) _NOEXCEPT + {__wrap_iter __tmp(*this); ++(*this); return __tmp;} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator--() _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__decrementable(this), + "Attempted to decrement a non-decrementable iterator"); +#endif + --__i; + return *this; + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator--(int) _NOEXCEPT + {__wrap_iter __tmp(*this); --(*this); return __tmp;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator+ (difference_type __n) const _NOEXCEPT + {__wrap_iter __w(*this); __w += __n; return __w;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator+=(difference_type __n) _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n), + "Attempted to add/subtract an iterator outside its valid range"); +#endif + __i += __n; + return *this; + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter operator- (difference_type __n) const _NOEXCEPT + {return *this + (-__n);} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter& operator-=(difference_type __n) _NOEXCEPT + {*this += -__n; return *this;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG reference operator[](difference_type __n) const _NOEXCEPT + { +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n), + "Attempted to subscript an iterator outside its valid range"); +#endif + return __i[__n]; + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG iterator_type base() const _NOEXCEPT {return __i;} + +private: +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(const void* __p, iterator_type __x) : __i(__x) + { + __get_db()->__insert_ic(this, __p); + } +#else + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} +#endif + + template <class _Up> friend class __wrap_iter; + template <class _CharT, class _Traits, class _Alloc> friend class basic_string; + template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector; + template <class _Tp, size_t> friend class _LIBCPP_TEMPLATE_VIS span; +}; + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ + return __x.base() == __y.base(); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ + return __x.base() == __y.base(); +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)), + "Attempted to compare incomparable iterators"); +#endif + return __x.base() < __y.base(); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y), + "Attempted to compare incomparable iterators"); +#endif + return __x.base() < __y.base(); +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ + return !(__x == __y); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ + return !(__x == __y); +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ + return __y < __x; +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ + return __y < __x; +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ + return !(__x < __y); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ + return !(__x < __y); +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT +{ + return !(__y < __x); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +bool operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +{ + return !(__y < __x); +} + +template <class _Iter1, class _Iter2> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +#ifndef _LIBCPP_CXX03_LANG +auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT + -> decltype(__x.base() - __y.base()) +#else +typename __wrap_iter<_Iter1>::difference_type +operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT +#endif // C++03 +{ +#if _LIBCPP_DEBUG_LEVEL == 2 + _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(_VSTD::addressof(__x), _VSTD::addressof(__y)), + "Attempted to subtract incompatible iterators"); +#endif + return __x.base() - __y.base(); +} + +template <class _Iter1> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +__wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT +{ + __x += __n; + return __x; +} + +#if _LIBCPP_STD_VER <= 17 +template <class _It> +struct __is_cpp17_contiguous_iterator<__wrap_iter<_It> > : true_type {}; +#endif + +template <class _It> +struct _LIBCPP_TEMPLATE_VIS pointer_traits<__wrap_iter<_It> > +{ + typedef __wrap_iter<_It> pointer; + typedef typename pointer_traits<_It>::element_type element_type; + typedef typename pointer_traits<_It>::difference_type difference_type; + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR + static element_type *to_address(pointer __w) _NOEXCEPT { + return _VSTD::__to_address(__w.base()); + } +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___ITERATOR_WRAP_ITER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__libcpp_version b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__libcpp_version index e334181..bfed819 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__libcpp_version +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__libcpp_version
@@ -1 +1 @@ -12000 +14000
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__locale b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__locale index 4721a00..4296adb 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__locale +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__locale
@@ -10,6 +10,7 @@ #ifndef _LIBCPP___LOCALE #define _LIBCPP___LOCALE +#include <__availability> #include <__config> #include <string> #include <memory> @@ -20,26 +21,28 @@ #include <locale.h> #if defined(_LIBCPP_MSVCRT_LIKE) # include <cstring> -# include <support/win32/locale_win32.h> -#elif defined(_AIX) -# include <support/ibm/xlocale.h> +# include <__support/win32/locale_win32.h> +#elif defined(_AIX) || defined(__MVS__) +# include <__support/ibm/xlocale.h> #elif defined(__ANDROID__) -# include <support/android/locale_bionic.h> +# include <__support/android/locale_bionic.h> #elif defined(__sun__) # include <xlocale.h> -# include <support/solaris/xlocale.h> +# include <__support/solaris/xlocale.h> #elif defined(_NEWLIB_VERSION) -# include <support/newlib/xlocale.h> +# include <__support/newlib/xlocale.h> +#elif defined(__OpenBSD__) +# include <__support/openbsd/xlocale.h> #elif (defined(__APPLE__) || defined(__FreeBSD__) \ || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) # include <xlocale.h> #elif defined(__Fuchsia__) -# include <support/fuchsia/xlocale.h> +# include <__support/fuchsia/xlocale.h> #elif defined(__wasi__) // WASI libc uses musl's locales support. -# include <support/musl/xlocale.h> +# include <__support/musl/xlocale.h> #elif defined(_LIBCPP_HAS_MUSL_LIBC) -# include <support/musl/xlocale.h> +# include <__support/musl/xlocale.h> #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -76,7 +79,7 @@ // locale name, otherwise it will be a semicolon-separated string listing // each category. In the second case, we know at least one category won't // be what we want, so we only have to check the first case. - if (strcmp(__l.__get_locale(), __lc) != 0) { + if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) { __locale_all = _strdup(__lc); if (__locale_all == nullptr) __throw_bad_alloc(); @@ -105,7 +108,6 @@ }; #endif - class _LIBCPP_TYPE_VIS locale; template <class _Facet> @@ -335,8 +337,10 @@ return static_cast<long>(__h); } -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>) +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>) +#endif // template <class CharT> class collate_byname; @@ -361,6 +365,7 @@ virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS collate_byname<wchar_t> : public collate<wchar_t> @@ -380,6 +385,7 @@ const char_type* __lo2, const char_type* __hi2) const; virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const; }; +#endif template <class _CharT, class _Traits, class _Allocator> bool @@ -396,7 +402,26 @@ class _LIBCPP_TYPE_VIS ctype_base { public: -#if defined(__GLIBC__) +#if defined(_LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE) + typedef unsigned long mask; + static const mask space = 1<<0; + static const mask print = 1<<1; + static const mask cntrl = 1<<2; + static const mask upper = 1<<3; + static const mask lower = 1<<4; + static const mask alpha = 1<<5; + static const mask digit = 1<<6; + static const mask punct = 1<<7; + static const mask xdigit = 1<<8; + static const mask blank = 1<<9; +#if defined(__BIONIC__) + // Historically this was a part of regex_traits rather than ctype_base. The + // historical value of the constant is preserved for ABI compatibility. + static const mask __regex_word = 0x8000; +#else + static const mask __regex_word = 1<<10; +#endif // defined(__BIONIC__) +#elif defined(__GLIBC__) typedef unsigned short mask; static const mask space = _ISspace; static const mask print = _ISprint; @@ -485,24 +510,7 @@ # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT #else - typedef unsigned long mask; - static const mask space = 1<<0; - static const mask print = 1<<1; - static const mask cntrl = 1<<2; - static const mask upper = 1<<3; - static const mask lower = 1<<4; - static const mask alpha = 1<<5; - static const mask digit = 1<<6; - static const mask punct = 1<<7; - static const mask xdigit = 1<<8; - static const mask blank = 1<<9; -#if defined(__BIONIC__) - // Historically this was a part of regex_traits rather than ctype_base. The - // historical value of the constant is preserved for ABI compatibility. - static const mask __regex_word = 0x8000; -#else - static const mask __regex_word = 1<<10; -#endif // defined(__BIONIC__) +# error unknown rune table for this platform -- do you mean to define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE? #endif static const mask alnum = alpha | digit; static const mask graph = alnum | punct; @@ -512,6 +520,7 @@ template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype<wchar_t> : public locale::facet, @@ -613,6 +622,7 @@ virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype<char> @@ -623,7 +633,7 @@ public: typedef char char_type; - explicit ctype(const mask* __tab = 0, bool __del = false, size_t __refs = 0); + explicit ctype(const mask* __tab = nullptr, bool __del = false, size_t __refs = 0); _LIBCPP_INLINE_VISIBILITY bool is(mask __m, char_type __c) const @@ -757,6 +767,7 @@ virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS ctype_byname<wchar_t> : public ctype<wchar_t> @@ -782,6 +793,7 @@ virtual char do_narrow(char_type, char __dfault) const; virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template <class _CharT> inline _LIBCPP_INLINE_VISIBILITY @@ -988,6 +1000,7 @@ // template <> class codecvt<wchar_t, char, mbstate_t> +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t> : public locale::facet, @@ -1068,11 +1081,12 @@ virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; virtual int do_max_length() const _NOEXCEPT; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS -// template <> class codecvt<char16_t, char, mbstate_t> +// template <> class codecvt<char16_t, char, mbstate_t> // deprecated in C++20 template <> -class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t> +class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t> : public locale::facet, public codecvt_base { @@ -1155,10 +1169,100 @@ virtual int do_max_length() const _NOEXCEPT; }; -// template <> class codecvt<char32_t, char, mbstate_t> +#ifndef _LIBCPP_HAS_NO_CHAR8_T + +// template <> class codecvt<char16_t, char8_t, mbstate_t> // C++20 template <> -class _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t> +class _LIBCPP_TYPE_VIS codecvt<char16_t, char8_t, mbstate_t> + : public locale::facet, + public codecvt_base +{ +public: + typedef char16_t intern_type; + typedef char8_t extern_type; + typedef mbstate_t state_type; + + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(size_t __refs = 0) + : locale::facet(__refs) {} + + _LIBCPP_INLINE_VISIBILITY + result out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_unshift(__st, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const + { + return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + int encoding() const _NOEXCEPT + { + return do_encoding(); + } + + _LIBCPP_INLINE_VISIBILITY + bool always_noconv() const _NOEXCEPT + { + return do_always_noconv(); + } + + _LIBCPP_INLINE_VISIBILITY + int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const + { + return do_length(__st, __frm, __end, __mx); + } + + _LIBCPP_INLINE_VISIBILITY + int max_length() const _NOEXCEPT + { + return do_max_length(); + } + + static locale::id id; + +protected: + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(const char*, size_t __refs = 0) + : locale::facet(__refs) {} + + ~codecvt(); + + virtual result do_out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual result do_in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const; + virtual result do_unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; + virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; + virtual int do_max_length() const _NOEXCEPT; +}; + +#endif + +// template <> class codecvt<char32_t, char, mbstate_t> // deprecated in C++20 + +template <> +class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t> : public locale::facet, public codecvt_base { @@ -1241,6 +1345,96 @@ virtual int do_max_length() const _NOEXCEPT; }; +#ifndef _LIBCPP_HAS_NO_CHAR8_T + +// template <> class codecvt<char32_t, char8_t, mbstate_t> // C++20 + +template <> +class _LIBCPP_TYPE_VIS codecvt<char32_t, char8_t, mbstate_t> + : public locale::facet, + public codecvt_base +{ +public: + typedef char32_t intern_type; + typedef char8_t extern_type; + typedef mbstate_t state_type; + + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(size_t __refs = 0) + : locale::facet(__refs) {} + + _LIBCPP_INLINE_VISIBILITY + result out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const + { + return do_unshift(__st, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + result in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const + { + return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt); + } + + _LIBCPP_INLINE_VISIBILITY + int encoding() const _NOEXCEPT + { + return do_encoding(); + } + + _LIBCPP_INLINE_VISIBILITY + bool always_noconv() const _NOEXCEPT + { + return do_always_noconv(); + } + + _LIBCPP_INLINE_VISIBILITY + int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const + { + return do_length(__st, __frm, __end, __mx); + } + + _LIBCPP_INLINE_VISIBILITY + int max_length() const _NOEXCEPT + { + return do_max_length(); + } + + static locale::id id; + +protected: + _LIBCPP_INLINE_VISIBILITY + explicit codecvt(const char*, size_t __refs = 0) + : locale::facet(__refs) {} + + ~codecvt(); + + virtual result do_out(state_type& __st, + const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual result do_in(state_type& __st, + const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt, + intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const; + virtual result do_unshift(state_type& __st, + extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const; + virtual int do_encoding() const _NOEXCEPT; + virtual bool do_always_noconv() const _NOEXCEPT; + virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const; + virtual int do_max_length() const _NOEXCEPT; +}; + +#endif + // template <class _InternT, class _ExternT, class _StateT> class codecvt_byname template <class _InternT, class _ExternT, class _StateT> @@ -1258,15 +1452,23 @@ ~codecvt_byname(); }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <class _InternT, class _ExternT, class _StateT> codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname() { } +_LIBCPP_SUPPRESS_DEPRECATED_POP -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>) -_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>) +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>) +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>) +#endif +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>) // deprecated in C++20 +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>) // deprecated in C++20 +#ifndef _LIBCPP_HAS_NO_CHAR8_T +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char8_t, mbstate_t>) // C++20 +_LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char8_t, mbstate_t>) // C++20 +#endif template <size_t _Np> struct __narrow_to_utf8 @@ -1290,14 +1492,16 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> -struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<16> +struct _LIBCPP_TYPE_VIS __narrow_to_utf8<16> : public codecvt<char16_t, char, mbstate_t> { _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP - _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8(); + ~__narrow_to_utf8(); template <class _OutputIterator, class _CharT> _LIBCPP_INLINE_VISIBILITY @@ -1324,14 +1528,16 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> -struct _LIBCPP_TEMPLATE_VIS __narrow_to_utf8<32> +struct _LIBCPP_TYPE_VIS __narrow_to_utf8<32> : public codecvt<char32_t, char, mbstate_t> { _LIBCPP_INLINE_VISIBILITY __narrow_to_utf8() : codecvt<char32_t, char, mbstate_t>(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP - _LIBCPP_EXPORTED_FROM_ABI ~__narrow_to_utf8(); + ~__narrow_to_utf8(); template <class _OutputIterator, class _CharT> _LIBCPP_INLINE_VISIBILITY @@ -1380,14 +1586,16 @@ } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> -struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<16> +struct _LIBCPP_TYPE_VIS __widen_from_utf8<16> : public codecvt<char16_t, char, mbstate_t> { _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP - _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8(); + ~__widen_from_utf8(); template <class _OutputIterator> _LIBCPP_INLINE_VISIBILITY @@ -1407,21 +1615,23 @@ if (__r == codecvt_base::error || __nn == __nb) __throw_runtime_error("locale not supported"); for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s) - *__s = (wchar_t)*__p; + *__s = *__p; __nb = __nn; } return __s; } }; +_LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> -struct _LIBCPP_TEMPLATE_VIS __widen_from_utf8<32> +struct _LIBCPP_TYPE_VIS __widen_from_utf8<32> : public codecvt<char32_t, char, mbstate_t> { _LIBCPP_INLINE_VISIBILITY __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {} +_LIBCPP_SUPPRESS_DEPRECATED_POP - _LIBCPP_EXPORTED_FROM_ABI ~__widen_from_utf8(); + ~__widen_from_utf8(); template <class _OutputIterator> _LIBCPP_INLINE_VISIBILITY @@ -1441,7 +1651,7 @@ if (__r == codecvt_base::error || __nn == __nb) __throw_runtime_error("locale not supported"); for (const char32_t* __p = __buf; __p < __bn; ++__p, ++__s) - *__s = (wchar_t)*__p; + *__s = *__p; __nb = __nn; } return __s; @@ -1483,6 +1693,7 @@ string __grouping_; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS numpunct<wchar_t> : public locale::facet @@ -1513,6 +1724,7 @@ char_type __thousands_sep_; string __grouping_; }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS // template <class charT> class numpunct_byname @@ -1536,6 +1748,7 @@ void __init(const char*); }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> class _LIBCPP_TYPE_VIS numpunct_byname<wchar_t> : public numpunct<wchar_t> @@ -1553,7 +1766,8 @@ private: void __init(const char*); }; +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP___LOCALE +#endif // _LIBCPP___LOCALE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mbstate_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mbstate_t.h new file mode 100644 index 0000000..3489f9c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mbstate_t.h
@@ -0,0 +1,44 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MBSTATE_T_H +#define _LIBCPP___MBSTATE_T_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +// TODO(ldionne): +// The goal of this header is to provide mbstate_t without having to pull in +// <wchar.h> or <uchar.h>. This is necessary because we need that type even +// when we don't have (or try to provide) support for wchar_t, because several +// types like std::fpos are defined in terms of mbstate_t. +// +// This is a gruesome hack, but I don't know how to make it cleaner for +// the time being. + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include <wchar.h> // for mbstate_t +#elif __has_include(<bits/types/mbstate_t.h>) +# include <bits/types/mbstate_t.h> // works on most Unixes +#elif __has_include(<sys/_types/_mbstate_t.h>) +# include <sys/_types/_mbstate_t.h> // works on Darwin +#else +# error "The library was configured without support for wide-characters, but we don't know how to get the definition of mbstate_t without <wchar.h> on your platform." +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +using ::mbstate_t _LIBCPP_USING_IF_EXISTS; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MBSTATE_T_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/addressof.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/addressof.h new file mode 100644 index 0000000..c45dedf --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/addressof.h
@@ -0,0 +1,76 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_ADDRESSOF_H +#define _LIBCPP___MEMORY_ADDRESSOF_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +inline _LIBCPP_CONSTEXPR_AFTER_CXX14 +_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY +_Tp* +addressof(_Tp& __x) _NOEXCEPT +{ + return __builtin_addressof(__x); +} + +#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF) +// Objective-C++ Automatic Reference Counting uses qualified pointers +// that require special addressof() signatures. When +// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler +// itself is providing these definitions. Otherwise, we provide them. +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +__strong _Tp* +addressof(__strong _Tp& __x) _NOEXCEPT +{ + return &__x; +} + +#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +__weak _Tp* +addressof(__weak _Tp& __x) _NOEXCEPT +{ + return &__x; +} +#endif + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +__autoreleasing _Tp* +addressof(__autoreleasing _Tp& __x) _NOEXCEPT +{ + return &__x; +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +__unsafe_unretained _Tp* +addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT +{ + return &__x; +} +#endif + +#if !defined(_LIBCPP_CXX03_LANG) +template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_ADDRESSOF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocation_guard.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocation_guard.h new file mode 100644 index 0000000..6412677 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocation_guard.h
@@ -0,0 +1,83 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_ALLOCATION_GUARD_H +#define _LIBCPP___MEMORY_ALLOCATION_GUARD_H + +#include <__config> +#include <__memory/allocator_traits.h> +#include <cstddef> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Helper class to allocate memory using an Allocator in an exception safe +// manner. +// +// The intended usage of this class is as follows: +// +// 0 +// 1 __allocation_guard<SomeAllocator> guard(alloc, 10); +// 2 do_some_initialization_that_may_throw(guard.__get()); +// 3 save_allocated_pointer_in_a_noexcept_operation(guard.__release_ptr()); +// 4 +// +// If line (2) throws an exception during initialization of the memory, the +// guard's destructor will be called, and the memory will be released using +// Allocator deallocation. Otherwise, we release the memory from the guard on +// line (3) in an operation that can't throw -- after that, the guard is not +// responsible for the memory anymore. +// +// This is similar to a unique_ptr, except it's easier to use with a +// custom allocator. +template<class _Alloc> +struct __allocation_guard { + using _Pointer = typename allocator_traits<_Alloc>::pointer; + using _Size = typename allocator_traits<_Alloc>::size_type; + + template<class _AllocT> // we perform the allocator conversion inside the constructor + _LIBCPP_HIDE_FROM_ABI + explicit __allocation_guard(_AllocT __alloc, _Size __n) + : __alloc_(_VSTD::move(__alloc)) + , __n_(__n) + , __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important + { } + + _LIBCPP_HIDE_FROM_ABI + ~__allocation_guard() _NOEXCEPT { + if (__ptr_ != nullptr) { + allocator_traits<_Alloc>::deallocate(__alloc_, __ptr_, __n_); + } + } + + _LIBCPP_HIDE_FROM_ABI + _Pointer __release_ptr() _NOEXCEPT { // not called __release() because it's a keyword in objective-c++ + _Pointer __tmp = __ptr_; + __ptr_ = nullptr; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + _Pointer __get() const _NOEXCEPT { + return __ptr_; + } + +private: + _Alloc __alloc_; + _Size __n_; + _Pointer __ptr_; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_ALLOCATION_GUARD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator.h new file mode 100644 index 0000000..283212f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator.h
@@ -0,0 +1,249 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_ALLOCATOR_H +#define _LIBCPP___MEMORY_ALLOCATOR_H + +#include <__config> +#include <__memory/allocator_traits.h> +#include <__utility/forward.h> +#include <cstddef> +#include <new> +#include <stdexcept> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> class allocator; + +#if _LIBCPP_STD_VER <= 17 +template <> +class _LIBCPP_TEMPLATE_VIS allocator<void> +{ +public: + _LIBCPP_DEPRECATED_IN_CXX17 typedef void* pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef void value_type; + + template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;}; +}; + +template <> +class _LIBCPP_TEMPLATE_VIS allocator<const void> +{ +public: + _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const void* const_pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const void value_type; + + template <class _Up> struct _LIBCPP_DEPRECATED_IN_CXX17 rebind {typedef allocator<_Up> other;}; +}; +#endif + +// This class provides a non-trivial default constructor to the class that derives from it +// if the condition is satisfied. +// +// The second template parameter exists to allow giving a unique type to __non_trivial_if, +// which makes it possible to avoid breaking the ABI when making this a base class of an +// existing class. Without that, imagine we have classes D1 and D2, both of which used to +// have no base classes, but which now derive from __non_trivial_if. The layout of a class +// that inherits from both D1 and D2 will change because the two __non_trivial_if base +// classes are not allowed to share the same address. +// +// By making those __non_trivial_if base classes unique, we work around this problem and +// it is safe to start deriving from __non_trivial_if in existing classes. +template <bool _Cond, class _Unique> +struct __non_trivial_if { }; + +template <class _Unique> +struct __non_trivial_if<true, _Unique> { + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR __non_trivial_if() _NOEXCEPT { } +}; + +// allocator +// +// Note: For ABI compatibility between C++20 and previous standards, we make +// allocator<void> trivial in C++20. + +template <class _Tp> +class _LIBCPP_TEMPLATE_VIS allocator + : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> > +{ + static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types"); +public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp value_type; + typedef true_type propagate_on_container_move_assignment; + typedef true_type is_always_equal; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator() _NOEXCEPT _LIBCPP_DEFAULT + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator(const allocator<_Up>&) _NOEXCEPT { } + + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + _Tp* allocate(size_t __n) { + if (__n > allocator_traits<allocator>::max_size(*this)) + __throw_bad_array_new_length(); + if (__libcpp_is_constant_evaluated()) { + return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); + } else { + return static_cast<_Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp))); + } + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void deallocate(_Tp* __p, size_t __n) _NOEXCEPT { + if (__libcpp_is_constant_evaluated()) { + ::operator delete(__p); + } else { + _VSTD::__libcpp_deallocate((void*)__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); + } + } + + // C++20 Removed members +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp* pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef _Tp& reference; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference; + + template <class _Up> + struct _LIBCPP_DEPRECATED_IN_CXX17 rebind { + typedef allocator<_Up> other; + }; + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + pointer address(reference __x) const _NOEXCEPT { + return _VSTD::addressof(__x); + } + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + const_pointer address(const_reference __x) const _NOEXCEPT { + return _VSTD::addressof(__x); + } + + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17 + _Tp* allocate(size_t __n, const void*) { + return allocate(__n); + } + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT { + return size_type(~0) / sizeof(_Tp); + } + + template <class _Up, class... _Args> + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + void construct(_Up* __p, _Args&&... __args) { + ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...); + } + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + void destroy(pointer __p) { + __p->~_Tp(); + } +#endif +}; + +template <class _Tp> +class _LIBCPP_TEMPLATE_VIS allocator<const _Tp> + : private __non_trivial_if<!is_void<_Tp>::value, allocator<const _Tp> > +{ + static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types"); +public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef const _Tp value_type; + typedef true_type propagate_on_container_move_assignment; + typedef true_type is_always_equal; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator() _NOEXCEPT _LIBCPP_DEFAULT + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + allocator(const allocator<_Up>&) _NOEXCEPT { } + + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + const _Tp* allocate(size_t __n) { + if (__n > allocator_traits<allocator>::max_size(*this)) + __throw_bad_array_new_length(); + if (__libcpp_is_constant_evaluated()) { + return static_cast<const _Tp*>(::operator new(__n * sizeof(_Tp))); + } else { + return static_cast<const _Tp*>(_VSTD::__libcpp_allocate(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp))); + } + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void deallocate(const _Tp* __p, size_t __n) { + if (__libcpp_is_constant_evaluated()) { + ::operator delete(const_cast<_Tp*>(__p)); + } else { + _VSTD::__libcpp_deallocate((void*) const_cast<_Tp *>(__p), __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); + } + } + + // C++20 Removed members +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp* const_pointer; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& reference; + _LIBCPP_DEPRECATED_IN_CXX17 typedef const _Tp& const_reference; + + template <class _Up> + struct _LIBCPP_DEPRECATED_IN_CXX17 rebind { + typedef allocator<_Up> other; + }; + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + const_pointer address(const_reference __x) const _NOEXCEPT { + return _VSTD::addressof(__x); + } + + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_IN_CXX17 + const _Tp* allocate(size_t __n, const void*) { + return allocate(__n); + } + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT { + return size_type(~0) / sizeof(_Tp); + } + + template <class _Up, class... _Args> + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + void construct(_Up* __p, _Args&&... __args) { + ::new ((void*)__p) _Up(_VSTD::forward<_Args>(__args)...); + } + + _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_INLINE_VISIBILITY + void destroy(pointer __p) { + __p->~_Tp(); + } +#endif +}; + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;} + +template <class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_ALLOCATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_arg_t.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_arg_t.h new file mode 100644 index 0000000..f5a116d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_arg_t.h
@@ -0,0 +1,78 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H +#define _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H + +#include <__config> +#include <__memory/uses_allocator.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { explicit allocator_arg_t() = default; }; + +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY) +extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg; +#else +/* inline */ constexpr allocator_arg_t allocator_arg = allocator_arg_t(); +#endif + +#ifndef _LIBCPP_CXX03_LANG + +// allocator construction + +template <class _Tp, class _Alloc, class ..._Args> +struct __uses_alloc_ctor_imp +{ + typedef _LIBCPP_NODEBUG typename __uncvref<_Alloc>::type _RawAlloc; + static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value; + static const bool __ic = + is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; + static const int value = __ua ? 2 - __ic : 0; +}; + +template <class _Tp, class _Alloc, class ..._Args> +struct __uses_alloc_ctor + : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value> + {}; + +template <class _Tp, class _Allocator, class... _Args> +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args ) +{ + new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); +} + +// FIXME: This should have a version which takes a non-const alloc. +template <class _Tp, class _Allocator, class... _Args> +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) +{ + new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); +} + +// FIXME: This should have a version which takes a non-const alloc. +template <class _Tp, class _Allocator, class... _Args> +inline _LIBCPP_INLINE_VISIBILITY +void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) +{ + new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); +} + +#endif // _LIBCPP_CXX03_LANG + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___FUNCTIONAL_ALLOCATOR_ARG_T_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_traits.h new file mode 100644 index 0000000..cc32352 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/allocator_traits.h
@@ -0,0 +1,413 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H +#define _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H + +#include <__config> +#include <__memory/construct_at.h> +#include <__memory/pointer_traits.h> +#include <__utility/forward.h> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#define _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(NAME, PROPERTY) \ + template <class _Tp, class = void> struct NAME : false_type { }; \ + template <class _Tp> struct NAME<_Tp, typename __void_t<typename _Tp:: PROPERTY >::type> : true_type { } + +// __pointer +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer); +template <class _Tp, class _Alloc, + class _RawAlloc = typename remove_reference<_Alloc>::type, + bool = __has_pointer<_RawAlloc>::value> +struct __pointer { + using type _LIBCPP_NODEBUG = typename _RawAlloc::pointer; +}; +template <class _Tp, class _Alloc, class _RawAlloc> +struct __pointer<_Tp, _Alloc, _RawAlloc, false> { + using type _LIBCPP_NODEBUG = _Tp*; +}; + +// __const_pointer +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_pointer, const_pointer); +template <class _Tp, class _Ptr, class _Alloc, + bool = __has_const_pointer<_Alloc>::value> +struct __const_pointer { + using type _LIBCPP_NODEBUG = typename _Alloc::const_pointer; +}; +template <class _Tp, class _Ptr, class _Alloc> +struct __const_pointer<_Tp, _Ptr, _Alloc, false> { +#ifdef _LIBCPP_CXX03_LANG + using type = typename pointer_traits<_Ptr>::template rebind<const _Tp>::other; +#else + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const _Tp>; +#endif +}; + +// __void_pointer +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_void_pointer, void_pointer); +template <class _Ptr, class _Alloc, + bool = __has_void_pointer<_Alloc>::value> +struct __void_pointer { + using type _LIBCPP_NODEBUG = typename _Alloc::void_pointer; +}; +template <class _Ptr, class _Alloc> +struct __void_pointer<_Ptr, _Alloc, false> { +#ifdef _LIBCPP_CXX03_LANG + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>::other; +#else + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<void>; +#endif +}; + +// __const_void_pointer +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_const_void_pointer, const_void_pointer); +template <class _Ptr, class _Alloc, + bool = __has_const_void_pointer<_Alloc>::value> +struct __const_void_pointer { + using type _LIBCPP_NODEBUG = typename _Alloc::const_void_pointer; +}; +template <class _Ptr, class _Alloc> +struct __const_void_pointer<_Ptr, _Alloc, false> { +#ifdef _LIBCPP_CXX03_LANG + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>::other; +#else + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::template rebind<const void>; +#endif +}; + +// __size_type +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_size_type, size_type); +template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value> +struct __size_type : make_unsigned<_DiffType> { }; +template <class _Alloc, class _DiffType> +struct __size_type<_Alloc, _DiffType, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::size_type; +}; + +// __alloc_traits_difference_type +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_alloc_traits_difference_type, difference_type); +template <class _Alloc, class _Ptr, bool = __has_alloc_traits_difference_type<_Alloc>::value> +struct __alloc_traits_difference_type { + using type _LIBCPP_NODEBUG = typename pointer_traits<_Ptr>::difference_type; +}; +template <class _Alloc, class _Ptr> +struct __alloc_traits_difference_type<_Alloc, _Ptr, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::difference_type; +}; + +// __propagate_on_container_copy_assignment +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment); +template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value> +struct __propagate_on_container_copy_assignment : false_type { }; +template <class _Alloc> +struct __propagate_on_container_copy_assignment<_Alloc, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_copy_assignment; +}; + +// __propagate_on_container_move_assignment +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_move_assignment, propagate_on_container_move_assignment); +template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value> +struct __propagate_on_container_move_assignment : false_type { }; +template <class _Alloc> +struct __propagate_on_container_move_assignment<_Alloc, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_move_assignment; +}; + +// __propagate_on_container_swap +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_propagate_on_container_swap, propagate_on_container_swap); +template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value> +struct __propagate_on_container_swap : false_type { }; +template <class _Alloc> +struct __propagate_on_container_swap<_Alloc, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::propagate_on_container_swap; +}; + +// __is_always_equal +_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_is_always_equal, is_always_equal); +template <class _Alloc, bool = __has_is_always_equal<_Alloc>::value> +struct __is_always_equal : is_empty<_Alloc> { }; +template <class _Alloc> +struct __is_always_equal<_Alloc, true> { + using type _LIBCPP_NODEBUG = typename _Alloc::is_always_equal; +}; + +// __allocator_traits_rebind +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp, class _Up, class = void> +struct __has_rebind_other : false_type { }; +template <class _Tp, class _Up> +struct __has_rebind_other<_Tp, _Up, typename __void_t< + typename _Tp::template rebind<_Up>::other +>::type> : true_type { }; + +template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value> +struct __allocator_traits_rebind { + using type _LIBCPP_NODEBUG = typename _Tp::template rebind<_Up>::other; +}; +template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> +struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true> { + using type _LIBCPP_NODEBUG = typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other; +}; +template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up> +struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> { + using type _LIBCPP_NODEBUG = _Alloc<_Up, _Args...>; +}; +_LIBCPP_SUPPRESS_DEPRECATED_POP + +template<class _Alloc, class _Tp> +using __allocator_traits_rebind_t = typename __allocator_traits_rebind<_Alloc, _Tp>::type; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH + +// __has_allocate_hint +template <class _Alloc, class _SizeType, class _ConstVoidPtr, class = void> +struct __has_allocate_hint : false_type { }; + +template <class _Alloc, class _SizeType, class _ConstVoidPtr> +struct __has_allocate_hint<_Alloc, _SizeType, _ConstVoidPtr, decltype( + (void)declval<_Alloc>().allocate(declval<_SizeType>(), declval<_ConstVoidPtr>()) +)> : true_type { }; + +// __has_construct +template <class, class _Alloc, class ..._Args> +struct __has_construct_impl : false_type { }; + +template <class _Alloc, class ..._Args> +struct __has_construct_impl<decltype( + (void)declval<_Alloc>().construct(declval<_Args>()...) +), _Alloc, _Args...> : true_type { }; + +template <class _Alloc, class ..._Args> +struct __has_construct : __has_construct_impl<void, _Alloc, _Args...> { }; + +// __has_destroy +template <class _Alloc, class _Pointer, class = void> +struct __has_destroy : false_type { }; + +template <class _Alloc, class _Pointer> +struct __has_destroy<_Alloc, _Pointer, decltype( + (void)declval<_Alloc>().destroy(declval<_Pointer>()) +)> : true_type { }; + +// __has_max_size +template <class _Alloc, class = void> +struct __has_max_size : false_type { }; + +template <class _Alloc> +struct __has_max_size<_Alloc, decltype( + (void)declval<_Alloc&>().max_size() +)> : true_type { }; + +// __has_select_on_container_copy_construction +template <class _Alloc, class = void> +struct __has_select_on_container_copy_construction : false_type { }; + +template <class _Alloc> +struct __has_select_on_container_copy_construction<_Alloc, decltype( + (void)declval<_Alloc>().select_on_container_copy_construction() +)> : true_type { }; + +_LIBCPP_SUPPRESS_DEPRECATED_POP + +template <class _Alloc> +struct _LIBCPP_TEMPLATE_VIS allocator_traits +{ + using allocator_type = _Alloc; + using value_type = typename allocator_type::value_type; + using pointer = typename __pointer<value_type, allocator_type>::type; + using const_pointer = typename __const_pointer<value_type, pointer, allocator_type>::type; + using void_pointer = typename __void_pointer<pointer, allocator_type>::type; + using const_void_pointer = typename __const_void_pointer<pointer, allocator_type>::type; + using difference_type = typename __alloc_traits_difference_type<allocator_type, pointer>::type; + using size_type = typename __size_type<allocator_type, difference_type>::type; + using propagate_on_container_copy_assignment = typename __propagate_on_container_copy_assignment<allocator_type>::type; + using propagate_on_container_move_assignment = typename __propagate_on_container_move_assignment<allocator_type>::type; + using propagate_on_container_swap = typename __propagate_on_container_swap<allocator_type>::type; + using is_always_equal = typename __is_always_equal<allocator_type>::type; + +#ifndef _LIBCPP_CXX03_LANG + template <class _Tp> + using rebind_alloc = __allocator_traits_rebind_t<allocator_type, _Tp>; + template <class _Tp> + using rebind_traits = allocator_traits<rebind_alloc<_Tp> >; +#else // _LIBCPP_CXX03_LANG + template <class _Tp> + struct rebind_alloc { + using other = __allocator_traits_rebind_t<allocator_type, _Tp>; + }; + template <class _Tp> + struct rebind_traits { + using other = allocator_traits<typename rebind_alloc<_Tp>::other>; + }; +#endif // _LIBCPP_CXX03_LANG + + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static pointer allocate(allocator_type& __a, size_type __n) { + return __a.allocate(__n); + } + + template <class _Ap = _Alloc, class = + __enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> > + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) { + _LIBCPP_SUPPRESS_DEPRECATED_PUSH + return __a.allocate(__n, __hint); + _LIBCPP_SUPPRESS_DEPRECATED_POP + } + template <class _Ap = _Alloc, class = void, class = + __enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> > + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) { + return __a.allocate(__n); + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT { + __a.deallocate(__p, __n); + } + + template <class _Tp, class... _Args, class = + __enable_if_t<__has_construct<allocator_type, _Tp*, _Args...>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) { + _LIBCPP_SUPPRESS_DEPRECATED_PUSH + __a.construct(__p, _VSTD::forward<_Args>(__args)...); + _LIBCPP_SUPPRESS_DEPRECATED_POP + } + template <class _Tp, class... _Args, class = void, class = + __enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static void construct(allocator_type&, _Tp* __p, _Args&&... __args) { +#if _LIBCPP_STD_VER > 17 + _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...); +#else + ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...); +#endif + } + + template <class _Tp, class = + __enable_if_t<__has_destroy<allocator_type, _Tp*>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static void destroy(allocator_type& __a, _Tp* __p) { + _LIBCPP_SUPPRESS_DEPRECATED_PUSH + __a.destroy(__p); + _LIBCPP_SUPPRESS_DEPRECATED_POP + } + template <class _Tp, class = void, class = + __enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static void destroy(allocator_type&, _Tp* __p) { +#if _LIBCPP_STD_VER > 17 + _VSTD::destroy_at(__p); +#else + __p->~_Tp(); +#endif + } + + template <class _Ap = _Alloc, class = + __enable_if_t<__has_max_size<const _Ap>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static size_type max_size(const allocator_type& __a) _NOEXCEPT { + _LIBCPP_SUPPRESS_DEPRECATED_PUSH + return __a.max_size(); + _LIBCPP_SUPPRESS_DEPRECATED_POP + } + template <class _Ap = _Alloc, class = void, class = + __enable_if_t<!__has_max_size<const _Ap>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static size_type max_size(const allocator_type&) _NOEXCEPT { + return numeric_limits<size_type>::max() / sizeof(value_type); + } + + template <class _Ap = _Alloc, class = + __enable_if_t<__has_select_on_container_copy_construction<const _Ap>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static allocator_type select_on_container_copy_construction(const allocator_type& __a) { + return __a.select_on_container_copy_construction(); + } + template <class _Ap = _Alloc, class = void, class = + __enable_if_t<!__has_select_on_container_copy_construction<const _Ap>::value> > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static allocator_type select_on_container_copy_construction(const allocator_type& __a) { + return __a; + } +}; + +// A version of `allocator_traits` for internal usage that SFINAEs away if the +// given allocator doesn't have a nested `value_type`. This helps avoid hard +// errors when forming implicit deduction guides for a container that has an +// invalid Allocator type. See https://wg21.link/LWGXXXXX. +// TODO(varconst): use the actual link once available. +template <class _Alloc, class _ValueType = typename _Alloc::value_type> +struct _LIBCPP_TEMPLATE_VIS __allocator_traits : allocator_traits<_Alloc> {}; + +template <class _Traits, class _Tp> +struct __rebind_alloc_helper { +#ifndef _LIBCPP_CXX03_LANG + using type _LIBCPP_NODEBUG = typename _Traits::template rebind_alloc<_Tp>; +#else + using type = typename _Traits::template rebind_alloc<_Tp>::other; +#endif +}; + +// __is_default_allocator +template <class _Tp> +struct __is_default_allocator : false_type { }; + +template <class> class allocator; + +template <class _Tp> +struct __is_default_allocator<allocator<_Tp> > : true_type { }; + +// __is_cpp17_move_insertable +template <class _Alloc, class = void> +struct __is_cpp17_move_insertable + : is_move_constructible<typename _Alloc::value_type> +{ }; + +template <class _Alloc> +struct __is_cpp17_move_insertable<_Alloc, __enable_if_t< + !__is_default_allocator<_Alloc>::value && + __has_construct<_Alloc, typename _Alloc::value_type*, typename _Alloc::value_type&&>::value +> > : true_type { }; + +// __is_cpp17_copy_insertable +template <class _Alloc, class = void> +struct __is_cpp17_copy_insertable + : integral_constant<bool, + is_copy_constructible<typename _Alloc::value_type>::value && + __is_cpp17_move_insertable<_Alloc>::value + > +{ }; + +template <class _Alloc> +struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t< + !__is_default_allocator<_Alloc>::value && + __has_construct<_Alloc, typename _Alloc::value_type*, const typename _Alloc::value_type&>::value +> > + : __is_cpp17_move_insertable<_Alloc> +{ }; + +#undef _LIBCPP_ALLOCATOR_TRAITS_HAS_XXX + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/auto_ptr.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/auto_ptr.h new file mode 100644 index 0000000..492cbab --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/auto_ptr.h
@@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_AUTO_PTR_H +#define _LIBCPP___MEMORY_AUTO_PTR_H + +#include <__config> +#include <__nullptr> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +struct _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr_ref +{ + _Tp* __ptr_; +}; + +template<class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr +{ +private: + _Tp* __ptr_; +public: + typedef _Tp element_type; + + _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) _NOEXCEPT : __ptr_(__p) {} + _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) _NOEXCEPT : __ptr_(__p.release()) {} + template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) _NOEXCEPT + : __ptr_(__p.release()) {} + _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) _NOEXCEPT + {reset(__p.release()); return *this;} + template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) _NOEXCEPT + {reset(__p.release()); return *this;} + _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) _NOEXCEPT + {reset(__p.__ptr_); return *this;} + _LIBCPP_INLINE_VISIBILITY ~auto_ptr() _NOEXCEPT {delete __ptr_;} + + _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const _NOEXCEPT + {return *__ptr_;} + _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const _NOEXCEPT {return __ptr_;} + _LIBCPP_INLINE_VISIBILITY _Tp* get() const _NOEXCEPT {return __ptr_;} + _LIBCPP_INLINE_VISIBILITY _Tp* release() _NOEXCEPT + { + _Tp* __t = __ptr_; + __ptr_ = nullptr; + return __t; + } + _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) _NOEXCEPT + { + if (__ptr_ != __p) + delete __ptr_; + __ptr_ = __p; + } + + _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) _NOEXCEPT : __ptr_(__p.__ptr_) {} + template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() _NOEXCEPT + {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;} + template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() _NOEXCEPT + {return auto_ptr<_Up>(release());} +}; + +template <> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr<void> +{ +public: + typedef void element_type; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_AUTO_PTR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/compressed_pair.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/compressed_pair.h new file mode 100644 index 0000000..fd1fcbe --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/compressed_pair.h
@@ -0,0 +1,196 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_COMPRESSED_PAIR_H +#define _LIBCPP___MEMORY_COMPRESSED_PAIR_H + +#include <__config> +#include <__utility/forward.h> +#include <tuple> // needed in c++03 for some constructors +#include <type_traits> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Tag used to default initialize one or both of the pair's elements. +struct __default_init_tag {}; +struct __value_init_tag {}; + +template <class _Tp, int _Idx, + bool _CanBeEmptyBase = + is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value> +struct __compressed_pair_elem { + typedef _Tp _ParamT; + typedef _Tp& reference; + typedef const _Tp& const_reference; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + __compressed_pair_elem(__default_init_tag) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + __compressed_pair_elem(__value_init_tag) : __value_() {} + + template <class _Up, class = typename enable_if< + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR explicit + __compressed_pair_elem(_Up&& __u) + : __value_(_VSTD::forward<_Up>(__u)) + { + } + + +#ifndef _LIBCPP_CXX03_LANG + template <class... _Args, size_t... _Indexes> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, + __tuple_indices<_Indexes...>) + : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {} +#endif + + + _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; } + _LIBCPP_INLINE_VISIBILITY + const_reference __get() const _NOEXCEPT { return __value_; } + +private: + _Tp __value_; +}; + +template <class _Tp, int _Idx> +struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { + typedef _Tp _ParamT; + typedef _Tp& reference; + typedef const _Tp& const_reference; + typedef _Tp __value_type; + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __compressed_pair_elem() = default; + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + __compressed_pair_elem(__default_init_tag) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + __compressed_pair_elem(__value_init_tag) : __value_type() {} + + template <class _Up, class = typename enable_if< + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR explicit + __compressed_pair_elem(_Up&& __u) + : __value_type(_VSTD::forward<_Up>(__u)) + {} + +#ifndef _LIBCPP_CXX03_LANG + template <class... _Args, size_t... _Indexes> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args, + __tuple_indices<_Indexes...>) + : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {} +#endif + + _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; } + _LIBCPP_INLINE_VISIBILITY + const_reference __get() const _NOEXCEPT { return *this; } +}; + +template <class _T1, class _T2> +class __compressed_pair : private __compressed_pair_elem<_T1, 0>, + private __compressed_pair_elem<_T2, 1> { +public: + // NOTE: This static assert should never fire because __compressed_pair + // is *almost never* used in a scenario where it's possible for T1 == T2. + // (The exception is std::function where it is possible that the function + // object and the allocator have the same type). + static_assert((!is_same<_T1, _T2>::value), + "__compressed_pair cannot be instantiated when T1 and T2 are the same type; " + "The current implementation is NOT ABI-compatible with the previous " + "implementation for this configuration"); + + typedef _LIBCPP_NODEBUG __compressed_pair_elem<_T1, 0> _Base1; + typedef _LIBCPP_NODEBUG __compressed_pair_elem<_T2, 1> _Base2; + + template <bool _Dummy = true, + class = typename enable_if< + __dependent_type<is_default_constructible<_T1>, _Dummy>::value && + __dependent_type<is_default_constructible<_T2>, _Dummy>::value + >::type + > + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR __compressed_pair() : _Base1(__value_init_tag()), _Base2(__value_init_tag()) {} + + template <class _U1, class _U2> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + __compressed_pair(_U1&& __t1, _U2&& __t2) + : _Base1(_VSTD::forward<_U1>(__t1)), _Base2(_VSTD::forward<_U2>(__t2)) {} + +#ifndef _LIBCPP_CXX03_LANG + template <class... _Args1, class... _Args2> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args, + tuple<_Args2...> __second_args) + : _Base1(__pc, _VSTD::move(__first_args), + typename __make_tuple_indices<sizeof...(_Args1)>::type()), + _Base2(__pc, _VSTD::move(__second_args), + typename __make_tuple_indices<sizeof...(_Args2)>::type()) {} +#endif + + _LIBCPP_INLINE_VISIBILITY + typename _Base1::reference first() _NOEXCEPT { + return static_cast<_Base1&>(*this).__get(); + } + + _LIBCPP_INLINE_VISIBILITY + typename _Base1::const_reference first() const _NOEXCEPT { + return static_cast<_Base1 const&>(*this).__get(); + } + + _LIBCPP_INLINE_VISIBILITY + typename _Base2::reference second() _NOEXCEPT { + return static_cast<_Base2&>(*this).__get(); + } + + _LIBCPP_INLINE_VISIBILITY + typename _Base2::const_reference second() const _NOEXCEPT { + return static_cast<_Base2 const&>(*this).__get(); + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + static _Base1* __get_first_base(__compressed_pair* __pair) _NOEXCEPT { + return static_cast<_Base1*>(__pair); + } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + static _Base2* __get_second_base(__compressed_pair* __pair) _NOEXCEPT { + return static_cast<_Base2*>(__pair); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(__compressed_pair& __x) + _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && + __is_nothrow_swappable<_T2>::value) + { + using _VSTD::swap; + swap(first(), __x.first()); + swap(second(), __x.second()); + } +}; + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y) + _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && + __is_nothrow_swappable<_T2>::value) { + __x.swap(__y); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_COMPRESSED_PAIR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/construct_at.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/construct_at.h new file mode 100644 index 0000000..789677d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/construct_at.h
@@ -0,0 +1,85 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_CONSTRUCT_AT_H +#define _LIBCPP___MEMORY_CONSTRUCT_AT_H + +#include <__config> +#include <__debug> +#include <__iterator/access.h> +#include <__memory/addressof.h> +#include <__utility/forward.h> +#include <type_traits> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// construct_at + +#if _LIBCPP_STD_VER > 17 + +template<class _Tp, class ..._Args, class = decltype( + ::new (declval<void*>()) _Tp(declval<_Args>()...) +)> +_LIBCPP_INLINE_VISIBILITY +constexpr _Tp* construct_at(_Tp* __location, _Args&& ...__args) { + _LIBCPP_ASSERT(__location, "null pointer given to construct_at"); + return ::new ((void*)__location) _Tp(_VSTD::forward<_Args>(__args)...); +} + +#endif + +// destroy_at + +#if _LIBCPP_STD_VER > 14 + +template <class _ForwardIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +void destroy(_ForwardIterator, _ForwardIterator); + +template <class _Tp, enable_if_t<!is_array_v<_Tp>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +void destroy_at(_Tp* __loc) { + _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at"); + __loc->~_Tp(); +} + +#if _LIBCPP_STD_VER > 17 +template <class _Tp, enable_if_t<is_array_v<_Tp>, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +void destroy_at(_Tp* __loc) { + _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at"); + _VSTD::destroy(_VSTD::begin(*__loc), _VSTD::end(*__loc)); +} +#endif + +template <class _ForwardIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +void destroy(_ForwardIterator __first, _ForwardIterator __last) { + for (; __first != __last; ++__first) + _VSTD::destroy_at(_VSTD::addressof(*__first)); +} + +template <class _ForwardIterator, class _Size> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 +_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) { + for (; __n > 0; (void)++__first, --__n) + _VSTD::destroy_at(_VSTD::addressof(*__first)); + return __first; +} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_CONSTRUCT_AT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/pointer_traits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/pointer_traits.h new file mode 100644 index 0000000..07bb6d4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/pointer_traits.h
@@ -0,0 +1,219 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_POINTER_TRAITS_H +#define _LIBCPP___MEMORY_POINTER_TRAITS_H + +#include <__config> +#include <__memory/addressof.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp, class = void> +struct __has_element_type : false_type {}; + +template <class _Tp> +struct __has_element_type<_Tp, + typename __void_t<typename _Tp::element_type>::type> : true_type {}; + +template <class _Ptr, bool = __has_element_type<_Ptr>::value> +struct __pointer_traits_element_type; + +template <class _Ptr> +struct __pointer_traits_element_type<_Ptr, true> +{ + typedef _LIBCPP_NODEBUG typename _Ptr::element_type type; +}; + +template <template <class, class...> class _Sp, class _Tp, class ..._Args> +struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true> +{ + typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::element_type type; +}; + +template <template <class, class...> class _Sp, class _Tp, class ..._Args> +struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false> +{ + typedef _LIBCPP_NODEBUG _Tp type; +}; + +template <class _Tp, class = void> +struct __has_difference_type : false_type {}; + +template <class _Tp> +struct __has_difference_type<_Tp, + typename __void_t<typename _Tp::difference_type>::type> : true_type {}; + +template <class _Ptr, bool = __has_difference_type<_Ptr>::value> +struct __pointer_traits_difference_type +{ + typedef _LIBCPP_NODEBUG ptrdiff_t type; +}; + +template <class _Ptr> +struct __pointer_traits_difference_type<_Ptr, true> +{ + typedef _LIBCPP_NODEBUG typename _Ptr::difference_type type; +}; + +template <class _Tp, class _Up> +struct __has_rebind +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Xp> static __two __test(...); + _LIBCPP_SUPPRESS_DEPRECATED_PUSH + template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0); + _LIBCPP_SUPPRESS_DEPRECATED_POP +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + +template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value> +struct __pointer_traits_rebind +{ +#ifndef _LIBCPP_CXX03_LANG + typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up> type; +#else + typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up>::other type; +#endif +}; + +template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up> +struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true> +{ +#ifndef _LIBCPP_CXX03_LANG + typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up> type; +#else + typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type; +#endif +}; + +template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up> +struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false> +{ + typedef _Sp<_Up, _Args...> type; +}; + +template <class _Ptr> +struct _LIBCPP_TEMPLATE_VIS pointer_traits +{ + typedef _Ptr pointer; + typedef typename __pointer_traits_element_type<pointer>::type element_type; + typedef typename __pointer_traits_difference_type<pointer>::type difference_type; + +#ifndef _LIBCPP_CXX03_LANG + template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type; +#else + template <class _Up> struct rebind + {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;}; +#endif // _LIBCPP_CXX03_LANG + +private: + struct __nat {}; +public: + _LIBCPP_INLINE_VISIBILITY + static pointer pointer_to(typename conditional<is_void<element_type>::value, + __nat, element_type>::type& __r) + {return pointer::pointer_to(__r);} +}; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*> +{ + typedef _Tp* pointer; + typedef _Tp element_type; + typedef ptrdiff_t difference_type; + +#ifndef _LIBCPP_CXX03_LANG + template <class _Up> using rebind = _Up*; +#else + template <class _Up> struct rebind {typedef _Up* other;}; +#endif + +private: + struct __nat {}; +public: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + static pointer pointer_to(typename conditional<is_void<element_type>::value, + __nat, element_type>::type& __r) _NOEXCEPT + {return _VSTD::addressof(__r);} +}; + +template <class _From, class _To> +struct __rebind_pointer { +#ifndef _LIBCPP_CXX03_LANG + typedef typename pointer_traits<_From>::template rebind<_To> type; +#else + typedef typename pointer_traits<_From>::template rebind<_To>::other type; +#endif +}; + +// to_address + +template <class _Pointer, class = void> +struct __to_address_helper; + +template <class _Tp> +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +_Tp* __to_address(_Tp* __p) _NOEXCEPT { + static_assert(!is_function<_Tp>::value, "_Tp is a function type"); + return __p; +} + +// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers +template <class _Pointer, class = __enable_if_t< + !is_pointer<_Pointer>::value && !is_array<_Pointer>::value && !is_function<_Pointer>::value +> > +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR +typename decay<decltype(__to_address_helper<_Pointer>::__call(declval<const _Pointer&>()))>::type +__to_address(const _Pointer& __p) _NOEXCEPT { + return __to_address_helper<_Pointer>::__call(__p); +} + +template <class _Pointer, class> +struct __to_address_helper { + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + static decltype(_VSTD::__to_address(declval<const _Pointer&>().operator->())) + __call(const _Pointer& __p) _NOEXCEPT { + return _VSTD::__to_address(__p.operator->()); + } +}; + +template <class _Pointer> +struct __to_address_helper<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(declval<const _Pointer&>()))> { + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + static decltype(pointer_traits<_Pointer>::to_address(declval<const _Pointer&>())) + __call(const _Pointer& __p) _NOEXCEPT { + return pointer_traits<_Pointer>::to_address(__p); + } +}; + +#if _LIBCPP_STD_VER > 17 +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY constexpr +auto to_address(_Tp *__p) noexcept { + return _VSTD::__to_address(__p); +} + +template <class _Pointer> +inline _LIBCPP_INLINE_VISIBILITY constexpr +auto to_address(const _Pointer& __p) noexcept { + return _VSTD::__to_address(__p); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_POINTER_TRAITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/raw_storage_iterator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/raw_storage_iterator.h new file mode 100644 index 0000000..abe9677 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/raw_storage_iterator.h
@@ -0,0 +1,68 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H +#define _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H + +#include <__config> +#include <__memory/addressof.h> +#include <cstddef> +#include <iterator> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR) + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _OutputIterator, class _Tp> +class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator +#if _LIBCPP_STD_VER <= 14 || !defined(_LIBCPP_ABI_NO_ITERATOR_BASES) + : public iterator<output_iterator_tag, void, void, void, void> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +private: + _OutputIterator __x_; +public: + typedef output_iterator_tag iterator_category; + typedef void value_type; +#if _LIBCPP_STD_VER > 17 + typedef ptrdiff_t difference_type; +#else + typedef void difference_type; +#endif + typedef void pointer; + typedef void reference; + + _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {} + _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;} + _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element) + {::new ((void*)_VSTD::addressof(*__x_)) _Tp(__element); return *this;} +#if _LIBCPP_STD_VER >= 14 + _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(_Tp&& __element) + {::new ((void*)_VSTD::addressof(*__x_)) _Tp(_VSTD::move(__element)); return *this;} +#endif + _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;} + _LIBCPP_INLINE_VISIBILITY raw_storage_iterator operator++(int) + {raw_storage_iterator __t(*this); ++__x_; return __t;} +#if _LIBCPP_STD_VER >= 14 + _LIBCPP_INLINE_VISIBILITY _OutputIterator base() const { return __x_; } +#endif +}; + +#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/shared_ptr.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/shared_ptr.h new file mode 100644 index 0000000..9c7df88 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/shared_ptr.h
@@ -0,0 +1,1719 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_SHARED_PTR_H +#define _LIBCPP___MEMORY_SHARED_PTR_H + +#include <__availability> +#include <__config> +#include <__functional_base> +#include <__functional/binary_function.h> +#include <__functional/operations.h> +#include <__functional/reference_wrapper.h> +#include <__memory/addressof.h> +#include <__memory/allocation_guard.h> +#include <__memory/allocator_traits.h> +#include <__memory/allocator.h> +#include <__memory/compressed_pair.h> +#include <__memory/pointer_traits.h> +#include <__memory/unique_ptr.h> +#include <__utility/forward.h> +#include <cstddef> +#include <cstdlib> // abort +#include <iosfwd> +#include <stdexcept> +#include <typeinfo> +#include <type_traits> +#include <utility> +#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) +# include <atomic> +#endif + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) +# include <__memory/auto_ptr.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Alloc> +class __allocator_destructor +{ + typedef _LIBCPP_NODEBUG allocator_traits<_Alloc> __alloc_traits; +public: + typedef _LIBCPP_NODEBUG typename __alloc_traits::pointer pointer; + typedef _LIBCPP_NODEBUG typename __alloc_traits::size_type size_type; +private: + _Alloc& __alloc_; + size_type __s_; +public: + _LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s) + _NOEXCEPT + : __alloc_(__a), __s_(__s) {} + _LIBCPP_INLINE_VISIBILITY + void operator()(pointer __p) _NOEXCEPT + {__alloc_traits::deallocate(__alloc_, __p, __s_);} +}; + +// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively) +// should be sufficient for thread safety. +// See https://llvm.org/PR22803 +#if defined(__clang__) && __has_builtin(__atomic_add_fetch) \ + && defined(__ATOMIC_RELAXED) \ + && defined(__ATOMIC_ACQ_REL) +# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT +#elif defined(_LIBCPP_COMPILER_GCC) +# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT +#endif + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +_ValueType __libcpp_relaxed_load(_ValueType const* __value) { +#if !defined(_LIBCPP_HAS_NO_THREADS) && \ + defined(__ATOMIC_RELAXED) && \ + (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) + return __atomic_load_n(__value, __ATOMIC_RELAXED); +#else + return *__value; +#endif +} + +template <class _ValueType> +inline _LIBCPP_INLINE_VISIBILITY +_ValueType __libcpp_acquire_load(_ValueType const* __value) { +#if !defined(_LIBCPP_HAS_NO_THREADS) && \ + defined(__ATOMIC_ACQUIRE) && \ + (__has_builtin(__atomic_load_n) || defined(_LIBCPP_COMPILER_GCC)) + return __atomic_load_n(__value, __ATOMIC_ACQUIRE); +#else + return *__value; +#endif +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _Tp +__libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT +{ +#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS) + return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED); +#else + return __t += 1; +#endif +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY _Tp +__libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT +{ +#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS) + return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL); +#else + return __t -= 1; +#endif +} + +class _LIBCPP_EXCEPTION_ABI bad_weak_ptr + : public std::exception +{ +public: + bad_weak_ptr() _NOEXCEPT = default; + bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default; + virtual ~bad_weak_ptr() _NOEXCEPT; + virtual const char* what() const _NOEXCEPT; +}; + +_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY +void __throw_bad_weak_ptr() +{ +#ifndef _LIBCPP_NO_EXCEPTIONS + throw bad_weak_ptr(); +#else + _VSTD::abort(); +#endif +} + +template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr; + +class _LIBCPP_TYPE_VIS __shared_count +{ + __shared_count(const __shared_count&); + __shared_count& operator=(const __shared_count&); + +protected: + long __shared_owners_; + virtual ~__shared_count(); +private: + virtual void __on_zero_shared() _NOEXCEPT = 0; + +public: + _LIBCPP_INLINE_VISIBILITY + explicit __shared_count(long __refs = 0) _NOEXCEPT + : __shared_owners_(__refs) {} + +#if defined(_LIBCPP_BUILDING_LIBRARY) && \ + defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) + void __add_shared() _NOEXCEPT; + bool __release_shared() _NOEXCEPT; +#else + _LIBCPP_INLINE_VISIBILITY + void __add_shared() _NOEXCEPT { + __libcpp_atomic_refcount_increment(__shared_owners_); + } + _LIBCPP_INLINE_VISIBILITY + bool __release_shared() _NOEXCEPT { + if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) { + __on_zero_shared(); + return true; + } + return false; + } +#endif + _LIBCPP_INLINE_VISIBILITY + long use_count() const _NOEXCEPT { + return __libcpp_relaxed_load(&__shared_owners_) + 1; + } +}; + +class _LIBCPP_TYPE_VIS __shared_weak_count + : private __shared_count +{ + long __shared_weak_owners_; + +public: + _LIBCPP_INLINE_VISIBILITY + explicit __shared_weak_count(long __refs = 0) _NOEXCEPT + : __shared_count(__refs), + __shared_weak_owners_(__refs) {} +protected: + virtual ~__shared_weak_count(); + +public: +#if defined(_LIBCPP_BUILDING_LIBRARY) && \ + defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS) + void __add_shared() _NOEXCEPT; + void __add_weak() _NOEXCEPT; + void __release_shared() _NOEXCEPT; +#else + _LIBCPP_INLINE_VISIBILITY + void __add_shared() _NOEXCEPT { + __shared_count::__add_shared(); + } + _LIBCPP_INLINE_VISIBILITY + void __add_weak() _NOEXCEPT { + __libcpp_atomic_refcount_increment(__shared_weak_owners_); + } + _LIBCPP_INLINE_VISIBILITY + void __release_shared() _NOEXCEPT { + if (__shared_count::__release_shared()) + __release_weak(); + } +#endif + void __release_weak() _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY + long use_count() const _NOEXCEPT {return __shared_count::use_count();} + __shared_weak_count* lock() _NOEXCEPT; + + virtual const void* __get_deleter(const type_info&) const _NOEXCEPT; +private: + virtual void __on_zero_shared_weak() _NOEXCEPT = 0; +}; + +template <class _Tp, class _Dp, class _Alloc> +class __shared_ptr_pointer + : public __shared_weak_count +{ + __compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_; +public: + _LIBCPP_INLINE_VISIBILITY + __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a) + : __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {} + +#ifndef _LIBCPP_NO_RTTI + virtual const void* __get_deleter(const type_info&) const _NOEXCEPT; +#endif + +private: + virtual void __on_zero_shared() _NOEXCEPT; + virtual void __on_zero_shared_weak() _NOEXCEPT; +}; + +#ifndef _LIBCPP_NO_RTTI + +template <class _Tp, class _Dp, class _Alloc> +const void* +__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT +{ + return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr; +} + +#endif // _LIBCPP_NO_RTTI + +template <class _Tp, class _Dp, class _Alloc> +void +__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() _NOEXCEPT +{ + __data_.first().second()(__data_.first().first()); + __data_.first().second().~_Dp(); +} + +template <class _Tp, class _Dp, class _Alloc> +void +__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT +{ + typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _Al; + typedef allocator_traits<_Al> _ATraits; + typedef pointer_traits<typename _ATraits::pointer> _PTraits; + + _Al __a(__data_.second()); + __data_.second().~_Alloc(); + __a.deallocate(_PTraits::pointer_to(*this), 1); +} + +template <class _Tp, class _Alloc> +struct __shared_ptr_emplace + : __shared_weak_count +{ + template<class ..._Args> + _LIBCPP_HIDE_FROM_ABI + explicit __shared_ptr_emplace(_Alloc __a, _Args&& ...__args) + : __storage_(_VSTD::move(__a)) + { +#if _LIBCPP_STD_VER > 17 + using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type; + _TpAlloc __tmp(*__get_alloc()); + allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), _VSTD::forward<_Args>(__args)...); +#else + ::new ((void*)__get_elem()) _Tp(_VSTD::forward<_Args>(__args)...); +#endif + } + + _LIBCPP_HIDE_FROM_ABI + _Alloc* __get_alloc() _NOEXCEPT { return __storage_.__get_alloc(); } + + _LIBCPP_HIDE_FROM_ABI + _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); } + +private: + virtual void __on_zero_shared() _NOEXCEPT { +#if _LIBCPP_STD_VER > 17 + using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type; + _TpAlloc __tmp(*__get_alloc()); + allocator_traits<_TpAlloc>::destroy(__tmp, __get_elem()); +#else + __get_elem()->~_Tp(); +#endif + } + + virtual void __on_zero_shared_weak() _NOEXCEPT { + using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type; + using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer; + _ControlBlockAlloc __tmp(*__get_alloc()); + __storage_.~_Storage(); + allocator_traits<_ControlBlockAlloc>::deallocate(__tmp, + pointer_traits<_ControlBlockPointer>::pointer_to(*this), 1); + } + + // This class implements the control block for non-array shared pointers created + // through `std::allocate_shared` and `std::make_shared`. + // + // In previous versions of the library, we used a compressed pair to store + // both the _Alloc and the _Tp. This implies using EBO, which is incompatible + // with Allocator construction for _Tp. To allow implementing P0674 in C++20, + // we now use a properly aligned char buffer while making sure that we maintain + // the same layout that we had when we used a compressed pair. + using _CompressedPair = __compressed_pair<_Alloc, _Tp>; + struct _ALIGNAS_TYPE(_CompressedPair) _Storage { + char __blob_[sizeof(_CompressedPair)]; + + _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) { + ::new ((void*)__get_alloc()) _Alloc(_VSTD::move(__a)); + } + _LIBCPP_HIDE_FROM_ABI ~_Storage() { + __get_alloc()->~_Alloc(); + } + _Alloc* __get_alloc() _NOEXCEPT { + _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); + typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair); + _Alloc *__alloc = reinterpret_cast<_Alloc*>(__first); + return __alloc; + } + _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT { + _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); + typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair); + _Tp *__elem = reinterpret_cast<_Tp*>(__second); + return __elem; + } + }; + + static_assert(_LIBCPP_ALIGNOF(_Storage) == _LIBCPP_ALIGNOF(_CompressedPair), ""); + static_assert(sizeof(_Storage) == sizeof(_CompressedPair), ""); + _Storage __storage_; +}; + +struct __shared_ptr_dummy_rebind_allocator_type; +template <> +class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type> +{ +public: + template <class _Other> + struct rebind + { + typedef allocator<_Other> other; + }; +}; + +template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this; + +template<class _Tp, class _Up> +struct __compatible_with +#if _LIBCPP_STD_VER > 14 + : is_convertible<remove_extent_t<_Tp>*, remove_extent_t<_Up>*> {}; +#else + : is_convertible<_Tp*, _Up*> {}; +#endif // _LIBCPP_STD_VER > 14 + +template <class _Ptr, class = void> +struct __is_deletable : false_type { }; +template <class _Ptr> +struct __is_deletable<_Ptr, decltype(delete declval<_Ptr>())> : true_type { }; + +template <class _Ptr, class = void> +struct __is_array_deletable : false_type { }; +template <class _Ptr> +struct __is_array_deletable<_Ptr, decltype(delete[] declval<_Ptr>())> : true_type { }; + +template <class _Dp, class _Pt, + class = decltype(declval<_Dp>()(declval<_Pt>()))> +static true_type __well_formed_deleter_test(int); + +template <class, class> +static false_type __well_formed_deleter_test(...); + +template <class _Dp, class _Pt> +struct __well_formed_deleter : decltype(__well_formed_deleter_test<_Dp, _Pt>(0)) {}; + +template<class _Dp, class _Tp, class _Yp> +struct __shared_ptr_deleter_ctor_reqs +{ + static const bool value = __compatible_with<_Tp, _Yp>::value && + is_move_constructible<_Dp>::value && + __well_formed_deleter<_Dp, _Tp*>::value; +}; + +#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI) +# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI __attribute__((trivial_abi)) +#else +# define _LIBCPP_SHARED_PTR_TRIVIAL_ABI +#endif + +template<class _Tp> +class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr +{ +public: +#if _LIBCPP_STD_VER > 14 + typedef weak_ptr<_Tp> weak_type; + typedef remove_extent_t<_Tp> element_type; +#else + typedef _Tp element_type; +#endif + +private: + element_type* __ptr_; + __shared_weak_count* __cntrl_; + +public: + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT + : __ptr_(nullptr), + __cntrl_(nullptr) + { } + + _LIBCPP_HIDE_FROM_ABI + _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT + : __ptr_(nullptr), + __cntrl_(nullptr) + { } + + template<class _Yp, class = __enable_if_t< + _And< + __compatible_with<_Yp, _Tp> + // In C++03 we get errors when trying to do SFINAE with the + // delete operator, so we always pretend that it's deletable. + // The same happens on GCC. +#if !defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_COMPILER_GCC) + , _If<is_array<_Tp>::value, __is_array_deletable<_Yp*>, __is_deletable<_Yp*> > +#endif + >::value + > > + explicit shared_ptr(_Yp* __p) : __ptr_(__p) { + unique_ptr<_Yp> __hold(__p); + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__p, __shared_ptr_default_delete<_Tp, _Yp>(), _AllocT()); + __hold.release(); + __enable_weak_this(__p, __p); + } + + template<class _Yp, class _Dp, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(_Yp* __p, _Dp __d) + : __ptr_(__p) + { +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk; +#ifndef _LIBCPP_CXX03_LANG + __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT()); +#else + __cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); +#endif // not _LIBCPP_CXX03_LANG + __enable_weak_this(__p, __p); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + __d(__p); + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + } + + template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t<__shared_ptr_deleter_ctor_reqs<_Dp, _Yp, element_type>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(_Yp* __p, _Dp __d, _Alloc __a) + : __ptr_(__p) + { +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk; + typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2; + typedef __allocator_destructor<_A2> _D2; + _A2 __a2(__a); + unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1)); + ::new ((void*)_VSTD::addressof(*__hold2.get())) +#ifndef _LIBCPP_CXX03_LANG + _CntrlBlk(__p, _VSTD::move(__d), __a); +#else + _CntrlBlk(__p, __d, __a); +#endif // not _LIBCPP_CXX03_LANG + __cntrl_ = _VSTD::addressof(*__hold2.release()); + __enable_weak_this(__p, __p); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + __d(__p); + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + } + + template<class _Dp> + _LIBCPP_HIDE_FROM_ABI + shared_ptr(nullptr_t __p, _Dp __d) + : __ptr_(nullptr) + { +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT; + typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk; +#ifndef _LIBCPP_CXX03_LANG + __cntrl_ = new _CntrlBlk(__p, _VSTD::move(__d), _AllocT()); +#else + __cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); +#endif // not _LIBCPP_CXX03_LANG +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + __d(__p); + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + } + + template<class _Dp, class _Alloc> + _LIBCPP_HIDE_FROM_ABI + shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a) + : __ptr_(nullptr) + { +#ifndef _LIBCPP_NO_EXCEPTIONS + try + { +#endif // _LIBCPP_NO_EXCEPTIONS + typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk; + typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2; + typedef __allocator_destructor<_A2> _D2; + _A2 __a2(__a); + unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1)); + ::new ((void*)_VSTD::addressof(*__hold2.get())) +#ifndef _LIBCPP_CXX03_LANG + _CntrlBlk(__p, _VSTD::move(__d), __a); +#else + _CntrlBlk(__p, __d, __a); +#endif // not _LIBCPP_CXX03_LANG + __cntrl_ = _VSTD::addressof(*__hold2.release()); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + __d(__p); + throw; + } +#endif // _LIBCPP_NO_EXCEPTIONS + } + + template<class _Yp> + _LIBCPP_HIDE_FROM_ABI + shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT + : __ptr_(__p), + __cntrl_(__r.__cntrl_) + { + if (__cntrl_) + __cntrl_->__add_shared(); + } + + _LIBCPP_HIDE_FROM_ABI + shared_ptr(const shared_ptr& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) + { + if (__cntrl_) + __cntrl_->__add_shared(); + } + + template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(const shared_ptr<_Yp>& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) + { + if (__cntrl_) + __cntrl_->__add_shared(); + } + + _LIBCPP_HIDE_FROM_ABI + shared_ptr(shared_ptr&& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) + { + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; + } + + template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(shared_ptr<_Yp>&& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) + { + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; + } + + template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> > + _LIBCPP_HIDE_FROM_ABI + explicit shared_ptr(const weak_ptr<_Yp>& __r) + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_) + { + if (__cntrl_ == nullptr) + __throw_bad_weak_ptr(); + } + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) + template<class _Yp, class = __enable_if_t<is_convertible<_Yp*, element_type*>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(auto_ptr<_Yp>&& __r) + : __ptr_(__r.get()) + { + typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>()); + __enable_weak_this(__r.get(), __r.get()); + __r.release(); + } +#endif + + template <class _Yp, class _Dp, class = __enable_if_t< + !is_lvalue_reference<_Dp>::value && + is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value + > > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(unique_ptr<_Yp, _Dp>&& __r) + : __ptr_(__r.get()) + { +#if _LIBCPP_STD_VER > 11 + if (__ptr_ == nullptr) + __cntrl_ = nullptr; + else +#endif + { + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, _Dp, _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT()); + __enable_weak_this(__r.get(), __r.get()); + } + __r.release(); + } + + template <class _Yp, class _Dp, class = void, class = __enable_if_t< + is_lvalue_reference<_Dp>::value && + is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value + > > + _LIBCPP_HIDE_FROM_ABI + shared_ptr(unique_ptr<_Yp, _Dp>&& __r) + : __ptr_(__r.get()) + { +#if _LIBCPP_STD_VER > 11 + if (__ptr_ == nullptr) + __cntrl_ = nullptr; + else +#endif + { + typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; + typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer, + reference_wrapper<typename remove_reference<_Dp>::type>, + _AllocT > _CntrlBlk; + __cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT()); + __enable_weak_this(__r.get(), __r.get()); + } + __r.release(); + } + + _LIBCPP_HIDE_FROM_ABI + ~shared_ptr() + { + if (__cntrl_) + __cntrl_->__release_shared(); + } + + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(const shared_ptr& __r) _NOEXCEPT + { + shared_ptr(__r).swap(*this); + return *this; + } + + template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT + { + shared_ptr(__r).swap(*this); + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(shared_ptr&& __r) _NOEXCEPT + { + shared_ptr(_VSTD::move(__r)).swap(*this); + return *this; + } + + template<class _Yp, class = __enable_if_t<__compatible_with<_Yp, _Tp>::value> > + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(shared_ptr<_Yp>&& __r) + { + shared_ptr(_VSTD::move(__r)).swap(*this); + return *this; + } + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) + template<class _Yp, class = __enable_if_t< + !is_array<_Yp>::value && + is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value + > > + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(auto_ptr<_Yp>&& __r) + { + shared_ptr(_VSTD::move(__r)).swap(*this); + return *this; + } +#endif + + template <class _Yp, class _Dp, class = __enable_if_t< + is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value + > > + _LIBCPP_HIDE_FROM_ABI + shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r) + { + shared_ptr(_VSTD::move(__r)).swap(*this); + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + void swap(shared_ptr& __r) _NOEXCEPT + { + _VSTD::swap(__ptr_, __r.__ptr_); + _VSTD::swap(__cntrl_, __r.__cntrl_); + } + + _LIBCPP_HIDE_FROM_ABI + void reset() _NOEXCEPT + { + shared_ptr().swap(*this); + } + + template<class _Yp, class = __enable_if_t< + __compatible_with<_Yp, _Tp>::value + > > + _LIBCPP_HIDE_FROM_ABI + void reset(_Yp* __p) + { + shared_ptr(__p).swap(*this); + } + + template<class _Yp, class _Dp, class = __enable_if_t< + __compatible_with<_Yp, _Tp>::value + > > + _LIBCPP_HIDE_FROM_ABI + void reset(_Yp* __p, _Dp __d) + { + shared_ptr(__p, __d).swap(*this); + } + + template<class _Yp, class _Dp, class _Alloc, class = __enable_if_t< + __compatible_with<_Yp, _Tp>::value + > > + _LIBCPP_HIDE_FROM_ABI + void reset(_Yp* __p, _Dp __d, _Alloc __a) + { + shared_ptr(__p, __d, __a).swap(*this); + } + + _LIBCPP_HIDE_FROM_ABI + element_type* get() const _NOEXCEPT + { + return __ptr_; + } + + _LIBCPP_HIDE_FROM_ABI + typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT + { + return *__ptr_; + } + + _LIBCPP_HIDE_FROM_ABI + element_type* operator->() const _NOEXCEPT + { + static_assert(!is_array<_Tp>::value, + "std::shared_ptr<T>::operator-> is only valid when T is not an array type."); + return __ptr_; + } + + _LIBCPP_HIDE_FROM_ABI + long use_count() const _NOEXCEPT + { + return __cntrl_ ? __cntrl_->use_count() : 0; + } + + _LIBCPP_HIDE_FROM_ABI + bool unique() const _NOEXCEPT + { + return use_count() == 1; + } + + _LIBCPP_HIDE_FROM_ABI + explicit operator bool() const _NOEXCEPT + { + return get() != nullptr; + } + + template <class _Up> + _LIBCPP_HIDE_FROM_ABI + bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT + { + return __cntrl_ < __p.__cntrl_; + } + + template <class _Up> + _LIBCPP_HIDE_FROM_ABI + bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT + { + return __cntrl_ < __p.__cntrl_; + } + + _LIBCPP_HIDE_FROM_ABI + bool __owner_equivalent(const shared_ptr& __p) const + { + return __cntrl_ == __p.__cntrl_; + } + +#if _LIBCPP_STD_VER > 14 + _LIBCPP_HIDE_FROM_ABI + typename add_lvalue_reference<element_type>::type operator[](ptrdiff_t __i) const + { + static_assert(is_array<_Tp>::value, + "std::shared_ptr<T>::operator[] is only valid when T is an array type."); + return __ptr_[__i]; + } +#endif + +#ifndef _LIBCPP_NO_RTTI + template <class _Dp> + _LIBCPP_HIDE_FROM_ABI + _Dp* __get_deleter() const _NOEXCEPT + { + return static_cast<_Dp*>(__cntrl_ + ? const_cast<void *>(__cntrl_->__get_deleter(typeid(_Dp))) + : nullptr); + } +#endif // _LIBCPP_NO_RTTI + + template<class _Yp, class _CntrlBlk> + _LIBCPP_HIDE_FROM_ABI + static shared_ptr<_Tp> __create_with_control_block(_Yp* __p, _CntrlBlk* __cntrl) _NOEXCEPT + { + shared_ptr<_Tp> __r; + __r.__ptr_ = __p; + __r.__cntrl_ = __cntrl; + __r.__enable_weak_this(__r.__ptr_, __r.__ptr_); + return __r; + } + +private: + template <class _Yp, bool = is_function<_Yp>::value> + struct __shared_ptr_default_allocator + { + typedef allocator<_Yp> type; + }; + + template <class _Yp> + struct __shared_ptr_default_allocator<_Yp, true> + { + typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type; + }; + + template <class _Yp, class _OrigPtr, class = __enable_if_t< + is_convertible<_OrigPtr*, const enable_shared_from_this<_Yp>*>::value + > > + _LIBCPP_HIDE_FROM_ABI + void __enable_weak_this(const enable_shared_from_this<_Yp>* __e, _OrigPtr* __ptr) _NOEXCEPT + { + typedef typename remove_cv<_Yp>::type _RawYp; + if (__e && __e->__weak_this_.expired()) + { + __e->__weak_this_ = shared_ptr<_RawYp>(*this, + const_cast<_RawYp*>(static_cast<const _Yp*>(__ptr))); + } + } + + _LIBCPP_HIDE_FROM_ABI void __enable_weak_this(...) _NOEXCEPT { } + + template <class, class _Yp> + struct __shared_ptr_default_delete + : default_delete<_Yp> + { }; + + template <class _Yp, class _Un, size_t _Sz> + struct __shared_ptr_default_delete<_Yp[_Sz], _Un> + : default_delete<_Yp[]> + { }; + + template <class _Yp, class _Un> + struct __shared_ptr_default_delete<_Yp[], _Un> + : default_delete<_Yp[]> + { }; + + template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr; + template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr; +}; + +#if _LIBCPP_STD_VER > 14 +template<class _Tp> +shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>; +template<class _Tp, class _Dp> +shared_ptr(unique_ptr<_Tp, _Dp>) -> shared_ptr<_Tp>; +#endif + +// +// std::allocate_shared and std::make_shared +// +template<class _Tp, class _Alloc, class ..._Args, class = __enable_if_t<!is_array<_Tp>::value> > +_LIBCPP_HIDE_FROM_ABI +shared_ptr<_Tp> allocate_shared(const _Alloc& __a, _Args&& ...__args) +{ + using _ControlBlock = __shared_ptr_emplace<_Tp, _Alloc>; + using _ControlBlockAllocator = typename __allocator_traits_rebind<_Alloc, _ControlBlock>::type; + __allocation_guard<_ControlBlockAllocator> __guard(__a, 1); + ::new ((void*)_VSTD::addressof(*__guard.__get())) _ControlBlock(__a, _VSTD::forward<_Args>(__args)...); + auto __control_block = __guard.__release_ptr(); + return shared_ptr<_Tp>::__create_with_control_block((*__control_block).__get_elem(), _VSTD::addressof(*__control_block)); +} + +template<class _Tp, class ..._Args, class = __enable_if_t<!is_array<_Tp>::value> > +_LIBCPP_HIDE_FROM_ABI +shared_ptr<_Tp> make_shared(_Args&& ...__args) +{ + return _VSTD::allocate_shared<_Tp>(allocator<_Tp>(), _VSTD::forward<_Args>(__args)...); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ + return __x.get() == __y.get(); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ + return !(__x == __y); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ +#if _LIBCPP_STD_VER <= 11 + typedef typename common_type<_Tp*, _Up*>::type _Vp; + return less<_Vp>()(__x.get(), __y.get()); +#else + return less<>()(__x.get(), __y.get()); +#endif + +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ + return __y < __x; +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ + return !(__y < __x); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT +{ + return !(__x < __y); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return !__x; +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return !__x; +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return static_cast<bool>(__x); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return static_cast<bool>(__x); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return less<_Tp*>()(__x.get(), nullptr); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return less<_Tp*>()(nullptr, __x.get()); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return nullptr < __x; +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return __x < nullptr; +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return !(nullptr < __x); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return !(__x < nullptr); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT +{ + return !(__x < nullptr); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT +{ + return !(nullptr < __x); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +void +swap(shared_ptr<_Tp>& __x, shared_ptr<_Tp>& __y) _NOEXCEPT +{ + __x.swap(__y); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +shared_ptr<_Tp> +static_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT +{ + return shared_ptr<_Tp>(__r, + static_cast< + typename shared_ptr<_Tp>::element_type*>(__r.get())); +} + +template<class _Tp, class _Up> +inline _LIBCPP_INLINE_VISIBILITY +shared_ptr<_Tp> +dynamic_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT +{ + typedef typename shared_ptr<_Tp>::element_type _ET; + _ET* __p = dynamic_cast<_ET*>(__r.get()); + return __p ? shared_ptr<_Tp>(__r, __p) : shared_ptr<_Tp>(); +} + +template<class _Tp, class _Up> +shared_ptr<_Tp> +const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT +{ + typedef typename shared_ptr<_Tp>::element_type _RTp; + return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get())); +} + +template<class _Tp, class _Up> +shared_ptr<_Tp> +reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT +{ + return shared_ptr<_Tp>(__r, + reinterpret_cast< + typename shared_ptr<_Tp>::element_type*>(__r.get())); +} + +#ifndef _LIBCPP_NO_RTTI + +template<class _Dp, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_Dp* +get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT +{ + return __p.template __get_deleter<_Dp>(); +} + +#endif // _LIBCPP_NO_RTTI + +template<class _Tp> +class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS weak_ptr +{ +public: +#if _LIBCPP_STD_VER > 14 + typedef remove_extent_t<_Tp> element_type; +#else + typedef _Tp element_type; +#endif + +private: + element_type* __ptr_; + __shared_weak_count* __cntrl_; + +public: + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT; + template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0) + _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY + weak_ptr(weak_ptr const& __r) _NOEXCEPT; + template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0) + _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + weak_ptr(weak_ptr&& __r) _NOEXCEPT; + template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0) + _NOEXCEPT; + ~weak_ptr(); + + _LIBCPP_INLINE_VISIBILITY + weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT; + template<class _Yp> + typename enable_if + < + __compatible_with<_Yp, _Tp>::value, + weak_ptr& + >::type + _LIBCPP_INLINE_VISIBILITY + operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT; + template<class _Yp> + typename enable_if + < + __compatible_with<_Yp, _Tp>::value, + weak_ptr& + >::type + _LIBCPP_INLINE_VISIBILITY + operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT; + + template<class _Yp> + typename enable_if + < + __compatible_with<_Yp, _Tp>::value, + weak_ptr& + >::type + _LIBCPP_INLINE_VISIBILITY + operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + void swap(weak_ptr& __r) _NOEXCEPT; + _LIBCPP_INLINE_VISIBILITY + void reset() _NOEXCEPT; + + _LIBCPP_INLINE_VISIBILITY + long use_count() const _NOEXCEPT + {return __cntrl_ ? __cntrl_->use_count() : 0;} + _LIBCPP_INLINE_VISIBILITY + bool expired() const _NOEXCEPT + {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;} + shared_ptr<_Tp> lock() const _NOEXCEPT; + template<class _Up> + _LIBCPP_INLINE_VISIBILITY + bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT + {return __cntrl_ < __r.__cntrl_;} + template<class _Up> + _LIBCPP_INLINE_VISIBILITY + bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT + {return __cntrl_ < __r.__cntrl_;} + + template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr; + template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr; +}; + +#if _LIBCPP_STD_VER > 14 +template<class _Tp> +weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>; +#endif + +template<class _Tp> +inline +_LIBCPP_CONSTEXPR +weak_ptr<_Tp>::weak_ptr() _NOEXCEPT + : __ptr_(nullptr), + __cntrl_(nullptr) +{ +} + +template<class _Tp> +inline +weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) +{ + if (__cntrl_) + __cntrl_->__add_weak(); +} + +template<class _Tp> +template<class _Yp> +inline +weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type) + _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) +{ + if (__cntrl_) + __cntrl_->__add_weak(); +} + +template<class _Tp> +template<class _Yp> +inline +weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type) + _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) +{ + if (__cntrl_) + __cntrl_->__add_weak(); +} + +template<class _Tp> +inline +weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) +{ + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; +} + +template<class _Tp> +template<class _Yp> +inline +weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r, + typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type) + _NOEXCEPT + : __ptr_(__r.__ptr_), + __cntrl_(__r.__cntrl_) +{ + __r.__ptr_ = nullptr; + __r.__cntrl_ = nullptr; +} + +template<class _Tp> +weak_ptr<_Tp>::~weak_ptr() +{ + if (__cntrl_) + __cntrl_->__release_weak(); +} + +template<class _Tp> +inline +weak_ptr<_Tp>& +weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT +{ + weak_ptr(__r).swap(*this); + return *this; +} + +template<class _Tp> +template<class _Yp> +inline +typename enable_if +< + __compatible_with<_Yp, _Tp>::value, + weak_ptr<_Tp>& +>::type +weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT +{ + weak_ptr(__r).swap(*this); + return *this; +} + +template<class _Tp> +inline +weak_ptr<_Tp>& +weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT +{ + weak_ptr(_VSTD::move(__r)).swap(*this); + return *this; +} + +template<class _Tp> +template<class _Yp> +inline +typename enable_if +< + __compatible_with<_Yp, _Tp>::value, + weak_ptr<_Tp>& +>::type +weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT +{ + weak_ptr(_VSTD::move(__r)).swap(*this); + return *this; +} + +template<class _Tp> +template<class _Yp> +inline +typename enable_if +< + __compatible_with<_Yp, _Tp>::value, + weak_ptr<_Tp>& +>::type +weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT +{ + weak_ptr(__r).swap(*this); + return *this; +} + +template<class _Tp> +inline +void +weak_ptr<_Tp>::swap(weak_ptr& __r) _NOEXCEPT +{ + _VSTD::swap(__ptr_, __r.__ptr_); + _VSTD::swap(__cntrl_, __r.__cntrl_); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +void +swap(weak_ptr<_Tp>& __x, weak_ptr<_Tp>& __y) _NOEXCEPT +{ + __x.swap(__y); +} + +template<class _Tp> +inline +void +weak_ptr<_Tp>::reset() _NOEXCEPT +{ + weak_ptr().swap(*this); +} + +template<class _Tp> +shared_ptr<_Tp> +weak_ptr<_Tp>::lock() const _NOEXCEPT +{ + shared_ptr<_Tp> __r; + __r.__cntrl_ = __cntrl_ ? __cntrl_->lock() : __cntrl_; + if (__r.__cntrl_) + __r.__ptr_ = __ptr_; + return __r; +} + +#if _LIBCPP_STD_VER > 14 +template <class _Tp = void> struct owner_less; +#else +template <class _Tp> struct owner_less; +#endif + + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> > +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> second_argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + _LIBCPP_INLINE_VISIBILITY + bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + _LIBCPP_INLINE_VISIBILITY + bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} +}; + +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> > +#if !defined(_LIBCPP_ABI_NO_BINDER_BASES) + : binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool> +#endif +{ +_LIBCPP_SUPPRESS_DEPRECATED_POP +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef bool result_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef weak_ptr<_Tp> first_argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef weak_ptr<_Tp> second_argument_type; +#endif + _LIBCPP_INLINE_VISIBILITY + bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + _LIBCPP_INLINE_VISIBILITY + bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + _LIBCPP_INLINE_VISIBILITY + bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} +}; + +#if _LIBCPP_STD_VER > 14 +template <> +struct _LIBCPP_TEMPLATE_VIS owner_less<void> +{ + template <class _Tp, class _Up> + _LIBCPP_INLINE_VISIBILITY + bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + template <class _Tp, class _Up> + _LIBCPP_INLINE_VISIBILITY + bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + template <class _Tp, class _Up> + _LIBCPP_INLINE_VISIBILITY + bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + template <class _Tp, class _Up> + _LIBCPP_INLINE_VISIBILITY + bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT + {return __x.owner_before(__y);} + typedef void is_transparent; +}; +#endif + +template<class _Tp> +class _LIBCPP_TEMPLATE_VIS enable_shared_from_this +{ + mutable weak_ptr<_Tp> __weak_this_; +protected: + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + enable_shared_from_this() _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY + enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {} + _LIBCPP_INLINE_VISIBILITY + enable_shared_from_this& operator=(enable_shared_from_this const&) _NOEXCEPT + {return *this;} + _LIBCPP_INLINE_VISIBILITY + ~enable_shared_from_this() {} +public: + _LIBCPP_INLINE_VISIBILITY + shared_ptr<_Tp> shared_from_this() + {return shared_ptr<_Tp>(__weak_this_);} + _LIBCPP_INLINE_VISIBILITY + shared_ptr<_Tp const> shared_from_this() const + {return shared_ptr<const _Tp>(__weak_this_);} + +#if _LIBCPP_STD_VER > 14 + _LIBCPP_INLINE_VISIBILITY + weak_ptr<_Tp> weak_from_this() _NOEXCEPT + { return __weak_this_; } + + _LIBCPP_INLINE_VISIBILITY + weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT + { return __weak_this_; } +#endif // _LIBCPP_STD_VER > 14 + + template <class _Up> friend class shared_ptr; +}; + +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> > +{ +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef shared_ptr<_Tp> argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; +#endif + + _LIBCPP_INLINE_VISIBILITY + size_t operator()(const shared_ptr<_Tp>& __ptr) const _NOEXCEPT + { + return hash<typename shared_ptr<_Tp>::element_type*>()(__ptr.get()); + } +}; + +template<class _CharT, class _Traits, class _Yp> +inline _LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p); + + +#if !defined(_LIBCPP_HAS_NO_THREADS) + +class _LIBCPP_TYPE_VIS __sp_mut +{ + void* __lx; +public: + void lock() _NOEXCEPT; + void unlock() _NOEXCEPT; + +private: + _LIBCPP_CONSTEXPR __sp_mut(void*) _NOEXCEPT; + __sp_mut(const __sp_mut&); + __sp_mut& operator=(const __sp_mut&); + + friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*); +}; + +_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +__sp_mut& __get_sp_mut(const void*); + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +atomic_is_lock_free(const shared_ptr<_Tp>*) +{ + return false; +} + +template <class _Tp> +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +shared_ptr<_Tp> +atomic_load(const shared_ptr<_Tp>* __p) +{ + __sp_mut& __m = __get_sp_mut(__p); + __m.lock(); + shared_ptr<_Tp> __q = *__p; + __m.unlock(); + return __q; +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +shared_ptr<_Tp> +atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order) +{ + return atomic_load(__p); +} + +template <class _Tp> +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +void +atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) +{ + __sp_mut& __m = __get_sp_mut(__p); + __m.lock(); + __p->swap(__r); + __m.unlock(); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +void +atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order) +{ + atomic_store(__p, __r); +} + +template <class _Tp> +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +shared_ptr<_Tp> +atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) +{ + __sp_mut& __m = __get_sp_mut(__p); + __m.lock(); + __p->swap(__r); + __m.unlock(); + return __r; +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +shared_ptr<_Tp> +atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order) +{ + return atomic_exchange(__p, __r); +} + +template <class _Tp> +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +bool +atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w) +{ + shared_ptr<_Tp> __temp; + __sp_mut& __m = __get_sp_mut(__p); + __m.lock(); + if (__p->__owner_equivalent(*__v)) + { + _VSTD::swap(__temp, *__p); + *__p = __w; + __m.unlock(); + return true; + } + _VSTD::swap(__temp, *__v); + *__v = *__p; + __m.unlock(); + return false; +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +bool +atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w) +{ + return atomic_compare_exchange_strong(__p, __v, __w); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +bool +atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, + shared_ptr<_Tp> __w, memory_order, memory_order) +{ + return atomic_compare_exchange_strong(__p, __v, __w); +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR +bool +atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, + shared_ptr<_Tp> __w, memory_order, memory_order) +{ + return atomic_compare_exchange_weak(__p, __v, __w); +} + +#endif // !defined(_LIBCPP_HAS_NO_THREADS) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_SHARED_PTR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/temporary_buffer.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/temporary_buffer.h new file mode 100644 index 0000000..06aa6c2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/temporary_buffer.h
@@ -0,0 +1,84 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_TEMPORARY_BUFFER_H +#define _LIBCPP___MEMORY_TEMPORARY_BUFFER_H + +#include <__config> +#include <cstddef> +#include <new> +#include <utility> // pair + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +_LIBCPP_NODISCARD_EXT _LIBCPP_NO_CFI +pair<_Tp*, ptrdiff_t> +get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT +{ + pair<_Tp*, ptrdiff_t> __r(0, 0); + const ptrdiff_t __m = (~ptrdiff_t(0) ^ + ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1))) + / sizeof(_Tp); + if (__n > __m) + __n = __m; + while (__n > 0) + { +#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) + if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) + { + align_val_t __al = + align_val_t(alignment_of<_Tp>::value); + __r.first = static_cast<_Tp*>(::operator new( + __n * sizeof(_Tp), __al, nothrow)); + } else { + __r.first = static_cast<_Tp*>(::operator new( + __n * sizeof(_Tp), nothrow)); + } +#else + if (__is_overaligned_for_new(_LIBCPP_ALIGNOF(_Tp))) + { + // Since aligned operator new is unavailable, return an empty + // buffer rather than one with invalid alignment. + return __r; + } + + __r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow)); +#endif + + if (__r.first) + { + __r.second = __n; + break; + } + __n /= 2; + } + return __r; +} + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +void return_temporary_buffer(_Tp* __p) _NOEXCEPT +{ + _VSTD::__libcpp_deallocate_unsized((void*)__p, _LIBCPP_ALIGNOF(_Tp)); +} + +struct __return_temporary_buffer +{ + template <class _Tp> + _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);} +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_TEMPORARY_BUFFER_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uninitialized_algorithms.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uninitialized_algorithms.h new file mode 100644 index 0000000..e83d62e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uninitialized_algorithms.h
@@ -0,0 +1,241 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H +#define _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H + +#include <__config> +#include <__memory/addressof.h> +#include <__memory/construct_at.h> +#include <iterator> +#include <utility> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _InputIterator, class _ForwardIterator> +_ForwardIterator +uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; +#ifndef _LIBCPP_NO_EXCEPTIONS + _ForwardIterator __s = __r; + try + { +#endif + for (; __f != __l; ++__f, (void) ++__r) + ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + for (; __s != __r; ++__s) + __s->~value_type(); + throw; + } +#endif + return __r; +} + +template <class _InputIterator, class _Size, class _ForwardIterator> +_ForwardIterator +uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; +#ifndef _LIBCPP_NO_EXCEPTIONS + _ForwardIterator __s = __r; + try + { +#endif + for (; __n > 0; ++__f, (void) ++__r, (void) --__n) + ::new ((void*)_VSTD::addressof(*__r)) value_type(*__f); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + for (; __s != __r; ++__s) + __s->~value_type(); + throw; + } +#endif + return __r; +} + +template <class _ForwardIterator, class _Tp> +void +uninitialized_fill(_ForwardIterator __f, _ForwardIterator __l, const _Tp& __x) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; +#ifndef _LIBCPP_NO_EXCEPTIONS + _ForwardIterator __s = __f; + try + { +#endif + for (; __f != __l; ++__f) + ::new ((void*)_VSTD::addressof(*__f)) value_type(__x); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + for (; __s != __f; ++__s) + __s->~value_type(); + throw; + } +#endif +} + +template <class _ForwardIterator, class _Size, class _Tp> +_ForwardIterator +uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x) +{ + typedef typename iterator_traits<_ForwardIterator>::value_type value_type; +#ifndef _LIBCPP_NO_EXCEPTIONS + _ForwardIterator __s = __f; + try + { +#endif + for (; __n > 0; ++__f, (void) --__n) + ::new ((void*)_VSTD::addressof(*__f)) value_type(__x); +#ifndef _LIBCPP_NO_EXCEPTIONS + } + catch (...) + { + for (; __s != __f; ++__s) + __s->~value_type(); + throw; + } +#endif + return __f; +} + +#if _LIBCPP_STD_VER > 14 + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY +void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) { + using _Vt = typename iterator_traits<_ForwardIterator>::value_type; + auto __idx = __first; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __idx != __last; ++__idx) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt; +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first, __idx); + throw; + } +#endif +} + +template <class _ForwardIterator, class _Size> +inline _LIBCPP_INLINE_VISIBILITY +_ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) { + using _Vt = typename iterator_traits<_ForwardIterator>::value_type; + auto __idx = __first; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __n > 0; ++__idx, (void) --__n) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt; + return __idx; +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first, __idx); + throw; + } +#endif +} + + +template <class _ForwardIterator> +inline _LIBCPP_INLINE_VISIBILITY +void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) { + using _Vt = typename iterator_traits<_ForwardIterator>::value_type; + auto __idx = __first; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __idx != __last; ++__idx) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt(); +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first, __idx); + throw; + } +#endif +} + +template <class _ForwardIterator, class _Size> +inline _LIBCPP_INLINE_VISIBILITY +_ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) { + using _Vt = typename iterator_traits<_ForwardIterator>::value_type; + auto __idx = __first; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __n > 0; ++__idx, (void) --__n) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt(); + return __idx; +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first, __idx); + throw; + } +#endif +} + + +template <class _InputIt, class _ForwardIt> +inline _LIBCPP_INLINE_VISIBILITY +_ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __first_res) { + using _Vt = typename iterator_traits<_ForwardIt>::value_type; + auto __idx = __first_res; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __first != __last; ++__idx, (void) ++__first) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first)); + return __idx; +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first_res, __idx); + throw; + } +#endif +} + +template <class _InputIt, class _Size, class _ForwardIt> +inline _LIBCPP_INLINE_VISIBILITY +pair<_InputIt, _ForwardIt> +uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) { + using _Vt = typename iterator_traits<_ForwardIt>::value_type; + auto __idx = __first_res; +#ifndef _LIBCPP_NO_EXCEPTIONS + try { +#endif + for (; __n > 0; ++__idx, (void) ++__first, --__n) + ::new ((void*)_VSTD::addressof(*__idx)) _Vt(_VSTD::move(*__first)); + return {__first, __idx}; +#ifndef _LIBCPP_NO_EXCEPTIONS + } catch (...) { + _VSTD::destroy(__first_res, __idx); + throw; + } +#endif +} + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/unique_ptr.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/unique_ptr.h new file mode 100644 index 0000000..4331203 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/unique_ptr.h
@@ -0,0 +1,768 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_UNIQUE_PTR_H +#define _LIBCPP___MEMORY_UNIQUE_PTR_H + +#include <__config> +#include <__functional_base> +#include <__functional/hash.h> +#include <__functional/operations.h> +#include <__memory/allocator_traits.h> // __pointer +#include <__memory/compressed_pair.h> +#include <__utility/forward.h> +#include <cstddef> +#include <type_traits> +#include <utility> + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) +# include <__memory/auto_ptr.h> +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS default_delete { + static_assert(!is_function<_Tp>::value, + "default_delete cannot be instantiated for function types"); +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default; +#else + _LIBCPP_INLINE_VISIBILITY default_delete() {} +#endif + template <class _Up> + _LIBCPP_INLINE_VISIBILITY + default_delete(const default_delete<_Up>&, + typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = + 0) _NOEXCEPT {} + + _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT { + static_assert(sizeof(_Tp) > 0, + "default_delete can not delete incomplete type"); + static_assert(!is_void<_Tp>::value, + "default_delete can not delete incomplete type"); + delete __ptr; + } +}; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> { +private: + template <class _Up> + struct _EnableIfConvertible + : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {}; + +public: +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY constexpr default_delete() _NOEXCEPT = default; +#else + _LIBCPP_INLINE_VISIBILITY default_delete() {} +#endif + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY + default_delete(const default_delete<_Up[]>&, + typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {} + + template <class _Up> + _LIBCPP_INLINE_VISIBILITY + typename _EnableIfConvertible<_Up>::type + operator()(_Up* __ptr) const _NOEXCEPT { + static_assert(sizeof(_Tp) > 0, + "default_delete can not delete incomplete type"); + static_assert(!is_void<_Tp>::value, + "default_delete can not delete void type"); + delete[] __ptr; + } +}; + +template <class _Deleter> +struct __unique_ptr_deleter_sfinae { + static_assert(!is_reference<_Deleter>::value, "incorrect specialization"); + typedef const _Deleter& __lval_ref_type; + typedef _Deleter&& __good_rval_ref_type; + typedef true_type __enable_rval_overload; +}; + +template <class _Deleter> +struct __unique_ptr_deleter_sfinae<_Deleter const&> { + typedef const _Deleter& __lval_ref_type; + typedef const _Deleter&& __bad_rval_ref_type; + typedef false_type __enable_rval_overload; +}; + +template <class _Deleter> +struct __unique_ptr_deleter_sfinae<_Deleter&> { + typedef _Deleter& __lval_ref_type; + typedef _Deleter&& __bad_rval_ref_type; + typedef false_type __enable_rval_overload; +}; + +#if defined(_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI) +# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI __attribute__((trivial_abi)) +#else +# define _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI +#endif + +template <class _Tp, class _Dp = default_delete<_Tp> > +class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr { +public: + typedef _Tp element_type; + typedef _Dp deleter_type; + typedef _LIBCPP_NODEBUG typename __pointer<_Tp, deleter_type>::type pointer; + + static_assert(!is_rvalue_reference<deleter_type>::value, + "the specified deleter type cannot be an rvalue reference"); + +private: + __compressed_pair<pointer, deleter_type> __ptr_; + + struct __nat { int __for_bool_; }; + + typedef _LIBCPP_NODEBUG __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; + + template <bool _Dummy> + using _LValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; + + template <bool _Dummy> + using _GoodRValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; + + template <bool _Dummy> + using _BadRValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; + + template <bool _Dummy, class _Deleter = typename __dependent_type< + __identity<deleter_type>, _Dummy>::type> + using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG = + typename enable_if<is_default_constructible<_Deleter>::value && + !is_pointer<_Deleter>::value>::type; + + template <class _ArgType> + using _EnableIfDeleterConstructible _LIBCPP_NODEBUG = + typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; + + template <class _UPtr, class _Up> + using _EnableIfMoveConvertible _LIBCPP_NODEBUG = typename enable_if< + is_convertible<typename _UPtr::pointer, pointer>::value && + !is_array<_Up>::value + >::type; + + template <class _UDel> + using _EnableIfDeleterConvertible _LIBCPP_NODEBUG = typename enable_if< + (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || + (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) + >::type; + + template <class _UDel> + using _EnableIfDeleterAssignable = typename enable_if< + is_assignable<_Dp&, _UDel&&>::value + >::type; + +public: + template <bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy> > + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy> > + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy> > + _LIBCPP_INLINE_VISIBILITY + explicit unique_ptr(pointer __p) _NOEXCEPT : __ptr_(__p, __value_init_tag()) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(pointer __p, _LValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(__p, __d) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(__p, _VSTD::move(__d)) { + static_assert(!is_reference<deleter_type>::value, + "rvalue deleter bound to reference"); + } + + template <bool _Dummy = true, + class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> > > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete; + + _LIBCPP_INLINE_VISIBILITY + unique_ptr(unique_ptr&& __u) _NOEXCEPT + : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) { + } + + template <class _Up, class _Ep, + class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, + class = _EnableIfDeleterConvertible<_Ep> + > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT + : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {} + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) + template <class _Up> + _LIBCPP_INLINE_VISIBILITY + unique_ptr(auto_ptr<_Up>&& __p, + typename enable_if<is_convertible<_Up*, _Tp*>::value && + is_same<_Dp, default_delete<_Tp> >::value, + __nat>::type = __nat()) _NOEXCEPT + : __ptr_(__p.release(), __value_init_tag()) {} +#endif + + _LIBCPP_INLINE_VISIBILITY + unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT { + reset(__u.release()); + __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter()); + return *this; + } + + template <class _Up, class _Ep, + class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, + class = _EnableIfDeleterAssignable<_Ep> + > + _LIBCPP_INLINE_VISIBILITY + unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT { + reset(__u.release()); + __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter()); + return *this; + } + +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) + template <class _Up> + _LIBCPP_INLINE_VISIBILITY + typename enable_if<is_convertible<_Up*, _Tp*>::value && + is_same<_Dp, default_delete<_Tp> >::value, + unique_ptr&>::type + operator=(auto_ptr<_Up> __p) { + reset(__p.release()); + return *this; + } +#endif + +#ifdef _LIBCPP_CXX03_LANG + unique_ptr(unique_ptr const&) = delete; + unique_ptr& operator=(unique_ptr const&) = delete; +#endif + + + _LIBCPP_INLINE_VISIBILITY + ~unique_ptr() { reset(); } + + _LIBCPP_INLINE_VISIBILITY + unique_ptr& operator=(nullptr_t) _NOEXCEPT { + reset(); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + typename add_lvalue_reference<_Tp>::type + operator*() const { + return *__ptr_.first(); + } + _LIBCPP_INLINE_VISIBILITY + pointer operator->() const _NOEXCEPT { + return __ptr_.first(); + } + _LIBCPP_INLINE_VISIBILITY + pointer get() const _NOEXCEPT { + return __ptr_.first(); + } + _LIBCPP_INLINE_VISIBILITY + deleter_type& get_deleter() _NOEXCEPT { + return __ptr_.second(); + } + _LIBCPP_INLINE_VISIBILITY + const deleter_type& get_deleter() const _NOEXCEPT { + return __ptr_.second(); + } + _LIBCPP_INLINE_VISIBILITY + explicit operator bool() const _NOEXCEPT { + return __ptr_.first() != nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + pointer release() _NOEXCEPT { + pointer __t = __ptr_.first(); + __ptr_.first() = pointer(); + return __t; + } + + _LIBCPP_INLINE_VISIBILITY + void reset(pointer __p = pointer()) _NOEXCEPT { + pointer __tmp = __ptr_.first(); + __ptr_.first() = __p; + if (__tmp) + __ptr_.second()(__tmp); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(unique_ptr& __u) _NOEXCEPT { + __ptr_.swap(__u.__ptr_); + } +}; + + +template <class _Tp, class _Dp> +class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> { +public: + typedef _Tp element_type; + typedef _Dp deleter_type; + typedef typename __pointer<_Tp, deleter_type>::type pointer; + +private: + __compressed_pair<pointer, deleter_type> __ptr_; + + template <class _From> + struct _CheckArrayPointerConversion : is_same<_From, pointer> {}; + + template <class _FromElem> + struct _CheckArrayPointerConversion<_FromElem*> + : integral_constant<bool, + is_same<_FromElem*, pointer>::value || + (is_same<pointer, element_type*>::value && + is_convertible<_FromElem(*)[], element_type(*)[]>::value) + > + {}; + + typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE; + + template <bool _Dummy> + using _LValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; + + template <bool _Dummy> + using _GoodRValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; + + template <bool _Dummy> + using _BadRValRefType _LIBCPP_NODEBUG = + typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type; + + template <bool _Dummy, class _Deleter = typename __dependent_type< + __identity<deleter_type>, _Dummy>::type> + using _EnableIfDeleterDefaultConstructible _LIBCPP_NODEBUG = + typename enable_if<is_default_constructible<_Deleter>::value && + !is_pointer<_Deleter>::value>::type; + + template <class _ArgType> + using _EnableIfDeleterConstructible _LIBCPP_NODEBUG = + typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type; + + template <class _Pp> + using _EnableIfPointerConvertible _LIBCPP_NODEBUG = typename enable_if< + _CheckArrayPointerConversion<_Pp>::value + >::type; + + template <class _UPtr, class _Up, + class _ElemT = typename _UPtr::element_type> + using _EnableIfMoveConvertible _LIBCPP_NODEBUG = typename enable_if< + is_array<_Up>::value && + is_same<pointer, element_type*>::value && + is_same<typename _UPtr::pointer, _ElemT*>::value && + is_convertible<_ElemT(*)[], element_type(*)[]>::value + >::type; + + template <class _UDel> + using _EnableIfDeleterConvertible _LIBCPP_NODEBUG = typename enable_if< + (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) || + (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value) + >::type; + + template <class _UDel> + using _EnableIfDeleterAssignable _LIBCPP_NODEBUG = typename enable_if< + is_assignable<_Dp&, _UDel&&>::value + >::type; + +public: + template <bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy> > + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy> > + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {} + + template <class _Pp, bool _Dummy = true, + class = _EnableIfDeleterDefaultConstructible<_Dummy>, + class = _EnableIfPointerConvertible<_Pp> > + _LIBCPP_INLINE_VISIBILITY + explicit unique_ptr(_Pp __p) _NOEXCEPT + : __ptr_(__p, __value_init_tag()) {} + + template <class _Pp, bool _Dummy = true, + class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> >, + class = _EnableIfPointerConvertible<_Pp> > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(__p, __d) {} + + template <bool _Dummy = true, + class = _EnableIfDeleterConstructible<_LValRefType<_Dummy> > > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(nullptr, __d) {} + + template <class _Pp, bool _Dummy = true, + class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> >, + class = _EnableIfPointerConvertible<_Pp> > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(__p, _VSTD::move(__d)) { + static_assert(!is_reference<deleter_type>::value, + "rvalue deleter bound to reference"); + } + + template <bool _Dummy = true, + class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy> > > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) _NOEXCEPT + : __ptr_(nullptr, _VSTD::move(__d)) { + static_assert(!is_reference<deleter_type>::value, + "rvalue deleter bound to reference"); + } + + template <class _Pp, bool _Dummy = true, + class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy> >, + class = _EnableIfPointerConvertible<_Pp> > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete; + + _LIBCPP_INLINE_VISIBILITY + unique_ptr(unique_ptr&& __u) _NOEXCEPT + : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) { + } + + _LIBCPP_INLINE_VISIBILITY + unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT { + reset(__u.release()); + __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter()); + return *this; + } + + template <class _Up, class _Ep, + class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, + class = _EnableIfDeleterConvertible<_Ep> + > + _LIBCPP_INLINE_VISIBILITY + unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT + : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) { + } + + template <class _Up, class _Ep, + class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>, + class = _EnableIfDeleterAssignable<_Ep> + > + _LIBCPP_INLINE_VISIBILITY + unique_ptr& + operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT { + reset(__u.release()); + __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter()); + return *this; + } + +#ifdef _LIBCPP_CXX03_LANG + unique_ptr(unique_ptr const&) = delete; + unique_ptr& operator=(unique_ptr const&) = delete; +#endif + +public: + _LIBCPP_INLINE_VISIBILITY + ~unique_ptr() { reset(); } + + _LIBCPP_INLINE_VISIBILITY + unique_ptr& operator=(nullptr_t) _NOEXCEPT { + reset(); + return *this; + } + + _LIBCPP_INLINE_VISIBILITY + typename add_lvalue_reference<_Tp>::type + operator[](size_t __i) const { + return __ptr_.first()[__i]; + } + _LIBCPP_INLINE_VISIBILITY + pointer get() const _NOEXCEPT { + return __ptr_.first(); + } + + _LIBCPP_INLINE_VISIBILITY + deleter_type& get_deleter() _NOEXCEPT { + return __ptr_.second(); + } + + _LIBCPP_INLINE_VISIBILITY + const deleter_type& get_deleter() const _NOEXCEPT { + return __ptr_.second(); + } + _LIBCPP_INLINE_VISIBILITY + explicit operator bool() const _NOEXCEPT { + return __ptr_.first() != nullptr; + } + + _LIBCPP_INLINE_VISIBILITY + pointer release() _NOEXCEPT { + pointer __t = __ptr_.first(); + __ptr_.first() = pointer(); + return __t; + } + + template <class _Pp> + _LIBCPP_INLINE_VISIBILITY + typename enable_if< + _CheckArrayPointerConversion<_Pp>::value + >::type + reset(_Pp __p) _NOEXCEPT { + pointer __tmp = __ptr_.first(); + __ptr_.first() = __p; + if (__tmp) + __ptr_.second()(__tmp); + } + + _LIBCPP_INLINE_VISIBILITY + void reset(nullptr_t = nullptr) _NOEXCEPT { + pointer __tmp = __ptr_.first(); + __ptr_.first() = nullptr; + if (__tmp) + __ptr_.second()(__tmp); + } + + _LIBCPP_INLINE_VISIBILITY + void swap(unique_ptr& __u) _NOEXCEPT { + __ptr_.swap(__u.__ptr_); + } + +}; + +template <class _Tp, class _Dp> +inline _LIBCPP_INLINE_VISIBILITY +typename enable_if< + __is_swappable<_Dp>::value, + void +>::type +swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {__x.swap(__y);} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __x.get() == __y.get();} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x == __y);} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) +{ + typedef typename unique_ptr<_T1, _D1>::pointer _P1; + typedef typename unique_ptr<_T2, _D2>::pointer _P2; + typedef typename common_type<_P1, _P2>::type _Vp; + return less<_Vp>()(__x.get(), __y.get()); +} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator> (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return __y < __x;} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__y < __x);} + +template <class _T1, class _D1, class _T2, class _D2> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {return !(__x < __y);} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT +{ + return !__x; +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT +{ + return !__x; +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT +{ + return static_cast<bool>(__x); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT +{ + return static_cast<bool>(__x); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t) +{ + typedef typename unique_ptr<_T1, _D1>::pointer _P1; + return less<_P1>()(__x.get(), nullptr); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x) +{ + typedef typename unique_ptr<_T1, _D1>::pointer _P1; + return less<_P1>()(nullptr, __x.get()); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>(const unique_ptr<_T1, _D1>& __x, nullptr_t) +{ + return nullptr < __x; +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>(nullptr_t, const unique_ptr<_T1, _D1>& __x) +{ + return __x < nullptr; +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const unique_ptr<_T1, _D1>& __x, nullptr_t) +{ + return !(nullptr < __x); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(nullptr_t, const unique_ptr<_T1, _D1>& __x) +{ + return !(__x < nullptr); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const unique_ptr<_T1, _D1>& __x, nullptr_t) +{ + return !(__x < nullptr); +} + +template <class _T1, class _D1> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x) +{ + return !(nullptr < __x); +} + +#if _LIBCPP_STD_VER > 11 + +template<class _Tp> +struct __unique_if +{ + typedef unique_ptr<_Tp> __unique_single; +}; + +template<class _Tp> +struct __unique_if<_Tp[]> +{ + typedef unique_ptr<_Tp[]> __unique_array_unknown_bound; +}; + +template<class _Tp, size_t _Np> +struct __unique_if<_Tp[_Np]> +{ + typedef void __unique_array_known_bound; +}; + +template<class _Tp, class... _Args> +inline _LIBCPP_INLINE_VISIBILITY +typename __unique_if<_Tp>::__unique_single +make_unique(_Args&&... __args) +{ + return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...)); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +typename __unique_if<_Tp>::__unique_array_unknown_bound +make_unique(size_t __n) +{ + typedef typename remove_extent<_Tp>::type _Up; + return unique_ptr<_Tp>(new _Up[__n]()); +} + +template<class _Tp, class... _Args> + typename __unique_if<_Tp>::__unique_array_known_bound + make_unique(_Args&&...) = delete; + +#endif // _LIBCPP_STD_VER > 11 + +template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash; + +template <class _Tp, class _Dp> +#ifdef _LIBCPP_CXX03_LANG +struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> > +#else +struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper< + unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer> > +#endif +{ +#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) + _LIBCPP_DEPRECATED_IN_CXX17 typedef unique_ptr<_Tp, _Dp> argument_type; + _LIBCPP_DEPRECATED_IN_CXX17 typedef size_t result_type; +#endif + + _LIBCPP_INLINE_VISIBILITY + size_t operator()(const unique_ptr<_Tp, _Dp>& __ptr) const + { + typedef typename unique_ptr<_Tp, _Dp>::pointer pointer; + return hash<pointer>()(__ptr.get()); + } +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_UNIQUE_PTR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uses_allocator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uses_allocator.h new file mode 100644 index 0000000..2e18620 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__memory/uses_allocator.h
@@ -0,0 +1,60 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___MEMORY_USES_ALLOCATOR_H +#define _LIBCPP___MEMORY_USES_ALLOCATOR_H + +#include <__config> +#include <cstddef> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +struct __has_allocator_type +{ +private: + struct __two {char __lx; char __lxx;}; + template <class _Up> static __two __test(...); + template <class _Up> static char __test(typename _Up::allocator_type* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; + +template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value> +struct __uses_allocator + : public integral_constant<bool, + is_convertible<_Alloc, typename _Tp::allocator_type>::value> +{ +}; + +template <class _Tp, class _Alloc> +struct __uses_allocator<_Tp, _Alloc, false> + : public false_type +{ +}; + +template <class _Tp, class _Alloc> +struct _LIBCPP_TEMPLATE_VIS uses_allocator + : public __uses_allocator<_Tp, _Alloc> +{ +}; + +#if _LIBCPP_STD_VER > 14 +template <class _Tp, class _Alloc> +inline constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___MEMORY_USES_ALLOCATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mutex_base b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mutex_base index c54a019..da29671 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mutex_base +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__mutex_base
@@ -11,10 +11,9 @@ #define _LIBCPP___MUTEX_BASE #include <__config> +#include <__threading_support> #include <chrono> #include <system_error> -#include <__threading_support> - #include <time.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) @@ -69,9 +68,9 @@ #else -/* _LIBCPP_INLINE_VAR */ constexpr defer_lock_t defer_lock = defer_lock_t(); -/* _LIBCPP_INLINE_VAR */ constexpr try_to_lock_t try_to_lock = try_to_lock_t(); -/* _LIBCPP_INLINE_VAR */ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); +/* inline */ constexpr defer_lock_t defer_lock = defer_lock_t(); +/* inline */ constexpr try_to_lock_t try_to_lock = try_to_lock_t(); +/* inline */ constexpr adopt_lock_t adopt_lock = adopt_lock_t(); #endif @@ -97,8 +96,8 @@ ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();} private: - lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE; - lock_guard& operator=(lock_guard const&) _LIBCPP_EQUAL_DELETE; + lock_guard(lock_guard const&) = delete; + lock_guard& operator=(lock_guard const&) = delete; }; template <class _Mutex> @@ -190,8 +189,7 @@ _LIBCPP_INLINE_VISIBILITY bool owns_lock() const _NOEXCEPT {return __owns_;} _LIBCPP_INLINE_VISIBILITY - _LIBCPP_EXPLICIT - operator bool () const _NOEXCEPT {return __owns_;} + explicit operator bool() const _NOEXCEPT {return __owns_;} _LIBCPP_INLINE_VISIBILITY mutex_type* mutex() const _NOEXCEPT {return __m_;} }; @@ -379,12 +377,12 @@ using __ratio = ratio_divide<_Period, nano>; using __ns_rep = nanoseconds::rep; - __ns_rep __result_max = std::numeric_limits<__ns_rep>::max(); + __ns_rep __result_max = numeric_limits<__ns_rep>::max(); if (__d.count() > 0 && __d.count() > __result_max / __ratio::num) { return nanoseconds::max(); } - __ns_rep __result_min = std::numeric_limits<__ns_rep>::min(); + __ns_rep __result_min = numeric_limits<__ns_rep>::min(); if (__d.count() < 0 && __d.count() < __result_min / __ratio::num) { return nanoseconds::min(); } @@ -418,7 +416,7 @@ if (__t <= __now) return cv_status::timeout; - __clock_tp_ns __t_ns = __clock_tp_ns(__safe_nanosecond_cast(__t.time_since_epoch())); + __clock_tp_ns __t_ns = __clock_tp_ns(_VSTD::__safe_nanosecond_cast(__t.time_since_epoch())); __do_timed_wait(__lk, __t_ns); return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout; @@ -451,13 +449,13 @@ #if defined(_LIBCPP_HAS_COND_CLOCKWAIT) using __clock_tp_ns = time_point<steady_clock, nanoseconds>; - __ns_rep __now_count_ns = __safe_nanosecond_cast(__c_now.time_since_epoch()).count(); + __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(__c_now.time_since_epoch()).count(); #else using __clock_tp_ns = time_point<system_clock, nanoseconds>; - __ns_rep __now_count_ns = __safe_nanosecond_cast(system_clock::now().time_since_epoch()).count(); + __ns_rep __now_count_ns = _VSTD::__safe_nanosecond_cast(system_clock::now().time_since_epoch()).count(); #endif - __ns_rep __d_ns_count = __safe_nanosecond_cast(__d).count(); + __ns_rep __d_ns_count = _VSTD::__safe_nanosecond_cast(__d).count(); if (__now_count_ns > numeric_limits<__ns_rep>::max() - __d_ns_count) { __do_timed_wait(__lk, __clock_tp_ns::max()); @@ -526,4 +524,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP___MUTEX_BASE +#endif // _LIBCPP___MUTEX_BASE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__node_handle b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__node_handle index be1fe17..f313409 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__node_handle +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__node_handle
@@ -10,7 +10,56 @@ #ifndef _LIBCPP___NODE_HANDLE #define _LIBCPP___NODE_HANDLE +/* + +template<unspecified> +class node-handle { +public: + using value_type = see below; // not present for map containers + using key_type = see below; // not present for set containers + using mapped_type = see below; // not present for set containers + using allocator_type = see below; + +private: + using container_node_type = unspecified; // exposition only + using ator_traits = allocator_traits<allocator_type>; // exposition only + + typename ator_traits::template + rebind_traits<container_node_type>::pointer ptr_; // exposition only + optional<allocator_type> alloc_; // exposition only + +public: + // [container.node.cons], constructors, copy, and assignment + constexpr node-handle() noexcept : ptr_(), alloc_() {} + node-handle(node-handle&&) noexcept; + node-handle& operator=(node-handle&&); + + // [container.node.dtor], destructor + ~node-handle(); + + // [container.node.observers], observers + value_type& value() const; // not present for map containers + key_type& key() const; // not present for set containers + mapped_type& mapped() const; // not present for set containers + + allocator_type get_allocator() const; + explicit operator bool() const noexcept; + [[nodiscard]] bool empty() const noexcept; // nodiscard since C++20 + + // [container.node.modifiers], modifiers + void swap(node-handle&) + noexcept(ator_traits::propagate_on_container_swap::value || + ator_traits::is_always_equal::value); + + friend void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) { + x.swap(y); + } +}; + +*/ + #include <__config> +#include <__debug> #include <memory> #include <optional> @@ -18,9 +67,6 @@ #pragma GCC system_header #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER > 14 @@ -203,6 +249,5 @@ #endif // _LIBCPP_STD_VER > 14 _LIBCPP_END_NAMESPACE_STD -_LIBCPP_POP_MACROS -#endif +#endif // _LIBCPP___NODE_HANDLE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__nullptr b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__nullptr index 45529a7..d02be21 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__nullptr +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__nullptr
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- __nullptr --------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -56,6 +56,6 @@ typedef decltype(nullptr) nullptr_t; } -#endif // _LIBCPP_HAS_NO_NULLPTR +#endif // _LIBCPP_HAS_NO_NULLPTR -#endif // _LIBCPP_NULLPTR +#endif // _LIBCPP_NULLPTR
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/bernoulli_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/bernoulli_distribution.h new file mode 100644 index 0000000..60ae5ea --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/bernoulli_distribution.h
@@ -0,0 +1,143 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H +#define _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <iosfwd> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +class _LIBCPP_TEMPLATE_VIS bernoulli_distribution +{ +public: + // types + typedef bool result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + double __p_; + public: + typedef bernoulli_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(double __p = 0.5) : __p_(__p) {} + + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + bernoulli_distribution() : bernoulli_distribution(0.5) {} + _LIBCPP_INLINE_VISIBILITY + explicit bernoulli_distribution(double __p) : __p_(param_type(__p)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit bernoulli_distribution(double __p = 0.5) : __p_(param_type(__p)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit bernoulli_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_.p();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return false;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return true;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const bernoulli_distribution& __x, + const bernoulli_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const bernoulli_distribution& __x, + const bernoulli_distribution& __y) + {return !(__x == __y);} +}; + +template<class _URNG> +inline +bernoulli_distribution::result_type +bernoulli_distribution::operator()(_URNG& __g, const param_type& __p) +{ + uniform_real_distribution<double> __gen; + return __gen(__g) < __p.p(); +} + +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.p(); +} + +template <class _CharT, class _Traits> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x) +{ + typedef bernoulli_distribution _Eng; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + double __p; + __is >> __p; + if (!__is.fail()) + __x.param(param_type(__p)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/binomial_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/binomial_distribution.h new file mode 100644 index 0000000..9662de8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/binomial_distribution.h
@@ -0,0 +1,225 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _IntType = int> +class _LIBCPP_TEMPLATE_VIS binomial_distribution +{ +public: + // types + typedef _IntType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __t_; + double __p_; + double __pr_; + double __odds_ratio_; + result_type __r0_; + public: + typedef binomial_distribution distribution_type; + + explicit param_type(result_type __t = 1, double __p = 0.5); + + _LIBCPP_INLINE_VISIBILITY + result_type t() const {return __t_;} + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__t_ == __y.__t_ && __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + + friend class binomial_distribution; + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + binomial_distribution() : binomial_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit binomial_distribution(result_type __t, double __p = 0.5) + : __p_(param_type(__t, __p)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit binomial_distribution(result_type __t = 1, double __p = 0.5) + : __p_(param_type(__t, __p)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit binomial_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type t() const {return __p_.t();} + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_.p();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return t();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const binomial_distribution& __x, + const binomial_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const binomial_distribution& __x, + const binomial_distribution& __y) + {return !(__x == __y);} +}; + +#ifndef _LIBCPP_MSVCRT_LIKE +extern "C" double lgamma_r(double, int *); +#endif + +inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) { +#if defined(_LIBCPP_MSVCRT_LIKE) + return lgamma(__d); +#else + int __sign; + return lgamma_r(__d, &__sign); +#endif +} + +template<class _IntType> +binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p) + : __t_(__t), __p_(__p) +{ + if (0 < __p_ && __p_ < 1) + { + __r0_ = static_cast<result_type>((__t_ + 1) * __p_); + __pr_ = _VSTD::exp(__libcpp_lgamma(__t_ + 1.) - + __libcpp_lgamma(__r0_ + 1.) - + __libcpp_lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) + + (__t_ - __r0_) * _VSTD::log(1 - __p_)); + __odds_ratio_ = __p_ / (1 - __p_); + } +} + +// Reference: Kemp, C.D. (1986). `A modal method for generating binomial +// variables', Commun. Statist. - Theor. Meth. 15(3), 805-813. +template<class _IntType> +template<class _URNG> +_IntType +binomial_distribution<_IntType>::operator()(_URNG& __g, const param_type& __pr) +{ + if (__pr.__t_ == 0 || __pr.__p_ == 0) + return 0; + if (__pr.__p_ == 1) + return __pr.__t_; + uniform_real_distribution<double> __gen; + double __u = __gen(__g) - __pr.__pr_; + if (__u < 0) + return __pr.__r0_; + double __pu = __pr.__pr_; + double __pd = __pu; + result_type __ru = __pr.__r0_; + result_type __rd = __ru; + while (true) + { + bool __break = true; + if (__rd >= 1) + { + __pd *= __rd / (__pr.__odds_ratio_ * (__pr.__t_ - __rd + 1)); + __u -= __pd; + __break = false; + if (__u < 0) + return __rd - 1; + } + if ( __rd != 0 ) + --__rd; + ++__ru; + if (__ru <= __pr.__t_) + { + __pu *= (__pr.__t_ - __ru + 1) * __pr.__odds_ratio_ / __ru; + __u -= __pu; + __break = false; + if (__u < 0) + return __ru; + } + if (__break) + return 0; + } +} + +template <class _CharT, class _Traits, class _IntType> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const binomial_distribution<_IntType>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.t() << __sp << __x.p(); +} + +template <class _CharT, class _Traits, class _IntType> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + binomial_distribution<_IntType>& __x) +{ + typedef binomial_distribution<_IntType> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __t; + double __p; + __is >> __t >> __p; + if (!__is.fail()) + __x.param(param_type(__t, __p)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/cauchy_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/cauchy_distribution.h new file mode 100644 index 0000000..6661e00 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/cauchy_distribution.h
@@ -0,0 +1,162 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H +#define _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS cauchy_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __a_; + result_type __b_; + public: + typedef cauchy_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __a = 0, result_type __b = 1) + : __a_(__a), __b_(__b) {} + + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __a_;} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __b_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + cauchy_distribution() : cauchy_distribution(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit cauchy_distribution(result_type __a, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit cauchy_distribution(result_type __a = 0, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit cauchy_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __p_.a();} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __p_.b();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return -numeric_limits<result_type>::infinity();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const cauchy_distribution& __x, + const cauchy_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const cauchy_distribution& __x, + const cauchy_distribution& __y) + {return !(__x == __y);} +}; + +template <class _RealType> +template<class _URNG> +inline +_RealType +cauchy_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + uniform_real_distribution<result_type> __gen; + // purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite + return __p.a() + __p.b() * _VSTD::tan(3.1415926535897932384626433832795 * __gen(__g)); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const cauchy_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.a() << __sp << __x.b(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + cauchy_distribution<_RT>& __x) +{ + typedef cauchy_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __a; + result_type __b; + __is >> __a >> __b; + if (!__is.fail()) + __x.param(param_type(__a, __b)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/chi_squared_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/chi_squared_distribution.h new file mode 100644 index 0000000..9cf3897 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/chi_squared_distribution.h
@@ -0,0 +1,144 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H +#define _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H + +#include <__config> +#include <__random/gamma_distribution.h> +#include <limits> +#include <iosfwd> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS chi_squared_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __n_; + public: + typedef chi_squared_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __n = 1) : __n_(__n) {} + + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __n_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__n_ == __y.__n_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + chi_squared_distribution() : chi_squared_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit chi_squared_distribution(result_type __n) + : __p_(param_type(__n)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit chi_squared_distribution(result_type __n = 1) + : __p_(param_type(__n)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit chi_squared_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g, const param_type& __p) + {return gamma_distribution<result_type>(__p.n() / 2, 2)(__g);} + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __p_.n();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const chi_squared_distribution& __x, + const chi_squared_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const chi_squared_distribution& __x, + const chi_squared_distribution& __y) + {return !(__x == __y);} +}; + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const chi_squared_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + __os << __x.n(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + chi_squared_distribution<_RT>& __x) +{ + typedef chi_squared_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __n; + __is >> __n; + if (!__is.fail()) + __x.param(param_type(__n)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/default_random_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/default_random_engine.h new file mode 100644 index 0000000..61c5cf9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/default_random_engine.h
@@ -0,0 +1,25 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H +#define _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H + +#include <__config> +#include <__random/linear_congruential_engine.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +typedef minstd_rand default_random_engine; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discard_block_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discard_block_engine.h new file mode 100644 index 0000000..3357152 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discard_block_engine.h
@@ -0,0 +1,203 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H +#define _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H + +#include <__config> +#include <__random/is_seed_sequence.h> +#include <__utility/move.h> +#include <climits> +#include <iosfwd> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Engine, size_t __p, size_t __r> +class _LIBCPP_TEMPLATE_VIS discard_block_engine +{ + _Engine __e_; + int __n_; + + static_assert( 0 < __r, "discard_block_engine invalid parameters"); + static_assert(__r <= __p, "discard_block_engine invalid parameters"); + static_assert(__r <= INT_MAX, "discard_block_engine invalid parameters"); +public: + // types + typedef typename _Engine::result_type result_type; + + // engine characteristics + static _LIBCPP_CONSTEXPR const size_t block_size = __p; + static _LIBCPP_CONSTEXPR const size_t used_block = __r; + +#ifdef _LIBCPP_CXX03_LANG + static const result_type _Min = _Engine::_Min; + static const result_type _Max = _Engine::_Max; +#else + static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min(); + static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max(); +#endif + + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); } + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); } + + // constructors and seeding functions + _LIBCPP_INLINE_VISIBILITY + discard_block_engine() : __n_(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit discard_block_engine(const _Engine& __e) + : __e_(__e), __n_(0) {} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit discard_block_engine(_Engine&& __e) + : __e_(_VSTD::move(__e)), __n_(0) {} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit discard_block_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value && + !is_convertible<_Sseq, _Engine>::value>::type* = 0) + : __e_(__q), __n_(0) {} + _LIBCPP_INLINE_VISIBILITY + void seed() {__e_.seed(); __n_ = 0;} + _LIBCPP_INLINE_VISIBILITY + void seed(result_type __sd) {__e_.seed(__sd); __n_ = 0;} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, discard_block_engine>::value, + void + >::type + seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;} + + // generating functions + result_type operator()(); + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + // property functions + _LIBCPP_INLINE_VISIBILITY + const _Engine& base() const _NOEXCEPT {return __e_;} + + template<class _Eng, size_t _Pp, size_t _Rp> + friend + bool + operator==( + const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y); + + template<class _Eng, size_t _Pp, size_t _Rp> + friend + bool + operator!=( + const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y); + + template <class _CharT, class _Traits, + class _Eng, size_t _Pp, size_t _Rp> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const discard_block_engine<_Eng, _Pp, _Rp>& __x); + + template <class _CharT, class _Traits, + class _Eng, size_t _Pp, size_t _Rp> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + discard_block_engine<_Eng, _Pp, _Rp>& __x); +}; + +template<class _Engine, size_t __p, size_t __r> + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size; + +template<class _Engine, size_t __p, size_t __r> + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block; + +template<class _Engine, size_t __p, size_t __r> +typename discard_block_engine<_Engine, __p, __r>::result_type +discard_block_engine<_Engine, __p, __r>::operator()() +{ + if (__n_ >= static_cast<int>(__r)) + { + __e_.discard(__p - __r); + __n_ = 0; + } + ++__n_; + return __e_(); +} + +template<class _Eng, size_t _Pp, size_t _Rp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==(const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y) +{ + return __x.__n_ == __y.__n_ && __x.__e_ == __y.__e_; +} + +template<class _Eng, size_t _Pp, size_t _Rp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const discard_block_engine<_Eng, _Pp, _Rp>& __x, + const discard_block_engine<_Eng, _Pp, _Rp>& __y) +{ + return !(__x == __y); +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Pp, size_t _Rp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const discard_block_engine<_Eng, _Pp, _Rp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.__e_ << __sp << __x.__n_; +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Pp, size_t _Rp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + discard_block_engine<_Eng, _Pp, _Rp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + _Eng __e; + int __n; + __is >> __e >> __n; + if (!__is.fail()) + { + __x.__e_ = __e; + __x.__n_ = __n; + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discrete_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discrete_distribution.h new file mode 100644 index 0000000..dc9881a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/discrete_distribution.h
@@ -0,0 +1,260 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H +#define _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H + +#include <__algorithm/upper_bound.h> +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <cstddef> +#include <iosfwd> +#include <numeric> +#include <vector> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _IntType = int> +class _LIBCPP_TEMPLATE_VIS discrete_distribution +{ +public: + // types + typedef _IntType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + vector<double> __p_; + public: + typedef discrete_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + param_type() {} + template<class _InputIterator> + _LIBCPP_INLINE_VISIBILITY + param_type(_InputIterator __f, _InputIterator __l) + : __p_(__f, __l) {__init();} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + param_type(initializer_list<double> __wl) + : __p_(__wl.begin(), __wl.end()) {__init();} +#endif // _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + param_type(size_t __nw, double __xmin, double __xmax, + _UnaryOperation __fw); + + vector<double> probabilities() const; + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + + private: + void __init(); + + friend class discrete_distribution; + + template <class _CharT, class _Traits, class _IT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const discrete_distribution<_IT>& __x); + + template <class _CharT, class _Traits, class _IT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + discrete_distribution<_IT>& __x); + }; + +private: + param_type __p_; + +public: + // constructor and reset functions + _LIBCPP_INLINE_VISIBILITY + discrete_distribution() {} + template<class _InputIterator> + _LIBCPP_INLINE_VISIBILITY + discrete_distribution(_InputIterator __f, _InputIterator __l) + : __p_(__f, __l) {} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + discrete_distribution(initializer_list<double> __wl) + : __p_(__wl) {} +#endif // _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + _LIBCPP_INLINE_VISIBILITY + discrete_distribution(size_t __nw, double __xmin, double __xmax, + _UnaryOperation __fw) + : __p_(__nw, __xmin, __xmax, __fw) {} + _LIBCPP_INLINE_VISIBILITY + explicit discrete_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + vector<double> probabilities() const {return __p_.probabilities();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return __p_.__p_.size();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const discrete_distribution& __x, + const discrete_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const discrete_distribution& __x, + const discrete_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _IT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const discrete_distribution<_IT>& __x); + + template <class _CharT, class _Traits, class _IT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + discrete_distribution<_IT>& __x); +}; + +template<class _IntType> +template<class _UnaryOperation> +discrete_distribution<_IntType>::param_type::param_type(size_t __nw, + double __xmin, + double __xmax, + _UnaryOperation __fw) +{ + if (__nw > 1) + { + __p_.reserve(__nw - 1); + double __d = (__xmax - __xmin) / __nw; + double __d2 = __d / 2; + for (size_t __k = 0; __k < __nw; ++__k) + __p_.push_back(__fw(__xmin + __k * __d + __d2)); + __init(); + } +} + +template<class _IntType> +void +discrete_distribution<_IntType>::param_type::__init() +{ + if (!__p_.empty()) + { + if (__p_.size() > 1) + { + double __s = _VSTD::accumulate(__p_.begin(), __p_.end(), 0.0); + for (vector<double>::iterator __i = __p_.begin(), __e = __p_.end(); __i < __e; ++__i) + *__i /= __s; + vector<double> __t(__p_.size() - 1); + _VSTD::partial_sum(__p_.begin(), __p_.end() - 1, __t.begin()); + swap(__p_, __t); + } + else + { + __p_.clear(); + __p_.shrink_to_fit(); + } + } +} + +template<class _IntType> +vector<double> +discrete_distribution<_IntType>::param_type::probabilities() const +{ + size_t __n = __p_.size(); + vector<double> __p(__n+1); + _VSTD::adjacent_difference(__p_.begin(), __p_.end(), __p.begin()); + if (__n > 0) + __p[__n] = 1 - __p_[__n-1]; + else + __p[0] = 1; + return __p; +} + +template<class _IntType> +template<class _URNG> +_IntType +discrete_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p) +{ + uniform_real_distribution<double> __gen; + return static_cast<_IntType>( + _VSTD::upper_bound(__p.__p_.begin(), __p.__p_.end(), __gen(__g)) - + __p.__p_.begin()); +} + +template <class _CharT, class _Traits, class _IT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const discrete_distribution<_IT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + size_t __n = __x.__p_.__p_.size(); + __os << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__p_[__i]; + return __os; +} + +template <class _CharT, class _Traits, class _IT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + discrete_distribution<_IT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + size_t __n; + __is >> __n; + vector<double> __p(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __p[__i]; + if (!__is.fail()) + swap(__x.__p_.__p_, __p); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/exponential_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/exponential_distribution.h new file mode 100644 index 0000000..9e555f0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/exponential_distribution.h
@@ -0,0 +1,155 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H + +#include <__config> +#include <__random/generate_canonical.h> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS exponential_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __lambda_; + public: + typedef exponential_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __lambda = 1) : __lambda_(__lambda) {} + + _LIBCPP_INLINE_VISIBILITY + result_type lambda() const {return __lambda_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__lambda_ == __y.__lambda_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + exponential_distribution() : exponential_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit exponential_distribution(result_type __lambda) + : __p_(param_type(__lambda)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit exponential_distribution(result_type __lambda = 1) + : __p_(param_type(__lambda)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit exponential_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type lambda() const {return __p_.lambda();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const exponential_distribution& __x, + const exponential_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const exponential_distribution& __x, + const exponential_distribution& __y) + {return !(__x == __y);} +}; + +template <class _RealType> +template<class _URNG> +_RealType +exponential_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + return -_VSTD::log + ( + result_type(1) - + _VSTD::generate_canonical<result_type, + numeric_limits<result_type>::digits>(__g) + ) + / __p.lambda(); +} + +template <class _CharT, class _Traits, class _RealType> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const exponential_distribution<_RealType>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + return __os << __x.lambda(); +} + +template <class _CharT, class _Traits, class _RealType> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + exponential_distribution<_RealType>& __x) +{ + typedef exponential_distribution<_RealType> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __lambda; + __is >> __lambda; + if (!__is.fail()) + __x.param(param_type(__lambda)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/extreme_value_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/extreme_value_distribution.h new file mode 100644 index 0000000..0e200f9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/extreme_value_distribution.h
@@ -0,0 +1,161 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H +#define _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS extreme_value_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __a_; + result_type __b_; + public: + typedef extreme_value_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __a = 0, result_type __b = 1) + : __a_(__a), __b_(__b) {} + + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __a_;} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __b_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + extreme_value_distribution() : extreme_value_distribution(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit extreme_value_distribution(result_type __a, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit extreme_value_distribution(result_type __a = 0, + result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit extreme_value_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __p_.a();} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __p_.b();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return -numeric_limits<result_type>::infinity();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const extreme_value_distribution& __x, + const extreme_value_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const extreme_value_distribution& __x, + const extreme_value_distribution& __y) + {return !(__x == __y);} +}; + +template<class _RealType> +template<class _URNG> +_RealType +extreme_value_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + return __p.a() - __p.b() * + _VSTD::log(-_VSTD::log(1-uniform_real_distribution<result_type>()(__g))); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const extreme_value_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.a() << __sp << __x.b(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + extreme_value_distribution<_RT>& __x) +{ + typedef extreme_value_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __a; + result_type __b; + __is >> __a >> __b; + if (!__is.fail()) + __x.param(param_type(__a, __b)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/fisher_f_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/fisher_f_distribution.h new file mode 100644 index 0000000..bf64d33 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/fisher_f_distribution.h
@@ -0,0 +1,160 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H +#define _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H + +#include <__config> +#include <__random/gamma_distribution.h> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS fisher_f_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __m_; + result_type __n_; + public: + typedef fisher_f_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __m = 1, result_type __n = 1) + : __m_(__m), __n_(__n) {} + + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __m_;} + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __n_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + fisher_f_distribution() : fisher_f_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit fisher_f_distribution(result_type __m, result_type __n = 1) + : __p_(param_type(__m, __n)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit fisher_f_distribution(result_type __m = 1, result_type __n = 1) + : __p_(param_type(__m, __n)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit fisher_f_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __p_.m();} + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __p_.n();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const fisher_f_distribution& __x, + const fisher_f_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const fisher_f_distribution& __x, + const fisher_f_distribution& __y) + {return !(__x == __y);} +}; + +template <class _RealType> +template<class _URNG> +_RealType +fisher_f_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + gamma_distribution<result_type> __gdm(__p.m() * result_type(.5)); + gamma_distribution<result_type> __gdn(__p.n() * result_type(.5)); + return __p.n() * __gdm(__g) / (__p.m() * __gdn(__g)); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const fisher_f_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.m() << __sp << __x.n(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + fisher_f_distribution<_RT>& __x) +{ + typedef fisher_f_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __m; + result_type __n; + __is >> __m >> __n; + if (!__is.fail()) + __x.param(param_type(__m, __n)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/gamma_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/gamma_distribution.h new file mode 100644 index 0000000..49d024e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/gamma_distribution.h
@@ -0,0 +1,213 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H +#define _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <__random/exponential_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS gamma_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __alpha_; + result_type __beta_; + public: + typedef gamma_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __alpha = 1, result_type __beta = 1) + : __alpha_(__alpha), __beta_(__beta) {} + + _LIBCPP_INLINE_VISIBILITY + result_type alpha() const {return __alpha_;} + _LIBCPP_INLINE_VISIBILITY + result_type beta() const {return __beta_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__alpha_ == __y.__alpha_ && __x.__beta_ == __y.__beta_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + gamma_distribution() : gamma_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit gamma_distribution(result_type __alpha, result_type __beta = 1) + : __p_(param_type(__alpha, __beta)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit gamma_distribution(result_type __alpha = 1, + result_type __beta = 1) + : __p_(param_type(__alpha, __beta)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit gamma_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type alpha() const {return __p_.alpha();} + _LIBCPP_INLINE_VISIBILITY + result_type beta() const {return __p_.beta();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const gamma_distribution& __x, + const gamma_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const gamma_distribution& __x, + const gamma_distribution& __y) + {return !(__x == __y);} +}; + +template <class _RealType> +template<class _URNG> +_RealType +gamma_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + result_type __a = __p.alpha(); + uniform_real_distribution<result_type> __gen(0, 1); + exponential_distribution<result_type> __egen; + result_type __x; + if (__a == 1) + __x = __egen(__g); + else if (__a > 1) + { + const result_type __b = __a - 1; + const result_type __c = 3 * __a - result_type(0.75); + while (true) + { + const result_type __u = __gen(__g); + const result_type __v = __gen(__g); + const result_type __w = __u * (1 - __u); + if (__w != 0) + { + const result_type __y = _VSTD::sqrt(__c / __w) * + (__u - result_type(0.5)); + __x = __b + __y; + if (__x >= 0) + { + const result_type __z = 64 * __w * __w * __w * __v * __v; + if (__z <= 1 - 2 * __y * __y / __x) + break; + if (_VSTD::log(__z) <= 2 * (__b * _VSTD::log(__x / __b) - __y)) + break; + } + } + } + } + else // __a < 1 + { + while (true) + { + const result_type __u = __gen(__g); + const result_type __es = __egen(__g); + if (__u <= 1 - __a) + { + __x = _VSTD::pow(__u, 1 / __a); + if (__x <= __es) + break; + } + else + { + const result_type __e = -_VSTD::log((1-__u)/__a); + __x = _VSTD::pow(1 - __a + __a * __e, 1 / __a); + if (__x <= __e + __es) + break; + } + } + } + return __x * __p.beta(); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const gamma_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.alpha() << __sp << __x.beta(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + gamma_distribution<_RT>& __x) +{ + typedef gamma_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __alpha; + result_type __beta; + __is >> __alpha >> __beta; + if (!__is.fail()) + __x.param(param_type(__alpha, __beta)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/generate_canonical.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/generate_canonical.h new file mode 100644 index 0000000..46c3b29 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/generate_canonical.h
@@ -0,0 +1,53 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_GENERATE_CANONICAL_H +#define _LIBCPP___RANDOM_GENERATE_CANONICAL_H + +#include <__config> +#include <__random/log2.h> +#include <cstdint> +#include <initializer_list> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +// generate_canonical + +template<class _RealType, size_t __bits, class _URNG> +_RealType +generate_canonical(_URNG& __g) +{ + const size_t _Dt = numeric_limits<_RealType>::digits; + const size_t __b = _Dt < __bits ? _Dt : __bits; +#ifdef _LIBCPP_CXX03_LANG + const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value; +#else + const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value; +#endif + const size_t __k = __b / __logR + (__b % __logR != 0) + (__b == 0); + const _RealType _Rp = static_cast<_RealType>(_URNG::max() - _URNG::min()) + _RealType(1); + _RealType __base = _Rp; + _RealType _Sp = __g() - _URNG::min(); + for (size_t __i = 1; __i < __k; ++__i, __base *= _Rp) + _Sp += (__g() - _URNG::min()) * __base; + return _Sp / __base; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_GENERATE_CANONICAL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/geometric_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/geometric_distribution.h new file mode 100644 index 0000000..174914e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/geometric_distribution.h
@@ -0,0 +1,141 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H +#define _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H + +#include <__config> +#include <__random/negative_binomial_distribution.h> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _IntType = int> +class _LIBCPP_TEMPLATE_VIS geometric_distribution +{ +public: + // types + typedef _IntType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + double __p_; + public: + typedef geometric_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(double __p = 0.5) : __p_(__p) {} + + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + geometric_distribution() : geometric_distribution(0.5) {} + _LIBCPP_INLINE_VISIBILITY + explicit geometric_distribution(double __p) + : __p_(__p) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit geometric_distribution(double __p = 0.5) + : __p_(__p) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit geometric_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g, const param_type& __p) + {return negative_binomial_distribution<result_type>(1, __p.p())(__g);} + + // property functions + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_.p();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::max();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const geometric_distribution& __x, + const geometric_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const geometric_distribution& __x, + const geometric_distribution& __y) + {return !(__x == __y);} +}; + +template <class _CharT, class _Traits, class _IntType> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const geometric_distribution<_IntType>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + return __os << __x.p(); +} + +template <class _CharT, class _Traits, class _IntType> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + geometric_distribution<_IntType>& __x) +{ + typedef geometric_distribution<_IntType> _Eng; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + double __p; + __is >> __p; + if (!__is.fail()) + __x.param(param_type(__p)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/independent_bits_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/independent_bits_engine.h new file mode 100644 index 0000000..f0e8c65 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/independent_bits_engine.h
@@ -0,0 +1,271 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H +#define _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H + +#include <__config> +#include <__random/is_seed_sequence.h> +#include <__random/log2.h> +#include <__utility/move.h> +#include <iosfwd> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Engine, size_t __w, class _UIntType> +class _LIBCPP_TEMPLATE_VIS independent_bits_engine +{ + template <class _UInt, _UInt _R0, size_t _Wp, size_t _Mp> + class __get_n + { + static _LIBCPP_CONSTEXPR const size_t _Dt = numeric_limits<_UInt>::digits; + static _LIBCPP_CONSTEXPR const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0); + static _LIBCPP_CONSTEXPR const size_t _W0 = _Wp / _Np; + static _LIBCPP_CONSTEXPR const _UInt _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0; + public: + static _LIBCPP_CONSTEXPR const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np; + }; +public: + // types + typedef _UIntType result_type; + +private: + _Engine __e_; + + static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits; + static_assert( 0 < __w, "independent_bits_engine invalid parameters"); + static_assert(__w <= _Dt, "independent_bits_engine invalid parameters"); + + typedef typename _Engine::result_type _Engine_result_type; + typedef typename conditional + < + sizeof(_Engine_result_type) <= sizeof(result_type), + result_type, + _Engine_result_type + >::type _Working_result_type; +#ifdef _LIBCPP_CXX03_LANG + static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + + _Working_result_type(1); +#else + static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min() + + _Working_result_type(1); +#endif + static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value; + static _LIBCPP_CONSTEXPR const size_t __n = __get_n<_Working_result_type, _Rp, __w, __m>::value; + static _LIBCPP_CONSTEXPR const size_t __w0 = __w / __n; + static _LIBCPP_CONSTEXPR const size_t __n0 = __n - __w % __n; + static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits; + static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits; + static _LIBCPP_CONSTEXPR const _Working_result_type __y0 = __w0 >= _WDt ? 0 : + (_Rp >> __w0) << __w0; + static _LIBCPP_CONSTEXPR const _Working_result_type __y1 = __w0 >= _WDt - 1 ? 0 : + (_Rp >> (__w0+1)) << (__w0+1); + static _LIBCPP_CONSTEXPR const _Engine_result_type __mask0 = __w0 > 0 ? + _Engine_result_type(~0) >> (_EDt - __w0) : + _Engine_result_type(0); + static _LIBCPP_CONSTEXPR const _Engine_result_type __mask1 = __w0 < _EDt - 1 ? + _Engine_result_type(~0) >> (_EDt - (__w0 + 1)) : + _Engine_result_type(~0); +public: + static _LIBCPP_CONSTEXPR const result_type _Min = 0; + static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) : + (result_type(1) << __w) - result_type(1); + static_assert(_Min < _Max, "independent_bits_engine invalid parameters"); + + // engine characteristics + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Min; } + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Max; } + + // constructors and seeding functions + _LIBCPP_INLINE_VISIBILITY + independent_bits_engine() {} + _LIBCPP_INLINE_VISIBILITY + explicit independent_bits_engine(const _Engine& __e) + : __e_(__e) {} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit independent_bits_engine(_Engine&& __e) + : __e_(_VSTD::move(__e)) {} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit independent_bits_engine(result_type __sd) : __e_(__sd) {} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit independent_bits_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value && + !is_convertible<_Sseq, _Engine>::value>::type* = 0) + : __e_(__q) {} + _LIBCPP_INLINE_VISIBILITY + void seed() {__e_.seed();} + _LIBCPP_INLINE_VISIBILITY + void seed(result_type __sd) {__e_.seed(__sd);} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, independent_bits_engine>::value, + void + >::type + seed(_Sseq& __q) {__e_.seed(__q);} + + // generating functions + _LIBCPP_INLINE_VISIBILITY + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + // property functions + _LIBCPP_INLINE_VISIBILITY + const _Engine& base() const _NOEXCEPT {return __e_;} + + template<class _Eng, size_t _Wp, class _UInt> + friend + bool + operator==( + const independent_bits_engine<_Eng, _Wp, _UInt>& __x, + const independent_bits_engine<_Eng, _Wp, _UInt>& __y); + + template<class _Eng, size_t _Wp, class _UInt> + friend + bool + operator!=( + const independent_bits_engine<_Eng, _Wp, _UInt>& __x, + const independent_bits_engine<_Eng, _Wp, _UInt>& __y); + + template <class _CharT, class _Traits, + class _Eng, size_t _Wp, class _UInt> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const independent_bits_engine<_Eng, _Wp, _UInt>& __x); + + template <class _CharT, class _Traits, + class _Eng, size_t _Wp, class _UInt> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + independent_bits_engine<_Eng, _Wp, _UInt>& __x); + +private: + _LIBCPP_INLINE_VISIBILITY + result_type __eval(false_type); + result_type __eval(true_type); + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + __count < _Dt, + result_type + >::type + __lshift(result_type __x) {return __x << __count;} + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + (__count >= _Dt), + result_type + >::type + __lshift(result_type) {return result_type(0);} +}; + +template<class _Engine, size_t __w, class _UIntType> +inline +_UIntType +independent_bits_engine<_Engine, __w, _UIntType>::__eval(false_type) +{ + return static_cast<result_type>(__e_() & __mask0); +} + +template<class _Engine, size_t __w, class _UIntType> +_UIntType +independent_bits_engine<_Engine, __w, _UIntType>::__eval(true_type) +{ + result_type _Sp = 0; + for (size_t __k = 0; __k < __n0; ++__k) + { + _Engine_result_type __u; + do + { + __u = __e_() - _Engine::min(); + } while (__u >= __y0); + _Sp = static_cast<result_type>(__lshift<__w0>(_Sp) + (__u & __mask0)); + } + for (size_t __k = __n0; __k < __n; ++__k) + { + _Engine_result_type __u; + do + { + __u = __e_() - _Engine::min(); + } while (__u >= __y1); + _Sp = static_cast<result_type>(__lshift<__w0+1>(_Sp) + (__u & __mask1)); + } + return _Sp; +} + +template<class _Eng, size_t _Wp, class _UInt> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator==( + const independent_bits_engine<_Eng, _Wp, _UInt>& __x, + const independent_bits_engine<_Eng, _Wp, _UInt>& __y) +{ + return __x.base() == __y.base(); +} + +template<class _Eng, size_t _Wp, class _UInt> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=( + const independent_bits_engine<_Eng, _Wp, _UInt>& __x, + const independent_bits_engine<_Eng, _Wp, _UInt>& __y) +{ + return !(__x == __y); +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Wp, class _UInt> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const independent_bits_engine<_Eng, _Wp, _UInt>& __x) +{ + return __os << __x.base(); +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Wp, class _UInt> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + independent_bits_engine<_Eng, _Wp, _UInt>& __x) +{ + _Eng __e; + __is >> __e; + if (!__is.fail()) + __x.__e_ = __e; + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/is_seed_sequence.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/is_seed_sequence.h new file mode 100644 index 0000000..46b1d71 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/is_seed_sequence.h
@@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H +#define _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Sseq, class _Engine> +struct __is_seed_sequence +{ + static _LIBCPP_CONSTEXPR const bool value = + !is_convertible<_Sseq, typename _Engine::result_type>::value && + !is_same<typename remove_cv<_Sseq>::type, _Engine>::value; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/knuth_b.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/knuth_b.h new file mode 100644 index 0000000..ade8538 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/knuth_b.h
@@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_KNUTH_B_H +#define _LIBCPP___RANDOM_KNUTH_B_H + +#include <__config> +#include <__random/linear_congruential_engine.h> +#include <__random/shuffle_order_engine.h> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +typedef shuffle_order_engine<minstd_rand0, 256> knuth_b; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANDOM_KNUTH_B_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/linear_congruential_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/linear_congruential_engine.h new file mode 100644 index 0000000..64c9f58 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/linear_congruential_engine.h
@@ -0,0 +1,398 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H +#define _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H + +#include <__config> +#include <__random/is_seed_sequence.h> +#include <cstdint> +#include <iosfwd> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <unsigned long long __a, unsigned long long __c, + unsigned long long __m, unsigned long long _Mp, + bool _MightOverflow = (__a != 0 && __m != 0 && __m-1 > (_Mp-__c)/__a), + bool _OverflowOK = ((__m | (__m-1)) > __m), // m = 2^n + bool _SchrageOK = (__a != 0 && __m != 0 && __m % __a <= __m / __a)> // r <= q +struct __lce_alg_picker +{ + static_assert(__a != 0 || __m != 0 || !_MightOverflow || _OverflowOK || _SchrageOK, + "The current values of a, c, and m cannot generate a number " + "within bounds of linear_congruential_engine."); + + static _LIBCPP_CONSTEXPR const bool __use_schrage = _MightOverflow && + !_OverflowOK && + _SchrageOK; +}; + +template <unsigned long long __a, unsigned long long __c, + unsigned long long __m, unsigned long long _Mp, + bool _UseSchrage = __lce_alg_picker<__a, __c, __m, _Mp>::__use_schrage> +struct __lce_ta; + +// 64 + +template <unsigned long long __a, unsigned long long __c, unsigned long long __m> +struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), true> +{ + typedef unsigned long long result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + // Schrage's algorithm + const result_type __q = __m / __a; + const result_type __r = __m % __a; + const result_type __t0 = __a * (__x % __q); + const result_type __t1 = __r * (__x / __q); + __x = __t0 + (__t0 < __t1) * __m - __t1; + __x += __c - (__x >= __m - __c) * __m; + return __x; + } +}; + +template <unsigned long long __a, unsigned long long __m> +struct __lce_ta<__a, 0, __m, (unsigned long long)(~0), true> +{ + typedef unsigned long long result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + // Schrage's algorithm + const result_type __q = __m / __a; + const result_type __r = __m % __a; + const result_type __t0 = __a * (__x % __q); + const result_type __t1 = __r * (__x / __q); + __x = __t0 + (__t0 < __t1) * __m - __t1; + return __x; + } +}; + +template <unsigned long long __a, unsigned long long __c, unsigned long long __m> +struct __lce_ta<__a, __c, __m, (unsigned long long)(~0), false> +{ + typedef unsigned long long result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + return (__a * __x + __c) % __m; + } +}; + +template <unsigned long long __a, unsigned long long __c> +struct __lce_ta<__a, __c, 0, (unsigned long long)(~0), false> +{ + typedef unsigned long long result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + return __a * __x + __c; + } +}; + +// 32 + +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), true> +{ + typedef unsigned result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + const result_type __m = static_cast<result_type>(_Mp); + // Schrage's algorithm + const result_type __q = __m / __a; + const result_type __r = __m % __a; + const result_type __t0 = __a * (__x % __q); + const result_type __t1 = __r * (__x / __q); + __x = __t0 + (__t0 < __t1) * __m - __t1; + __x += __c - (__x >= __m - __c) * __m; + return __x; + } +}; + +template <unsigned long long _Ap, unsigned long long _Mp> +struct __lce_ta<_Ap, 0, _Mp, unsigned(~0), true> +{ + typedef unsigned result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + const result_type __a = static_cast<result_type>(_Ap); + const result_type __m = static_cast<result_type>(_Mp); + // Schrage's algorithm + const result_type __q = __m / __a; + const result_type __r = __m % __a; + const result_type __t0 = __a * (__x % __q); + const result_type __t1 = __r * (__x / __q); + __x = __t0 + (__t0 < __t1) * __m - __t1; + return __x; + } +}; + +template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp> +struct __lce_ta<_Ap, _Cp, _Mp, unsigned(~0), false> +{ + typedef unsigned result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + const result_type __m = static_cast<result_type>(_Mp); + return (__a * __x + __c) % __m; + } +}; + +template <unsigned long long _Ap, unsigned long long _Cp> +struct __lce_ta<_Ap, _Cp, 0, unsigned(~0), false> +{ + typedef unsigned result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + const result_type __a = static_cast<result_type>(_Ap); + const result_type __c = static_cast<result_type>(_Cp); + return __a * __x + __c; + } +}; + +// 16 + +template <unsigned long long __a, unsigned long long __c, unsigned long long __m, bool __b> +struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b> +{ + typedef unsigned short result_type; + _LIBCPP_INLINE_VISIBILITY + static result_type next(result_type __x) + { + return static_cast<result_type>(__lce_ta<__a, __c, __m, unsigned(~0)>::next(__x)); + } +}; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +class _LIBCPP_TEMPLATE_VIS linear_congruential_engine; + +template <class _CharT, class _Traits, + class _Up, _Up _Ap, _Up _Cp, _Up _Np> +_LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&); + +template <class _CharT, class _Traits, + class _Up, _Up _Ap, _Up _Cp, _Up _Np> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +class _LIBCPP_TEMPLATE_VIS linear_congruential_engine +{ +public: + // types + typedef _UIntType result_type; + +private: + result_type __x_; + + static _LIBCPP_CONSTEXPR const result_type _Mp = result_type(~0); + + static_assert(__m == 0 || __a < __m, "linear_congruential_engine invalid parameters"); + static_assert(__m == 0 || __c < __m, "linear_congruential_engine invalid parameters"); + static_assert(is_unsigned<_UIntType>::value, "_UIntType must be unsigned type"); +public: + static _LIBCPP_CONSTEXPR const result_type _Min = __c == 0u ? 1u: 0u; + static _LIBCPP_CONSTEXPR const result_type _Max = __m - 1u; + static_assert(_Min < _Max, "linear_congruential_engine invalid parameters"); + + // engine characteristics + static _LIBCPP_CONSTEXPR const result_type multiplier = __a; + static _LIBCPP_CONSTEXPR const result_type increment = __c; + static _LIBCPP_CONSTEXPR const result_type modulus = __m; + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() {return _Min;} + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() {return _Max;} + static _LIBCPP_CONSTEXPR const result_type default_seed = 1u; + + // constructors and seeding functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + linear_congruential_engine() : linear_congruential_engine(default_seed) {} + _LIBCPP_INLINE_VISIBILITY + explicit linear_congruential_engine(result_type __s) { seed(__s); } +#else + _LIBCPP_INLINE_VISIBILITY + explicit linear_congruential_engine(result_type __s = default_seed) { + seed(__s); + } +#endif + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit linear_congruential_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0) + {seed(__q);} + _LIBCPP_INLINE_VISIBILITY + void seed(result_type __s = default_seed) + {seed(integral_constant<bool, __m == 0>(), + integral_constant<bool, __c == 0>(), __s);} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, linear_congruential_engine>::value, + void + >::type + seed(_Sseq& __q) + {__seed(__q, integral_constant<unsigned, + 1 + (__m == 0 ? (sizeof(result_type) * __CHAR_BIT__ - 1)/32 + : (__m > 0x100000000ull))>());} + + // generating functions + _LIBCPP_INLINE_VISIBILITY + result_type operator()() + {return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));} + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const linear_congruential_engine& __x, + const linear_congruential_engine& __y) + {return __x.__x_ == __y.__x_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const linear_congruential_engine& __x, + const linear_congruential_engine& __y) + {return !(__x == __y);} + +private: + + _LIBCPP_INLINE_VISIBILITY + void seed(true_type, true_type, result_type __s) {__x_ = __s == 0 ? 1 : __s;} + _LIBCPP_INLINE_VISIBILITY + void seed(true_type, false_type, result_type __s) {__x_ = __s;} + _LIBCPP_INLINE_VISIBILITY + void seed(false_type, true_type, result_type __s) {__x_ = __s % __m == 0 ? + 1 : __s % __m;} + _LIBCPP_INLINE_VISIBILITY + void seed(false_type, false_type, result_type __s) {__x_ = __s % __m;} + + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 1>); + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 2>); + + template <class _CharT, class _Traits, + class _Up, _Up _Ap, _Up _Cp, _Up _Np> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&); + + template <class _CharT, class _Traits, + class _Up, _Up _Ap, _Up _Cp, _Up _Np> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); +}; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::increment; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +template<class _Sseq> +void +linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, + integral_constant<unsigned, 1>) +{ + const unsigned __k = 1; + uint32_t __ar[__k+3]; + __q.generate(__ar, __ar + __k + 3); + result_type __s = static_cast<result_type>(__ar[3] % __m); + __x_ = __c == 0 && __s == 0 ? result_type(1) : __s; +} + +template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +template<class _Sseq> +void +linear_congruential_engine<_UIntType, __a, __c, __m>::__seed(_Sseq& __q, + integral_constant<unsigned, 2>) +{ + const unsigned __k = 2; + uint32_t __ar[__k+3]; + __q.generate(__ar, __ar + __k + 3); + result_type __s = static_cast<result_type>((__ar[3] + + ((uint64_t)__ar[4] << 32)) % __m); + __x_ = __c == 0 && __s == 0 ? result_type(1) : __s; +} + +template <class _CharT, class _Traits, + class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +inline _LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const linear_congruential_engine<_UIntType, __a, __c, __m>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + __os.fill(__os.widen(' ')); + return __os << __x.__x_; +} + +template <class _CharT, class _Traits, + class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + linear_congruential_engine<_UIntType, __a, __c, __m>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + _UIntType __t; + __is >> __t; + if (!__is.fail()) + __x.__x_ = __t; + return __is; +} + +typedef linear_congruential_engine<uint_fast32_t, 16807, 0, 2147483647> + minstd_rand0; +typedef linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647> + minstd_rand; + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/log2.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/log2.h new file mode 100644 index 0000000..c2d9b6b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/log2.h
@@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_LOG2_H +#define _LIBCPP___RANDOM_LOG2_H + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <unsigned long long _Xp, size_t _Rp> +struct __log2_imp +{ + static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp + : __log2_imp<_Xp, _Rp - 1>::value; +}; + +template <unsigned long long _Xp> +struct __log2_imp<_Xp, 0> +{ + static const size_t value = 0; +}; + +template <size_t _Rp> +struct __log2_imp<0, _Rp> +{ + static const size_t value = _Rp + 1; +}; + +template <class _UIntType, _UIntType _Xp> +struct __log2 +{ + static const size_t value = __log2_imp<_Xp, + sizeof(_UIntType) * __CHAR_BIT__ - 1>::value; +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANDOM_LOG2_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/lognormal_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/lognormal_distribution.h new file mode 100644 index 0000000..752861c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/lognormal_distribution.h
@@ -0,0 +1,163 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H + +#include <__config> +#include <__random/normal_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS lognormal_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + normal_distribution<result_type> __nd_; + public: + typedef lognormal_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __m = 0, result_type __s = 1) + : __nd_(__m, __s) {} + + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __nd_.mean();} + _LIBCPP_INLINE_VISIBILITY + result_type s() const {return __nd_.stddev();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__nd_ == __y.__nd_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + friend class lognormal_distribution; + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const lognormal_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + lognormal_distribution<_RT>& __x); + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + lognormal_distribution() : lognormal_distribution(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(result_type __m, result_type __s = 1) + : __p_(param_type(__m, __s)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(result_type __m = 0, + result_type __s = 1) + : __p_(param_type(__m, __s)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit lognormal_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {__p_.__nd_.reset();} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g, const param_type& __p) + {return _VSTD::exp(const_cast<normal_distribution<result_type>&>(__p.__nd_)(__g));} + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type m() const {return __p_.m();} + _LIBCPP_INLINE_VISIBILITY + result_type s() const {return __p_.s();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const lognormal_distribution& __x, + const lognormal_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const lognormal_distribution& __x, + const lognormal_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const lognormal_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + lognormal_distribution<_RT>& __x); +}; + +template <class _CharT, class _Traits, class _RT> +inline _LIBCPP_INLINE_VISIBILITY +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const lognormal_distribution<_RT>& __x) +{ + return __os << __x.__p_.__nd_; +} + +template <class _CharT, class _Traits, class _RT> +inline _LIBCPP_INLINE_VISIBILITY +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + lognormal_distribution<_RT>& __x) +{ + return __is >> __x.__p_.__nd_; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/mersenne_twister_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/mersenne_twister_engine.h new file mode 100644 index 0000000..121ffae --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/mersenne_twister_engine.h
@@ -0,0 +1,534 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H +#define _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H + +#include <__algorithm/equal.h> +#include <__algorithm/min.h> +#include <__config> +#include <__random/is_seed_sequence.h> +#include <cstddef> +#include <cstdint> +#include <iosfwd> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine; + +template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +bool +operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + +template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +_LIBCPP_INLINE_VISIBILITY +bool +operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine +{ +public: + // types + typedef _UIntType result_type; + +private: + result_type __x_[__n]; + size_t __i_; + + static_assert( 0 < __m, "mersenne_twister_engine invalid parameters"); + static_assert(__m <= __n, "mersenne_twister_engine invalid parameters"); + static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits; + static_assert(__w <= _Dt, "mersenne_twister_engine invalid parameters"); + static_assert( 2 <= __w, "mersenne_twister_engine invalid parameters"); + static_assert(__r <= __w, "mersenne_twister_engine invalid parameters"); + static_assert(__u <= __w, "mersenne_twister_engine invalid parameters"); + static_assert(__s <= __w, "mersenne_twister_engine invalid parameters"); + static_assert(__t <= __w, "mersenne_twister_engine invalid parameters"); + static_assert(__l <= __w, "mersenne_twister_engine invalid parameters"); +public: + static _LIBCPP_CONSTEXPR const result_type _Min = 0; + static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) : + (result_type(1) << __w) - result_type(1); + static_assert(_Min < _Max, "mersenne_twister_engine invalid parameters"); + static_assert(__a <= _Max, "mersenne_twister_engine invalid parameters"); + static_assert(__b <= _Max, "mersenne_twister_engine invalid parameters"); + static_assert(__c <= _Max, "mersenne_twister_engine invalid parameters"); + static_assert(__d <= _Max, "mersenne_twister_engine invalid parameters"); + static_assert(__f <= _Max, "mersenne_twister_engine invalid parameters"); + + // engine characteristics + static _LIBCPP_CONSTEXPR const size_t word_size = __w; + static _LIBCPP_CONSTEXPR const size_t state_size = __n; + static _LIBCPP_CONSTEXPR const size_t shift_size = __m; + static _LIBCPP_CONSTEXPR const size_t mask_bits = __r; + static _LIBCPP_CONSTEXPR const result_type xor_mask = __a; + static _LIBCPP_CONSTEXPR const size_t tempering_u = __u; + static _LIBCPP_CONSTEXPR const result_type tempering_d = __d; + static _LIBCPP_CONSTEXPR const size_t tempering_s = __s; + static _LIBCPP_CONSTEXPR const result_type tempering_b = __b; + static _LIBCPP_CONSTEXPR const size_t tempering_t = __t; + static _LIBCPP_CONSTEXPR const result_type tempering_c = __c; + static _LIBCPP_CONSTEXPR const size_t tempering_l = __l; + static _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f; + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Min; } + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Max; } + static _LIBCPP_CONSTEXPR const result_type default_seed = 5489u; + + // constructors and seeding functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + mersenne_twister_engine() : mersenne_twister_engine(default_seed) {} + _LIBCPP_INLINE_VISIBILITY + explicit mersenne_twister_engine(result_type __sd) { seed(__sd); } +#else + _LIBCPP_INLINE_VISIBILITY + explicit mersenne_twister_engine(result_type __sd = default_seed) { + seed(__sd); + } +#endif + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit mersenne_twister_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0) + {seed(__q);} + void seed(result_type __sd = default_seed); + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, mersenne_twister_engine>::value, + void + >::type + seed(_Sseq& __q) + {__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());} + + // generating functions + result_type operator()(); + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> + friend + bool + operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + + template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> + friend + bool + operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y); + + template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); + + template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x); +private: + + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 1>); + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 2>); + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + __count < __w, + result_type + >::type + __lshift(result_type __x) {return (__x << __count) & _Max;} + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + (__count >= __w), + result_type + >::type + __lshift(result_type) {return result_type(0);} + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + __count < _Dt, + result_type + >::type + __rshift(result_type __x) {return __x >> __count;} + + template <size_t __count> + _LIBCPP_INLINE_VISIBILITY + static + typename enable_if + < + (__count >= _Dt), + result_type + >::type + __rshift(result_type) {return result_type(0);} +}; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed; + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +void +mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, + __t, __c, __l, __f>::seed(result_type __sd) + _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +{ // __w >= 2 + __x_[0] = __sd & _Max; + for (size_t __i = 1; __i < __n; ++__i) + __x_[__i] = (__f * (__x_[__i-1] ^ __rshift<__w - 2>(__x_[__i-1])) + __i) & _Max; + __i_ = 0; +} + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +template<class _Sseq> +void +mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, + __t, __c, __l, __f>::__seed(_Sseq& __q, integral_constant<unsigned, 1>) +{ + const unsigned __k = 1; + uint32_t __ar[__n * __k]; + __q.generate(__ar, __ar + __n * __k); + for (size_t __i = 0; __i < __n; ++__i) + __x_[__i] = static_cast<result_type>(__ar[__i] & _Max); + const result_type __mask = __r == _Dt ? result_type(~0) : + (result_type(1) << __r) - result_type(1); + __i_ = 0; + if ((__x_[0] & ~__mask) == 0) + { + for (size_t __i = 1; __i < __n; ++__i) + if (__x_[__i] != 0) + return; + __x_[0] = result_type(1) << (__w - 1); + } +} + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +template<class _Sseq> +void +mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, + __t, __c, __l, __f>::__seed(_Sseq& __q, integral_constant<unsigned, 2>) +{ + const unsigned __k = 2; + uint32_t __ar[__n * __k]; + __q.generate(__ar, __ar + __n * __k); + for (size_t __i = 0; __i < __n; ++__i) + __x_[__i] = static_cast<result_type>( + (__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max); + const result_type __mask = __r == _Dt ? result_type(~0) : + (result_type(1) << __r) - result_type(1); + __i_ = 0; + if ((__x_[0] & ~__mask) == 0) + { + for (size_t __i = 1; __i < __n; ++__i) + if (__x_[__i] != 0) + return; + __x_[0] = result_type(1) << (__w - 1); + } +} + +template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r, + _UIntType __a, size_t __u, _UIntType __d, size_t __s, + _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> +_UIntType +mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, + __t, __c, __l, __f>::operator()() +{ + const size_t __j = (__i_ + 1) % __n; + const result_type __mask = __r == _Dt ? result_type(~0) : + (result_type(1) << __r) - result_type(1); + const result_type _Yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask); + const size_t __k = (__i_ + __m) % __n; + __x_[__i_] = __x_[__k] ^ __rshift<1>(_Yp) ^ (__a * (_Yp & 1)); + result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d); + __i_ = __j; + __z ^= __lshift<__s>(__z) & __b; + __z ^= __lshift<__t>(__z) & __c; + return __z ^ __rshift<__l>(__z); +} + +template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +bool +operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y) +{ + if (__x.__i_ == __y.__i_) + return _VSTD::equal(__x.__x_, __x.__x_ + _Np, __y.__x_); + if (__x.__i_ == 0 || __y.__i_ == 0) + { + size_t __j = _VSTD::min(_Np - __x.__i_, _Np - __y.__i_); + if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j, + __y.__x_ + __y.__i_)) + return false; + if (__x.__i_ == 0) + return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Np, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + (_Np - __j), __y.__x_ + __j); + } + if (__x.__i_ < __y.__i_) + { + size_t __j = _Np - __y.__i_; + if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j), + __y.__x_ + __y.__i_)) + return false; + if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Np, + __y.__x_)) + return false; + return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_, + __y.__x_ + (_Np - (__x.__i_ + __j))); + } + size_t __j = _Np - __x.__i_; + if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j), + __x.__x_ + __x.__i_)) + return false; + if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Np, + __x.__x_)) + return false; + return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_, + __x.__x_ + (_Np - (__y.__i_ + __j))); +} + +template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __y) +{ + return !(__x == __y); +} + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.__x_[__x.__i_]; + for (size_t __j = __x.__i_ + 1; __j < _Np; ++__j) + __os << __sp << __x.__x_[__j]; + for (size_t __j = 0; __j < __x.__i_; ++__j) + __os << __sp << __x.__x_[__j]; + return __os; +} + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, + _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, + _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, + _Bp, _Tp, _Cp, _Lp, _Fp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + _UInt __t[_Np]; + for (size_t __i = 0; __i < _Np; ++__i) + __is >> __t[__i]; + if (!__is.fail()) + { + for (size_t __i = 0; __i < _Np; ++__i) + __x.__x_[__i] = __t[__i]; + __x.__i_ = 0; + } + return __is; +} + +typedef mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31, + 0x9908b0df, 11, 0xffffffff, + 7, 0x9d2c5680, + 15, 0xefc60000, + 18, 1812433253> mt19937; +typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31, + 0xb5026f5aa96619e9ULL, 29, 0x5555555555555555ULL, + 17, 0x71d67fffeda60000ULL, + 37, 0xfff7eee000000000ULL, + 43, 6364136223846793005ULL> mt19937_64; + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/negative_binomial_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/negative_binomial_distribution.h new file mode 100644 index 0000000..7329bac --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/negative_binomial_distribution.h
@@ -0,0 +1,176 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H + +#include <__config> +#include <__random/bernoulli_distribution.h> +#include <__random/gamma_distribution.h> +#include <__random/poisson_distribution.h> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _IntType = int> +class _LIBCPP_TEMPLATE_VIS negative_binomial_distribution +{ +public: + // types + typedef _IntType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __k_; + double __p_; + public: + typedef negative_binomial_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __k = 1, double __p = 0.5) + : __k_(__k), __p_(__p) {} + + _LIBCPP_INLINE_VISIBILITY + result_type k() const {return __k_;} + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__k_ == __y.__k_ && __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + negative_binomial_distribution() : negative_binomial_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit negative_binomial_distribution(result_type __k, double __p = 0.5) + : __p_(__k, __p) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit negative_binomial_distribution(result_type __k = 1, + double __p = 0.5) + : __p_(__k, __p) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit negative_binomial_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type k() const {return __p_.k();} + _LIBCPP_INLINE_VISIBILITY + double p() const {return __p_.p();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::max();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const negative_binomial_distribution& __x, + const negative_binomial_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const negative_binomial_distribution& __x, + const negative_binomial_distribution& __y) + {return !(__x == __y);} +}; + +template <class _IntType> +template<class _URNG> +_IntType +negative_binomial_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr) +{ + result_type __k = __pr.k(); + double __p = __pr.p(); + if (__k <= 21 * __p) + { + bernoulli_distribution __gen(__p); + result_type __f = 0; + result_type __s = 0; + while (__s < __k) + { + if (__gen(__urng)) + ++__s; + else + ++__f; + } + return __f; + } + return poisson_distribution<result_type>(gamma_distribution<double> + (__k, (1-__p)/__p)(__urng))(__urng); +} + +template <class _CharT, class _Traits, class _IntType> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const negative_binomial_distribution<_IntType>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.k() << __sp << __x.p(); +} + +template <class _CharT, class _Traits, class _IntType> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + negative_binomial_distribution<_IntType>& __x) +{ + typedef negative_binomial_distribution<_IntType> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __k; + double __p; + __is >> __k >> __p; + if (!__is.fail()) + __x.param(param_type(__k, __p)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/normal_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/normal_distribution.h new file mode 100644 index 0000000..b460ffb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/normal_distribution.h
@@ -0,0 +1,208 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H + +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS normal_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __mean_; + result_type __stddev_; + public: + typedef normal_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __mean = 0, result_type __stddev = 1) + : __mean_(__mean), __stddev_(__stddev) {} + + _LIBCPP_INLINE_VISIBILITY + result_type mean() const {return __mean_;} + _LIBCPP_INLINE_VISIBILITY + result_type stddev() const {return __stddev_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__mean_ == __y.__mean_ && __x.__stddev_ == __y.__stddev_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + result_type _V_; + bool _V_hot_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + normal_distribution() : normal_distribution(0) {} + _LIBCPP_INLINE_VISIBILITY + explicit normal_distribution(result_type __mean, result_type __stddev = 1) + : __p_(param_type(__mean, __stddev)), _V_hot_(false) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit normal_distribution(result_type __mean = 0, + result_type __stddev = 1) + : __p_(param_type(__mean, __stddev)), _V_hot_(false) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit normal_distribution(const param_type& __p) + : __p_(__p), _V_hot_(false) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {_V_hot_ = false;} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type mean() const {return __p_.mean();} + _LIBCPP_INLINE_VISIBILITY + result_type stddev() const {return __p_.stddev();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return -numeric_limits<result_type>::infinity();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const normal_distribution& __x, + const normal_distribution& __y) + {return __x.__p_ == __y.__p_ && __x._V_hot_ == __y._V_hot_ && + (!__x._V_hot_ || __x._V_ == __y._V_);} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const normal_distribution& __x, + const normal_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const normal_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + normal_distribution<_RT>& __x); +}; + +template <class _RealType> +template<class _URNG> +_RealType +normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + result_type _Up; + if (_V_hot_) + { + _V_hot_ = false; + _Up = _V_; + } + else + { + uniform_real_distribution<result_type> _Uni(-1, 1); + result_type __u; + result_type __v; + result_type __s; + do + { + __u = _Uni(__g); + __v = _Uni(__g); + __s = __u * __u + __v * __v; + } while (__s > 1 || __s == 0); + result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s); + _V_ = __v * _Fp; + _V_hot_ = true; + _Up = __u * _Fp; + } + return _Up * __p.stddev() + __p.mean(); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const normal_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_; + if (__x._V_hot_) + __os << __sp << __x._V_; + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + normal_distribution<_RT>& __x) +{ + typedef normal_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __mean; + result_type __stddev; + result_type _Vp = 0; + bool _V_hot = false; + __is >> __mean >> __stddev >> _V_hot; + if (_V_hot) + __is >> _Vp; + if (!__is.fail()) + { + __x.param(param_type(__mean, __stddev)); + __x._V_hot_ = _V_hot; + __x._V_ = _Vp; + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_constant_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_constant_distribution.h new file mode 100644 index 0000000..ece20d1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_constant_distribution.h
@@ -0,0 +1,356 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H +#define _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H + +#include <__algorithm/upper_bound.h> +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <iosfwd> +#include <numeric> +#include <vector> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + vector<result_type> __b_; + vector<result_type> __densities_; + vector<result_type> __areas_; + public: + typedef piecewise_constant_distribution distribution_type; + + param_type(); + template<class _InputIteratorB, class _InputIteratorW> + param_type(_InputIteratorB __fB, _InputIteratorB __lB, + _InputIteratorW __fW); +#ifndef _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + param_type(initializer_list<result_type> __bl, _UnaryOperation __fw); +#endif // _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + param_type(size_t __nw, result_type __xmin, result_type __xmax, + _UnaryOperation __fw); + param_type(param_type const&) = default; + param_type & operator=(const param_type& __rhs); + + _LIBCPP_INLINE_VISIBILITY + vector<result_type> intervals() const {return __b_;} + _LIBCPP_INLINE_VISIBILITY + vector<result_type> densities() const {return __densities_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + + private: + void __init(); + + friend class piecewise_constant_distribution; + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_constant_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_constant_distribution<_RT>& __x); + }; + +private: + param_type __p_; + +public: + // constructor and reset functions + _LIBCPP_INLINE_VISIBILITY + piecewise_constant_distribution() {} + template<class _InputIteratorB, class _InputIteratorW> + _LIBCPP_INLINE_VISIBILITY + piecewise_constant_distribution(_InputIteratorB __fB, + _InputIteratorB __lB, + _InputIteratorW __fW) + : __p_(__fB, __lB, __fW) {} + +#ifndef _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + _LIBCPP_INLINE_VISIBILITY + piecewise_constant_distribution(initializer_list<result_type> __bl, + _UnaryOperation __fw) + : __p_(__bl, __fw) {} +#endif // _LIBCPP_CXX03_LANG + + template<class _UnaryOperation> + _LIBCPP_INLINE_VISIBILITY + piecewise_constant_distribution(size_t __nw, result_type __xmin, + result_type __xmax, _UnaryOperation __fw) + : __p_(__nw, __xmin, __xmax, __fw) {} + + _LIBCPP_INLINE_VISIBILITY + explicit piecewise_constant_distribution(const param_type& __p) + : __p_(__p) {} + + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + vector<result_type> intervals() const {return __p_.intervals();} + _LIBCPP_INLINE_VISIBILITY + vector<result_type> densities() const {return __p_.densities();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return __p_.__b_.front();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return __p_.__b_.back();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const piecewise_constant_distribution& __x, + const piecewise_constant_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const piecewise_constant_distribution& __x, + const piecewise_constant_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_constant_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_constant_distribution<_RT>& __x); +}; + +template<class _RealType> +typename piecewise_constant_distribution<_RealType>::param_type & +piecewise_constant_distribution<_RealType>::param_type::operator= + (const param_type& __rhs) +{ +// These can throw + __b_.reserve (__rhs.__b_.size ()); + __densities_.reserve(__rhs.__densities_.size()); + __areas_.reserve (__rhs.__areas_.size()); + +// These can not throw + __b_ = __rhs.__b_; + __densities_ = __rhs.__densities_; + __areas_ = __rhs.__areas_; + return *this; +} + +template<class _RealType> +void +piecewise_constant_distribution<_RealType>::param_type::__init() +{ + // __densities_ contains non-normalized areas + result_type __total_area = _VSTD::accumulate(__densities_.begin(), + __densities_.end(), + result_type()); + for (size_t __i = 0; __i < __densities_.size(); ++__i) + __densities_[__i] /= __total_area; + // __densities_ contains normalized areas + __areas_.assign(__densities_.size(), result_type()); + _VSTD::partial_sum(__densities_.begin(), __densities_.end() - 1, + __areas_.begin() + 1); + // __areas_ contains partial sums of normalized areas: [0, __densities_ - 1] + __densities_.back() = 1 - __areas_.back(); // correct round off error + for (size_t __i = 0; __i < __densities_.size(); ++__i) + __densities_[__i] /= (__b_[__i+1] - __b_[__i]); + // __densities_ now contains __densities_ +} + +template<class _RealType> +piecewise_constant_distribution<_RealType>::param_type::param_type() + : __b_(2), + __densities_(1, 1.0), + __areas_(1, 0.0) +{ + __b_[1] = 1; +} + +template<class _RealType> +template<class _InputIteratorB, class _InputIteratorW> +piecewise_constant_distribution<_RealType>::param_type::param_type( + _InputIteratorB __fB, _InputIteratorB __lB, _InputIteratorW __fW) + : __b_(__fB, __lB) +{ + if (__b_.size() < 2) + { + __b_.resize(2); + __b_[0] = 0; + __b_[1] = 1; + __densities_.assign(1, 1.0); + __areas_.assign(1, 0.0); + } + else + { + __densities_.reserve(__b_.size() - 1); + for (size_t __i = 0; __i < __b_.size() - 1; ++__i, ++__fW) + __densities_.push_back(*__fW); + __init(); + } +} + +#ifndef _LIBCPP_CXX03_LANG + +template<class _RealType> +template<class _UnaryOperation> +piecewise_constant_distribution<_RealType>::param_type::param_type( + initializer_list<result_type> __bl, _UnaryOperation __fw) + : __b_(__bl.begin(), __bl.end()) +{ + if (__b_.size() < 2) + { + __b_.resize(2); + __b_[0] = 0; + __b_[1] = 1; + __densities_.assign(1, 1.0); + __areas_.assign(1, 0.0); + } + else + { + __densities_.reserve(__b_.size() - 1); + for (size_t __i = 0; __i < __b_.size() - 1; ++__i) + __densities_.push_back(__fw((__b_[__i+1] + __b_[__i])*.5)); + __init(); + } +} + +#endif // _LIBCPP_CXX03_LANG + +template<class _RealType> +template<class _UnaryOperation> +piecewise_constant_distribution<_RealType>::param_type::param_type( + size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw) + : __b_(__nw == 0 ? 2 : __nw + 1) +{ + size_t __n = __b_.size() - 1; + result_type __d = (__xmax - __xmin) / __n; + __densities_.reserve(__n); + for (size_t __i = 0; __i < __n; ++__i) + { + __b_[__i] = __xmin + __i * __d; + __densities_.push_back(__fw(__b_[__i] + __d*.5)); + } + __b_[__n] = __xmax; + __init(); +} + +template<class _RealType> +template<class _URNG> +_RealType +piecewise_constant_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + typedef uniform_real_distribution<result_type> _Gen; + result_type __u = _Gen()(__g); + ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(), + __u) - __p.__areas_.begin() - 1; + return (__u - __p.__areas_[__k]) / __p.__densities_[__k] + __p.__b_[__k]; +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_constant_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + size_t __n = __x.__p_.__b_.size(); + __os << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__b_[__i]; + __n = __x.__p_.__densities_.size(); + __os << __sp << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__densities_[__i]; + __n = __x.__p_.__areas_.size(); + __os << __sp << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__areas_[__i]; + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_constant_distribution<_RT>& __x) +{ + typedef piecewise_constant_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + size_t __n; + __is >> __n; + vector<result_type> __b(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __b[__i]; + __is >> __n; + vector<result_type> __densities(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __densities[__i]; + __is >> __n; + vector<result_type> __areas(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __areas[__i]; + if (!__is.fail()) + { + swap(__x.__p_.__b_, __b); + swap(__x.__p_.__densities_, __densities); + swap(__x.__p_.__areas_, __areas); + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_linear_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_linear_distribution.h new file mode 100644 index 0000000..b2ba164 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/piecewise_linear_distribution.h
@@ -0,0 +1,372 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H +#define _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H + +#include <__algorithm/upper_bound.h> +#include <__config> +#include <__random/uniform_real_distribution.h> +#include <iosfwd> +#include <numeric> +#include <vector> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + vector<result_type> __b_; + vector<result_type> __densities_; + vector<result_type> __areas_; + public: + typedef piecewise_linear_distribution distribution_type; + + param_type(); + template<class _InputIteratorB, class _InputIteratorW> + param_type(_InputIteratorB __fB, _InputIteratorB __lB, + _InputIteratorW __fW); +#ifndef _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + param_type(initializer_list<result_type> __bl, _UnaryOperation __fw); +#endif // _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + param_type(size_t __nw, result_type __xmin, result_type __xmax, + _UnaryOperation __fw); + param_type(param_type const&) = default; + param_type & operator=(const param_type& __rhs); + + _LIBCPP_INLINE_VISIBILITY + vector<result_type> intervals() const {return __b_;} + _LIBCPP_INLINE_VISIBILITY + vector<result_type> densities() const {return __densities_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + + private: + void __init(); + + friend class piecewise_linear_distribution; + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_linear_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_linear_distribution<_RT>& __x); + }; + +private: + param_type __p_; + +public: + // constructor and reset functions + _LIBCPP_INLINE_VISIBILITY + piecewise_linear_distribution() {} + template<class _InputIteratorB, class _InputIteratorW> + _LIBCPP_INLINE_VISIBILITY + piecewise_linear_distribution(_InputIteratorB __fB, + _InputIteratorB __lB, + _InputIteratorW __fW) + : __p_(__fB, __lB, __fW) {} + +#ifndef _LIBCPP_CXX03_LANG + template<class _UnaryOperation> + _LIBCPP_INLINE_VISIBILITY + piecewise_linear_distribution(initializer_list<result_type> __bl, + _UnaryOperation __fw) + : __p_(__bl, __fw) {} +#endif // _LIBCPP_CXX03_LANG + + template<class _UnaryOperation> + _LIBCPP_INLINE_VISIBILITY + piecewise_linear_distribution(size_t __nw, result_type __xmin, + result_type __xmax, _UnaryOperation __fw) + : __p_(__nw, __xmin, __xmax, __fw) {} + + _LIBCPP_INLINE_VISIBILITY + explicit piecewise_linear_distribution(const param_type& __p) + : __p_(__p) {} + + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + vector<result_type> intervals() const {return __p_.intervals();} + _LIBCPP_INLINE_VISIBILITY + vector<result_type> densities() const {return __p_.densities();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return __p_.__b_.front();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return __p_.__b_.back();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const piecewise_linear_distribution& __x, + const piecewise_linear_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const piecewise_linear_distribution& __x, + const piecewise_linear_distribution& __y) + {return !(__x == __y);} + + template <class _CharT, class _Traits, class _RT> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_linear_distribution<_RT>& __x); + + template <class _CharT, class _Traits, class _RT> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_linear_distribution<_RT>& __x); +}; + +template<class _RealType> +typename piecewise_linear_distribution<_RealType>::param_type & +piecewise_linear_distribution<_RealType>::param_type::operator= + (const param_type& __rhs) +{ +// These can throw + __b_.reserve (__rhs.__b_.size ()); + __densities_.reserve(__rhs.__densities_.size()); + __areas_.reserve (__rhs.__areas_.size()); + +// These can not throw + __b_ = __rhs.__b_; + __densities_ = __rhs.__densities_; + __areas_ = __rhs.__areas_; + return *this; +} + + +template<class _RealType> +void +piecewise_linear_distribution<_RealType>::param_type::__init() +{ + __areas_.assign(__densities_.size() - 1, result_type()); + result_type _Sp = 0; + for (size_t __i = 0; __i < __areas_.size(); ++__i) + { + __areas_[__i] = (__densities_[__i+1] + __densities_[__i]) * + (__b_[__i+1] - __b_[__i]) * .5; + _Sp += __areas_[__i]; + } + for (size_t __i = __areas_.size(); __i > 1;) + { + --__i; + __areas_[__i] = __areas_[__i-1] / _Sp; + } + __areas_[0] = 0; + for (size_t __i = 1; __i < __areas_.size(); ++__i) + __areas_[__i] += __areas_[__i-1]; + for (size_t __i = 0; __i < __densities_.size(); ++__i) + __densities_[__i] /= _Sp; +} + +template<class _RealType> +piecewise_linear_distribution<_RealType>::param_type::param_type() + : __b_(2), + __densities_(2, 1.0), + __areas_(1, 0.0) +{ + __b_[1] = 1; +} + +template<class _RealType> +template<class _InputIteratorB, class _InputIteratorW> +piecewise_linear_distribution<_RealType>::param_type::param_type( + _InputIteratorB __fB, _InputIteratorB __lB, _InputIteratorW __fW) + : __b_(__fB, __lB) +{ + if (__b_.size() < 2) + { + __b_.resize(2); + __b_[0] = 0; + __b_[1] = 1; + __densities_.assign(2, 1.0); + __areas_.assign(1, 0.0); + } + else + { + __densities_.reserve(__b_.size()); + for (size_t __i = 0; __i < __b_.size(); ++__i, ++__fW) + __densities_.push_back(*__fW); + __init(); + } +} + +#ifndef _LIBCPP_CXX03_LANG + +template<class _RealType> +template<class _UnaryOperation> +piecewise_linear_distribution<_RealType>::param_type::param_type( + initializer_list<result_type> __bl, _UnaryOperation __fw) + : __b_(__bl.begin(), __bl.end()) +{ + if (__b_.size() < 2) + { + __b_.resize(2); + __b_[0] = 0; + __b_[1] = 1; + __densities_.assign(2, 1.0); + __areas_.assign(1, 0.0); + } + else + { + __densities_.reserve(__b_.size()); + for (size_t __i = 0; __i < __b_.size(); ++__i) + __densities_.push_back(__fw(__b_[__i])); + __init(); + } +} + +#endif // _LIBCPP_CXX03_LANG + +template<class _RealType> +template<class _UnaryOperation> +piecewise_linear_distribution<_RealType>::param_type::param_type( + size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw) + : __b_(__nw == 0 ? 2 : __nw + 1) +{ + size_t __n = __b_.size() - 1; + result_type __d = (__xmax - __xmin) / __n; + __densities_.reserve(__b_.size()); + for (size_t __i = 0; __i < __n; ++__i) + { + __b_[__i] = __xmin + __i * __d; + __densities_.push_back(__fw(__b_[__i])); + } + __b_[__n] = __xmax; + __densities_.push_back(__fw(__b_[__n])); + __init(); +} + +template<class _RealType> +template<class _URNG> +_RealType +piecewise_linear_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + typedef uniform_real_distribution<result_type> _Gen; + result_type __u = _Gen()(__g); + ptrdiff_t __k = _VSTD::upper_bound(__p.__areas_.begin(), __p.__areas_.end(), + __u) - __p.__areas_.begin() - 1; + __u -= __p.__areas_[__k]; + const result_type __dk = __p.__densities_[__k]; + const result_type __dk1 = __p.__densities_[__k+1]; + const result_type __deltad = __dk1 - __dk; + const result_type __bk = __p.__b_[__k]; + if (__deltad == 0) + return __u / __dk + __bk; + const result_type __bk1 = __p.__b_[__k+1]; + const result_type __deltab = __bk1 - __bk; + return (__bk * __dk1 - __bk1 * __dk + + _VSTD::sqrt(__deltab * (__deltab * __dk * __dk + 2 * __deltad * __u))) / + __deltad; +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const piecewise_linear_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + size_t __n = __x.__p_.__b_.size(); + __os << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__b_[__i]; + __n = __x.__p_.__densities_.size(); + __os << __sp << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__densities_[__i]; + __n = __x.__p_.__areas_.size(); + __os << __sp << __n; + for (size_t __i = 0; __i < __n; ++__i) + __os << __sp << __x.__p_.__areas_[__i]; + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + piecewise_linear_distribution<_RT>& __x) +{ + typedef piecewise_linear_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + size_t __n; + __is >> __n; + vector<result_type> __b(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __b[__i]; + __is >> __n; + vector<result_type> __densities(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __densities[__i]; + __is >> __n; + vector<result_type> __areas(__n); + for (size_t __i = 0; __i < __n; ++__i) + __is >> __areas[__i]; + if (!__is.fail()) + { + swap(__x.__p_.__b_, __b); + swap(__x.__p_.__densities_, __densities); + swap(__x.__p_.__areas_, __areas); + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/poisson_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/poisson_distribution.h new file mode 100644 index 0000000..fb213b0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/poisson_distribution.h
@@ -0,0 +1,276 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H +#define _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H + +#include <__config> +#include <__random/exponential_distribution.h> +#include <__random/normal_distribution.h> +#include <__random/uniform_real_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _IntType = int> +class _LIBCPP_TEMPLATE_VIS poisson_distribution +{ +public: + // types + typedef _IntType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + double __mean_; + double __s_; + double __d_; + double __l_; + double __omega_; + double __c0_; + double __c1_; + double __c2_; + double __c3_; + double __c_; + + public: + typedef poisson_distribution distribution_type; + + explicit param_type(double __mean = 1.0); + + _LIBCPP_INLINE_VISIBILITY + double mean() const {return __mean_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__mean_ == __y.__mean_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + + friend class poisson_distribution; + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + poisson_distribution() : poisson_distribution(1.0) {} + _LIBCPP_INLINE_VISIBILITY + explicit poisson_distribution(double __mean) + : __p_(__mean) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit poisson_distribution(double __mean = 1.0) + : __p_(__mean) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit poisson_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + double mean() const {return __p_.mean();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::max();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const poisson_distribution& __x, + const poisson_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const poisson_distribution& __x, + const poisson_distribution& __y) + {return !(__x == __y);} +}; + +template<class _IntType> +poisson_distribution<_IntType>::param_type::param_type(double __mean) + // According to the standard `inf` is a valid input, but it causes the + // distribution to hang, so we replace it with the maximum representable + // mean. + : __mean_(isinf(__mean) ? numeric_limits<double>::max() : __mean) +{ + if (__mean_ < 10) + { + __s_ = 0; + __d_ = 0; + __l_ = _VSTD::exp(-__mean_); + __omega_ = 0; + __c3_ = 0; + __c2_ = 0; + __c1_ = 0; + __c0_ = 0; + __c_ = 0; + } + else + { + __s_ = _VSTD::sqrt(__mean_); + __d_ = 6 * __mean_ * __mean_; + __l_ = _VSTD::trunc(__mean_ - 1.1484); + __omega_ = .3989423 / __s_; + double __b1_ = .4166667E-1 / __mean_; + double __b2_ = .3 * __b1_ * __b1_; + __c3_ = .1428571 * __b1_ * __b2_; + __c2_ = __b2_ - 15. * __c3_; + __c1_ = __b1_ - 6. * __b2_ + 45. * __c3_; + __c0_ = 1. - __b1_ + 3. * __b2_ - 15. * __c3_; + __c_ = .1069 / __mean_; + } +} + +template <class _IntType> +template<class _URNG> +_IntType +poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr) +{ + double __tx; + uniform_real_distribution<double> __urd; + if (__pr.__mean_ < 10) + { + __tx = 0; + for (double __p = __urd(__urng); __p > __pr.__l_; ++__tx) + __p *= __urd(__urng); + } + else + { + double __difmuk; + double __g = __pr.__mean_ + __pr.__s_ * normal_distribution<double>()(__urng); + double __u; + if (__g > 0) + { + __tx = _VSTD::trunc(__g); + if (__tx >= __pr.__l_) + return _VSTD::__clamp_to_integral<result_type>(__tx); + __difmuk = __pr.__mean_ - __tx; + __u = __urd(__urng); + if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk) + return _VSTD::__clamp_to_integral<result_type>(__tx); + } + exponential_distribution<double> __edist; + for (bool __using_exp_dist = false; true; __using_exp_dist = true) + { + double __e; + if (__using_exp_dist || __g <= 0) + { + double __t; + do + { + __e = __edist(__urng); + __u = __urd(__urng); + __u += __u - 1; + __t = 1.8 + (__u < 0 ? -__e : __e); + } while (__t <= -.6744); + __tx = _VSTD::trunc(__pr.__mean_ + __pr.__s_ * __t); + __difmuk = __pr.__mean_ - __tx; + __using_exp_dist = true; + } + double __px; + double __py; + if (__tx < 10 && __tx >= 0) + { + const double __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040, + 40320, 362880}; + __px = -__pr.__mean_; + __py = _VSTD::pow(__pr.__mean_, (double)__tx) / __fac[static_cast<int>(__tx)]; + } + else + { + double __del = .8333333E-1 / __tx; + __del -= 4.8 * __del * __del * __del; + double __v = __difmuk / __tx; + if (_VSTD::abs(__v) > 0.25) + __px = __tx * _VSTD::log(1 + __v) - __difmuk - __del; + else + __px = __tx * __v * __v * (((((((.1250060 * __v + -.1384794) * + __v + .1421878) * __v + -.1661269) * __v + .2000118) * + __v + -.2500068) * __v + .3333333) * __v + -.5) - __del; + __py = .3989423 / _VSTD::sqrt(__tx); + } + double __r = (0.5 - __difmuk) / __pr.__s_; + double __r2 = __r * __r; + double __fx = -0.5 * __r2; + double __fy = __pr.__omega_ * (((__pr.__c3_ * __r2 + __pr.__c2_) * + __r2 + __pr.__c1_) * __r2 + __pr.__c0_); + if (__using_exp_dist) + { + if (__pr.__c_ * _VSTD::abs(__u) <= __py * _VSTD::exp(__px + __e) - + __fy * _VSTD::exp(__fx + __e)) + break; + } + else + { + if (__fy - __u * __fy <= __py * _VSTD::exp(__px - __fx)) + break; + } + } + } + return _VSTD::__clamp_to_integral<result_type>(__tx); +} + +template <class _CharT, class _Traits, class _IntType> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const poisson_distribution<_IntType>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + return __os << __x.mean(); +} + +template <class _CharT, class _Traits, class _IntType> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + poisson_distribution<_IntType>& __x) +{ + typedef poisson_distribution<_IntType> _Eng; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + double __mean; + __is >> __mean; + if (!__is.fail()) + __x.param(param_type(__mean)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/random_device.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/random_device.h new file mode 100644 index 0000000..f62f7a3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/random_device.h
@@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_RANDOM_DEVICE_H +#define _LIBCPP___RANDOM_RANDOM_DEVICE_H + +#include <__config> +#include <string> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANDOM_DEVICE) + +class _LIBCPP_TYPE_VIS random_device +{ +#ifdef _LIBCPP_USING_DEV_RANDOM + int __f_; +#endif // defined(_LIBCPP_USING_DEV_RANDOM) +public: + // types + typedef unsigned result_type; + + // generator characteristics + static _LIBCPP_CONSTEXPR const result_type _Min = 0; + static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu; + + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Min;} + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Max;} + + // constructors +#ifndef _LIBCPP_CXX03_LANG + random_device() : random_device("/dev/urandom") {} + explicit random_device(const string& __token); +#else + explicit random_device(const string& __token = "/dev/urandom"); +#endif + ~random_device(); + + // generating functions + result_type operator()(); + + // property functions + double entropy() const _NOEXCEPT; + +private: + // no copy functions + random_device(const random_device&); // = delete; + random_device& operator=(const random_device&); // = delete; +}; + +#endif // !_LIBCPP_HAS_NO_RANDOM_DEVICE + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_RANDOM_DEVICE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/ranlux.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/ranlux.h new file mode 100644 index 0000000..0b41592 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/ranlux.h
@@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_RANLUX_H +#define _LIBCPP___RANDOM_RANLUX_H + +#include <__config> +#include <__random/discard_block_engine.h> +#include <__random/subtract_with_carry_engine.h> +#include <cstdint> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +typedef subtract_with_carry_engine<uint_fast32_t, 24, 10, 24> ranlux24_base; +typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> ranlux48_base; + +typedef discard_block_engine<ranlux24_base, 223, 23> ranlux24; +typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANDOM_RANLUX_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/seed_seq.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/seed_seq.h new file mode 100644 index 0000000..97bc88d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/seed_seq.h
@@ -0,0 +1,150 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_SEED_SEQ_H +#define _LIBCPP___RANDOM_SEED_SEQ_H + +#include <__algorithm/copy.h> +#include <__algorithm/fill.h> +#include <__algorithm/max.h> +#include <__config> +#include <initializer_list> +#include <vector> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +class _LIBCPP_TEMPLATE_VIS seed_seq +{ +public: + // types + typedef uint32_t result_type; + +private: + vector<result_type> __v_; + + template<class _InputIterator> + void init(_InputIterator __first, _InputIterator __last); +public: + // constructors + _LIBCPP_INLINE_VISIBILITY + seed_seq() _NOEXCEPT {} +#ifndef _LIBCPP_CXX03_LANG + template<class _Tp> + _LIBCPP_INLINE_VISIBILITY + seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());} +#endif // _LIBCPP_CXX03_LANG + + template<class _InputIterator> + _LIBCPP_INLINE_VISIBILITY + seed_seq(_InputIterator __first, _InputIterator __last) + {init(__first, __last);} + + // generating functions + template<class _RandomAccessIterator> + void generate(_RandomAccessIterator __first, _RandomAccessIterator __last); + + // property functions + _LIBCPP_INLINE_VISIBILITY + size_t size() const _NOEXCEPT {return __v_.size();} + template<class _OutputIterator> + _LIBCPP_INLINE_VISIBILITY + void param(_OutputIterator __dest) const + {_VSTD::copy(__v_.begin(), __v_.end(), __dest);} + +private: + // no copy functions + seed_seq(const seed_seq&); // = delete; + void operator=(const seed_seq&); // = delete; + + _LIBCPP_INLINE_VISIBILITY + static result_type _Tp(result_type __x) {return __x ^ (__x >> 27);} +}; + +template<class _InputIterator> +void +seed_seq::init(_InputIterator __first, _InputIterator __last) +{ + for (_InputIterator __s = __first; __s != __last; ++__s) + __v_.push_back(*__s & 0xFFFFFFFF); +} + +template<class _RandomAccessIterator> +void +seed_seq::generate(_RandomAccessIterator __first, _RandomAccessIterator __last) +{ + if (__first != __last) + { + _VSTD::fill(__first, __last, 0x8b8b8b8b); + const size_t __n = static_cast<size_t>(__last - __first); + const size_t __s = __v_.size(); + const size_t __t = (__n >= 623) ? 11 + : (__n >= 68) ? 7 + : (__n >= 39) ? 5 + : (__n >= 7) ? 3 + : (__n - 1) / 2; + const size_t __p = (__n - __t) / 2; + const size_t __q = __p + __t; + const size_t __m = _VSTD::max(__s + 1, __n); + // __k = 0; + { + result_type __r = 1664525 * _Tp(__first[0] ^ __first[__p] + ^ __first[__n - 1]); + __first[__p] += __r; + __r += __s; + __first[__q] += __r; + __first[0] = __r; + } + for (size_t __k = 1; __k <= __s; ++__k) + { + const size_t __kmodn = __k % __n; + const size_t __kpmodn = (__k + __p) % __n; + result_type __r = 1664525 * _Tp(__first[__kmodn] ^ __first[__kpmodn] + ^ __first[(__k - 1) % __n]); + __first[__kpmodn] += __r; + __r += __kmodn + __v_[__k-1]; + __first[(__k + __q) % __n] += __r; + __first[__kmodn] = __r; + } + for (size_t __k = __s + 1; __k < __m; ++__k) + { + const size_t __kmodn = __k % __n; + const size_t __kpmodn = (__k + __p) % __n; + result_type __r = 1664525 * _Tp(__first[__kmodn] ^ __first[__kpmodn] + ^ __first[(__k - 1) % __n]); + __first[__kpmodn] += __r; + __r += __kmodn; + __first[(__k + __q) % __n] += __r; + __first[__kmodn] = __r; + } + for (size_t __k = __m; __k < __m + __n; ++__k) + { + const size_t __kmodn = __k % __n; + const size_t __kpmodn = (__k + __p) % __n; + result_type __r = 1566083941 * _Tp(__first[__kmodn] + + __first[__kpmodn] + + __first[(__k - 1) % __n]); + __first[__kpmodn] ^= __r; + __r -= __kmodn; + __first[(__k + __q) % __n] ^= __r; + __first[__kmodn] = __r; + } + } +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_SEED_SEQ_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/shuffle_order_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/shuffle_order_engine.h new file mode 100644 index 0000000..7a5735d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/shuffle_order_engine.h
@@ -0,0 +1,283 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H +#define _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H + +#include <__algorithm/equal.h> +#include <__config> +#include <__random/is_seed_sequence.h> +#include <__utility/move.h> +#include <cstdint> +#include <iosfwd> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <uint64_t _Xp, uint64_t _Yp> +struct __ugcd +{ + static _LIBCPP_CONSTEXPR const uint64_t value = __ugcd<_Yp, _Xp % _Yp>::value; +}; + +template <uint64_t _Xp> +struct __ugcd<_Xp, 0> +{ + static _LIBCPP_CONSTEXPR const uint64_t value = _Xp; +}; + +template <uint64_t _Np, uint64_t _Dp> +class __uratio +{ + static_assert(_Dp != 0, "__uratio divide by 0"); + static _LIBCPP_CONSTEXPR const uint64_t __gcd = __ugcd<_Np, _Dp>::value; +public: + static _LIBCPP_CONSTEXPR const uint64_t num = _Np / __gcd; + static _LIBCPP_CONSTEXPR const uint64_t den = _Dp / __gcd; + + typedef __uratio<num, den> type; +}; + +template<class _Engine, size_t __k> +class _LIBCPP_TEMPLATE_VIS shuffle_order_engine +{ + static_assert(0 < __k, "shuffle_order_engine invalid parameters"); +public: + // types + typedef typename _Engine::result_type result_type; + +private: + _Engine __e_; + result_type _V_[__k]; + result_type _Y_; + +public: + // engine characteristics + static _LIBCPP_CONSTEXPR const size_t table_size = __k; + +#ifdef _LIBCPP_CXX03_LANG + static const result_type _Min = _Engine::_Min; + static const result_type _Max = _Engine::_Max; +#else + static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min(); + static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max(); +#endif + static_assert(_Min < _Max, "shuffle_order_engine invalid parameters"); + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Min; } + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Max; } + + static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull; + + // constructors and seeding functions + _LIBCPP_INLINE_VISIBILITY + shuffle_order_engine() {__init();} + _LIBCPP_INLINE_VISIBILITY + explicit shuffle_order_engine(const _Engine& __e) + : __e_(__e) {__init();} +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit shuffle_order_engine(_Engine&& __e) + : __e_(_VSTD::move(__e)) {__init();} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit shuffle_order_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value && + !is_convertible<_Sseq, _Engine>::value>::type* = 0) + : __e_(__q) {__init();} + _LIBCPP_INLINE_VISIBILITY + void seed() {__e_.seed(); __init();} + _LIBCPP_INLINE_VISIBILITY + void seed(result_type __sd) {__e_.seed(__sd); __init();} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, shuffle_order_engine>::value, + void + >::type + seed(_Sseq& __q) {__e_.seed(__q); __init();} + + // generating functions + _LIBCPP_INLINE_VISIBILITY + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + // property functions + _LIBCPP_INLINE_VISIBILITY + const _Engine& base() const _NOEXCEPT {return __e_;} + +private: + template<class _Eng, size_t _Kp> + friend + bool + operator==( + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y); + + template<class _Eng, size_t _Kp> + friend + bool + operator!=( + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y); + + template <class _CharT, class _Traits, + class _Eng, size_t _Kp> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const shuffle_order_engine<_Eng, _Kp>& __x); + + template <class _CharT, class _Traits, + class _Eng, size_t _Kp> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + shuffle_order_engine<_Eng, _Kp>& __x); + + _LIBCPP_INLINE_VISIBILITY + void __init() + { + for (size_t __i = 0; __i < __k; ++__i) + _V_[__i] = __e_(); + _Y_ = __e_(); + } + + _LIBCPP_INLINE_VISIBILITY + result_type __eval(false_type) {return __eval2(integral_constant<bool, __k & 1>());} + _LIBCPP_INLINE_VISIBILITY + result_type __eval(true_type) {return __eval(__uratio<__k, _Rp>());} + + _LIBCPP_INLINE_VISIBILITY + result_type __eval2(false_type) {return __eval(__uratio<__k/2, 0x8000000000000000ull>());} + _LIBCPP_INLINE_VISIBILITY + result_type __eval2(true_type) {return __evalf<__k, 0>();} + + template <uint64_t _Np, uint64_t _Dp> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + (__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), + result_type + >::type + __eval(__uratio<_Np, _Dp>) + {return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();} + + template <uint64_t _Np, uint64_t _Dp> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), + result_type + >::type + __eval(__uratio<_Np, _Dp>) + { + const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (_Y_ - _Min) + / __uratio<_Np, _Dp>::den); + _Y_ = _V_[__j]; + _V_[__j] = __e_(); + return _Y_; + } + + template <uint64_t __n, uint64_t __d> + _LIBCPP_INLINE_VISIBILITY + result_type __evalf() + { + const double _Fp = __d == 0 ? + __n / (2. * 0x8000000000000000ull) : + __n / (double)__d; + const size_t __j = static_cast<size_t>(_Fp * (_Y_ - _Min)); + _Y_ = _V_[__j]; + _V_[__j] = __e_(); + return _Y_; + } +}; + +template<class _Engine, size_t __k> + _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size; + +template<class _Eng, size_t _Kp> +bool +operator==( + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y) +{ + return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) && + __x.__e_ == __y.__e_; +} + +template<class _Eng, size_t _Kp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=( + const shuffle_order_engine<_Eng, _Kp>& __x, + const shuffle_order_engine<_Eng, _Kp>& __y) +{ + return !(__x == __y); +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Kp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const shuffle_order_engine<_Eng, _Kp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.__e_ << __sp << __x._V_[0]; + for (size_t __i = 1; __i < _Kp; ++__i) + __os << __sp << __x._V_[__i]; + return __os << __sp << __x._Y_; +} + +template <class _CharT, class _Traits, + class _Eng, size_t _Kp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + shuffle_order_engine<_Eng, _Kp>& __x) +{ + typedef typename shuffle_order_engine<_Eng, _Kp>::result_type result_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + _Eng __e; + result_type _Vp[_Kp+1]; + __is >> __e; + for (size_t __i = 0; __i < _Kp+1; ++__i) + __is >> _Vp[__i]; + if (!__is.fail()) + { + __x.__e_ = __e; + for (size_t __i = 0; __i < _Kp; ++__i) + __x._V_[__i] = _Vp[__i]; + __x._Y_ = _Vp[_Kp]; + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/student_t_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/student_t_distribution.h new file mode 100644 index 0000000..0cf911e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/student_t_distribution.h
@@ -0,0 +1,153 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H +#define _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H + +#include <__config> +#include <__random/gamma_distribution.h> +#include <__random/normal_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS student_t_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __n_; + public: + typedef student_t_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __n = 1) : __n_(__n) {} + + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __n_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__n_ == __y.__n_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + normal_distribution<result_type> __nd_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + student_t_distribution() : student_t_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit student_t_distribution(result_type __n) + : __p_(param_type(__n)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit student_t_distribution(result_type __n = 1) + : __p_(param_type(__n)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit student_t_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {__nd_.reset();} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type n() const {return __p_.n();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return -numeric_limits<result_type>::infinity();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const student_t_distribution& __x, + const student_t_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const student_t_distribution& __x, + const student_t_distribution& __y) + {return !(__x == __y);} +}; + +template <class _RealType> +template<class _URNG> +_RealType +student_t_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + gamma_distribution<result_type> __gd(__p.n() * .5, 2); + return __nd_(__g) * _VSTD::sqrt(__p.n()/__gd(__g)); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const student_t_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + __os << __x.n(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + student_t_distribution<_RT>& __x) +{ + typedef student_t_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __n; + __is >> __n; + if (!__is.fail()) + __x.param(param_type(__n)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/subtract_with_carry_engine.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/subtract_with_carry_engine.h new file mode 100644 index 0000000..073f84d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/subtract_with_carry_engine.h
@@ -0,0 +1,352 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H +#define _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H + +#include <__algorithm/equal.h> +#include <__algorithm/min.h> +#include <__config> +#include <__random/is_seed_sequence.h> +#include <__random/linear_congruential_engine.h> +#include <cstddef> +#include <cstdint> +#include <iosfwd> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine; + +template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +bool +operator==( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y); + +template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +_LIBCPP_INLINE_VISIBILITY +bool +operator!=( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y); + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine +{ +public: + // types + typedef _UIntType result_type; + +private: + result_type __x_[__r]; + result_type __c_; + size_t __i_; + + static _LIBCPP_CONSTEXPR const result_type _Dt = numeric_limits<result_type>::digits; + static_assert( 0 < __w, "subtract_with_carry_engine invalid parameters"); + static_assert(__w <= _Dt, "subtract_with_carry_engine invalid parameters"); + static_assert( 0 < __s, "subtract_with_carry_engine invalid parameters"); + static_assert(__s < __r, "subtract_with_carry_engine invalid parameters"); +public: + static _LIBCPP_CONSTEXPR const result_type _Min = 0; + static _LIBCPP_CONSTEXPR const result_type _Max = __w == _Dt ? result_type(~0) : + (result_type(1) << __w) - result_type(1); + static_assert(_Min < _Max, "subtract_with_carry_engine invalid parameters"); + + // engine characteristics + static _LIBCPP_CONSTEXPR const size_t word_size = __w; + static _LIBCPP_CONSTEXPR const size_t short_lag = __s; + static _LIBCPP_CONSTEXPR const size_t long_lag = __r; + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type min() { return _Min; } + _LIBCPP_INLINE_VISIBILITY + static _LIBCPP_CONSTEXPR result_type max() { return _Max; } + static _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u; + + // constructors and seeding functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} + _LIBCPP_INLINE_VISIBILITY + explicit subtract_with_carry_engine(result_type __sd) { seed(__sd); } +#else + _LIBCPP_INLINE_VISIBILITY + explicit subtract_with_carry_engine(result_type __sd = default_seed) { + seed(__sd); + } +#endif + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + explicit subtract_with_carry_engine(_Sseq& __q, + typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0) + {seed(__q);} + _LIBCPP_INLINE_VISIBILITY + void seed(result_type __sd = default_seed) + {seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());} + template<class _Sseq> + _LIBCPP_INLINE_VISIBILITY + typename enable_if + < + __is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, + void + >::type + seed(_Sseq& __q) + {__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());} + + // generating functions + result_type operator()(); + _LIBCPP_INLINE_VISIBILITY + void discard(unsigned long long __z) {for (; __z; --__z) operator()();} + + template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> + friend + bool + operator==( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y); + + template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> + friend + bool + operator!=( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y); + + template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> + friend + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); + + template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> + friend + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, + subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); + +private: + + void seed(result_type __sd, integral_constant<unsigned, 1>); + void seed(result_type __sd, integral_constant<unsigned, 2>); + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 1>); + template<class _Sseq> + void __seed(_Sseq& __q, integral_constant<unsigned, 2>); +}; + +template<class _UIntType, size_t __w, size_t __s, size_t __r> + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; + +template<class _UIntType, size_t __w, size_t __s, size_t __r> + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; + +template<class _UIntType, size_t __w, size_t __s, size_t __r> + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; + +template<class _UIntType, size_t __w, size_t __s, size_t __r> + _LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type + subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +void +subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, + integral_constant<unsigned, 1>) +{ + linear_congruential_engine<result_type, 40014u, 0u, 2147483563u> + __e(__sd == 0u ? default_seed : __sd); + for (size_t __i = 0; __i < __r; ++__i) + __x_[__i] = static_cast<result_type>(__e() & _Max); + __c_ = __x_[__r-1] == 0; + __i_ = 0; +} + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +void +subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, + integral_constant<unsigned, 2>) +{ + linear_congruential_engine<result_type, 40014u, 0u, 2147483563u> + __e(__sd == 0u ? default_seed : __sd); + for (size_t __i = 0; __i < __r; ++__i) + { + result_type __e0 = __e(); + __x_[__i] = static_cast<result_type>( + (__e0 + ((uint64_t)__e() << 32)) & _Max); + } + __c_ = __x_[__r-1] == 0; + __i_ = 0; +} + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +template<class _Sseq> +void +subtract_with_carry_engine<_UIntType, __w, __s, __r>::__seed(_Sseq& __q, + integral_constant<unsigned, 1>) +{ + const unsigned __k = 1; + uint32_t __ar[__r * __k]; + __q.generate(__ar, __ar + __r * __k); + for (size_t __i = 0; __i < __r; ++__i) + __x_[__i] = static_cast<result_type>(__ar[__i] & _Max); + __c_ = __x_[__r-1] == 0; + __i_ = 0; +} + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +template<class _Sseq> +void +subtract_with_carry_engine<_UIntType, __w, __s, __r>::__seed(_Sseq& __q, + integral_constant<unsigned, 2>) +{ + const unsigned __k = 2; + uint32_t __ar[__r * __k]; + __q.generate(__ar, __ar + __r * __k); + for (size_t __i = 0; __i < __r; ++__i) + __x_[__i] = static_cast<result_type>( + (__ar[2 * __i] + ((uint64_t)__ar[2 * __i + 1] << 32)) & _Max); + __c_ = __x_[__r-1] == 0; + __i_ = 0; +} + +template<class _UIntType, size_t __w, size_t __s, size_t __r> +_UIntType +subtract_with_carry_engine<_UIntType, __w, __s, __r>::operator()() +{ + const result_type& __xs = __x_[(__i_ + (__r - __s)) % __r]; + result_type& __xr = __x_[__i_]; + result_type __new_c = __c_ == 0 ? __xs < __xr : __xs != 0 ? __xs <= __xr : 1; + __xr = (__xs - __xr - __c_) & _Max; + __c_ = __new_c; + __i_ = (__i_ + 1) % __r; + return __xr; +} + +template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +bool +operator==( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y) +{ + if (__x.__c_ != __y.__c_) + return false; + if (__x.__i_ == __y.__i_) + return _VSTD::equal(__x.__x_, __x.__x_ + _Rp, __y.__x_); + if (__x.__i_ == 0 || __y.__i_ == 0) + { + size_t __j = _VSTD::min(_Rp - __x.__i_, _Rp - __y.__i_); + if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + __x.__i_ + __j, + __y.__x_ + __y.__i_)) + return false; + if (__x.__i_ == 0) + return _VSTD::equal(__x.__x_ + __j, __x.__x_ + _Rp, __y.__x_); + return _VSTD::equal(__x.__x_, __x.__x_ + (_Rp - __j), __y.__x_ + __j); + } + if (__x.__i_ < __y.__i_) + { + size_t __j = _Rp - __y.__i_; + if (!_VSTD::equal(__x.__x_ + __x.__i_, __x.__x_ + (__x.__i_ + __j), + __y.__x_ + __y.__i_)) + return false; + if (!_VSTD::equal(__x.__x_ + (__x.__i_ + __j), __x.__x_ + _Rp, + __y.__x_)) + return false; + return _VSTD::equal(__x.__x_, __x.__x_ + __x.__i_, + __y.__x_ + (_Rp - (__x.__i_ + __j))); + } + size_t __j = _Rp - __x.__i_; + if (!_VSTD::equal(__y.__x_ + __y.__i_, __y.__x_ + (__y.__i_ + __j), + __x.__x_ + __x.__i_)) + return false; + if (!_VSTD::equal(__y.__x_ + (__y.__i_ + __j), __y.__x_ + _Rp, + __x.__x_)) + return false; + return _VSTD::equal(__y.__x_, __y.__x_ + __y.__i_, + __x.__x_ + (_Rp - (__y.__i_ + __j))); +} + +template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=( + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y) +{ + return !(__x == __y); +} + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.__x_[__x.__i_]; + for (size_t __j = __x.__i_ + 1; __j < _Rp; ++__j) + __os << __sp << __x.__x_[__j]; + for (size_t __j = 0; __j < __x.__i_; ++__j) + __os << __sp << __x.__x_[__j]; + __os << __sp << __x.__c_; + return __os; +} + +template <class _CharT, class _Traits, + class _UInt, size_t _Wp, size_t _Sp, size_t _Rp> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + _UInt __t[_Rp+1]; + for (size_t __i = 0; __i < _Rp+1; ++__i) + __is >> __t[__i]; + if (!__is.fail()) + { + for (size_t __i = 0; __i < _Rp; ++__i) + __x.__x_[__i] = __t[__i]; + __x.__c_ = __t[_Rp]; + __x.__i_ = 0; + } + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_int_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_int_distribution.h new file mode 100644 index 0000000..3f47d5f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_int_distribution.h
@@ -0,0 +1,289 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H +#define _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H + +#include <__bits> +#include <__config> +#include <__random/log2.h> +#include <cstddef> +#include <cstdint> +#include <iosfwd> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _Engine, class _UIntType> +class __independent_bits_engine +{ +public: + // types + typedef _UIntType result_type; + +private: + typedef typename _Engine::result_type _Engine_result_type; + typedef typename conditional + < + sizeof(_Engine_result_type) <= sizeof(result_type), + result_type, + _Engine_result_type + >::type _Working_result_type; + + _Engine& __e_; + size_t __w_; + size_t __w0_; + size_t __n_; + size_t __n0_; + _Working_result_type __y0_; + _Working_result_type __y1_; + _Engine_result_type __mask0_; + _Engine_result_type __mask1_; + +#ifdef _LIBCPP_CXX03_LANG + static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + + _Working_result_type(1); +#else + static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min() + + _Working_result_type(1); +#endif + static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value; + static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits; + static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits; + +public: + // constructors and seeding functions + __independent_bits_engine(_Engine& __e, size_t __w); + + // generating functions + result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} + +private: + result_type __eval(false_type); + result_type __eval(true_type); +}; + +template<class _Engine, class _UIntType> +__independent_bits_engine<_Engine, _UIntType> + ::__independent_bits_engine(_Engine& __e, size_t __w) + : __e_(__e), + __w_(__w) +{ + __n_ = __w_ / __m + (__w_ % __m != 0); + __w0_ = __w_ / __n_; + if (_Rp == 0) + __y0_ = _Rp; + else if (__w0_ < _WDt) + __y0_ = (_Rp >> __w0_) << __w0_; + else + __y0_ = 0; + if (_Rp - __y0_ > __y0_ / __n_) + { + ++__n_; + __w0_ = __w_ / __n_; + if (__w0_ < _WDt) + __y0_ = (_Rp >> __w0_) << __w0_; + else + __y0_ = 0; + } + __n0_ = __n_ - __w_ % __n_; + if (__w0_ < _WDt - 1) + __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1); + else + __y1_ = 0; + __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) : + _Engine_result_type(0); + __mask1_ = __w0_ < _EDt - 1 ? + _Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) : + _Engine_result_type(~0); +} + +template<class _Engine, class _UIntType> +inline +_UIntType +__independent_bits_engine<_Engine, _UIntType>::__eval(false_type) +{ + return static_cast<result_type>(__e_() & __mask0_); +} + +template<class _Engine, class _UIntType> +_UIntType +__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) +{ + const size_t _WRt = numeric_limits<result_type>::digits; + result_type _Sp = 0; + for (size_t __k = 0; __k < __n0_; ++__k) + { + _Engine_result_type __u; + do + { + __u = __e_() - _Engine::min(); + } while (__u >= __y0_); + if (__w0_ < _WRt) + _Sp <<= __w0_; + else + _Sp = 0; + _Sp += __u & __mask0_; + } + for (size_t __k = __n0_; __k < __n_; ++__k) + { + _Engine_result_type __u; + do + { + __u = __e_() - _Engine::min(); + } while (__u >= __y1_); + if (__w0_ < _WRt - 1) + _Sp <<= __w0_ + 1; + else + _Sp = 0; + _Sp += __u & __mask1_; + } + return _Sp; +} + +template<class _IntType = int> +class uniform_int_distribution +{ +public: + // types + typedef _IntType result_type; + + class param_type + { + result_type __a_; + result_type __b_; + public: + typedef uniform_int_distribution distribution_type; + + explicit param_type(result_type __a = 0, + result_type __b = numeric_limits<result_type>::max()) + : __a_(__a), __b_(__b) {} + + result_type a() const {return __a_;} + result_type b() const {return __b_;} + + friend bool operator==(const param_type& __x, const param_type& __y) + {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + friend bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + uniform_int_distribution() : uniform_int_distribution(0) {} + explicit uniform_int_distribution( + result_type __a, result_type __b = numeric_limits<result_type>::max()) + : __p_(param_type(__a, __b)) {} +#else + explicit uniform_int_distribution( + result_type __a = 0, + result_type __b = numeric_limits<result_type>::max()) + : __p_(param_type(__a, __b)) {} +#endif + explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {} + void reset() {} + + // generating functions + template<class _URNG> result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + result_type a() const {return __p_.a();} + result_type b() const {return __p_.b();} + + param_type param() const {return __p_;} + void param(const param_type& __p) {__p_ = __p;} + + result_type min() const {return a();} + result_type max() const {return b();} + + friend bool operator==(const uniform_int_distribution& __x, + const uniform_int_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend bool operator!=(const uniform_int_distribution& __x, + const uniform_int_distribution& __y) + {return !(__x == __y);} +}; + +template<class _IntType> +template<class _URNG> +typename uniform_int_distribution<_IntType>::result_type +uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p) +_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +{ + typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), + uint32_t, uint64_t>::type _UIntType; + const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1); + if (_Rp == 1) + return __p.a(); + const size_t _Dt = numeric_limits<_UIntType>::digits; + typedef __independent_bits_engine<_URNG, _UIntType> _Eng; + if (_Rp == 0) + return static_cast<result_type>(_Eng(__g, _Dt)()); + size_t __w = _Dt - __libcpp_clz(_Rp) - 1; + if ((_Rp & (numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0) + ++__w; + _Eng __e(__g, __w); + _UIntType __u; + do + { + __u = __e(); + } while (__u >= _Rp); + return static_cast<result_type>(__u + __p.a()); +} + +template <class _CharT, class _Traits, class _IT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const uniform_int_distribution<_IT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _Ostream; + __os.flags(_Ostream::dec | _Ostream::left); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.a() << __sp << __x.b(); +} + +template <class _CharT, class _Traits, class _IT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + uniform_int_distribution<_IT>& __x) +{ + typedef uniform_int_distribution<_IT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __a; + result_type __b; + __is >> __a >> __b; + if (!__is.fail()) + __x.param(param_type(__a, __b)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_random_bit_generator.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_random_bit_generator.h new file mode 100644 index 0000000..7b2f0df --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_random_bit_generator.h
@@ -0,0 +1,45 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H +#define _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H + +#include <__concepts/arithmetic.h> +#include <__concepts/invocable.h> +#include <__concepts/same_as.h> +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +// [rand.req.urng] +template<class _Gen> +concept uniform_random_bit_generator = + invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>> && + requires { + { _Gen::min() } -> same_as<invoke_result_t<_Gen&>>; + { _Gen::max() } -> same_as<invoke_result_t<_Gen&>>; + requires bool_constant<(_Gen::min() < _Gen::max())>::value; + }; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_real_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_real_distribution.h new file mode 100644 index 0000000..967e4e2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/uniform_real_distribution.h
@@ -0,0 +1,160 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H + +#include <__config> +#include <__random/generate_canonical.h> +#include <iosfwd> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS uniform_real_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __a_; + result_type __b_; + public: + typedef uniform_real_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __a = 0, + result_type __b = 1) + : __a_(__a), __b_(__b) {} + + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __a_;} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __b_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructors and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + uniform_real_distribution() : uniform_real_distribution(0) {} + explicit uniform_real_distribution(result_type __a, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit uniform_real_distribution(result_type __a = 0, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit uniform_real_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g, const param_type& __p); + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __p_.a();} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __p_.b();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return a();} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return b();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const uniform_real_distribution& __x, + const uniform_real_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const uniform_real_distribution& __x, + const uniform_real_distribution& __y) + {return !(__x == __y);} +}; + +template<class _RealType> +template<class _URNG> +inline +typename uniform_real_distribution<_RealType>::result_type +uniform_real_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p) +{ + return (__p.b() - __p.a()) + * _VSTD::generate_canonical<_RealType, numeric_limits<_RealType>::digits>(__g) + + __p.a(); +} + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const uniform_real_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + return __os << __x.a() << __sp << __x.b(); +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + uniform_real_distribution<_RT>& __x) +{ + typedef uniform_real_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __a; + result_type __b; + __is >> __a >> __b; + if (!__is.fail()) + __x.param(param_type(__a, __b)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/weibull_distribution.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/weibull_distribution.h new file mode 100644 index 0000000..4c5e4e8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__random/weibull_distribution.h
@@ -0,0 +1,155 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H +#define _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H + +#include <__config> +#include <__random/exponential_distribution.h> +#include <cmath> +#include <iosfwd> +#include <limits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<class _RealType = double> +class _LIBCPP_TEMPLATE_VIS weibull_distribution +{ +public: + // types + typedef _RealType result_type; + + class _LIBCPP_TEMPLATE_VIS param_type + { + result_type __a_; + result_type __b_; + public: + typedef weibull_distribution distribution_type; + + _LIBCPP_INLINE_VISIBILITY + explicit param_type(result_type __a = 1, result_type __b = 1) + : __a_(__a), __b_(__b) {} + + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __a_;} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __b_;} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const param_type& __x, const param_type& __y) + {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const param_type& __x, const param_type& __y) + {return !(__x == __y);} + }; + +private: + param_type __p_; + +public: + // constructor and reset functions +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + weibull_distribution() : weibull_distribution(1) {} + _LIBCPP_INLINE_VISIBILITY + explicit weibull_distribution(result_type __a, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#else + _LIBCPP_INLINE_VISIBILITY + explicit weibull_distribution(result_type __a = 1, result_type __b = 1) + : __p_(param_type(__a, __b)) {} +#endif + _LIBCPP_INLINE_VISIBILITY + explicit weibull_distribution(const param_type& __p) + : __p_(__p) {} + _LIBCPP_INLINE_VISIBILITY + void reset() {} + + // generating functions + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g) + {return (*this)(__g, __p_);} + template<class _URNG> + _LIBCPP_INLINE_VISIBILITY + result_type operator()(_URNG& __g, const param_type& __p) + {return __p.b() * + _VSTD::pow(exponential_distribution<result_type>()(__g), 1/__p.a());} + + // property functions + _LIBCPP_INLINE_VISIBILITY + result_type a() const {return __p_.a();} + _LIBCPP_INLINE_VISIBILITY + result_type b() const {return __p_.b();} + + _LIBCPP_INLINE_VISIBILITY + param_type param() const {return __p_;} + _LIBCPP_INLINE_VISIBILITY + void param(const param_type& __p) {__p_ = __p;} + + _LIBCPP_INLINE_VISIBILITY + result_type min() const {return 0;} + _LIBCPP_INLINE_VISIBILITY + result_type max() const {return numeric_limits<result_type>::infinity();} + + friend _LIBCPP_INLINE_VISIBILITY + bool operator==(const weibull_distribution& __x, + const weibull_distribution& __y) + {return __x.__p_ == __y.__p_;} + friend _LIBCPP_INLINE_VISIBILITY + bool operator!=(const weibull_distribution& __x, + const weibull_distribution& __y) + {return !(__x == __y);} +}; + +template <class _CharT, class _Traits, class _RT> +basic_ostream<_CharT, _Traits>& +operator<<(basic_ostream<_CharT, _Traits>& __os, + const weibull_distribution<_RT>& __x) +{ + __save_flags<_CharT, _Traits> __lx(__os); + typedef basic_ostream<_CharT, _Traits> _OStream; + __os.flags(_OStream::dec | _OStream::left | _OStream::fixed | + _OStream::scientific); + _CharT __sp = __os.widen(' '); + __os.fill(__sp); + __os << __x.a() << __sp << __x.b(); + return __os; +} + +template <class _CharT, class _Traits, class _RT> +basic_istream<_CharT, _Traits>& +operator>>(basic_istream<_CharT, _Traits>& __is, + weibull_distribution<_RT>& __x) +{ + typedef weibull_distribution<_RT> _Eng; + typedef typename _Eng::result_type result_type; + typedef typename _Eng::param_type param_type; + __save_flags<_CharT, _Traits> __lx(__is); + typedef basic_istream<_CharT, _Traits> _Istream; + __is.flags(_Istream::dec | _Istream::skipws); + result_type __a; + result_type __b; + __is >> __a >> __b; + if (!__is.fail()) + __x.param(param_type(__a, __b)); + return __is; +} + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/access.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/access.h new file mode 100644 index 0000000..b0b89c0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/access.h
@@ -0,0 +1,218 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_ACCESS_H +#define _LIBCPP___RANGES_ACCESS_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/readable_traits.h> +#include <__ranges/enable_borrowed_range.h> +#include <__utility/as_const.h> +#include <__utility/decay_copy.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format off + +namespace ranges { + template <class _Tp> + concept __can_borrow = + is_lvalue_reference_v<_Tp> || enable_borrowed_range<remove_cvref_t<_Tp> >; + + template<class _Tp> + concept __is_complete = requires { sizeof(_Tp); }; +} // namespace ranges + +// [range.access.begin] +namespace ranges::__begin { + template <class _Tp> + concept __member_begin = + __can_borrow<_Tp> && + requires(_Tp&& __t) { + { _VSTD::__decay_copy(__t.begin()) } -> input_or_output_iterator; + }; + + void begin(auto&) = delete; + void begin(const auto&) = delete; + + template <class _Tp> + concept __unqualified_begin = + !__member_begin<_Tp> && + __can_borrow<_Tp> && + __class_or_enum<remove_cvref_t<_Tp> > && + requires(_Tp && __t) { + { _VSTD::__decay_copy(begin(__t)) } -> input_or_output_iterator; + }; + + struct __fn { + template <class _Tp> + requires is_array_v<remove_cv_t<_Tp>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const noexcept { + constexpr bool __complete = __is_complete<iter_value_t<_Tp> >; + if constexpr (__complete) { // used to disable cryptic diagnostic + return __t + 0; + } + else { + static_assert(__complete, "`std::ranges::begin` is SFINAE-unfriendly on arrays of an incomplete type."); + } + } + + template <class _Tp> + requires __member_begin<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::__decay_copy(__t.begin()))) + { + return __t.begin(); + } + + template <class _Tp> + requires __unqualified_begin<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::__decay_copy(begin(__t)))) + { + return begin(__t); + } + + void operator()(auto&&) const = delete; + }; +} // namespace ranges::__begin + +namespace ranges { + inline namespace __cpo { + inline constexpr auto begin = __begin::__fn{}; + } // namespace __cpo + + template <class _Tp> + using iterator_t = decltype(ranges::begin(declval<_Tp&>())); +} // namespace ranges + +// [range.access.end] +namespace ranges::__end { + template <class _Tp> + concept __member_end = + __can_borrow<_Tp> && + requires(_Tp&& __t) { + typename iterator_t<_Tp>; + { _VSTD::__decay_copy(_VSTD::forward<_Tp>(__t).end()) } -> sentinel_for<iterator_t<_Tp> >; + }; + + void end(auto&) = delete; + void end(const auto&) = delete; + + template <class _Tp> + concept __unqualified_end = + !__member_end<_Tp> && + __can_borrow<_Tp> && + __class_or_enum<remove_cvref_t<_Tp> > && + requires(_Tp && __t) { + typename iterator_t<_Tp>; + { _VSTD::__decay_copy(end(_VSTD::forward<_Tp>(__t))) } -> sentinel_for<iterator_t<_Tp> >; + }; + + class __fn { + public: + template <class _Tp, size_t _Np> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept { + constexpr bool __complete = __is_complete<remove_cv_t<_Tp> >; + if constexpr (__complete) { // used to disable cryptic diagnostic + return __t + _Np; + } + else { + static_assert(__complete, "`std::ranges::end` is SFINAE-unfriendly on arrays of an incomplete type."); + } + } + + template <class _Tp> + requires __member_end<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::__decay_copy(__t.end()))) + { + return _VSTD::forward<_Tp>(__t).end(); + } + + template <class _Tp> + requires __unqualified_end<_Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::__decay_copy(end(__t)))) + { + return end(__t); + } + + void operator()(auto&&) const = delete; + }; +} // namespace ranges::__end + +namespace ranges::inline __cpo { + inline constexpr auto end = __end::__fn{}; +} // namespace ranges::__cpo + +namespace ranges::__cbegin { + struct __fn { + template <class _Tp> + requires invocable<decltype(ranges::begin), _Tp const&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const + noexcept(noexcept(ranges::begin(_VSTD::as_const(__t)))) + { + return ranges::begin(_VSTD::as_const(__t)); + } + + template <class _Tp> + requires is_rvalue_reference_v<_Tp> && invocable<decltype(ranges::begin), _Tp const&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::begin(static_cast<_Tp const&&>(__t)))) + { + return ranges::begin(static_cast<_Tp const&&>(__t)); + } + }; +} // namespace ranges::__cbegin + +namespace ranges::inline __cpo { + inline constexpr auto cbegin = __cbegin::__fn{}; +} // namespace ranges::__cpo + +namespace ranges::__cend { + struct __fn { + template <class _Tp> + requires invocable<decltype(ranges::end), _Tp const&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp& __t) const + noexcept(noexcept(ranges::end(_VSTD::as_const(__t)))) + { + return ranges::end(_VSTD::as_const(__t)); + } + + template <class _Tp> + requires is_rvalue_reference_v<_Tp> && invocable<decltype(ranges::end), _Tp const&&> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::end(static_cast<_Tp const&&>(__t)))) + { + return ranges::end(static_cast<_Tp const&&>(__t)); + } + }; +} // namespace ranges::__cend + +namespace ranges::inline __cpo { + inline constexpr auto cend = __cend::__fn{}; +} // namespace ranges::__cpo + +// clang-format off + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_ACCESS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/all.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/all.h new file mode 100644 index 0000000..affe13e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/all.h
@@ -0,0 +1,82 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_ALL_H +#define _LIBCPP___RANGES_ALL_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/ref_view.h> +#include <__ranges/subrange.h> +#include <__utility/decay_copy.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges::views { + +namespace __all { + struct __fn : __range_adaptor_closure<__fn> { + template<class _Tp> + requires ranges::view<decay_t<_Tp>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::__decay_copy(_VSTD::forward<_Tp>(__t)))) + { + return _VSTD::forward<_Tp>(__t); + } + + template<class _Tp> + requires (!ranges::view<decay_t<_Tp>>) && + requires (_Tp&& __t) { ranges::ref_view{_VSTD::forward<_Tp>(__t)}; } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::ref_view{_VSTD::forward<_Tp>(__t)})) + { + return ranges::ref_view{_VSTD::forward<_Tp>(__t)}; + } + + template<class _Tp> + requires (!ranges::view<decay_t<_Tp>> && + !requires (_Tp&& __t) { ranges::ref_view{_VSTD::forward<_Tp>(__t)}; } && + requires (_Tp&& __t) { ranges::subrange{_VSTD::forward<_Tp>(__t)}; }) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::subrange{_VSTD::forward<_Tp>(__t)})) + { + return ranges::subrange{_VSTD::forward<_Tp>(__t)}; + } + }; +} + +inline namespace __cpo { + inline constexpr auto all = __all::__fn{}; +} // namespace __cpo + +template<ranges::viewable_range _Range> +using all_t = decltype(views::all(declval<_Range>())); + +} // namespace ranges::views + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_ALL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/common_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/common_view.h new file mode 100644 index 0000000..a58554f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/common_view.h
@@ -0,0 +1,135 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_COMMON_VIEW_H +#define _LIBCPP___RANGES_COMMON_VIEW_H + +#include <__config> +#include <__iterator/common_iterator.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + +template<view _View> + requires (!common_range<_View> && copyable<iterator_t<_View>>) +class common_view : public view_interface<common_view<_View>> { + _View __base_ = _View(); + +public: + _LIBCPP_HIDE_FROM_ABI + common_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit common_view(_View __v) : __base_(_VSTD::move(__v)) { } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() { + if constexpr (random_access_range<_View> && sized_range<_View>) + return ranges::begin(__base_); + else + return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires range<const _View> { + if constexpr (random_access_range<const _View> && sized_range<const _View>) + return ranges::begin(__base_); + else + return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() { + if constexpr (random_access_range<_View> && sized_range<_View>) + return ranges::begin(__base_) + ranges::size(__base_); + else + return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires range<const _View> { + if constexpr (random_access_range<const _View> && sized_range<const _View>) + return ranges::begin(__base_) + ranges::size(__base_); + else + return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + return ranges::size(__base_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + return ranges::size(__base_); + } +}; + +template<class _Range> +common_view(_Range&&) + -> common_view<views::all_t<_Range>>; + +template<class _View> +inline constexpr bool enable_borrowed_range<common_view<_View>> = enable_borrowed_range<_View>; + +namespace views { +namespace __common { + struct __fn : __range_adaptor_closure<__fn> { + template<class _Range> + requires common_range<_Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(views::all(_VSTD::forward<_Range>(__range)))) + -> decltype( views::all(_VSTD::forward<_Range>(__range))) + { return views::all(_VSTD::forward<_Range>(__range)); } + + template<class _Range> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(common_view{_VSTD::forward<_Range>(__range)})) + -> decltype( common_view{_VSTD::forward<_Range>(__range)}) + { return common_view{_VSTD::forward<_Range>(__range)}; } + }; +} + +inline namespace __cpo { + inline constexpr auto common = __common::__fn{}; +} +} // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COMMON_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/concepts.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/concepts.h new file mode 100644 index 0000000..6a83640 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/concepts.h
@@ -0,0 +1,133 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_CONCEPTS_H +#define _LIBCPP___RANGES_CONCEPTS_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iter_move.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/readable_traits.h> +#include <__ranges/access.h> +#include <__ranges/data.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/enable_view.h> +#include <__ranges/size.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// clang-format off + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + // [range.range] + template <class _Tp> + concept range = requires(_Tp& __t) { + ranges::begin(__t); // sometimes equality-preserving + ranges::end(__t); + }; + + template<class _Range> + concept borrowed_range = range<_Range> && + (is_lvalue_reference_v<_Range> || enable_borrowed_range<remove_cvref_t<_Range>>); + + // `iterator_t` defined in <__ranges/access.h> + + template <range _Rp> + using sentinel_t = decltype(ranges::end(declval<_Rp&>())); + + template <range _Rp> + using range_difference_t = iter_difference_t<iterator_t<_Rp>>; + + template <range _Rp> + using range_value_t = iter_value_t<iterator_t<_Rp>>; + + template <range _Rp> + using range_reference_t = iter_reference_t<iterator_t<_Rp>>; + + template <range _Rp> + using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>; + + // [range.sized] + template <class _Tp> + concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); }; + + template<sized_range _Rp> + using range_size_t = decltype(ranges::size(declval<_Rp&>())); + + // `disable_sized_range` defined in `<__ranges/size.h>` + + // [range.view], views + + // `enable_view` defined in <__ranges/enable_view.h> + // `view_base` defined in <__ranges/enable_view.h> + + template <class _Tp> + concept view = + range<_Tp> && + movable<_Tp> && + enable_view<_Tp>; + + template<class _Range> + concept __simple_view = + view<_Range> && range<const _Range> && + same_as<iterator_t<_Range>, iterator_t<const _Range>> && + same_as<sentinel_t<_Range>, iterator_t<const _Range>>; + + // [range.refinements], other range refinements + template <class _Rp, class _Tp> + concept output_range = range<_Rp> && output_iterator<iterator_t<_Rp>, _Tp>; + + template <class _Tp> + concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp>>; + + template <class _Tp> + concept forward_range = input_range<_Tp> && forward_iterator<iterator_t<_Tp>>; + + template <class _Tp> + concept bidirectional_range = forward_range<_Tp> && bidirectional_iterator<iterator_t<_Tp>>; + + template <class _Tp> + concept random_access_range = + bidirectional_range<_Tp> && random_access_iterator<iterator_t<_Tp>>; + + template<class _Tp> + concept contiguous_range = + random_access_range<_Tp> && + contiguous_iterator<iterator_t<_Tp>> && + requires(_Tp& __t) { + { ranges::data(__t) } -> same_as<add_pointer_t<range_reference_t<_Tp>>>; + }; + + template <class _Tp> + concept common_range = range<_Tp> && same_as<iterator_t<_Tp>, sentinel_t<_Tp>>; + + template<class _Tp> + concept viewable_range = + range<_Tp> && ( + (view<remove_cvref_t<_Tp>> && constructible_from<remove_cvref_t<_Tp>, _Tp>) || + (!view<remove_cvref_t<_Tp>> && borrowed_range<_Tp>) + ); +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format on + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_CONCEPTS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/copyable_box.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/copyable_box.h new file mode 100644 index 0000000..4811690 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/copyable_box.h
@@ -0,0 +1,178 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_COPYABLE_BOX_H +#define _LIBCPP___RANGES_COPYABLE_BOX_H + +#include <__config> +#include <__memory/addressof.h> +#include <__memory/construct_at.h> +#include <__utility/move.h> +#include <concepts> +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into +// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state +// and basically doing destroy-then-copy-construct in the assignment operator. The empty state is necessary +// to handle the case where the copy construction fails after destroying the object. +// +// In some cases, we can completely avoid the use of an empty state; we provide a specialization of +// __copyable_box that does this, see below for the details. + +template<class _Tp> +concept __copy_constructible_object = copy_constructible<_Tp> && is_object_v<_Tp>; + +namespace ranges { + // Primary template - uses std::optional and introduces an empty state in case assignment fails. + template<__copy_constructible_object _Tp> + class __copyable_box { + [[no_unique_address]] optional<_Tp> __val_; + + public: + template<class ..._Args> + requires is_constructible_v<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) + noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + : __val_(in_place, _VSTD::forward<_Args>(__args)...) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) + requires default_initializable<_Tp> + : __val_(in_place) + { } + + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box const& __other) + noexcept(is_nothrow_copy_constructible_v<_Tp>) + { + if (this != _VSTD::addressof(__other)) { + if (__other.__has_value()) __val_.emplace(*__other); + else __val_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box&& __other) + noexcept(is_nothrow_move_constructible_v<_Tp>) + { + if (this != _VSTD::addressof(__other)) { + if (__other.__has_value()) __val_.emplace(_VSTD::move(*__other)); + else __val_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; } + + _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return __val_.operator->(); } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return __val_.operator->(); } + + _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); } + }; + + // This partial specialization implements an optimization for when we know we don't need to store + // an empty state to represent failure to perform an assignment. For copy-assignment, this happens: + // + // 1. If the type is copyable (which includes copy-assignment), we can use the type's own assignment operator + // directly and avoid using std::optional. + // 2. If the type is not copyable, but it is nothrow-copy-constructible, then we can implement assignment as + // destroy-and-then-construct and we know it will never fail, so we don't need an empty state. + // + // The exact same reasoning can be applied for move-assignment, with copyable replaced by movable and + // nothrow-copy-constructible replaced by nothrow-move-constructible. This specialization is enabled + // whenever we can apply any of these optimizations for both the copy assignment and the move assignment + // operator. + template<class _Tp> + concept __doesnt_need_empty_state_for_copy = copyable<_Tp> || is_nothrow_copy_constructible_v<_Tp>; + + template<class _Tp> + concept __doesnt_need_empty_state_for_move = movable<_Tp> || is_nothrow_move_constructible_v<_Tp>; + + template<__copy_constructible_object _Tp> + requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp> + class __copyable_box<_Tp> { + [[no_unique_address]] _Tp __val_; + + public: + template<class ..._Args> + requires is_constructible_v<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) + noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + : __val_(_VSTD::forward<_Args>(__args)...) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) + requires default_initializable<_Tp> + : __val_() + { } + + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; + + // Implementation of assignment operators in case we perform optimization (1) + _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default; + _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; + + // Implementation of assignment operators in case we perform optimization (2) + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box const& __other) noexcept { + static_assert(is_nothrow_copy_constructible_v<_Tp>); + if (this != _VSTD::addressof(__other)) { + _VSTD::destroy_at(_VSTD::addressof(__val_)); + _VSTD::construct_at(_VSTD::addressof(__val_), __other.__val_); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __copyable_box& operator=(__copyable_box&& __other) noexcept { + static_assert(is_nothrow_move_constructible_v<_Tp>); + if (this != _VSTD::addressof(__other)) { + _VSTD::destroy_at(_VSTD::addressof(__val_)); + _VSTD::construct_at(_VSTD::addressof(__val_), _VSTD::move(__other.__val_)); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; } + + _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return _VSTD::addressof(__val_); } + _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return _VSTD::addressof(__val_); } + + _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; } + }; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COPYABLE_BOX_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/counted.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/counted.h new file mode 100644 index 0000000..d292bcb --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/counted.h
@@ -0,0 +1,94 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_COUNTED_H +#define _LIBCPP___RANGES_COUNTED_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/counted_iterator.h> +#include <__iterator/default_sentinel.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__memory/pointer_traits.h> +#include <__ranges/concepts.h> +#include <__ranges/subrange.h> +#include <__utility/decay_copy.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <span> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges::views { + +namespace __counted { + template<class _From, class _To> + concept __explicitly_convertible = requires { + _To(_From{}); + }; + + struct __fn { + template<class _Iter, class _Diff> + requires contiguous_iterator<decay_t<_Iter>> && + __explicitly_convertible<_Diff, iter_difference_t<_Iter>> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Iter&& __it, _Diff __c) const + noexcept(noexcept( + span(_VSTD::to_address(__it), static_cast<iter_difference_t<_Iter>>(__c)) + )) + { + return span(_VSTD::to_address(__it), static_cast<iter_difference_t<_Iter>>(__c)); + } + + template<class _Iter, class _Diff> + requires random_access_iterator<decay_t<_Iter>> && + __explicitly_convertible<_Diff, iter_difference_t<_Iter>> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Iter&& __it, _Diff __c) const + noexcept( + noexcept(__it + static_cast<iter_difference_t<_Iter>>(__c)) && + noexcept(ranges::subrange(_VSTD::forward<_Iter>(__it), _VSTD::__decay_copy(__it))) + ) + { + auto __last = __it + static_cast<iter_difference_t<_Iter>>(__c); + return ranges::subrange(_VSTD::forward<_Iter>(__it), _VSTD::move(__last)); + } + + template<class _Iter, class _Diff> + requires __explicitly_convertible<_Diff, iter_difference_t<_Iter>> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Iter&& __it, _Diff __c) const + noexcept(noexcept( + ranges::subrange(counted_iterator(_VSTD::forward<_Iter>(__it), __c), default_sentinel) + )) + { + return ranges::subrange(counted_iterator(_VSTD::forward<_Iter>(__it), __c), default_sentinel); + } + }; +} + +inline namespace __cpo { + inline constexpr auto counted = __counted::__fn{}; +} // namespace __cpo + +} // namespace ranges::views + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_COUNTED_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/dangling.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/dangling.h new file mode 100644 index 0000000..45ff83b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/dangling.h
@@ -0,0 +1,42 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_DANGLING_H +#define _LIBCPP___RANGES_DANGLING_H + +#include <__config> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { +struct dangling { + dangling() = default; + _LIBCPP_HIDE_FROM_ABI constexpr dangling(auto&&...) noexcept {} +}; + +template <range _Rp> +using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>; + +// borrowed_subrange_t defined in <__ranges/subrange.h> +} // namespace ranges + +#endif // !_LIBCPP_HAS_NO_RANGES + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_DANGLING_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/data.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/data.h new file mode 100644 index 0000000..7eade49 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/data.h
@@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_DATA_H +#define _LIBCPP___RANGES_DATA_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__memory/pointer_traits.h> +#include <__ranges/access.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format off +namespace ranges { +// [range.prim.data] +namespace __data { + template <class _Tp> + concept __ptr_to_object = is_pointer_v<_Tp> && is_object_v<remove_pointer_t<_Tp>>; + + template <class _Tp> + concept __member_data = + requires(_Tp&& __t) { + { _VSTD::forward<_Tp>(__t) } -> __can_borrow; + { __t.data() } -> __ptr_to_object; + }; + + template <class _Tp> + concept __ranges_begin_invocable = + !__member_data<_Tp> && + requires(_Tp&& __t) { + { _VSTD::forward<_Tp>(__t) } -> __can_borrow; + { ranges::begin(_VSTD::forward<_Tp>(__t)) } -> contiguous_iterator; + }; + + struct __fn { + template <__member_data _Tp> + requires __can_borrow<_Tp> + _LIBCPP_HIDE_FROM_ABI + constexpr __ptr_to_object auto operator()(_Tp&& __t) const + noexcept(noexcept(__t.data())) { + return __t.data(); + } + + template<__ranges_begin_invocable _Tp> + requires __can_borrow<_Tp> + _LIBCPP_HIDE_FROM_ABI + constexpr __ptr_to_object auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::to_address(ranges::begin(_VSTD::forward<_Tp>(__t))))) { + return _VSTD::to_address(ranges::begin(_VSTD::forward<_Tp>(__t))); + } + }; +} // end namespace __data + +inline namespace __cpo { + inline constexpr auto data = __data::__fn{}; +} // namespace __cpo +} // namespace ranges + +// clang-format off + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_DATA_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/drop_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/drop_view.h new file mode 100644 index 0000000..6adb09c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/drop_view.h
@@ -0,0 +1,127 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_DROP_VIEW_H +#define _LIBCPP___RANGES_DROP_VIEW_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/next.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<view _View> + class drop_view + : public view_interface<drop_view<_View>> + { + // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an + // amortized O(1) begin() method. If this is an input_range, then we cannot cache + // begin because begin is not equality preserving. + // Note: drop_view<input-range>::begin() is still trivially amortized O(1) because + // one can't call begin() on it more than once. + static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>); + using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>; + [[no_unique_address]] _Cache __cached_begin_ = _Cache(); + range_difference_t<_View> __count_ = 0; + _View __base_ = _View(); + +public: + drop_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr drop_view(_View __base, range_difference_t<_View> __count) + : __count_(__count) + , __base_(_VSTD::move(__base)) + { + _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero."); + } + + _LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() + requires (!(__simple_view<_View> && + random_access_range<const _View> && sized_range<const _View>)) + { + if constexpr (_UseCache) + if (__cached_begin_.__has_value()) + return *__cached_begin_; + + auto __tmp = ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); + if constexpr (_UseCache) + __cached_begin_.__emplace(__tmp); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const + requires random_access_range<const _View> && sized_range<const _View> + { + return ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() + requires (!__simple_view<_View>) + { return ranges::end(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const + requires range<const _View> + { return ranges::end(__base_); } + + _LIBCPP_HIDE_FROM_ABI + static constexpr auto __size(auto& __self) { + const auto __s = ranges::size(__self.__base_); + const auto __c = static_cast<decltype(__s)>(__self.__count_); + return __s < __c ? 0 : __s - __c; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() + requires sized_range<_View> + { return __size(*this); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires sized_range<const _View> + { return __size(*this); } + }; + + template<class _Range> + drop_view(_Range&&, range_difference_t<_Range>) -> drop_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<drop_view<_Tp>> = enable_borrowed_range<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_DROP_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty.h new file mode 100644 index 0000000..fc6a938 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty.h
@@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_EMPTY_H +#define _LIBCPP___RANGES_EMPTY_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__ranges/access.h> +#include <__ranges/size.h> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format off +namespace ranges { +// [range.prim.empty] +namespace __empty { + template <class _Tp> + concept __member_empty = requires(_Tp&& __t) { + bool(_VSTD::forward<_Tp>(__t).empty()); + }; + + template<class _Tp> + concept __can_invoke_size = + !__member_empty<_Tp> && + requires(_Tp&& __t) { ranges::size(_VSTD::forward<_Tp>(__t)); }; + + template <class _Tp> + concept __can_compare_begin_end = + !__member_empty<_Tp> && + !__can_invoke_size<_Tp> && + requires(_Tp&& __t) { + bool(ranges::begin(__t) == ranges::end(__t)); + { ranges::begin(__t) } -> forward_iterator; + }; + + struct __fn { + template <__member_empty _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(bool(__t.empty()))) { + return __t.empty(); + } + + template <__can_invoke_size _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(ranges::size(_VSTD::forward<_Tp>(__t)))) { + return ranges::size(_VSTD::forward<_Tp>(__t)) == 0; + } + + template<__can_compare_begin_end _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const + noexcept(noexcept(bool(ranges::begin(__t) == ranges::end(__t)))) { + return ranges::begin(__t) == ranges::end(__t); + } + }; +} + +inline namespace __cpo { + inline constexpr auto empty = __empty::__fn{}; +} // namespace __cpo +} // namespace ranges +// clang-format off + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_EMPTY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty_view.h new file mode 100644 index 0000000..4a98a6f --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/empty_view.h
@@ -0,0 +1,41 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_EMPTY_VIEW_H +#define _LIBCPP___RANGES_EMPTY_VIEW_H + +#include <__config> +#include <__ranges/view_interface.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<class _Tp> + requires is_object_v<_Tp> + class empty_view : public view_interface<empty_view<_Tp>> { + public: + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; } + _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; } + _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; } + }; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_EMPTY_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_borrowed_range.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_borrowed_range.h new file mode 100644 index 0000000..20b1d42 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_borrowed_range.h
@@ -0,0 +1,41 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H +#define _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H + +// These customization variables are used in <span> and <string_view>. The +// separate header is used to avoid including the entire <ranges> header in +// <span> and <string_view>. + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges +{ + +// [range.range], ranges + +template <class> +inline constexpr bool enable_borrowed_range = false; + +} // namespace ranges + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_view.h new file mode 100644 index 0000000..a09de11 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/enable_view.h
@@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_ENABLE_VIEW_H +#define _LIBCPP___RANGES_ENABLE_VIEW_H + +#include <__config> +#include <concepts> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + +struct view_base { }; + +template <class _Tp> +inline constexpr bool enable_view = derived_from<_Tp, view_base>; + +} // end namespace ranges + +#endif // !_LIBCPP_HAS_NO_RANGES + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_ENABLE_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/iota_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/iota_view.h new file mode 100644 index 0000000..da712b8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/iota_view.h
@@ -0,0 +1,408 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_IOTA_VIEW_H +#define _LIBCPP___RANGES_IOTA_VIEW_H + +#include <__compare/three_way_comparable.h> +#include <__concepts/arithmetic.h> +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/equality_comparable.h> +#include <__concepts/invocable.h> +#include <__concepts/same_as.h> +#include <__concepts/semiregular.h> +#include <__concepts/totally_ordered.h> +#include <__config> +#include <__debug> +#include <__functional/ranges_operations.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/unreachable_sentinel.h> +#include <__ranges/copyable_box.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<class _Int> + struct __get_wider_signed { + static auto __call() { + if constexpr (sizeof(_Int) < sizeof(short)) return type_identity<short>{}; + else if constexpr (sizeof(_Int) < sizeof(int)) return type_identity<int>{}; + else if constexpr (sizeof(_Int) < sizeof(long)) return type_identity<long>{}; + else return type_identity<long long>{}; + + static_assert(sizeof(_Int) <= sizeof(long long), + "Found integer-like type that is bigger than largest integer like type."); + } + + using type = typename decltype(__call())::type; + }; + + template<class _Start> + using _IotaDiffT = typename _If< + (!integral<_Start> || sizeof(iter_difference_t<_Start>) > sizeof(_Start)), + type_identity<iter_difference_t<_Start>>, + __get_wider_signed<_Start> + >::type; + + template<class _Iter> + concept __decrementable = incrementable<_Iter> && requires(_Iter __i) { + { --__i } -> same_as<_Iter&>; + { __i-- } -> same_as<_Iter>; + }; + + template<class _Iter> + concept __advanceable = + __decrementable<_Iter> && totally_ordered<_Iter> && + requires(_Iter __i, const _Iter __j, const _IotaDiffT<_Iter> __n) { + { __i += __n } -> same_as<_Iter&>; + { __i -= __n } -> same_as<_Iter&>; + _Iter(__j + __n); + _Iter(__n + __j); + _Iter(__j - __n); + { __j - __j } -> convertible_to<_IotaDiffT<_Iter>>; + }; + + template<class> + struct __iota_iterator_category {}; + + template<incrementable _Tp> + struct __iota_iterator_category<_Tp> { + using iterator_category = input_iterator_tag; + }; + + template<weakly_incrementable _Start, semiregular _Bound = unreachable_sentinel_t> + requires __weakly_equality_comparable_with<_Start, _Bound> && copyable<_Start> + class iota_view : public view_interface<iota_view<_Start, _Bound>> { + struct __iterator : public __iota_iterator_category<_Start> { + friend class iota_view; + + using iterator_concept = + _If<__advanceable<_Start>, random_access_iterator_tag, + _If<__decrementable<_Start>, bidirectional_iterator_tag, + _If<incrementable<_Start>, forward_iterator_tag, + /*Else*/ input_iterator_tag>>>; + + using value_type = _Start; + using difference_type = _IotaDiffT<_Start>; + + _Start __value_ = _Start(); + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<_Start> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __iterator(_Start __value) : __value_(_VSTD::move(__value)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) { + return __value_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + ++__value_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { ++*this; } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) requires incrementable<_Start> { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() requires __decrementable<_Start> { + --__value_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) requires __decrementable<_Start> { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator+=(difference_type __n) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { + if (__n >= difference_type(0)) { + __value_ += static_cast<_Start>(__n); + } else { + __value_ -= static_cast<_Start>(-__n); + } + } else { + __value_ += __n; + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator-=(difference_type __n) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { + if (__n >= difference_type(0)) { + __value_ -= static_cast<_Start>(__n); + } else { + __value_ += static_cast<_Start>(-__n); + } + } else { + __value_ -= __n; + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Start operator[](difference_type __n) const + requires __advanceable<_Start> + { + return _Start(__value_ + __n); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires equality_comparable<_Start> + { + return __x.__value_ == __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return __x.__value_ < __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return __y < __x; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return !(__y < __x); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> + { + return !(__x < __y); + } + + friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) + requires totally_ordered<_Start> && three_way_comparable<_Start> + { + return __x.__value_ <=> __y.__value_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(__iterator __i, difference_type __n) + requires __advanceable<_Start> + { + __i += __n; + return __i; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(difference_type __n, __iterator __i) + requires __advanceable<_Start> + { + return __i + __n; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator-(__iterator __i, difference_type __n) + requires __advanceable<_Start> + { + __i -= __n; + return __i; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) + requires __advanceable<_Start> + { + if constexpr (__integer_like<_Start>) { + if constexpr (__signed_integer_like<_Start>) { + return difference_type(difference_type(__x.__value_) - difference_type(__y.__value_)); + } + if (__y.__value_ > __x.__value_) { + return difference_type(-difference_type(__y.__value_ - __x.__value_)); + } + return difference_type(__x.__value_ - __y.__value_); + } + return __x.__value_ - __y.__value_; + } + }; + + struct __sentinel { + friend class iota_view; + + private: + _Bound __bound_ = _Bound(); + + public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + constexpr explicit __sentinel(_Bound __bound) : __bound_(_VSTD::move(__bound)) {} + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) { + return __x.__value_ == __y.__bound_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Start> operator-(const __iterator& __x, const __sentinel& __y) + requires sized_sentinel_for<_Bound, _Start> + { + return __x.__value_ - __y.__bound_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr iter_difference_t<_Start> operator-(const __sentinel& __x, const __iterator& __y) + requires sized_sentinel_for<_Bound, _Start> + { + return -(__y - __x); + } + }; + + _Start __value_ = _Start(); + _Bound __bound_ = _Bound(); + + public: + _LIBCPP_HIDE_FROM_ABI + iota_view() requires default_initializable<_Start> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit iota_view(_Start __value) : __value_(_VSTD::move(__value)) { } + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(type_identity_t<_Start> __value, type_identity_t<_Bound> __bound) + : __value_(_VSTD::move(__value)), __bound_(_VSTD::move(__bound)) { + // Validate the precondition if possible. + if constexpr (totally_ordered_with<_Start, _Bound>) { + _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_), + "Precondition violated: value is greater than bound."); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, __iterator __last) + requires same_as<_Start, _Bound> + : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last.__value_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, _Bound __last) + requires same_as<_Bound, unreachable_sentinel_t> + : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr iota_view(__iterator __first, __sentinel __last) + requires (!same_as<_Start, _Bound> && !same_as<_Start, unreachable_sentinel_t>) + : iota_view(_VSTD::move(__first.__value_), _VSTD::move(__last.__bound_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator begin() const { return __iterator{__value_}; } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const { + if constexpr (same_as<_Bound, unreachable_sentinel_t>) + return unreachable_sentinel; + else + return __sentinel{__bound_}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator end() const requires same_as<_Start, _Bound> { + return __iterator{__bound_}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires (same_as<_Start, _Bound> && __advanceable<_Start>) || + (integral<_Start> && integral<_Bound>) || + sized_sentinel_for<_Bound, _Start> + { + if constexpr (__integer_like<_Start> && __integer_like<_Bound>) { + if (__value_ < 0) { + if (__bound_ < 0) { + return _VSTD::__to_unsigned_like(-__value_) - _VSTD::__to_unsigned_like(-__bound_); + } + return _VSTD::__to_unsigned_like(__bound_) + _VSTD::__to_unsigned_like(-__value_); + } + return _VSTD::__to_unsigned_like(__bound_) - _VSTD::__to_unsigned_like(__value_); + } + return _VSTD::__to_unsigned_like(__bound_ - __value_); + } + }; + + template<class _Start, class _Bound> + requires (!__integer_like<_Start> || !__integer_like<_Bound> || + (__signed_integer_like<_Start> == __signed_integer_like<_Bound>)) + iota_view(_Start, _Bound) -> iota_view<_Start, _Bound>; + + template<class _Start, class _Bound> + inline constexpr bool enable_borrowed_range<iota_view<_Start, _Bound>> = true; + +namespace views { +namespace __iota { + struct __fn { + template<class _Start> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Start&& __start) const + noexcept(noexcept(ranges::iota_view(_VSTD::forward<_Start>(__start)))) + -> decltype( ranges::iota_view(_VSTD::forward<_Start>(__start))) + { return ranges::iota_view(_VSTD::forward<_Start>(__start)); } + + template<class _Start, class _Bound> + _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Start&& __start, _Bound&& __bound) const + noexcept(noexcept(ranges::iota_view(_VSTD::forward<_Start>(__start), _VSTD::forward<_Bound>(__bound)))) + -> decltype( ranges::iota_view(_VSTD::forward<_Start>(__start), _VSTD::forward<_Bound>(__bound))) + { return ranges::iota_view(_VSTD::forward<_Start>(__start), _VSTD::forward<_Bound>(__bound)); } + }; +} // namespace __iota + +inline namespace __cpo { + inline constexpr auto iota = __iota::__fn{}; +} +} // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_IOTA_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/join_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/join_view.h new file mode 100644 index 0000000..9aa69da --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/join_view.h
@@ -0,0 +1,350 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_JOIN_VIEW_H +#define _LIBCPP___RANGES_JOIN_VIEW_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/ref_view.h> +#include <__ranges/subrange.h> +#include <__ranges/view_interface.h> +#include <__utility/declval.h> +#include <__utility/forward.h> +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<class> + struct __join_view_iterator_category {}; + + template<class _View> + requires is_reference_v<range_reference_t<_View>> && + forward_range<_View> && + forward_range<range_reference_t<_View>> + struct __join_view_iterator_category<_View> { + using _OuterC = typename iterator_traits<iterator_t<_View>>::iterator_category; + using _InnerC = typename iterator_traits<iterator_t<range_reference_t<_View>>>::iterator_category; + + using iterator_category = _If< + derived_from<_OuterC, bidirectional_iterator_tag> && derived_from<_InnerC, bidirectional_iterator_tag>, + bidirectional_iterator_tag, + _If< + derived_from<_OuterC, forward_iterator_tag> && derived_from<_InnerC, forward_iterator_tag>, + forward_iterator_tag, + input_iterator_tag + > + >; + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + class join_view + : public view_interface<join_view<_View>> { + private: + using _InnerRange = range_reference_t<_View>; + + template<bool> struct __iterator; + template<bool> struct __sentinel; + + static constexpr bool _UseCache = !is_reference_v<_InnerRange>; + using _Cache = _If<_UseCache, __non_propagating_cache<remove_cvref_t<_InnerRange>>, __empty_cache>; + [[no_unique_address]] _Cache __cache_; + _View __base_ = _View(); // TODO: [[no_unique_address]] makes clang crash! File a bug :) + + public: + _LIBCPP_HIDE_FROM_ABI + join_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit join_view(_View __base) + : __base_(_VSTD::move(__base)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() { + constexpr bool __use_const = __simple_view<_View> && + is_reference_v<range_reference_t<_View>>; + return __iterator<__use_const>{*this, ranges::begin(__base_)}; + } + + template<class _V2 = _View> + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const + requires input_range<const _V2> && + is_reference_v<range_reference_t<const _V2>> + { + return __iterator<true>{*this, ranges::begin(__base_)}; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() { + if constexpr (forward_range<_View> && + is_reference_v<_InnerRange> && + forward_range<_InnerRange> && + common_range<_View> && + common_range<_InnerRange>) + return __iterator<__simple_view<_View>>{*this, ranges::end(__base_)}; + else + return __sentinel<__simple_view<_View>>{*this}; + } + + template<class _V2 = _View> + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const + requires input_range<const _V2> && + is_reference_v<range_reference_t<const _V2>> + { + using _ConstInnerRange = range_reference_t<const _View>; + if constexpr (forward_range<const _View> && + is_reference_v<_ConstInnerRange> && + forward_range<_ConstInnerRange> && + common_range<const _View> && + common_range<_ConstInnerRange>) { + return __iterator<true>{*this, ranges::end(__base_)}; + } else { + return __sentinel<true>{*this}; + } + } + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + template<bool _Const> struct join_view<_View>::__sentinel { + template<bool> friend struct __sentinel; + + private: + using _Parent = __maybe_const<_Const, join_view>; + using _Base = __maybe_const<_Const, _View>; + sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(_Parent& __parent) + : __end_(ranges::end(__parent.__base_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __s) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(_VSTD::move(__s.__end_)) {} + + template<bool _OtherConst> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__outer_ == __y.__end_; + } + }; + + template<input_range _View> + requires view<_View> && input_range<range_reference_t<_View>> + template<bool _Const> struct join_view<_View>::__iterator + : public __join_view_iterator_category<__maybe_const<_Const, _View>> { + + template<bool> friend struct __iterator; + + private: + using _Parent = __maybe_const<_Const, join_view>; + using _Base = __maybe_const<_Const, _View>; + using _Outer = iterator_t<_Base>; + using _Inner = iterator_t<range_reference_t<_Base>>; + + static constexpr bool __ref_is_glvalue = is_reference_v<range_reference_t<_Base>>; + + public: + _Outer __outer_ = _Outer(); + + private: + optional<_Inner> __inner_; + _Parent *__parent_ = nullptr; + + _LIBCPP_HIDE_FROM_ABI + constexpr void __satisfy() { + for (; __outer_ != ranges::end(__parent_->__base_); ++__outer_) { + auto&& __inner = [&]() -> auto&& { + if constexpr (__ref_is_glvalue) + return *__outer_; + else + return __parent_->__cache_.__emplace_from([&]() -> decltype(auto) { return *__outer_; }); + }(); + __inner_ = ranges::begin(__inner); + if (*__inner_ != ranges::end(__inner)) + return; + } + + if constexpr (__ref_is_glvalue) + __inner_.reset(); + } + + public: + using iterator_concept = _If< + __ref_is_glvalue && bidirectional_range<_Base> && bidirectional_range<range_reference_t<_Base>>, + bidirectional_iterator_tag, + _If< + __ref_is_glvalue && forward_range<_Base> && forward_range<range_reference_t<_Base>>, + forward_iterator_tag, + input_iterator_tag + > + >; + + using value_type = range_value_t<range_reference_t<_Base>>; + + using difference_type = common_type_t< + range_difference_t<_Base>, range_difference_t<range_reference_t<_Base>>>; + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<_Outer> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(_Parent& __parent, _Outer __outer) + : __outer_(_VSTD::move(__outer)) + , __parent_(_VSTD::addressof(__parent)) { + __satisfy(); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(__iterator<!_Const> __i) + requires _Const && + convertible_to<iterator_t<_View>, _Outer> && + convertible_to<iterator_t<_InnerRange>, _Inner> + : __outer_(_VSTD::move(__i.__outer_)) + , __inner_(_VSTD::move(__i.__inner_)) + , __parent_(__i.__parent_) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() const { + return **__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Inner operator->() const + requires __has_arrow<_Inner> && copyable<_Inner> + { + return *__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + auto&& __inner = [&]() -> auto&& { + if constexpr (__ref_is_glvalue) + return *__outer_; + else + return *__parent_->__cache_; + }(); + if (++*__inner_ == ranges::end(__inner)) { + ++__outer_; + __satisfy(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { + ++*this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) + requires __ref_is_glvalue && + forward_range<_Base> && + forward_range<range_reference_t<_Base>> + { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() + requires __ref_is_glvalue && + bidirectional_range<_Base> && + bidirectional_range<range_reference_t<_Base>> && + common_range<range_reference_t<_Base>> + { + if (__outer_ == ranges::end(__parent_->__base_)) + __inner_ = ranges::end(*--__outer_); + + // Skip empty inner ranges when going backwards. + while (*__inner_ == ranges::begin(*__outer_)) { + __inner_ = ranges::end(*--__outer_); + } + + --*__inner_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) + requires __ref_is_glvalue && + bidirectional_range<_Base> && + bidirectional_range<range_reference_t<_Base>> && + common_range<range_reference_t<_Base>> + { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires __ref_is_glvalue && + equality_comparable<iterator_t<_Base>> && + equality_comparable<iterator_t<range_reference_t<_Base>>> + { + return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) iter_move(const __iterator& __i) + noexcept(noexcept(ranges::iter_move(*__i.__inner_))) + { + return ranges::iter_move(*__i.__inner_); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y) + noexcept(noexcept(ranges::iter_swap(*__x.__inner_, *__y.__inner_))) + requires indirectly_swappable<_Inner> + { + return ranges::iter_swap(*__x.__inner_, *__y.__inner_); + } + }; + + template<class _Range> + explicit join_view(_Range&&) -> join_view<views::all_t<_Range>>; + +} // namespace ranges + +#undef _CONSTEXPR_TERNARY + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_JOIN_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/non_propagating_cache.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/non_propagating_cache.h new file mode 100644 index 0000000..456e08d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/non_propagating_cache.h
@@ -0,0 +1,114 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H +#define _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H + +#include <__config> +#include <__iterator/concepts.h> // indirectly_readable +#include <__iterator/iterator_traits.h> // iter_reference_t +#include <__memory/addressof.h> +#include <__utility/forward.h> +#include <concepts> // constructible_from +#include <optional> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + // __non_propagating_cache is a helper type that allows storing an optional value in it, + // but which does not copy the source's value when it is copy constructed/assigned to, + // and which resets the source's value when it is moved-from. + // + // This type is used as an implementation detail of some views that need to cache the + // result of `begin()` in order to provide an amortized O(1) begin() method. Typically, + // we don't want to propagate the value of the cache upon copy because the cached iterator + // may refer to internal details of the source view. + template<class _Tp> + requires is_object_v<_Tp> + class _LIBCPP_TEMPLATE_VIS __non_propagating_cache { + struct __from_tag { }; + struct __forward_tag { }; + + // This helper class is needed to perform copy and move elision when + // constructing the contained type from an iterator. + struct __wrapper { + template<class ..._Args> + constexpr explicit __wrapper(__forward_tag, _Args&& ...__args) : __t_(_VSTD::forward<_Args>(__args)...) { } + template<class _Fn> + constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) { } + _Tp __t_; + }; + + optional<__wrapper> __value_ = nullopt; + + public: + _LIBCPP_HIDE_FROM_ABI __non_propagating_cache() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache(__non_propagating_cache const&) noexcept + : __value_(nullopt) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache(__non_propagating_cache&& __other) noexcept + : __value_(nullopt) + { + __other.__value_.reset(); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache& operator=(__non_propagating_cache const& __other) noexcept { + if (this != _VSTD::addressof(__other)) { + __value_.reset(); + } + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __non_propagating_cache& operator=(__non_propagating_cache&& __other) noexcept { + __value_.reset(); + __other.__value_.reset(); + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& operator*() { return __value_->__t_; } + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp const& operator*() const { return __value_->__t_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr bool __has_value() const { return __value_.has_value(); } + + template<class _Fn> + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& __emplace_from(_Fn const& __f) { + return __value_.emplace(__from_tag{}, __f).__t_; + } + + template<class ..._Args> + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp& __emplace(_Args&& ...__args) { + return __value_.emplace(__forward_tag{}, _VSTD::forward<_Args>(__args)...).__t_; + } + }; + + struct __empty_cache { }; +} // namespace ranges + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/range_adaptor.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/range_adaptor.h new file mode 100644 index 0000000..74aea31 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/range_adaptor.h
@@ -0,0 +1,73 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_RANGE_ADAPTOR_H +#define _LIBCPP___RANGES_RANGE_ADAPTOR_H + +#include <__config> +#include <__functional/compose.h> +#include <__functional/invoke.h> +#include <__ranges/concepts.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// CRTP base that one can derive from in order to be considered a range adaptor closure +// by the library. When deriving from this class, a pipe operator will be provided to +// make the following hold: +// - `x | f` is equivalent to `f(x)` +// - `f1 | f2` is an adaptor closure `g` such that `g(x)` is equivalent to `f2(f1(x))` +template <class _Tp> +struct __range_adaptor_closure; + +// Type that wraps an arbitrary function object and makes it into a range adaptor closure, +// i.e. something that can be called via the `x | f` notation. +template <class _Fn> +struct __range_adaptor_closure_t : _Fn, __range_adaptor_closure<__range_adaptor_closure_t<_Fn>> { + constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(_VSTD::move(__f)) { } +}; + +template <class _Tp> +concept _RangeAdaptorClosure = derived_from<remove_cvref_t<_Tp>, __range_adaptor_closure<remove_cvref_t<_Tp>>>; + +template <class _Tp> +struct __range_adaptor_closure { + template <ranges::viewable_range _View, _RangeAdaptorClosure _Closure> + requires same_as<_Tp, remove_cvref_t<_Closure>> && + invocable<_Closure, _View> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) operator|(_View&& __view, _Closure&& __closure) + noexcept(is_nothrow_invocable_v<_Closure, _View>) + { return _VSTD::invoke(_VSTD::forward<_Closure>(__closure), _VSTD::forward<_View>(__view)); } + + template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure> + requires same_as<_Tp, remove_cvref_t<_Closure>> && + constructible_from<decay_t<_Closure>, _Closure> && + constructible_from<decay_t<_OtherClosure>, _OtherClosure> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) + noexcept(is_nothrow_constructible_v<decay_t<_Closure>, _Closure> && + is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) + { return __range_adaptor_closure_t(_VSTD::__compose(_VSTD::forward<_OtherClosure>(__c2), _VSTD::forward<_Closure>(__c1))); } +}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/ref_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/ref_view.h new file mode 100644 index 0000000..7567ac4 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/ref_view.h
@@ -0,0 +1,83 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_REF_VIEW_H +#define _LIBCPP___RANGES_REF_VIEW_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/data.h> +#include <__ranges/empty.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<range _Range> + requires is_object_v<_Range> + class ref_view : public view_interface<ref_view<_Range>> { + _Range *__range_; + + static void __fun(_Range&); + static void __fun(_Range&&) = delete; + +public: + template<class _Tp> + requires __different_from<_Tp, ref_view> && + convertible_to<_Tp, _Range&> && requires { __fun(declval<_Tp>()); } + _LIBCPP_HIDE_FROM_ABI + constexpr ref_view(_Tp&& __t) + : __range_(_VSTD::addressof(static_cast<_Range&>(_VSTD::forward<_Tp>(__t)))) + {} + + _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; } + + _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); } + _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr bool empty() const + requires requires { ranges::empty(*__range_); } + { return ranges::empty(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + requires sized_range<_Range> + { return ranges::size(*__range_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() const + requires contiguous_range<_Range> + { return ranges::data(*__range_); } + }; + + template<class _Range> + ref_view(_Range&) -> ref_view<_Range>; + +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_REF_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/reverse_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/reverse_view.h new file mode 100644 index 0000000..618be80 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/reverse_view.h
@@ -0,0 +1,190 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_REVERSE_VIEW_H +#define _LIBCPP___RANGES_REVERSE_VIEW_H + +#include <__concepts/constructible.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/next.h> +#include <__iterator/reverse_iterator.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/non_propagating_cache.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/subrange.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<view _View> + requires bidirectional_range<_View> + class reverse_view : public view_interface<reverse_view<_View>> { + // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an + // amortized O(1) begin() method. + static constexpr bool _UseCache = !random_access_range<_View> && !common_range<_View>; + using _Cache = _If<_UseCache, __non_propagating_cache<reverse_iterator<iterator_t<_View>>>, __empty_cache>; + [[no_unique_address]] _Cache __cached_begin_ = _Cache(); + [[no_unique_address]] _View __base_ = _View(); + + public: + _LIBCPP_HIDE_FROM_ABI + reverse_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit reverse_view(_View __view) : __base_(_VSTD::move(__view)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> begin() { + if constexpr (_UseCache) + if (__cached_begin_.__has_value()) + return *__cached_begin_; + + auto __tmp = _VSTD::make_reverse_iterator(ranges::next(ranges::begin(__base_), ranges::end(__base_))); + if constexpr (_UseCache) + __cached_begin_.__emplace(__tmp); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> begin() requires common_range<_View> { + return _VSTD::make_reverse_iterator(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires common_range<const _View> { + return _VSTD::make_reverse_iterator(ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr reverse_iterator<iterator_t<_View>> end() { + return _VSTD::make_reverse_iterator(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires common_range<const _View> { + return _VSTD::make_reverse_iterator(ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + return ranges::size(__base_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + return ranges::size(__base_); + } + }; + + template<class _Range> + reverse_view(_Range&&) -> reverse_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<reverse_view<_Tp>> = enable_borrowed_range<_Tp>; + + namespace views { + namespace __reverse { + template<class _Tp> + constexpr bool __is_reverse_view = false; + + template<class _Tp> + constexpr bool __is_reverse_view<reverse_view<_Tp>> = true; + + template<class _Tp> + constexpr bool __is_sized_reverse_subrange = false; + + template<class _Iter> + constexpr bool __is_sized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, subrange_kind::sized>> = true; + + template<class _Tp> + constexpr bool __is_unsized_reverse_subrange = false; + + template<class _Iter, subrange_kind _Kind> + constexpr bool __is_unsized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> = _Kind == subrange_kind::unsized; + + template<class _Tp> + struct __unwrapped_reverse_subrange { + using type = void; // avoid SFINAE-ing out the overload below -- let the concept requirements do it for better diagnostics + }; + + template<class _Iter, subrange_kind _Kind> + struct __unwrapped_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> { + using type = subrange<_Iter, _Iter, _Kind>; + }; + + struct __fn : __range_adaptor_closure<__fn> { + template<class _Range> + requires __is_reverse_view<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(_VSTD::forward<_Range>(__range).base())) + -> decltype( _VSTD::forward<_Range>(__range).base()) + { return _VSTD::forward<_Range>(__range).base(); } + + template<class _Range, + class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> + requires __is_sized_reverse_subrange<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()))) + -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size())) + { return _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()); } + + template<class _Range, + class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> + requires __is_unsized_reverse_subrange<remove_cvref_t<_Range>> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base()))) + -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base())) + { return _UnwrappedSubrange(__range.end().base(), __range.begin().base()); } + + template<class _Range> + requires (!__is_reverse_view<remove_cvref_t<_Range>> && + !__is_sized_reverse_subrange<remove_cvref_t<_Range>> && + !__is_unsized_reverse_subrange<remove_cvref_t<_Range>>) + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range) const + noexcept(noexcept(reverse_view{_VSTD::forward<_Range>(__range)})) + -> decltype( reverse_view{_VSTD::forward<_Range>(__range)}) + { return reverse_view{_VSTD::forward<_Range>(__range)}; } + }; + } + + inline namespace __cpo { + inline constexpr auto reverse = __reverse::__fn{}; + } + } // namespace views +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_REVERSE_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/single_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/single_view.h new file mode 100644 index 0000000..412fa9b --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/single_view.h
@@ -0,0 +1,81 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_SINGLE_VIEW_H +#define _LIBCPP___RANGES_SINGLE_VIEW_H + +#include <__config> +#include <__ranges/view_interface.h> +#include <__ranges/copyable_box.h> +#include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<copy_constructible _Tp> + requires is_object_v<_Tp> + class single_view : public view_interface<single_view<_Tp>> { + __copyable_box<_Tp> __value_; + + public: + _LIBCPP_HIDE_FROM_ABI + single_view() requires default_initializable<_Tp> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(const _Tp& __t) : __value_(in_place, __t) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(_Tp&& __t) : __value_(in_place, _VSTD::move(__t)) {} + + template<class... _Args> + requires constructible_from<_Tp, _Args...> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit single_view(in_place_t, _Args&&... __args) + : __value_{in_place, _VSTD::forward<_Args>(__args)...} {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* begin() noexcept { return data(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* begin() const noexcept { return data(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* end() noexcept { return data() + 1; } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* end() const noexcept { return data() + 1; } + + _LIBCPP_HIDE_FROM_ABI + static constexpr size_t size() noexcept { return 1; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Tp* data() noexcept { return __value_.operator->(); } + + _LIBCPP_HIDE_FROM_ABI + constexpr const _Tp* data() const noexcept { return __value_.operator->(); } + }; + + template<class _Tp> + single_view(_Tp) -> single_view<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_SINGLE_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/size.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/size.h new file mode 100644 index 0000000..af0a847 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/size.h
@@ -0,0 +1,127 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_SIZE_H +#define _LIBCPP___RANGES_SIZE_H + +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__utility/decay_copy.h> +#include <__utility/forward.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +// clang-format off +namespace ranges { +template<class> +inline constexpr bool disable_sized_range = false; + +// [range.prim.size] +namespace __size { + void size(auto&) = delete; + void size(const auto&) = delete; + + template <class _Tp> + concept __size_enabled = !disable_sized_range<remove_cvref_t<_Tp>>; + + template <class _Tp> + concept __member_size = __size_enabled<_Tp> && requires(_Tp&& __t) { + { _VSTD::__decay_copy(_VSTD::forward<_Tp>(__t).size()) } -> __integer_like; + }; + + template <class _Tp> + concept __unqualified_size = + __size_enabled<_Tp> && + !__member_size<_Tp> && + __class_or_enum<remove_cvref_t<_Tp>> && + requires(_Tp&& __t) { + { _VSTD::__decay_copy(size(_VSTD::forward<_Tp>(__t))) } -> __integer_like; + }; + + template <class _Tp> + concept __difference = + !__member_size<_Tp> && + !__unqualified_size<_Tp> && + __class_or_enum<remove_cvref_t<_Tp>> && + requires(_Tp&& __t) { + { ranges::begin(__t) } -> forward_iterator; + { ranges::end(__t) } -> sized_sentinel_for<decltype(ranges::begin(declval<_Tp>()))>; + }; + + struct __fn { + template <class _Tp, size_t _Sz> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&&)[_Sz]) const noexcept { + return _Sz; + } + + template <class _Tp, size_t _Sz> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr size_t operator()(_Tp (&)[_Sz]) const noexcept { + return _Sz; + } + + template <__member_size _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const + noexcept(noexcept(_VSTD::forward<_Tp>(__t).size())) { + return _VSTD::forward<_Tp>(__t).size(); + } + + template <__unqualified_size _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const + noexcept(noexcept(size(_VSTD::forward<_Tp>(__t)))) { + return size(_VSTD::forward<_Tp>(__t)); + } + + template<__difference _Tp> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __integer_like auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::end(__t) - ranges::begin(__t))) { + return _VSTD::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t)); + } + }; +} // end namespace __size + +inline namespace __cpo { + inline constexpr auto size = __size::__fn{}; +} // namespace __cpo + +namespace __ssize { + struct __fn { + template<class _Tp> + requires requires (_Tp&& __t) { ranges::size(__t); } + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr integral auto operator()(_Tp&& __t) const + noexcept(noexcept(ranges::size(__t))) { + using _Signed = make_signed_t<decltype(ranges::size(__t))>; + if constexpr (sizeof(ptrdiff_t) > sizeof(_Signed)) + return static_cast<ptrdiff_t>(ranges::size(__t)); + else + return static_cast<_Signed>(ranges::size(__t)); + } + }; +} + +inline namespace __cpo { + inline constexpr auto ssize = __ssize::__fn{}; +} // namespace __cpo +} // namespace ranges + +// clang-format off + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_SIZE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/subrange.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/subrange.h new file mode 100644 index 0000000..af4e276 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/subrange.h
@@ -0,0 +1,287 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_SUBRANGE_H +#define _LIBCPP___RANGES_SUBRANGE_H + +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/derived_from.h> +#include <__concepts/different_from.h> +#include <__config> +#include <__debug> +#include <__iterator/advance.h> +#include <__iterator/concepts.h> +#include <__iterator/incrementable_traits.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/dangling.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__tuple> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<class _From, class _To> + concept __convertible_to_non_slicing = + convertible_to<_From, _To> && + // If they're both pointers, they must have the same element type. + !(is_pointer_v<decay_t<_From>> && + is_pointer_v<decay_t<_To>> && + __different_from<remove_pointer_t<decay_t<_From>>, remove_pointer_t<decay_t<_To>>>); + + template<class _Tp> + concept __pair_like = + !is_reference_v<_Tp> && requires(_Tp __t) { + typename tuple_size<_Tp>::type; // Ensures `tuple_size<T>` is complete. + requires derived_from<tuple_size<_Tp>, integral_constant<size_t, 2>>; + typename tuple_element_t<0, remove_const_t<_Tp>>; + typename tuple_element_t<1, remove_const_t<_Tp>>; + { _VSTD::get<0>(__t) } -> convertible_to<const tuple_element_t<0, _Tp>&>; + { _VSTD::get<1>(__t) } -> convertible_to<const tuple_element_t<1, _Tp>&>; + }; + + template<class _Pair, class _Iter, class _Sent> + concept __pair_like_convertible_from = + !range<_Pair> && __pair_like<_Pair> && + constructible_from<_Pair, _Iter, _Sent> && + __convertible_to_non_slicing<_Iter, tuple_element_t<0, _Pair>> && + convertible_to<_Sent, tuple_element_t<1, _Pair>>; + + enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized }; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter, + subrange_kind _Kind = sized_sentinel_for<_Sent, _Iter> + ? subrange_kind::sized + : subrange_kind::unsized> + requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>) + class _LIBCPP_TEMPLATE_VIS subrange + : public view_interface<subrange<_Iter, _Sent, _Kind>> + { + private: + static constexpr bool _StoreSize = (_Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _Iter>); + static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics + struct _Empty { constexpr _Empty(auto) noexcept { } }; + using _Size = conditional_t<_StoreSize, make_unsigned_t<iter_difference_t<_Iter>>, _Empty>; + [[no_unique_address]] _Iter __begin_ = _Iter(); + [[no_unique_address]] _Sent __end_ = _Sent(); + [[no_unique_address]] _Size __size_ = 0; + + public: + _LIBCPP_HIDE_FROM_ABI + subrange() requires default_initializable<_Iter> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent) + requires _MustProvideSizeAtConstruction + : __begin_(_VSTD::move(__iter)), __end_(std::move(__sent)) + { } + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent, + make_unsigned_t<iter_difference_t<_Iter>> __n) + requires (_Kind == subrange_kind::sized) + : __begin_(_VSTD::move(__iter)), __end_(std::move(__sent)), __size_(__n) + { + if constexpr (sized_sentinel_for<_Sent, _Iter>) + _LIBCPP_ASSERT((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n), + "std::ranges::subrange was passed an invalid size hint"); + } + + template<__different_from<subrange> _Range> + requires borrowed_range<_Range> && + __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range) + requires (!_StoreSize) + : subrange(ranges::begin(__range), ranges::end(__range)) + { } + + template<__different_from<subrange> _Range> + requires borrowed_range<_Range> && + __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range) + requires _StoreSize && sized_range<_Range> + : subrange(__range, ranges::size(__range)) + { } + + template<borrowed_range _Range> + requires __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && + convertible_to<sentinel_t<_Range>, _Sent> + _LIBCPP_HIDE_FROM_ABI + constexpr subrange(_Range&& __range, make_unsigned_t<iter_difference_t<_Iter>> __n) + requires (_Kind == subrange_kind::sized) + : subrange(ranges::begin(__range), ranges::end(__range), __n) + { } + + template<__different_from<subrange> _Pair> + requires __pair_like_convertible_from<_Pair, const _Iter&, const _Sent&> + _LIBCPP_HIDE_FROM_ABI + constexpr operator _Pair() const { + return _Pair(__begin_, __end_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Iter begin() const requires copyable<_Iter> { + return __begin_; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) { + return _VSTD::move(__begin_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Sent end() const { + return __end_; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { + return __begin_ == __end_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const + requires (_Kind == subrange_kind::sized) + { + if constexpr (_StoreSize) + return __size_; + else + return _VSTD::__to_unsigned_like(__end_ - __begin_); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const& + requires forward_iterator<_Iter> + { + auto __tmp = *this; + __tmp.advance(__n); + return __tmp; + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) && { + advance(__n); + return _VSTD::move(*this); + } + + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const + requires bidirectional_iterator<_Iter> + { + auto __tmp = *this; + __tmp.advance(-__n); + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr subrange& advance(iter_difference_t<_Iter> __n) { + if constexpr (bidirectional_iterator<_Iter>) { + if (__n < 0) { + ranges::advance(__begin_, __n); + if constexpr (_StoreSize) + __size_ += _VSTD::__to_unsigned_like(-__n); + return *this; + } + } + + auto __d = __n - ranges::advance(__begin_, __n, __end_); + if constexpr (_StoreSize) + __size_ -= _VSTD::__to_unsigned_like(__d); + return *this; + } + }; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> + subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>; + + template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> + subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) + -> subrange<_Iter, _Sent, subrange_kind::sized>; + + template<borrowed_range _Range> + subrange(_Range&&) -> subrange<iterator_t<_Range>, sentinel_t<_Range>, + (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>) + ? subrange_kind::sized : subrange_kind::unsized>; + + template<borrowed_range _Range> + subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>) + -> subrange<iterator_t<_Range>, sentinel_t<_Range>, subrange_kind::sized>; + + template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> + requires (_Index < 2) + _LIBCPP_HIDE_FROM_ABI + constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) { + if constexpr (_Index == 0) + return __subrange.begin(); + else + return __subrange.end(); + } + + template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> + requires (_Index < 2) + _LIBCPP_HIDE_FROM_ABI + constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) { + if constexpr (_Index == 0) + return __subrange.begin(); + else + return __subrange.end(); + } + + template<class _Ip, class _Sp, subrange_kind _Kp> + inline constexpr bool enable_borrowed_range<subrange<_Ip, _Sp, _Kp>> = true; + + template<range _Rp> + using borrowed_subrange_t = _If<borrowed_range<_Rp>, subrange<iterator_t<_Rp>>, dangling>; +} // namespace ranges + +// [range.subrange.general] + +using ranges::get; + +// [ranges.syn] + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_size<ranges::subrange<_Ip, _Sp, _Kp>> : integral_constant<size_t, 2> {}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<0, ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Ip; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<1, ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Sp; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<0, const ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Ip; +}; + +template<class _Ip, class _Sp, ranges::subrange_kind _Kp> +struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> { + using type = _Sp; +}; + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_SUBRANGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/take_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/take_view.h new file mode 100644 index 0000000..73a57fe --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/take_view.h
@@ -0,0 +1,185 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_TAKE_VIEW_H +#define _LIBCPP___RANGES_TAKE_VIEW_H + +#include <__algorithm/min.h> +#include <__config> +#include <__iterator/concepts.h> +#include <__iterator/counted_iterator.h> +#include <__iterator/default_sentinel.h> +#include <__iterator/iterator_traits.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/enable_borrowed_range.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/move.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + template<view _View> + class take_view : public view_interface<take_view<_View>> { + [[no_unique_address]] _View __base_ = _View(); + range_difference_t<_View> __count_ = 0; + + template<bool> class __sentinel; + + public: + _LIBCPP_HIDE_FROM_ABI + take_view() requires default_initializable<_View> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr take_view(_View __base, range_difference_t<_View> __count) + : __base_(_VSTD::move(__base)), __count_(__count) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() requires (!__simple_view<_View>) { + if constexpr (sized_range<_View>) { + if constexpr (random_access_range<_View>) { + return ranges::begin(__base_); + } else { + using _DifferenceT = range_difference_t<_View>; + auto __size = size(); + return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); + } + } else { + return counted_iterator(ranges::begin(__base_), __count_); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto begin() const requires range<const _View> { + if constexpr (sized_range<const _View>) { + if constexpr (random_access_range<const _View>) { + return ranges::begin(__base_); + } else { + using _DifferenceT = range_difference_t<const _View>; + auto __size = size(); + return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); + } + } else { + return counted_iterator(ranges::begin(__base_), __count_); + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() requires (!__simple_view<_View>) { + if constexpr (sized_range<_View>) { + if constexpr (random_access_range<_View>) { + return ranges::begin(__base_) + size(); + } else { + return default_sentinel; + } + } else { + return __sentinel<false>{ranges::end(__base_)}; + } + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto end() const requires range<const _View> { + if constexpr (sized_range<const _View>) { + if constexpr (random_access_range<const _View>) { + return ranges::begin(__base_) + size(); + } else { + return default_sentinel; + } + } else { + return __sentinel<true>{ranges::end(__base_)}; + } + } + + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { + auto __n = ranges::size(__base_); + // TODO: use ranges::min here. + return _VSTD::min(__n, static_cast<decltype(__n)>(__count_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { + auto __n = ranges::size(__base_); + // TODO: use ranges::min here. + return _VSTD::min(__n, static_cast<decltype(__n)>(__count_)); + } + }; + + template<view _View> + template<bool _Const> + class take_view<_View>::__sentinel { + using _Base = __maybe_const<_Const, _View>; + template<bool _OtherConst> + using _Iter = counted_iterator<iterator_t<__maybe_const<_OtherConst, _View>>>; + [[no_unique_address]] sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + template<bool> + friend class take_view<_View>::__sentinel; + +public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(_VSTD::move(__end)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __s) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(_VSTD::move(__s.__end_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr sentinel_t<_Base> base() const { return __end_; } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { + return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; + } + + template<bool _OtherConst = !_Const> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { + return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; + } + }; + + template<class _Range> + take_view(_Range&&, range_difference_t<_Range>) -> take_view<views::all_t<_Range>>; + + template<class _Tp> + inline constexpr bool enable_borrowed_range<take_view<_Tp>> = enable_borrowed_range<_Tp>; +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___RANGES_TAKE_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/transform_view.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/transform_view.h new file mode 100644 index 0000000..208a9a2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/transform_view.h
@@ -0,0 +1,439 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H +#define _LIBCPP___RANGES_TRANSFORM_VIEW_H + +#include <__compare/three_way_comparable.h> +#include <__concepts/constructible.h> +#include <__concepts/convertible_to.h> +#include <__concepts/copyable.h> +#include <__concepts/derived_from.h> +#include <__concepts/equality_comparable.h> +#include <__concepts/invocable.h> +#include <__config> +#include <__functional/bind_back.h> +#include <__functional/invoke.h> +#include <__iterator/concepts.h> +#include <__iterator/iter_swap.h> +#include <__iterator/iterator_traits.h> +#include <__memory/addressof.h> +#include <__ranges/access.h> +#include <__ranges/all.h> +#include <__ranges/concepts.h> +#include <__ranges/copyable_box.h> +#include <__ranges/empty.h> +#include <__ranges/range_adaptor.h> +#include <__ranges/size.h> +#include <__ranges/view_interface.h> +#include <__utility/forward.h> +#include <__utility/in_place.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + +template<class _View, class _Fn> +concept __transform_view_constraints = + view<_View> && is_object_v<_Fn> && + regular_invocable<_Fn&, range_reference_t<_View>> && + __referenceable<invoke_result_t<_Fn&, range_reference_t<_View>>>; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +class transform_view : public view_interface<transform_view<_View, _Fn>> { + template<bool> class __iterator; + template<bool> class __sentinel; + + [[no_unique_address]] __copyable_box<_Fn> __func_; + [[no_unique_address]] _View __base_ = _View(); + +public: + _LIBCPP_HIDE_FROM_ABI + transform_view() + requires default_initializable<_View> && default_initializable<_Fn> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr transform_view(_View __base, _Fn __func) + : __func_(_VSTD::in_place, _VSTD::move(__func)), __base_(_VSTD::move(__base)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() const& requires copy_constructible<_View> { return __base_; } + _LIBCPP_HIDE_FROM_ABI + constexpr _View base() && { return _VSTD::move(__base_); } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<false> begin() { + return __iterator<false>{*this, ranges::begin(__base_)}; + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<true> begin() const + requires range<const _View> && + regular_invocable<const _Fn&, range_reference_t<const _View>> + { + return __iterator<true>(*this, ranges::begin(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel<false> end() { + return __sentinel<false>(ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<false> end() + requires common_range<_View> + { + return __iterator<false>(*this, ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel<true> end() const + requires range<const _View> && + regular_invocable<const _Fn&, range_reference_t<const _View>> + { + return __sentinel<true>(ranges::end(__base_)); + } + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator<true> end() const + requires common_range<const _View> && + regular_invocable<const _Fn&, range_reference_t<const _View>> + { + return __iterator<true>(*this, ranges::end(__base_)); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() requires sized_range<_View> { return ranges::size(__base_); } + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const requires sized_range<const _View> { return ranges::size(__base_); } +}; + +template<class _Range, class _Fn> +transform_view(_Range&&, _Fn) -> transform_view<views::all_t<_Range>, _Fn>; + +template<class _View> +struct __transform_view_iterator_concept { using type = input_iterator_tag; }; + +template<random_access_range _View> +struct __transform_view_iterator_concept<_View> { using type = random_access_iterator_tag; }; + +template<bidirectional_range _View> +struct __transform_view_iterator_concept<_View> { using type = bidirectional_iterator_tag; }; + +template<forward_range _View> +struct __transform_view_iterator_concept<_View> { using type = forward_iterator_tag; }; + +template<class, class> +struct __transform_view_iterator_category_base {}; + +template<forward_range _View, class _Fn> +struct __transform_view_iterator_category_base<_View, _Fn> { + using _Cat = typename iterator_traits<iterator_t<_View>>::iterator_category; + + using iterator_category = conditional_t< + is_lvalue_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>, + conditional_t< + derived_from<_Cat, contiguous_iterator_tag>, + random_access_iterator_tag, + _Cat + >, + input_iterator_tag + >; +}; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +template<bool _Const> +class transform_view<_View, _Fn>::__iterator + : public __transform_view_iterator_category_base<_View, _Fn> { + + using _Parent = __maybe_const<_Const, transform_view>; + using _Base = __maybe_const<_Const, _View>; + + _Parent *__parent_ = nullptr; + + template<bool> + friend class transform_view<_View, _Fn>::__iterator; + + template<bool> + friend class transform_view<_View, _Fn>::__sentinel; + +public: + iterator_t<_Base> __current_ = iterator_t<_Base>(); + + using iterator_concept = typename __transform_view_iterator_concept<_View>::type; + using value_type = remove_cvref_t<invoke_result_t<_Fn&, range_reference_t<_Base>>>; + using difference_type = range_difference_t<_Base>; + + _LIBCPP_HIDE_FROM_ABI + __iterator() requires default_initializable<iterator_t<_Base>> = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current) + : __parent_(_VSTD::addressof(__parent)), __current_(_VSTD::move(__current)) {} + + // Note: `__i` should always be `__iterator<false>`, but directly using + // `__iterator<false>` is ill-formed when `_Const` is false + // (see http://wg21.link/class.copy.ctor#5). + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator(__iterator<!_Const> __i) + requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>> + : __parent_(__i.__parent_), __current_(_VSTD::move(__i.__current_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr iterator_t<_Base> base() const& + requires copyable<iterator_t<_Base>> + { + return __current_; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr iterator_t<_Base> base() && { + return _VSTD::move(__current_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator*() const + noexcept(noexcept(_VSTD::invoke(*__parent_->__func_, *__current_))) + { + return _VSTD::invoke(*__parent_->__func_, *__current_); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator++() { + ++__current_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr void operator++(int) { ++__current_; } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator++(int) + requires forward_range<_Base> + { + auto __tmp = *this; + ++*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator--() + requires bidirectional_range<_Base> + { + --__current_; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator operator--(int) + requires bidirectional_range<_Base> + { + auto __tmp = *this; + --*this; + return __tmp; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator+=(difference_type __n) + requires random_access_range<_Base> + { + __current_ += __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr __iterator& operator-=(difference_type __n) + requires random_access_range<_Base> + { + __current_ -= __n; + return *this; + } + + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](difference_type __n) const + noexcept(noexcept(_VSTD::invoke(*__parent_->__func_, __current_[__n]))) + requires random_access_range<_Base> + { + return _VSTD::invoke(*__parent_->__func_, __current_[__n]); + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) + requires equality_comparable<iterator_t<_Base>> + { + return __x.__current_ == __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ < __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ > __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ <= __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> + { + return __x.__current_ >= __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) + requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>> + { + return __x.__current_ <=> __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(__iterator __i, difference_type __n) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ + __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator+(difference_type __n, __iterator __i) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ + __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr __iterator operator-(__iterator __i, difference_type __n) + requires random_access_range<_Base> + { + return __iterator{*__i.__parent_, __i.__current_ - __n}; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) + requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> + { + return __x.__current_ - __y.__current_; + } + + _LIBCPP_HIDE_FROM_ABI + friend constexpr decltype(auto) iter_move(const __iterator& __i) + noexcept(noexcept(*__i)) + { + if constexpr (is_lvalue_reference_v<decltype(*__i)>) + return _VSTD::move(*__i); + else + return *__i; + } +}; + +template<input_range _View, copy_constructible _Fn> + requires __transform_view_constraints<_View, _Fn> +template<bool _Const> +class transform_view<_View, _Fn>::__sentinel { + using _Parent = __maybe_const<_Const, transform_view>; + using _Base = __maybe_const<_Const, _View>; + + sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + + template<bool> + friend class transform_view<_View, _Fn>::__iterator; + + template<bool> + friend class transform_view<_View, _Fn>::__sentinel; + +public: + _LIBCPP_HIDE_FROM_ABI + __sentinel() = default; + + _LIBCPP_HIDE_FROM_ABI + constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {} + + // Note: `__i` should always be `__sentinel<false>`, but directly using + // `__sentinel<false>` is ill-formed when `_Const` is false + // (see http://wg21.link/class.copy.ctor#5). + _LIBCPP_HIDE_FROM_ABI + constexpr __sentinel(__sentinel<!_Const> __i) + requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> + : __end_(_VSTD::move(__i.__end_)) {} + + _LIBCPP_HIDE_FROM_ABI + constexpr sentinel_t<_Base> base() const { return __end_; } + + template<bool _OtherConst> + requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__current_ == __y.__end_; + } + + template<bool _OtherConst> + requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> + operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) { + return __x.__current_ - __y.__end_; + } + + template<bool _OtherConst> + requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> + _LIBCPP_HIDE_FROM_ABI + friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> + operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) { + return __x.__end_ - __y.__current_; + } +}; + +namespace views { +namespace __transform { + struct __fn { + template<class _Range, class _Fn> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Range&& __range, _Fn&& __f) const + noexcept(noexcept(transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f)))) + -> decltype( transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f))) + { return transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f)); } + + template<class _Fn> + requires constructible_from<decay_t<_Fn>, _Fn> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI + constexpr auto operator()(_Fn&& __f) const + noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) + { return __range_adaptor_closure_t(_VSTD::__bind_back(*this, _VSTD::forward<_Fn>(__f))); } + }; +} + +inline namespace __cpo { + inline constexpr auto transform = __transform::__fn{}; +} +} // namespace views + +} // namespace ranges + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/view_interface.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/view_interface.h new file mode 100644 index 0000000..8a1f5d8 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__ranges/view_interface.h
@@ -0,0 +1,196 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___RANGES_VIEW_INTERFACE_H +#define _LIBCPP___RANGES_VIEW_INTERFACE_H + +#include <__config> +#include <__debug> +#include <__iterator/concepts.h> +#include <__iterator/iterator_traits.h> +#include <__iterator/prev.h> +#include <__memory/pointer_traits.h> +#include <__ranges/access.h> +#include <__ranges/concepts.h> +#include <__ranges/empty.h> +#include <__ranges/enable_view.h> +#include <concepts> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if !defined(_LIBCPP_HAS_NO_RANGES) + +namespace ranges { + +template<class _Tp> +concept __can_empty = requires(_Tp __t) { ranges::empty(__t); }; + +template<class _Tp> +void __implicitly_convert_to(type_identity_t<_Tp>) noexcept; + +template<class _Derived> + requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> +class view_interface : public view_base { + _LIBCPP_HIDE_FROM_ABI + constexpr _Derived& __derived() noexcept { + static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); + return static_cast<_Derived&>(*this); + } + + _LIBCPP_HIDE_FROM_ABI + constexpr _Derived const& __derived() const noexcept { + static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); + return static_cast<_Derived const&>(*this); + } + +public: + template<class _D2 = _Derived> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() + noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) + requires forward_range<_D2> + { + return ranges::begin(__derived()) == ranges::end(__derived()); + } + + template<class _D2 = _Derived> + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const + noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) + requires forward_range<const _D2> + { + return ranges::begin(__derived()) == ranges::end(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() + noexcept(noexcept(ranges::empty(declval<_D2>()))) + requires __can_empty<_D2> + { + return !ranges::empty(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr explicit operator bool() const + noexcept(noexcept(ranges::empty(declval<const _D2>()))) + requires __can_empty<const _D2> + { + return !ranges::empty(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() + noexcept(noexcept(_VSTD::to_address(ranges::begin(__derived())))) + requires contiguous_iterator<iterator_t<_D2>> + { + return _VSTD::to_address(ranges::begin(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto data() const + noexcept(noexcept(_VSTD::to_address(ranges::begin(__derived())))) + requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>> + { + return _VSTD::to_address(ranges::begin(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() + noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) + requires forward_range<_D2> + && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>> + { + return ranges::end(__derived()) - ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr auto size() const + noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) + requires forward_range<const _D2> + && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>> + { + return ranges::end(__derived()) - ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) front() + noexcept(noexcept(*ranges::begin(__derived()))) + requires forward_range<_D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); + return *ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) front() const + noexcept(noexcept(*ranges::begin(__derived()))) + requires forward_range<const _D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); + return *ranges::begin(__derived()); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) back() + noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) + requires bidirectional_range<_D2> && common_range<_D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); + return *ranges::prev(ranges::end(__derived())); + } + + template<class _D2 = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) back() const + noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) + requires bidirectional_range<const _D2> && common_range<const _D2> + { + _LIBCPP_ASSERT(!empty(), + "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); + return *ranges::prev(ranges::end(__derived())); + } + + template<random_access_range _RARange = _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) + noexcept(noexcept(ranges::begin(__derived())[__index])) + { + return ranges::begin(__derived())[__index]; + } + + template<random_access_range _RARange = const _Derived> + _LIBCPP_HIDE_FROM_ABI + constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const + noexcept(noexcept(ranges::begin(__derived())[__index])) + { + return ranges::begin(__derived())[__index]; + } +}; + +} + +#endif // !defined(_LIBCPP_HAS_NO_RANGES) + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__split_buffer b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__split_buffer index d212804..2642cf6 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__split_buffer +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__split_buffer
@@ -3,8 +3,9 @@ #define _LIBCPP_SPLIT_BUFFER #include <__config> -#include <type_traits> +#include <__utility/forward.h> #include <algorithm> +#include <type_traits> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -16,17 +17,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template <bool> -class __split_buffer_common -{ -protected: - void __throw_length_error() const; - void __throw_out_of_range() const; -}; - template <class _Tp, class _Allocator = allocator<_Tp> > struct __split_buffer - : private __split_buffer_common<true> { private: __split_buffer(const __split_buffer&); @@ -247,7 +239,7 @@ size_type __old_cap = __end_cap() - __first_; size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8); __split_buffer __buf(__new_cap, 0, __a); - for (pointer __p = __begin_; __p != __end_; ++__p, ++__buf.__end_) + for (pointer __p = __begin_; __p != __end_; ++__p, (void) ++__buf.__end_) __alloc_traits::construct(__buf.__alloc(), _VSTD::__to_address(__buf.__end_), _VSTD::move(*__p)); swap(__buf); @@ -266,8 +258,8 @@ >::type __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last) { - _ConstructTransaction __tx(&this->__end_, std::distance(__first, __last)); - for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, ++__first) { + _ConstructTransaction __tx(&this->__end_, _VSTD::distance(__first, __last)); + for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void) ++__first) { __alloc_traits::construct(this->__alloc(), _VSTD::__to_address(__tx.__pos_), *__first); } @@ -279,7 +271,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type) { while (__begin_ != __new_begin) - __alloc_traits::destroy(__alloc(), __to_address(__begin_++)); + __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++)); } template <class _Tp, class _Allocator> @@ -296,7 +288,7 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT { while (__new_last != __end_) - __alloc_traits::destroy(__alloc(), __to_address(--__end_)); + __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_)); } template <class _Tp, class _Allocator> @@ -416,7 +408,7 @@ _VSTD::swap(__begin_, __x.__begin_); _VSTD::swap(__end_, __x.__end_); _VSTD::swap(__end_cap(), __x.__end_cap()); - __swap_allocator(__alloc(), __x.__alloc()); + _VSTD::__swap_allocator(__alloc(), __x.__alloc()); } template <class _Tp, class _Allocator> @@ -444,7 +436,7 @@ #ifndef _LIBCPP_NO_EXCEPTIONS try { -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS __split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); @@ -458,7 +450,7 @@ catch (...) { } -#endif // _LIBCPP_NO_EXCEPTIONS +#endif // _LIBCPP_NO_EXCEPTIONS } } @@ -625,4 +617,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP_SPLIT_BUFFER +#endif // _LIBCPP_SPLIT_BUFFER
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__sso_allocator b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__sso_allocator deleted file mode 100644 index 117b728..0000000 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__sso_allocator +++ /dev/null
@@ -1,77 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___SSO_ALLOCATOR -#define _LIBCPP___SSO_ALLOCATOR - -#include <__config> -#include <memory> -#include <new> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp, size_t _Np> class _LIBCPP_HIDDEN __sso_allocator; - -template <size_t _Np> -class _LIBCPP_HIDDEN __sso_allocator<void, _Np> -{ -public: - typedef const void* const_pointer; - typedef void value_type; -}; - -template <class _Tp, size_t _Np> -class _LIBCPP_HIDDEN __sso_allocator -{ - typename aligned_storage<sizeof(_Tp) * _Np>::type buf_; - bool __allocated_; -public: - typedef size_t size_type; - typedef _Tp* pointer; - typedef _Tp value_type; - - _LIBCPP_INLINE_VISIBILITY __sso_allocator() throw() : __allocated_(false) {} - _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator&) throw() : __allocated_(false) {} - template <class _Up> _LIBCPP_INLINE_VISIBILITY __sso_allocator(const __sso_allocator<_Up, _Np>&) throw() - : __allocated_(false) {} -private: - __sso_allocator& operator=(const __sso_allocator&); -public: - _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, typename __sso_allocator<void, _Np>::const_pointer = 0) - { - if (!__allocated_ && __n <= _Np) - { - __allocated_ = true; - return (pointer)&buf_; - } - return allocator<_Tp>().allocate(__n); - } - _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type __n) - { - if (__p == (pointer)&buf_) - __allocated_ = false; - else - allocator<_Tp>().deallocate(__p, __n); - } - _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);} - - _LIBCPP_INLINE_VISIBILITY - bool operator==(__sso_allocator& __a) const {return &buf_ == &__a.buf_;} - _LIBCPP_INLINE_VISIBILITY - bool operator!=(__sso_allocator& __a) const {return &buf_ != &__a.buf_;} -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___SSO_ALLOCATOR
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__std_stream b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__std_stream index 5a9a470..65e90b7 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__std_stream +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__std_stream
@@ -11,10 +11,10 @@ #define _LIBCPP___STD_STREAM #include <__config> -#include <ostream> -#include <istream> #include <__locale> #include <cstdio> +#include <istream> +#include <ostream> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -358,4 +358,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP___STD_STREAM +#endif // _LIBCPP___STD_STREAM
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__string b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__string index 9060bf9..890fb21 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__string +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__string
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===-------------------------- __string ----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -10,53 +10,25 @@ #ifndef _LIBCPP___STRING #define _LIBCPP___STRING -/* - string synopsis - -namespace std -{ - -template <class charT> -struct char_traits -{ - typedef charT char_type; - typedef ... int_type; - typedef streamoff off_type; - typedef streampos pos_type; - typedef mbstate_t state_type; - - static constexpr void assign(char_type& c1, const char_type& c2) noexcept; - static constexpr bool eq(char_type c1, char_type c2) noexcept; - static constexpr bool lt(char_type c1, char_type c2) noexcept; - - static constexpr int compare(const char_type* s1, const char_type* s2, size_t n); - static constexpr size_t length(const char_type* s); - static constexpr const char_type* - find(const char_type* s, size_t n, const char_type& a); - - static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n); // constexpr in C++20 - static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n); // constexpr in C++20 - static constexpr char_type* assign(char_type* s, size_t n, char_type a); // constexpr in C++20 - - static constexpr int_type not_eof(int_type c) noexcept; - static constexpr char_type to_char_type(int_type c) noexcept; - static constexpr int_type to_int_type(char_type c) noexcept; - static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept; - static constexpr int_type eof() noexcept; -}; - -template <> struct char_traits<char>; -template <> struct char_traits<wchar_t>; -template <> struct char_traits<char8_t>; // c++20 - -} // std - -*/ - #include <__config> -#include <algorithm> // for search and min -#include <cstdio> // For EOF. -#include <memory> // for __murmur2_or_cityhash +#include <__algorithm/copy.h> +#include <__algorithm/copy_backward.h> +#include <__algorithm/copy_n.h> +#include <__algorithm/fill_n.h> +#include <__algorithm/find_first_of.h> +#include <__algorithm/find_end.h> +#include <__algorithm/min.h> +#include <__functional/hash.h> // for __murmur2_or_cityhash +#include <__iterator/iterator_traits.h> +#include <cstdio> // for EOF +#include <cstdint> // for uint_least16_t +#include <cstring> // for memcpy +#include <type_traits> // for __libcpp_is_constant_evaluated +#include <iosfwd> // for streampos & friends + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include <cwchar> // for wmemcpy +#endif #include <__debug> @@ -92,7 +64,7 @@ _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(value_type const*, size_type, size_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*)) \ - _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, std::allocator<_CharType> const&)) \ + _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, allocator<_CharType> const&)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_last_not_of(value_type const*, size_type, size_type) const) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::~basic_string()) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find_first_not_of(value_type const*, size_type, size_type) const) \ @@ -108,7 +80,7 @@ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \ - _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \ + _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \ _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \ @@ -158,7 +130,7 @@ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::append(value_type const*, size_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::assign(basic_string const&, size_type, size_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::copy(value_type*, size_type, size_type) const) \ - _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, std::allocator<_CharType> const&)) \ + _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::basic_string(basic_string const&, size_type, size_type, allocator<_CharType> const&)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>::size_type basic_string<_CharType>::find(value_type, size_type) const) \ _Func(_LIBCPP_FUNC_VIS void basic_string<_CharType>::__init(size_type, value_type)) \ _Func(_LIBCPP_FUNC_VIS basic_string<_CharType>& basic_string<_CharType>::insert(size_type, value_type const*)) \ @@ -268,7 +240,7 @@ return __s; ++__s; } - return 0; + return nullptr; } template <class _CharT> @@ -297,7 +269,9 @@ _CharT* char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n) { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } char_type* __r = __s1; for (; __n; --__n, ++__s1, ++__s2) assign(*__s1, *__s2); @@ -318,7 +292,7 @@ // constexpr versions of move/copy/assign. template <class _CharT> -static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED +static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 _CharT* __move_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT { if (__n == 0) return __s1; @@ -331,7 +305,7 @@ } template <class _CharT> -static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED +static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 _CharT* __copy_constexpr(_CharT* __s1, const _CharT* __s2, size_t __n) _NOEXCEPT { _VSTD::copy_n(__s2, __n, __s1); @@ -339,7 +313,7 @@ } template <class _CharT> -static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED +static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 _CharT* __assign_constexpr(_CharT* __s, size_t __n, _CharT __a) _NOEXCEPT { _VSTD::fill_n(__s, __n, __a); @@ -370,27 +344,29 @@ length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);} static _LIBCPP_CONSTEXPR_AFTER_CXX14 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n); + ? _VSTD::__move_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } return __libcpp_is_constant_evaluated() - ? __copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n); + ? _VSTD::__copy_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n); + ? _VSTD::__assign_constexpr(__s, __n, __a) + : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n); } static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT @@ -414,7 +390,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_memcmp(__s1, __s2, __n); #elif _LIBCPP_STD_VER <= 14 - return memcmp(__s1, __s2, __n); + return _VSTD::memcmp(__s1, __s2, __n); #else for (; __n; --__n, ++__s1, ++__s2) { @@ -436,7 +412,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_char_memchr(__s, to_int_type(__a), __n); #elif _LIBCPP_STD_VER <= 14 - return (const char_type*) memchr(__s, to_int_type(__a), __n); + return (const char_type*) _VSTD::memchr(__s, to_int_type(__a), __n); #else for (; __n; --__n) { @@ -451,6 +427,7 @@ // char_traits<wchar_t> +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template <> struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t> { @@ -473,27 +450,29 @@ size_t length(const char_type* __s) _NOEXCEPT; static _LIBCPP_CONSTEXPR_AFTER_CXX14 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : wmemmove(__s1, __s2, __n); + ? _VSTD::__move_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : _VSTD::wmemmove(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } return __libcpp_is_constant_evaluated() - ? __copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : wmemcpy(__s1, __s2, __n); + ? _VSTD::__copy_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : _VSTD::wmemcpy(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : wmemset(__s, __a, __n); + ? _VSTD::__assign_constexpr(__s, __n, __a) + : __n == 0 ? __s : _VSTD::wmemset(__s, __a, __n); } static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} @@ -516,7 +495,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wmemcmp(__s1, __s2, __n); #elif _LIBCPP_STD_VER <= 14 - return wmemcmp(__s1, __s2, __n); + return _VSTD::wmemcmp(__s1, __s2, __n); #else for (; __n; --__n, ++__s1, ++__s2) { @@ -529,18 +508,6 @@ #endif } - -template <class _Traits> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR -inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) _NOEXCEPT { -#if _LIBCPP_DEBUG_LEVEL >= 1 - return __s ? _Traits::length(__s) : (_VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, "p == nullptr", "null pointer pass to non-null argument of char_traits<...>::length")), 0); -#else - return _Traits::length(__s); -#endif -} - inline _LIBCPP_CONSTEXPR_AFTER_CXX14 size_t char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT @@ -548,7 +515,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wcslen(__s); #elif _LIBCPP_STD_VER <= 14 - return wcslen(__s); + return _VSTD::wcslen(__s); #else size_t __len = 0; for (; !eq(*__s, char_type(0)); ++__s) @@ -566,7 +533,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wmemchr(__s, __a, __n); #elif _LIBCPP_STD_VER <= 14 - return wmemchr(__s, __a, __n); + return _VSTD::wmemchr(__s, __a, __n); #else for (; __n; --__n) { @@ -577,9 +544,20 @@ return nullptr; #endif } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +template <class _Traits> +_LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR +inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) _NOEXCEPT { +#if _LIBCPP_DEBUG_LEVEL >= 1 + return __s ? _Traits::length(__s) : (_VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, "p == nullptr", "null pointer pass to non-null argument of char_traits<...>::length")), 0); +#else + return _Traits::length(__s); +#endif +} -#ifndef _LIBCPP_NO_HAS_CHAR8_T +#ifndef _LIBCPP_HAS_NO_CHAR8_T template <> struct _LIBCPP_TEMPLATE_VIS char_traits<char8_t> @@ -606,29 +584,31 @@ _LIBCPP_INLINE_VISIBILITY static constexpr const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n); + ? _VSTD::__move_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n); } - static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT - { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + { + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } return __libcpp_is_constant_evaluated() - ? __copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n); + ? _VSTD::__copy_constexpr(__s1, __s2, __n) + : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n); } - static _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED + static _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { return __libcpp_is_constant_evaluated() - ? __assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n); + ? _VSTD::__assign_constexpr(__s, __n, __a) + : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n); } static inline constexpr int_type not_eof(int_type __c) noexcept @@ -683,10 +663,10 @@ return __s; ++__s; } - return 0; + return nullptr; } -#endif // #_LIBCPP_NO_HAS_CHAR8_T +#endif // #_LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS @@ -765,7 +745,7 @@ return __s; ++__s; } - return 0; + return nullptr; } inline _LIBCPP_CONSTEXPR_AFTER_CXX17 @@ -793,7 +773,9 @@ char16_t* char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } char_type* __r = __s1; for (; __n; --__n, ++__s1, ++__s2) assign(*__s1, *__s2); @@ -885,7 +867,7 @@ return __s; ++__s; } - return 0; + return nullptr; } inline _LIBCPP_CONSTEXPR_AFTER_CXX17 @@ -913,7 +895,9 @@ char32_t* char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + if (!__libcpp_is_constant_evaluated()) { + _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); + } char_type* __r = __s1; for (; __n; --__n, ++__s1, ++__s2) assign(*__s1, *__s2); @@ -930,7 +914,7 @@ return __r; } -#endif // _LIBCPP_HAS_NO_UNICODE_CHARS +#endif // _LIBCPP_HAS_NO_UNICODE_CHARS // helper fns for basic_string and string_view @@ -943,7 +927,7 @@ if (__pos >= __sz) return __npos; const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c); - if (__r == 0) + if (__r == nullptr) return __npos; return static_cast<_SizeT>(__r - __p); } @@ -951,7 +935,7 @@ template <class _CharT, class _Traits> inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT * __search_substring(const _CharT *__first1, const _CharT *__last1, - const _CharT *__first2, const _CharT *__last2) { + const _CharT *__first2, const _CharT *__last2) _NOEXCEPT { // Take advantage of knowing source and pattern lengths. // Stop short when source is smaller than pattern. const ptrdiff_t __len2 = __last2 - __first2; @@ -972,7 +956,7 @@ // Find __f2 the first byte matching in __first1. __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2); - if (__first1 == 0) + if (__first1 == nullptr) return __last1; // It is faster to compare from the first byte of __first1 even if we @@ -1095,7 +1079,7 @@ { const _CharT* __pe = __p + __sz; for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps) - if (_Traits::find(__s, __n, *__ps) == 0) + if (_Traits::find(__s, __n, *__ps) == nullptr) return static_cast<_SizeT>(__ps - __p); } return __npos; @@ -1129,7 +1113,7 @@ else __pos = __sz; for (const _CharT* __ps = __p + __pos; __ps != __p;) - if (_Traits::find(__s, __n, *--__ps) == 0) + if (_Traits::find(__s, __n, *--__ps) == nullptr) return static_cast<_SizeT>(__ps - __p); return __npos; } @@ -1175,4 +1159,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP___STRING +#endif // _LIBCPP___STRING
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/android/locale_bionic.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/android/locale_bionic.h new file mode 100644 index 0000000..8c6d4bd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/android/locale_bionic.h
@@ -0,0 +1,69 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H +#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H + +#if defined(__BIONIC__) + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdlib.h> +#include <xlocale.h> + +#ifdef __cplusplus +} +#endif + +#if defined(__ANDROID__) + +#include <android/api-level.h> +#include <android/ndk-version.h> +#if __ANDROID_API__ < 21 +#include <__support/xlocale/__posix_l_fallback.h> +#endif +// In NDK versions later than 16, locale-aware functions are provided by +// legacy_stdlib_inlines.h +#if __NDK_MAJOR__ <= 16 +#if __ANDROID_API__ < 21 +#include <__support/xlocale/__strtonum_fallback.h> +#elif __ANDROID_API__ < 26 + +#if defined(__cplusplus) +extern "C" { +#endif + +inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char* __nptr, char** __endptr, + locale_t) { + return ::strtof(__nptr, __endptr); +} + +inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char* __nptr, + char** __endptr, locale_t) { + return ::strtod(__nptr, __endptr); +} + +inline _LIBCPP_INLINE_VISIBILITY long strtol_l(const char* __nptr, char** __endptr, + int __base, locale_t) { + return ::strtol(__nptr, __endptr, __base); +} + +#if defined(__cplusplus) +} +#endif + +#endif // __ANDROID_API__ < 26 + +#endif // __NDK_MAJOR__ <= 16 +#endif // defined(__ANDROID__) + +#endif // defined(__BIONIC__) +#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/fuchsia/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/fuchsia/xlocale.h new file mode 100644 index 0000000..e8def81 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/fuchsia/xlocale.h
@@ -0,0 +1,22 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H +#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H + +#if defined(__Fuchsia__) + +#include <cstdlib> +#include <cwchar> +#include <__support/xlocale/__posix_l_fallback.h> +#include <__support/xlocale/__strtonum_fallback.h> + +#endif // defined(__Fuchsia__) + +#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/gettod_zos.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/gettod_zos.h new file mode 100644 index 0000000..46e02a6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/gettod_zos.h
@@ -0,0 +1,53 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H +#define _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H + +#include <time.h> + +static inline int gettimeofdayMonotonic(struct timespec64* Output) { + + // The POSIX gettimeofday() function is not available on z/OS. Therefore, + // we will call stcke and other hardware instructions in implement equivalent. + // Note that nanoseconds alone will overflow when reaching new epoch in 2042. + + struct _t { + uint64_t Hi; + uint64_t Lo; + }; + struct _t Value = {0, 0}; + uint64_t CC = 0; + asm(" stcke %0\n" + " ipm %1\n" + " srlg %1,%1,28\n" + : "=m"(Value), "+r"(CC)::); + + if (CC != 0) { + errno = EMVSTODNOTSET; + return CC; + } + uint64_t us = (Value.Hi >> 4); + uint64_t ns = ((Value.Hi & 0x0F) << 8) + (Value.Lo >> 56); + ns = (ns * 1000) >> 12; + us = us - 2208988800000000; + + register uint64_t DivPair0 asm("r0"); // dividend (upper half), remainder + DivPair0 = 0; + register uint64_t DivPair1 asm("r1"); // dividend (lower half), quotient + DivPair1 = us; + uint64_t Divisor = 1000000; + asm(" dlgr %0,%2" : "+r"(DivPair0), "+r"(DivPair1) : "r"(Divisor) :); + + Output->tv_sec = DivPair1; + Output->tv_nsec = DivPair0 * 1000 + ns; + return 0; +} + +#endif // _LIBCPP_SUPPORT_IBM_GETTOD_ZOS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/limits.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/limits.h new file mode 100644 index 0000000..45f1f1e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/limits.h
@@ -0,0 +1,98 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_LIMITS_H +#define _LIBCPP_SUPPORT_IBM_LIMITS_H + +#if !defined(_AIX) // Linux +#include <math.h> // for HUGE_VAL, HUGE_VALF, HUGE_VALL, and NAN + +static const unsigned int _QNAN_F = 0x7fc00000; +#define NANF (*((float *)(&_QNAN_F))) +static const unsigned int _QNAN_LDBL128[4] = {0x7ff80000, 0x0, 0x0, 0x0}; +#define NANL (*((long double *)(&_QNAN_LDBL128))) +static const unsigned int _SNAN_F= 0x7f855555; +#define NANSF (*((float *)(&_SNAN_F))) +static const unsigned int _SNAN_D[2] = {0x7ff55555, 0x55555555}; +#define NANS (*((double *)(&_SNAN_D))) +static const unsigned int _SNAN_LDBL128[4] = {0x7ff55555, 0x55555555, 0x0, 0x0}; +#define NANSL (*((long double *)(&_SNAN_LDBL128))) + +#define __builtin_huge_val() HUGE_VAL +#define __builtin_huge_valf() HUGE_VALF +#define __builtin_huge_vall() HUGE_VALL +#define __builtin_nan(__dummy) NAN +#define __builtin_nanf(__dummy) NANF +#define __builtin_nanl(__dummy) NANL +#define __builtin_nans(__dummy) NANS +#define __builtin_nansf(__dummy) NANSF +#define __builtin_nansl(__dummy) NANSL + +#else + +#include <math.h> +#include <float.h> // limit constants + +#define __builtin_huge_val() HUGE_VAL //0x7ff0000000000000 +#define __builtin_huge_valf() HUGE_VALF //0x7f800000 +#define __builtin_huge_vall() HUGE_VALL //0x7ff0000000000000 +#define __builtin_nan(__dummy) nan(__dummy) //0x7ff8000000000000 +#define __builtin_nanf(__dummy) nanf(__dummy) // 0x7ff80000 +#define __builtin_nanl(__dummy) nanl(__dummy) //0x7ff8000000000000 +#define __builtin_nans(__dummy) DBL_SNAN //0x7ff5555555555555 +#define __builtin_nansf(__dummy) FLT_SNAN //0x7f855555 +#define __builtin_nansl(__dummy) DBL_SNAN //0x7ff5555555555555 + +#define __FLT_MANT_DIG__ FLT_MANT_DIG +#define __FLT_DIG__ FLT_DIG +#define __FLT_RADIX__ FLT_RADIX +#define __FLT_MIN_EXP__ FLT_MIN_EXP +#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP +#define __FLT_MAX_EXP__ FLT_MAX_EXP +#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP +#define __FLT_MIN__ FLT_MIN +#define __FLT_MAX__ FLT_MAX +#define __FLT_EPSILON__ FLT_EPSILON +// predefined by XLC on LoP +#define __FLT_DENORM_MIN__ 1.40129846e-45F + +#define __DBL_MANT_DIG__ DBL_MANT_DIG +#define __DBL_DIG__ DBL_DIG +#define __DBL_MIN_EXP__ DBL_MIN_EXP +#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP +#define __DBL_MAX_EXP__ DBL_MAX_EXP +#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP +#define __DBL_MIN__ DBL_MIN +#define __DBL_MAX__ DBL_MAX +#define __DBL_EPSILON__ DBL_EPSILON +// predefined by XLC on LoP +#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 + +#define __LDBL_MANT_DIG__ LDBL_MANT_DIG +#define __LDBL_DIG__ LDBL_DIG +#define __LDBL_MIN_EXP__ LDBL_MIN_EXP +#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP +#define __LDBL_MAX_EXP__ LDBL_MAX_EXP +#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP +#define __LDBL_MIN__ LDBL_MIN +#define __LDBL_MAX__ LDBL_MAX +#define __LDBL_EPSILON__ LDBL_EPSILON +// predefined by XLC on LoP +#if __LONGDOUBLE128 +#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L +#else +#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L +#endif + +// predefined by XLC on LoP +#define __CHAR_BIT__ 8 + +#endif // _AIX + +#endif // _LIBCPP_SUPPORT_IBM_LIMITS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/locale_mgmt_zos.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/locale_mgmt_zos.h new file mode 100644 index 0000000..90ad2c2 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/locale_mgmt_zos.h
@@ -0,0 +1,53 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H +#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H + +#if defined(__MVS__) +#include <locale.h> +#include <string> + +#ifdef __cplusplus +extern "C" { +#endif + +#define _LC_MAX LC_MESSAGES /* highest real category */ +#define _NCAT (_LC_MAX + 1) /* maximum + 1 */ + +#define _CATMASK(n) (1 << (n)) +#define LC_COLLATE_MASK _CATMASK(LC_COLLATE) +#define LC_CTYPE_MASK _CATMASK(LC_CTYPE) +#define LC_MONETARY_MASK _CATMASK(LC_MONETARY) +#define LC_NUMERIC_MASK _CATMASK(LC_NUMERIC) +#define LC_TIME_MASK _CATMASK(LC_TIME) +#define LC_MESSAGES_MASK _CATMASK(LC_MESSAGES) +#define LC_ALL_MASK (_CATMASK(_NCAT) - 1) + +typedef struct locale_struct { + int category_mask; + std::string lc_collate; + std::string lc_ctype; + std::string lc_monetary; + std::string lc_numeric; + std::string lc_time; + std::string lc_messages; +} * locale_t; + +// z/OS does not have newlocale, freelocale and uselocale. +// The functions below are workarounds in single thread mode. +locale_t newlocale(int category_mask, const char* locale, locale_t base); +void freelocale(locale_t locobj); +locale_t uselocale(locale_t newloc); + +#ifdef __cplusplus +} +#endif +#endif // defined(__MVS__) +#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_ZOS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/nanosleep.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/nanosleep.h new file mode 100644 index 0000000..9c6b976 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/nanosleep.h
@@ -0,0 +1,55 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_NANOSLEEP_H +#define _LIBCPP_SUPPORT_IBM_NANOSLEEP_H + +#include <unistd.h> + +inline int nanosleep(const struct timespec* __req, struct timespec* __rem) { + // The nanosleep() function is not available on z/OS. Therefore, we will call + // sleep() to sleep for whole seconds and usleep() to sleep for any remaining + // fraction of a second. Any remaining nanoseconds will round up to the next + // microsecond. + if (__req->tv_sec < 0 || __req->tv_nsec < 0 || __req->tv_nsec > 999999999) { + errno = EINVAL; + return -1; + } + long __micro_sec = (__req->tv_nsec + 999) / 1000; + time_t __sec = __req->tv_sec; + if (__micro_sec > 999999) { + ++__sec; + __micro_sec -= 1000000; + } + __sec = static_cast<time_t>(sleep(static_cast<unsigned int>(__sec))); + if (__sec) { + if (__rem) { + // Updating the remaining time to sleep in case of unsuccessful call to sleep(). + __rem->tv_sec = __sec; + __rem->tv_nsec = __micro_sec * 1000; + } + errno = EINTR; + return -1; + } + if (__micro_sec) { + int __rt = usleep(static_cast<unsigned int>(__micro_sec)); + if (__rt != 0 && __rem) { + // The usleep() does not provide the amount of remaining time upon its failure, + // so the time slept will be ignored. + __rem->tv_sec = 0; + __rem->tv_nsec = __micro_sec * 1000; + // The errno is already set. + return -1; + } + return __rt; + } + return 0; +} + +#endif // _LIBCPP_SUPPORT_IBM_NANOSLEEP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/support.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/support.h new file mode 100644 index 0000000..a7751b0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/support.h
@@ -0,0 +1,53 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H +#define _LIBCPP_SUPPORT_IBM_SUPPORT_H + +extern "builtin" int __popcnt4(unsigned int); +extern "builtin" int __popcnt8(unsigned long long); +extern "builtin" unsigned int __cnttz4(unsigned int); +extern "builtin" unsigned int __cnttz8(unsigned long long); +extern "builtin" unsigned int __cntlz4(unsigned int); +extern "builtin" unsigned int __cntlz8(unsigned long long); + +// Builtin functions for counting population +#define __builtin_popcount(x) __popcnt4(x) +#define __builtin_popcountll(x) __popcnt8(x) +#if defined(__64BIT__) +#define __builtin_popcountl(x) __builtin_popcountll(x) +#else +#define __builtin_popcountl(x) __builtin_popcount(x) +#endif + +// Builtin functions for counting trailing zeros +#define __builtin_ctz(x) __cnttz4(x) +#define __builtin_ctzll(x) __cnttz8(x) +#if defined(__64BIT__) +#define __builtin_ctzl(x) __builtin_ctzll(x) +#else +#define __builtin_ctzl(x) __builtin_ctz(x) +#endif + +// Builtin functions for counting leading zeros +#define __builtin_clz(x) __cntlz4(x) +#define __builtin_clzll(x) __cntlz8(x) +#if defined(__64BIT__) +#define __builtin_clzl(x) __builtin_clzll(x) +#else +#define __builtin_clzl(x) __builtin_clz(x) +#endif + +#if defined(__64BIT__) +#define __SIZE_WIDTH__ 64 +#else +#define __SIZE_WIDTH__ 32 +#endif + +#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/xlocale.h new file mode 100644 index 0000000..15b8386 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/ibm/xlocale.h
@@ -0,0 +1,133 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H +#define _LIBCPP_SUPPORT_IBM_XLOCALE_H + +#include <__support/ibm/locale_mgmt_zos.h> +#include <stdarg.h> + +#include "cstdlib" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__MVS__) +#include <wctype.h> +// POSIX routines +#include <__support/xlocale/__posix_l_fallback.h> +#endif // defined(__MVS__) + +namespace { + +struct __setAndRestore { + explicit __setAndRestore(locale_t locale) { + if (locale == (locale_t)0) { + __cloc = newlocale(LC_ALL_MASK, "C", /* base */ (locale_t)0); + __stored = uselocale(__cloc); + } else { + __stored = uselocale(locale); + } + } + + ~__setAndRestore() { + uselocale(__stored); + if (__cloc) + freelocale(__cloc); + } + +private: + locale_t __stored = (locale_t)0; + locale_t __cloc = (locale_t)0; +}; + +} // namespace + +// The following are not POSIX routines. These are quick-and-dirty hacks +// to make things pretend to work +static inline +long long strtoll_l(const char *__nptr, char **__endptr, + int __base, locale_t locale) { + __setAndRestore __newloc(locale); + return strtoll(__nptr, __endptr, __base); +} + +static inline +long strtol_l(const char *__nptr, char **__endptr, + int __base, locale_t locale) { + __setAndRestore __newloc(locale); + return strtol(__nptr, __endptr, __base); +} + +static inline +double strtod_l(const char *__nptr, char **__endptr, + locale_t locale) { + __setAndRestore __newloc(locale); + return strtod(__nptr, __endptr); +} + +static inline +float strtof_l(const char *__nptr, char **__endptr, + locale_t locale) { + __setAndRestore __newloc(locale); + return strtof(__nptr, __endptr); +} + +static inline +long double strtold_l(const char *__nptr, char **__endptr, + locale_t locale) { + __setAndRestore __newloc(locale); + return strtold(__nptr, __endptr); +} + +static inline +unsigned long long strtoull_l(const char *__nptr, char **__endptr, + int __base, locale_t locale) { + __setAndRestore __newloc(locale); + return strtoull(__nptr, __endptr, __base); +} + +static inline +unsigned long strtoul_l(const char *__nptr, char **__endptr, + int __base, locale_t locale) { + __setAndRestore __newloc(locale); + return strtoul(__nptr, __endptr, __base); +} + +static inline +int vasprintf(char **strp, const char *fmt, va_list ap) { + const size_t buff_size = 256; + if ((*strp = (char *)malloc(buff_size)) == NULL) { + return -1; + } + + va_list ap_copy; + // va_copy may not be provided by the C library in C++ 03 mode. +#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy) + __builtin_va_copy(ap_copy, ap); +#else + va_copy(ap_copy, ap); +#endif + int str_size = vsnprintf(*strp, buff_size, fmt, ap_copy); + va_end(ap_copy); + + if ((size_t) str_size >= buff_size) { + if ((*strp = (char *)realloc(*strp, str_size + 1)) == NULL) { + return -1; + } + str_size = vsnprintf(*strp, str_size + 1, fmt, ap); + } + return str_size; +} + +#ifdef __cplusplus +} +#endif +#endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/musl/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/musl/xlocale.h new file mode 100644 index 0000000..2508a8e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/musl/xlocale.h
@@ -0,0 +1,57 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// This adds support for the extended locale functions that are currently +// missing from the Musl C library. +// +// This only works when the specified locale is "C" or "POSIX", but that's +// about as good as we can do without implementing full xlocale support +// in Musl. +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_MUSL_XLOCALE_H +#define _LIBCPP_SUPPORT_MUSL_XLOCALE_H + +#include <cstdlib> +#include <cwchar> + +#ifdef __cplusplus +extern "C" { +#endif + +static inline long long strtoll_l(const char *nptr, char **endptr, int base, + locale_t) { + return strtoll(nptr, endptr, base); +} + +static inline unsigned long long strtoull_l(const char *nptr, char **endptr, + int base, locale_t) { + return strtoull(nptr, endptr, base); +} + +static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr, + int base, locale_t) { + return wcstoll(nptr, endptr, base); +} + +static inline unsigned long long wcstoull_l(const wchar_t *nptr, + wchar_t **endptr, int base, + locale_t) { + return wcstoull(nptr, endptr, base); +} + +static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr, + locale_t) { + return wcstold(nptr, endptr); +} + +#ifdef __cplusplus +} +#endif + +#endif // _LIBCPP_SUPPORT_MUSL_XLOCALE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/newlib/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/newlib/xlocale.h new file mode 100644 index 0000000..b75f926 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/newlib/xlocale.h
@@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H +#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H + +#if defined(_NEWLIB_VERSION) + +#include <cstdlib> +#include <clocale> +#include <cwctype> +#include <ctype.h> +#if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \ + __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5 +#include <__support/xlocale/__nop_locale_mgmt.h> +#include <__support/xlocale/__posix_l_fallback.h> +#include <__support/xlocale/__strtonum_fallback.h> +#endif + +#endif // _NEWLIB_VERSION + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/openbsd/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/openbsd/xlocale.h new file mode 100644 index 0000000..49d66fd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/openbsd/xlocale.h
@@ -0,0 +1,19 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H +#define _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H + +#include <__support/xlocale/__strtonum_fallback.h> +#include <clocale> +#include <cstdlib> +#include <ctype.h> +#include <cwctype> + +#endif
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/floatingpoint.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/floatingpoint.h similarity index 100% rename from aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/floatingpoint.h rename to aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/floatingpoint.h
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/wchar.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/wchar.h similarity index 100% rename from aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/wchar.h rename to aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/wchar.h
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/xlocale.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/xlocale.h similarity index 100% rename from aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/support/solaris/xlocale.h rename to aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/solaris/xlocale.h
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/limits_msvc_win32.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/limits_msvc_win32.h new file mode 100644 index 0000000..c80df66 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/limits_msvc_win32.h
@@ -0,0 +1,71 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H +#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H + +#if !defined(_LIBCPP_MSVCRT) +#error "This header complements the Microsoft C Runtime library, and should not be included otherwise." +#endif +#if defined(__clang__) +#error "This header should only be included when using Microsofts C1XX frontend" +#endif + +#include <float.h> // limit constants +#include <limits.h> // CHAR_BIT +#include <math.h> // HUGE_VAL +#include <ymath.h> // internal MSVC header providing the needed functionality + +#define __CHAR_BIT__ CHAR_BIT + +#define __FLT_MANT_DIG__ FLT_MANT_DIG +#define __FLT_DIG__ FLT_DIG +#define __FLT_RADIX__ FLT_RADIX +#define __FLT_MIN_EXP__ FLT_MIN_EXP +#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP +#define __FLT_MAX_EXP__ FLT_MAX_EXP +#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP +#define __FLT_MIN__ FLT_MIN +#define __FLT_MAX__ FLT_MAX +#define __FLT_EPSILON__ FLT_EPSILON +// predefined by MinGW GCC +#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F + +#define __DBL_MANT_DIG__ DBL_MANT_DIG +#define __DBL_DIG__ DBL_DIG +#define __DBL_RADIX__ DBL_RADIX +#define __DBL_MIN_EXP__ DBL_MIN_EXP +#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP +#define __DBL_MAX_EXP__ DBL_MAX_EXP +#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP +#define __DBL_MIN__ DBL_MIN +#define __DBL_MAX__ DBL_MAX +#define __DBL_EPSILON__ DBL_EPSILON +// predefined by MinGW GCC +#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L) + +#define __LDBL_MANT_DIG__ LDBL_MANT_DIG +#define __LDBL_DIG__ LDBL_DIG +#define __LDBL_RADIX__ LDBL_RADIX +#define __LDBL_MIN_EXP__ LDBL_MIN_EXP +#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP +#define __LDBL_MAX_EXP__ LDBL_MAX_EXP +#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP +#define __LDBL_MIN__ LDBL_MIN +#define __LDBL_MAX__ LDBL_MAX +#define __LDBL_EPSILON__ LDBL_EPSILON +// predefined by MinGW GCC +#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L + +// __builtin replacements/workarounds +#define __builtin_huge_vall() _LInf._Long_double +#define __builtin_nanl(__dummmy) _LNan._Long_double +#define __builtin_nansl(__dummy) _LSnan._Long_double + +#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/locale_win32.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/locale_win32.h new file mode 100644 index 0000000..dd8a600 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/win32/locale_win32.h
@@ -0,0 +1,283 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H +#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H + +#include <__config> +#include <__nullptr> +#include <locale.h> // _locale_t +#include <stdio.h> + +#define _X_ALL LC_ALL +#define _X_COLLATE LC_COLLATE +#define _X_CTYPE LC_CTYPE +#define _X_MONETARY LC_MONETARY +#define _X_NUMERIC LC_NUMERIC +#define _X_TIME LC_TIME +#define _X_MAX LC_MAX +#define _X_MESSAGES 6 +#define _NCAT (_X_MESSAGES + 1) + +#define _CATMASK(n) ((1 << (n)) >> 1) +#define _M_COLLATE _CATMASK(_X_COLLATE) +#define _M_CTYPE _CATMASK(_X_CTYPE) +#define _M_MONETARY _CATMASK(_X_MONETARY) +#define _M_NUMERIC _CATMASK(_X_NUMERIC) +#define _M_TIME _CATMASK(_X_TIME) +#define _M_MESSAGES _CATMASK(_X_MESSAGES) +#define _M_ALL (_CATMASK(_NCAT) - 1) + +#define LC_COLLATE_MASK _M_COLLATE +#define LC_CTYPE_MASK _M_CTYPE +#define LC_MONETARY_MASK _M_MONETARY +#define LC_NUMERIC_MASK _M_NUMERIC +#define LC_TIME_MASK _M_TIME +#define LC_MESSAGES_MASK _M_MESSAGES +#define LC_ALL_MASK ( LC_COLLATE_MASK \ + | LC_CTYPE_MASK \ + | LC_MESSAGES_MASK \ + | LC_MONETARY_MASK \ + | LC_NUMERIC_MASK \ + | LC_TIME_MASK ) + +class __lconv_storage { +public: + __lconv_storage(const lconv *__lc_input) { + __lc = *__lc_input; + + __decimal_point = __lc_input->decimal_point; + __thousands_sep = __lc_input->thousands_sep; + __grouping = __lc_input->grouping; + __int_curr_symbol = __lc_input->int_curr_symbol; + __currency_symbol = __lc_input->currency_symbol; + __mon_decimal_point = __lc_input->mon_decimal_point; + __mon_thousands_sep = __lc_input->mon_thousands_sep; + __mon_grouping = __lc_input->mon_grouping; + __positive_sign = __lc_input->positive_sign; + __negative_sign = __lc_input->negative_sign; + + __lc.decimal_point = const_cast<char *>(__decimal_point.c_str()); + __lc.thousands_sep = const_cast<char *>(__thousands_sep.c_str()); + __lc.grouping = const_cast<char *>(__grouping.c_str()); + __lc.int_curr_symbol = const_cast<char *>(__int_curr_symbol.c_str()); + __lc.currency_symbol = const_cast<char *>(__currency_symbol.c_str()); + __lc.mon_decimal_point = const_cast<char *>(__mon_decimal_point.c_str()); + __lc.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep.c_str()); + __lc.mon_grouping = const_cast<char *>(__mon_grouping.c_str()); + __lc.positive_sign = const_cast<char *>(__positive_sign.c_str()); + __lc.negative_sign = const_cast<char *>(__negative_sign.c_str()); + } + + lconv *__get() { + return &__lc; + } +private: + lconv __lc; + std::string __decimal_point; + std::string __thousands_sep; + std::string __grouping; + std::string __int_curr_symbol; + std::string __currency_symbol; + std::string __mon_decimal_point; + std::string __mon_thousands_sep; + std::string __mon_grouping; + std::string __positive_sign; + std::string __negative_sign; +}; + +class locale_t { +public: + locale_t() + : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {} + locale_t(std::nullptr_t) + : __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {} + locale_t(_locale_t __xlocale, const char* __xlocale_str) + : __locale(__xlocale), __locale_str(__xlocale_str), __lc(nullptr) {} + locale_t(const locale_t &__l) + : __locale(__l.__locale), __locale_str(__l.__locale_str), __lc(nullptr) {} + + ~locale_t() { + delete __lc; + } + + locale_t &operator =(const locale_t &__l) { + __locale = __l.__locale; + __locale_str = __l.__locale_str; + // __lc not copied + return *this; + } + + friend bool operator==(const locale_t& __left, const locale_t& __right) { + return __left.__locale == __right.__locale; + } + + friend bool operator==(const locale_t& __left, int __right) { + return __left.__locale == nullptr && __right == 0; + } + + friend bool operator==(const locale_t& __left, long long __right) { + return __left.__locale == nullptr && __right == 0; + } + + friend bool operator==(const locale_t& __left, std::nullptr_t) { + return __left.__locale == nullptr; + } + + friend bool operator==(int __left, const locale_t& __right) { + return __left == 0 && nullptr == __right.__locale; + } + + friend bool operator==(std::nullptr_t, const locale_t& __right) { + return nullptr == __right.__locale; + } + + friend bool operator!=(const locale_t& __left, const locale_t& __right) { + return !(__left == __right); + } + + friend bool operator!=(const locale_t& __left, int __right) { + return !(__left == __right); + } + + friend bool operator!=(const locale_t& __left, long long __right) { + return !(__left == __right); + } + + friend bool operator!=(const locale_t& __left, std::nullptr_t __right) { + return !(__left == __right); + } + + friend bool operator!=(int __left, const locale_t& __right) { + return !(__left == __right); + } + + friend bool operator!=(std::nullptr_t __left, const locale_t& __right) { + return !(__left == __right); + } + + operator bool() const { + return __locale != nullptr; + } + + const char* __get_locale() const { return __locale_str; } + + operator _locale_t() const { + return __locale; + } + + lconv *__store_lconv(const lconv *__input_lc) { + delete __lc; + __lc = new __lconv_storage(__input_lc); + return __lc->__get(); + } +private: + _locale_t __locale; + const char* __locale_str; + __lconv_storage *__lc = nullptr; +}; + +// Locale management functions +#define freelocale _free_locale +// FIXME: base currently unused. Needs manual work to construct the new locale +locale_t newlocale( int mask, const char * locale, locale_t base ); +// uselocale can't be implemented on Windows because Windows allows partial modification +// of thread-local locale and so _get_current_locale() returns a copy while uselocale does +// not create any copies. +// We can still implement raii even without uselocale though. + + +lconv *localeconv_l( locale_t &loc ); +size_t mbrlen_l( const char *__restrict s, size_t n, + mbstate_t *__restrict ps, locale_t loc); +size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src, + size_t len, mbstate_t *__restrict ps, locale_t loc ); +size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps, + locale_t loc); +size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s, + size_t n, mbstate_t *__restrict ps, locale_t loc); +size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src, + size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc); +size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src, + size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc); +wint_t btowc_l( int c, locale_t loc ); +int wctob_l( wint_t c, locale_t loc ); + +decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l ); + +// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+ +#define mbtowc_l _mbtowc_l +#define strtoll_l _strtoi64_l +#define strtoull_l _strtoui64_l +#define strtod_l _strtod_l +#if defined(_LIBCPP_MSVCRT) +#define strtof_l _strtof_l +#define strtold_l _strtold_l +#else +_LIBCPP_FUNC_VIS float strtof_l(const char*, char**, locale_t); +_LIBCPP_FUNC_VIS long double strtold_l(const char*, char**, locale_t); +#endif +inline _LIBCPP_INLINE_VISIBILITY +int +islower_l(int c, _locale_t loc) +{ + return _islower_l((int)c, loc); +} + +inline _LIBCPP_INLINE_VISIBILITY +int +isupper_l(int c, _locale_t loc) +{ + return _isupper_l((int)c, loc); +} + +#define isdigit_l _isdigit_l +#define isxdigit_l _isxdigit_l +#define strcoll_l _strcoll_l +#define strxfrm_l _strxfrm_l +#define wcscoll_l _wcscoll_l +#define wcsxfrm_l _wcsxfrm_l +#define toupper_l _toupper_l +#define tolower_l _tolower_l +#define iswspace_l _iswspace_l +#define iswprint_l _iswprint_l +#define iswcntrl_l _iswcntrl_l +#define iswupper_l _iswupper_l +#define iswlower_l _iswlower_l +#define iswalpha_l _iswalpha_l +#define iswdigit_l _iswdigit_l +#define iswpunct_l _iswpunct_l +#define iswxdigit_l _iswxdigit_l +#define towupper_l _towupper_l +#define towlower_l _towlower_l +#if defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x0800 +_LIBCPP_FUNC_VIS size_t strftime_l(char *ret, size_t n, const char *format, + const struct tm *tm, locale_t loc); +#else +#define strftime_l _strftime_l +#endif +#define sscanf_l( __s, __l, __f, ...) _sscanf_l( __s, __f, __l, __VA_ARGS__ ) +#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ ) +#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ ) +#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ ) +_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...); +_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... ); +_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap ); + +// not-so-pressing FIXME: use locale to determine blank characters +inline int isblank_l( int c, locale_t /*loc*/ ) +{ + return ( c == ' ' || c == '\t' ); +} +inline int iswblank_l( wint_t c, locale_t /*loc*/ ) +{ + return ( c == L' ' || c == L'\t' ); +} + +#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__nop_locale_mgmt.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__nop_locale_mgmt.h new file mode 100644 index 0000000..57b1884 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__nop_locale_mgmt.h
@@ -0,0 +1,51 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H +#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H + +#ifdef __cplusplus +extern "C" { +#endif + +// Patch over lack of extended locale support +typedef void *locale_t; +static inline locale_t duplocale(locale_t) { + return NULL; +} + +static inline void freelocale(locale_t) { +} + +static inline locale_t newlocale(int, const char *, locale_t) { + return NULL; +} + +static inline locale_t uselocale(locale_t) { + return NULL; +} + +#define LC_COLLATE_MASK (1 << LC_COLLATE) +#define LC_CTYPE_MASK (1 << LC_CTYPE) +#define LC_MESSAGES_MASK (1 << LC_MESSAGES) +#define LC_MONETARY_MASK (1 << LC_MONETARY) +#define LC_NUMERIC_MASK (1 << LC_NUMERIC) +#define LC_TIME_MASK (1 << LC_TIME) +#define LC_ALL_MASK (LC_COLLATE_MASK|\ + LC_CTYPE_MASK|\ + LC_MONETARY_MASK|\ + LC_NUMERIC_MASK|\ + LC_TIME_MASK|\ + LC_MESSAGES_MASK) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__posix_l_fallback.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__posix_l_fallback.h new file mode 100644 index 0000000..00d69d1 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__posix_l_fallback.h
@@ -0,0 +1,164 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// These are reimplementations of some extended locale functions ( *_l ) that +// are normally part of POSIX. This shared implementation provides parts of the +// extended locale support for libc's that normally don't have any (like +// Android's bionic and Newlib). +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H +#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H + +#ifdef __cplusplus +extern "C" { +#endif + +inline _LIBCPP_INLINE_VISIBILITY int isalnum_l(int c, locale_t) { + return ::isalnum(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isalpha_l(int c, locale_t) { + return ::isalpha(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isblank_l(int c, locale_t) { + return ::isblank(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iscntrl_l(int c, locale_t) { + return ::iscntrl(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isdigit_l(int c, locale_t) { + return ::isdigit(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isgraph_l(int c, locale_t) { + return ::isgraph(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int islower_l(int c, locale_t) { + return ::islower(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isprint_l(int c, locale_t) { + return ::isprint(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int ispunct_l(int c, locale_t) { + return ::ispunct(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isspace_l(int c, locale_t) { + return ::isspace(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isupper_l(int c, locale_t) { + return ::isupper(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int isxdigit_l(int c, locale_t) { + return ::isxdigit(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswalnum_l(wint_t c, locale_t) { + return ::iswalnum(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswalpha_l(wint_t c, locale_t) { + return ::iswalpha(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswblank_l(wint_t c, locale_t) { + return ::iswblank(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) { + return ::iswcntrl(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswdigit_l(wint_t c, locale_t) { + return ::iswdigit(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswgraph_l(wint_t c, locale_t) { + return ::iswgraph(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswlower_l(wint_t c, locale_t) { + return ::iswlower(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswprint_l(wint_t c, locale_t) { + return ::iswprint(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswpunct_l(wint_t c, locale_t) { + return ::iswpunct(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswspace_l(wint_t c, locale_t) { + return ::iswspace(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswupper_l(wint_t c, locale_t) { + return ::iswupper(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int iswxdigit_l(wint_t c, locale_t) { + return ::iswxdigit(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int toupper_l(int c, locale_t) { + return ::toupper(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int tolower_l(int c, locale_t) { + return ::tolower(c); +} + +inline _LIBCPP_INLINE_VISIBILITY wint_t towupper_l(wint_t c, locale_t) { + return ::towupper(c); +} + +inline _LIBCPP_INLINE_VISIBILITY wint_t towlower_l(wint_t c, locale_t) { + return ::towlower(c); +} + +inline _LIBCPP_INLINE_VISIBILITY int strcoll_l(const char *s1, const char *s2, + locale_t) { + return ::strcoll(s1, s2); +} + +inline _LIBCPP_INLINE_VISIBILITY size_t strxfrm_l(char *dest, const char *src, + size_t n, locale_t) { + return ::strxfrm(dest, src, n); +} + +inline _LIBCPP_INLINE_VISIBILITY size_t strftime_l(char *s, size_t max, + const char *format, + const struct tm *tm, locale_t) { + return ::strftime(s, max, format, tm); +} + +inline _LIBCPP_INLINE_VISIBILITY int wcscoll_l(const wchar_t *ws1, + const wchar_t *ws2, locale_t) { + return ::wcscoll(ws1, ws2); +} + +inline _LIBCPP_INLINE_VISIBILITY size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, + size_t n, locale_t) { + return ::wcsxfrm(dest, src, n); +} + +#ifdef __cplusplus +} +#endif + +#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__strtonum_fallback.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__strtonum_fallback.h new file mode 100644 index 0000000..1172a5d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__support/xlocale/__strtonum_fallback.h
@@ -0,0 +1,66 @@ +// -*- C++ -*- +//===-----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// These are reimplementations of some extended locale functions ( *_l ) that +// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe +// others). The unifying aspect in this case is that all of these functions +// convert strings to some numeric type. +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H +#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H + +#ifdef __cplusplus +extern "C" { +#endif + +inline _LIBCPP_INLINE_VISIBILITY float strtof_l(const char *nptr, + char **endptr, locale_t) { + return ::strtof(nptr, endptr); +} + +inline _LIBCPP_INLINE_VISIBILITY double strtod_l(const char *nptr, + char **endptr, locale_t) { + return ::strtod(nptr, endptr); +} + +inline _LIBCPP_INLINE_VISIBILITY long double strtold_l(const char *nptr, + char **endptr, locale_t) { + return ::strtold(nptr, endptr); +} + +inline _LIBCPP_INLINE_VISIBILITY long long +strtoll_l(const char *nptr, char **endptr, int base, locale_t) { + return ::strtoll(nptr, endptr, base); +} + +inline _LIBCPP_INLINE_VISIBILITY unsigned long long +strtoull_l(const char *nptr, char **endptr, int base, locale_t) { + return ::strtoull(nptr, endptr, base); +} + +inline _LIBCPP_INLINE_VISIBILITY long long +wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) { + return ::wcstoll(nptr, endptr, base); +} + +inline _LIBCPP_INLINE_VISIBILITY unsigned long long +wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) { + return ::wcstoull(nptr, endptr, base); +} + +inline _LIBCPP_INLINE_VISIBILITY long double wcstold_l(const wchar_t *nptr, + wchar_t **endptr, locale_t) { + return ::wcstold(nptr, endptr); +} + +#ifdef __cplusplus +} +#endif + +#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__thread/poll_with_backoff.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__thread/poll_with_backoff.h new file mode 100644 index 0000000..e1d8a9c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__thread/poll_with_backoff.h
@@ -0,0 +1,68 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP___THREAD_POLL_WITH_BACKOFF_H +#define _LIBCPP___THREAD_POLL_WITH_BACKOFF_H + +#include <__config> +#include <chrono> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64; + +// Polls a thread for a condition given by a predicate, and backs off based on a backoff policy +// before polling again. +// +// - __f is the "test function" that should return true if polling succeeded, and false if it failed. +// +// - __bf is the "backoff policy", which is called with the duration since we started polling. It should +// return false in order to resume polling, and true if polling should stop entirely for some reason. +// In general, backoff policies sleep for some time before returning control to the polling loop. +// +// - __max_elapsed is the maximum duration to try polling for. If the maximum duration is exceeded, +// the polling loop will return false to report a timeout. +template<class _Fn, class _BFn> +_LIBCPP_AVAILABILITY_SYNC _LIBCPP_HIDE_FROM_ABI +bool __libcpp_thread_poll_with_backoff(_Fn&& __f, _BFn&& __bf, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) { + auto const __start = chrono::high_resolution_clock::now(); + for (int __count = 0;;) { + if (__f()) + return true; // _Fn completion means success + if (__count < __libcpp_polling_count) { + __count += 1; + continue; + } + chrono::nanoseconds const __elapsed = chrono::high_resolution_clock::now() - __start; + if (__max_elapsed != chrono::nanoseconds::zero() && __max_elapsed < __elapsed) + return false; // timeout failure + if (__bf(__elapsed)) + return false; // _BFn completion means failure + } +} + +// A trivial backoff policy that always immediately returns the control to +// the polling loop. +// +// This is not very well-behaved since it will cause the polling loop to spin, +// so this should most likely only be used on single-threaded systems where there +// are no other threads to compete with. +struct __spinning_backoff_policy { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR + bool operator()(chrono::nanoseconds const&) const { + return false; + } +}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___THREAD_POLL_WITH_BACKOFF_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__threading_support b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__threading_support index 6501217..0094fca 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__threading_support +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__threading_support
@@ -10,10 +10,17 @@ #ifndef _LIBCPP_THREADING_SUPPORT #define _LIBCPP_THREADING_SUPPORT +#include <__availability> #include <__config> +#include <__thread/poll_with_backoff.h> #include <chrono> -#include <iosfwd> #include <errno.h> +#include <iosfwd> +#include <limits> + +#ifdef __MVS__ +# include <__support/ibm/nanosleep.h> +#endif #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #pragma GCC system_header @@ -26,12 +33,6 @@ #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) # include <pthread.h> # include <sched.h> -# ifdef __APPLE__ -# define _LIBCPP_NO_NATIVE_SEMAPHORES -# endif -# ifndef _LIBCPP_NO_NATIVE_SEMAPHORES -# include <semaphore.h> -# endif #elif defined(_LIBCPP_HAS_THREAD_API_C11) # include <threads.h> #endif @@ -71,22 +72,19 @@ typedef pthread_cond_t __libcpp_condvar_t; #define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER -#ifndef _LIBCPP_NO_NATIVE_SEMAPHORES -// Semaphore -typedef sem_t __libcpp_semaphore_t; -# define _LIBCPP_SEMAPHORE_MAX SEM_VALUE_MAX -#endif - // Execute once typedef pthread_once_t __libcpp_exec_once_flag; #define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT // Thread id -typedef pthread_t __libcpp_thread_id; +#if defined(__MVS__) + typedef unsigned long long __libcpp_thread_id; +#else + typedef pthread_t __libcpp_thread_id; +#endif // Thread -#define _LIBCPP_NULL_THREAD 0U - +#define _LIBCPP_NULL_THREAD ((__libcpp_thread_t())) typedef pthread_t __libcpp_thread_t; // Thread Local Storage @@ -139,9 +137,6 @@ typedef void* __libcpp_condvar_t; #define _LIBCPP_CONDVAR_INITIALIZER 0 -// Semaphore -typedef void* __libcpp_semaphore_t; - // Execute Once typedef void* __libcpp_exec_once_flag; #define _LIBCPP_EXEC_ONCE_INITIALIZER 0 @@ -206,26 +201,6 @@ _LIBCPP_THREAD_ABI_VISIBILITY int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv); -#ifndef _LIBCPP_NO_NATIVE_SEMAPHORES - -// Semaphore -_LIBCPP_THREAD_ABI_VISIBILITY -bool __libcpp_semaphore_init(__libcpp_semaphore_t* __sem, int __init); - -_LIBCPP_THREAD_ABI_VISIBILITY -bool __libcpp_semaphore_destroy(__libcpp_semaphore_t* __sem); - -_LIBCPP_THREAD_ABI_VISIBILITY -bool __libcpp_semaphore_post(__libcpp_semaphore_t* __sem); - -_LIBCPP_THREAD_ABI_VISIBILITY -bool __libcpp_semaphore_wait(__libcpp_semaphore_t* __sem); - -_LIBCPP_THREAD_ABI_VISIBILITY -bool __libcpp_semaphore_wait_timed(__libcpp_semaphore_t* __sem, chrono::nanoseconds const& __ns); - -#endif // _LIBCPP_NO_NATIVE_SEMAPHORES - // Execute once _LIBCPP_THREAD_ABI_VISIBILITY int __libcpp_execute_once(__libcpp_exec_once_flag *flag, @@ -288,34 +263,11 @@ else if(__elapsed > chrono::microseconds(4)) __libcpp_thread_yield(); else - ; // poll + {} // poll return false; } }; -static _LIBCPP_CONSTEXPR const int __libcpp_polling_count = 64; - -template<class _Fn, class _BFn> -_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY -bool __libcpp_thread_poll_with_backoff( - _Fn && __f, _BFn && __bf, chrono::nanoseconds __max_elapsed = chrono::nanoseconds::zero()) -{ - auto const __start = chrono::high_resolution_clock::now(); - for(int __count = 0;;) { - if(__f()) - return true; // _Fn completion means success - if(__count < __libcpp_polling_count) { - __count += 1; - continue; - } - chrono::nanoseconds const __elapsed = chrono::high_resolution_clock::now() - __start; - if(__max_elapsed != chrono::nanoseconds::zero() && __max_elapsed < __elapsed) - return false; // timeout failure - if(__bf(__elapsed)) - return false; // _BFn completion means failure - } -} - #if (!defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)) @@ -382,7 +334,7 @@ return pthread_mutex_trylock(__m) == 0; } -int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m) +int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m) { return pthread_mutex_unlock(__m); } @@ -439,38 +391,6 @@ return pthread_cond_destroy(__cv); } -#ifndef _LIBCPP_NO_NATIVE_SEMAPHORES - -// Semaphore -bool __libcpp_semaphore_init(__libcpp_semaphore_t* __sem, int __init) -{ - return sem_init(__sem, 0, __init) == 0; -} - -bool __libcpp_semaphore_destroy(__libcpp_semaphore_t* __sem) -{ - return sem_destroy(__sem) == 0; -} - -bool __libcpp_semaphore_post(__libcpp_semaphore_t* __sem) -{ - return sem_post(__sem) == 0; -} - -bool __libcpp_semaphore_wait(__libcpp_semaphore_t* __sem) -{ - return sem_wait(__sem) == 0; -} - -bool __libcpp_semaphore_wait_timed(__libcpp_semaphore_t* __sem, chrono::nanoseconds const& __ns) -{ - auto const __abs_time = chrono::system_clock::now().time_since_epoch() + __ns; - __libcpp_timespec_t __ts = __thread_detail::__convert_to_timespec(__abs_time); - return sem_timedwait(__sem, &__ts) == 0; -} - -#endif //_LIBCPP_NO_NATIVE_SEMAPHORES - // Execute once int __libcpp_execute_once(__libcpp_exec_once_flag *flag, void (*init_routine)()) { @@ -481,7 +401,7 @@ // Returns non-zero if the thread ids are equal, otherwise 0 bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2) { - return pthread_equal(t1, t2) != 0; + return t1 == t2; } // Returns non-zero if t1 < t2, otherwise 0 @@ -492,28 +412,33 @@ // Thread bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { - return *__t == 0; + return __libcpp_thread_get_id(__t) == 0; } int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *), void *__arg) { - return pthread_create(__t, 0, __func, __arg); + return pthread_create(__t, nullptr, __func, __arg); } __libcpp_thread_id __libcpp_thread_get_current_id() { - return pthread_self(); + const __libcpp_thread_t thread = pthread_self(); + return __libcpp_thread_get_id(&thread); } __libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t) { +#if defined(__MVS__) + return __t->__; +#else return *__t; +#endif } int __libcpp_thread_join(__libcpp_thread_t *__t) { - return pthread_join(*__t, 0); + return pthread_join(*__t, nullptr); } int __libcpp_thread_detach(__libcpp_thread_t *__t) @@ -565,7 +490,7 @@ return mtx_trylock(__m) == thrd_success; } -int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m) +int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m) { return mtx_unlock(__m) == thrd_success ? 0 : EINVAL; } @@ -648,7 +573,7 @@ // Thread bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) { - return *__t == 0; + return __libcpp_thread_get_id(__t) == 0; } int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tree b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tree index 4e131a1..f3f2e8d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tree +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tree
@@ -11,10 +11,12 @@ #define _LIBCPP___TREE #include <__config> +#include <__utility/forward.h> +#include <algorithm> #include <iterator> +#include <limits> #include <memory> #include <stdexcept> -#include <algorithm> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -108,10 +110,10 @@ if (__x->__right_ && !__x->__right_->__is_black_) return 0; } - unsigned __h = __tree_sub_invariant(__x->__left_); + unsigned __h = _VSTD::__tree_sub_invariant(__x->__left_); if (__h == 0) return 0; // invalid left subtree - if (__h != __tree_sub_invariant(__x->__right_)) + if (__h != _VSTD::__tree_sub_invariant(__x->__right_)) return 0; // invalid or different height right subtree return __h + __x->__is_black_; // return black height of this node } @@ -128,13 +130,13 @@ // check __x->__parent_ consistency if (__root->__parent_ == nullptr) return false; - if (!__tree_is_left_child(__root)) + if (!_VSTD::__tree_is_left_child(__root)) return false; // root must be black if (!__root->__is_black_) return false; // do normal node checks - return __tree_sub_invariant(__root) != 0; + return _VSTD::__tree_sub_invariant(__root) != 0; } // Returns: pointer to the left-most node under __x. @@ -168,8 +170,8 @@ __tree_next(_NodePtr __x) _NOEXCEPT { if (__x->__right_ != nullptr) - return __tree_min(__x->__right_); - while (!__tree_is_left_child(__x)) + return _VSTD::__tree_min(__x->__right_); + while (!_VSTD::__tree_is_left_child(__x)) __x = __x->__parent_unsafe(); return __x->__parent_unsafe(); } @@ -180,8 +182,8 @@ __tree_next_iter(_NodePtr __x) _NOEXCEPT { if (__x->__right_ != nullptr) - return static_cast<_EndNodePtr>(__tree_min(__x->__right_)); - while (!__tree_is_left_child(__x)) + return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_)); + while (!_VSTD::__tree_is_left_child(__x)) __x = __x->__parent_unsafe(); return static_cast<_EndNodePtr>(__x->__parent_); } @@ -195,9 +197,9 @@ __tree_prev_iter(_EndNodePtr __x) _NOEXCEPT { if (__x->__left_ != nullptr) - return __tree_max(__x->__left_); + return _VSTD::__tree_max(__x->__left_); _NodePtr __xx = static_cast<_NodePtr>(__x); - while (__tree_is_left_child(__xx)) + while (_VSTD::__tree_is_left_child(__xx)) __xx = __xx->__parent_unsafe(); return __xx->__parent_unsafe(); } @@ -237,7 +239,7 @@ if (__x->__right_ != nullptr) __x->__right_->__set_parent(__x); __y->__parent_ = __x->__parent_; - if (__tree_is_left_child(__x)) + if (_VSTD::__tree_is_left_child(__x)) __x->__parent_->__left_ = __y; else __x->__parent_unsafe()->__right_ = __y; @@ -257,7 +259,7 @@ if (__x->__left_ != nullptr) __x->__left_->__set_parent(__x); __y->__parent_ = __x->__parent_; - if (__tree_is_left_child(__x)) + if (_VSTD::__tree_is_left_child(__x)) __x->__parent_->__left_ = __y; else __x->__parent_unsafe()->__right_ = __y; @@ -281,7 +283,7 @@ while (__x != __root && !__x->__parent_unsafe()->__is_black_) { // __x->__parent_ != __root because __x->__parent_->__is_black == false - if (__tree_is_left_child(__x->__parent_unsafe())) + if (_VSTD::__tree_is_left_child(__x->__parent_unsafe())) { _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_; if (__y != nullptr && !__y->__is_black_) @@ -294,16 +296,16 @@ } else { - if (!__tree_is_left_child(__x)) + if (!_VSTD::__tree_is_left_child(__x)) { __x = __x->__parent_unsafe(); - __tree_left_rotate(__x); + _VSTD::__tree_left_rotate(__x); } __x = __x->__parent_unsafe(); __x->__is_black_ = true; __x = __x->__parent_unsafe(); __x->__is_black_ = false; - __tree_right_rotate(__x); + _VSTD::__tree_right_rotate(__x); break; } } @@ -320,16 +322,16 @@ } else { - if (__tree_is_left_child(__x)) + if (_VSTD::__tree_is_left_child(__x)) { __x = __x->__parent_unsafe(); - __tree_right_rotate(__x); + _VSTD::__tree_right_rotate(__x); } __x = __x->__parent_unsafe(); __x->__is_black_ = true; __x = __x->__parent_unsafe(); __x->__is_black_ = false; - __tree_left_rotate(__x); + _VSTD::__tree_left_rotate(__x); break; } } @@ -352,7 +354,7 @@ // __y will have at most one child. // __y will be the initial hole in the tree (make the hole at a leaf) _NodePtr __y = (__z->__left_ == nullptr || __z->__right_ == nullptr) ? - __z : __tree_next(__z); + __z : _VSTD::__tree_next(__z); // __x is __y's possibly null single child _NodePtr __x = __y->__left_ != nullptr ? __y->__left_ : __y->__right_; // __w is __x's possibly null uncle (will become __x's sibling) @@ -360,7 +362,7 @@ // link __x to __y's parent, and find __w if (__x != nullptr) __x->__parent_ = __y->__parent_; - if (__tree_is_left_child(__y)) + if (_VSTD::__tree_is_left_child(__y)) { __y->__parent_->__left_ = __x; if (__y != __root) @@ -381,7 +383,7 @@ { // __z->__left_ != nulptr but __z->__right_ might == __x == nullptr __y->__parent_ = __z->__parent_; - if (__tree_is_left_child(__z)) + if (_VSTD::__tree_is_left_child(__z)) __y->__parent_->__left_ = __y; else __y->__parent_unsafe()->__right_ = __y; @@ -421,13 +423,13 @@ // with a non-null black child). while (true) { - if (!__tree_is_left_child(__w)) // if x is left child + if (!_VSTD::__tree_is_left_child(__w)) // if x is left child { if (!__w->__is_black_) { __w->__is_black_ = true; __w->__parent_unsafe()->__is_black_ = false; - __tree_left_rotate(__w->__parent_unsafe()); + _VSTD::__tree_left_rotate(__w->__parent_unsafe()); // __x is still valid // reset __root only if necessary if (__root == __w->__left_) @@ -448,7 +450,7 @@ break; } // reset sibling, and it still can't be null - __w = __tree_is_left_child(__x) ? + __w = _VSTD::__tree_is_left_child(__x) ? __x->__parent_unsafe()->__right_ : __x->__parent_->__left_; // continue; @@ -460,7 +462,7 @@ // __w left child is non-null and red __w->__left_->__is_black_ = true; __w->__is_black_ = false; - __tree_right_rotate(__w); + _VSTD::__tree_right_rotate(__w); // __w is known not to be root, so root hasn't changed // reset sibling, and it still can't be null __w = __w->__parent_unsafe(); @@ -469,7 +471,7 @@ __w->__is_black_ = __w->__parent_unsafe()->__is_black_; __w->__parent_unsafe()->__is_black_ = true; __w->__right_->__is_black_ = true; - __tree_left_rotate(__w->__parent_unsafe()); + _VSTD::__tree_left_rotate(__w->__parent_unsafe()); break; } } @@ -479,7 +481,7 @@ { __w->__is_black_ = true; __w->__parent_unsafe()->__is_black_ = false; - __tree_right_rotate(__w->__parent_unsafe()); + _VSTD::__tree_right_rotate(__w->__parent_unsafe()); // __x is still valid // reset __root only if necessary if (__root == __w->__right_) @@ -500,7 +502,7 @@ break; } // reset sibling, and it still can't be null - __w = __tree_is_left_child(__x) ? + __w = _VSTD::__tree_is_left_child(__x) ? __x->__parent_unsafe()->__right_ : __x->__parent_->__left_; // continue; @@ -512,7 +514,7 @@ // __w right child is non-null and red __w->__right_->__is_black_ = true; __w->__is_black_ = false; - __tree_left_rotate(__w); + _VSTD::__tree_left_rotate(__w); // __w is known not to be root, so root hasn't changed // reset sibling, and it still can't be null __w = __w->__parent_unsafe(); @@ -521,7 +523,7 @@ __w->__is_black_ = __w->__parent_unsafe()->__is_black_; __w->__parent_unsafe()->__is_black_ = true; __w->__left_->__is_black_ = true; - __tree_right_rotate(__w->__parent_unsafe()); + _VSTD::__tree_right_rotate(__w->__parent_unsafe()); break; } } @@ -714,7 +716,7 @@ }; template <class _VoidPtr> -class __tree_node_base +class _LIBCPP_STANDALONE_DEBUG __tree_node_base : public __tree_node_base_types<_VoidPtr>::__end_node_type { typedef __tree_node_base_types<_VoidPtr> _NodeBaseTypes; @@ -736,13 +738,13 @@ } private: - ~__tree_node_base() _LIBCPP_EQUAL_DELETE; - __tree_node_base(__tree_node_base const&) _LIBCPP_EQUAL_DELETE; - __tree_node_base& operator=(__tree_node_base const&) _LIBCPP_EQUAL_DELETE; + ~__tree_node_base() = delete; + __tree_node_base(__tree_node_base const&) = delete; + __tree_node_base& operator=(__tree_node_base const&) = delete; }; template <class _Tp, class _VoidPtr> -class __tree_node +class _LIBCPP_STANDALONE_DEBUG __tree_node : public __tree_node_base<_VoidPtr> { public: @@ -751,9 +753,9 @@ __node_value_type __value_; private: - ~__tree_node() _LIBCPP_EQUAL_DELETE; - __tree_node(__tree_node const&) _LIBCPP_EQUAL_DELETE; - __tree_node& operator=(__tree_node const&) _LIBCPP_EQUAL_DELETE; + ~__tree_node() = delete; + __tree_node(__tree_node const&) = delete; + __tree_node& operator=(__tree_node const&) = delete; }; @@ -839,7 +841,7 @@ _LIBCPP_INLINE_VISIBILITY __tree_iterator& operator++() { __ptr_ = static_cast<__iter_pointer>( - __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); + _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); return *this; } _LIBCPP_INLINE_VISIBILITY @@ -848,7 +850,7 @@ _LIBCPP_INLINE_VISIBILITY __tree_iterator& operator--() { - __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>( + __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>( static_cast<__end_node_pointer>(__ptr_))); return *this; } @@ -920,7 +922,7 @@ _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator++() { __ptr_ = static_cast<__iter_pointer>( - __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); + _VSTD::__tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_))); return *this; } @@ -930,7 +932,7 @@ _LIBCPP_INLINE_VISIBILITY __tree_const_iterator& operator--() { - __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>( + __ptr_ = static_cast<__iter_pointer>(_VSTD::__tree_prev_iter<__node_base_pointer>( static_cast<__end_node_pointer>(__ptr_))); return *this; } @@ -967,7 +969,7 @@ template<class _Tp, class _Compare> #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value, + _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value, "the specified comparator type does not provide a viable const call operator") #endif int __diagnose_non_const_comparator(); @@ -1120,7 +1122,7 @@ _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT - {return std::min<size_type>( + {return _VSTD::min<size_type>( __node_traits::max_size(__node_alloc()), numeric_limits<difference_type >::max());} @@ -1428,7 +1430,7 @@ __node_base_pointer& __find_leaf(const_iterator __hint, __parent_pointer& __parent, const key_type& __v); - // FIXME: Make this function const qualified. Unfortunetly doing so + // FIXME: Make this function const qualified. Unfortunately doing so // breaks existing code which uses non-const callable comparators. template <class _Key> __node_base_pointer& @@ -1590,27 +1592,27 @@ { if (__cache->__parent_ == nullptr) return nullptr; - if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache))) + if (_VSTD::__tree_is_left_child(static_cast<__node_base_pointer>(__cache))) { __cache->__parent_->__left_ = nullptr; __cache = static_cast<__node_pointer>(__cache->__parent_); if (__cache->__right_ == nullptr) return __cache; - return static_cast<__node_pointer>(__tree_leaf(__cache->__right_)); + return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__right_)); } // __cache is right child __cache->__parent_unsafe()->__right_ = nullptr; __cache = static_cast<__node_pointer>(__cache->__parent_); if (__cache->__left_ == nullptr) return __cache; - return static_cast<__node_pointer>(__tree_leaf(__cache->__left_)); + return static_cast<__node_pointer>(_VSTD::__tree_leaf(__cache->__left_)); } template <class _Tp, class _Compare, class _Allocator> __tree<_Tp, _Compare, _Allocator>& __tree<_Tp, _Compare, _Allocator>::operator=(const __tree& __t) { - if (this != &__t) + if (this != _VSTD::addressof(__t)) { value_comp() = __t.value_comp(); __copy_assign_alloc(__t); @@ -1819,7 +1821,7 @@ using _VSTD::swap; swap(__begin_node_, __t.__begin_node_); swap(__pair1_.first(), __t.__pair1_.first()); - __swap_allocator(__node_alloc(), __t.__node_alloc()); + _VSTD::__swap_allocator(__node_alloc(), __t.__node_alloc()); __pair3_.swap(__t.__pair3_); if (size() == 0) __begin_node() = __end_node(); @@ -2078,7 +2080,7 @@ __child = __new_node; if (__begin_node()->__left_ != nullptr) __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_); - __tree_balance_after_insert(__end_node()->__left_, __child); + _VSTD::__tree_balance_after_insert(__end_node()->__left_, __child); ++size(); } @@ -2248,8 +2250,8 @@ if (__begin_node() == __ptr) __begin_node() = __r.__ptr_; --size(); - __tree_remove(__end_node()->__left_, - static_cast<__node_base_pointer>(__ptr)); + _VSTD::__tree_remove(__end_node()->__left_, + static_cast<__node_base_pointer>(__ptr)); return __r; } @@ -2410,7 +2412,7 @@ } } -#endif // _LIBCPP_STD_VER > 14 +#endif // _LIBCPP_STD_VER > 14 template <class _Tp, class _Compare, class _Allocator> typename __tree<_Tp, _Compare, _Allocator>::iterator @@ -2627,7 +2629,7 @@ return _Pp(iterator(__rt), iterator( __rt->__right_ != nullptr ? - static_cast<__iter_pointer>(__tree_min(__rt->__right_)) + static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_)) : __result)); } return _Pp(iterator(__result), iterator(__result)); @@ -2655,7 +2657,7 @@ return _Pp(const_iterator(__rt), const_iterator( __rt->__right_ != nullptr ? - static_cast<__iter_pointer>(__tree_min(__rt->__right_)) + static_cast<__iter_pointer>(_VSTD::__tree_min(__rt->__right_)) : __result)); } return _Pp(const_iterator(__result), const_iterator(__result)); @@ -2724,8 +2726,8 @@ __begin_node() = static_cast<__iter_pointer>(__np->__parent_); } --size(); - __tree_remove(__end_node()->__left_, - static_cast<__node_base_pointer>(__np)); + _VSTD::__tree_remove(__end_node()->__left_, + static_cast<__node_base_pointer>(__np)); return __node_holder(__np, _Dp(__node_alloc(), true)); } @@ -2743,4 +2745,4 @@ _LIBCPP_POP_MACROS -#endif // _LIBCPP___TREE +#endif // _LIBCPP___TREE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tuple b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tuple index 4da9ec5..11fbba2 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tuple +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__tuple
@@ -58,19 +58,19 @@ template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> { - typedef _LIBCPP_NODEBUG_TYPE typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; + typedef _LIBCPP_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> { - typedef _LIBCPP_NODEBUG_TYPE typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; + typedef _LIBCPP_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> { - typedef _LIBCPP_NODEBUG_TYPE typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; + typedef _LIBCPP_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; }; template <class _Tp> struct __tuple_like : false_type {}; @@ -99,7 +99,7 @@ template<typename _Tp, size_t ..._Extra> struct __repeat; template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> { - typedef _LIBCPP_NODEBUG_TYPE __integer_sequence<_Tp, + typedef _LIBCPP_NODEBUG __integer_sequence<_Tp, _Np..., sizeof...(_Np) + _Np..., 2 * sizeof...(_Np) + _Np..., @@ -134,7 +134,7 @@ } // namespace detail -#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) +#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) #if __has_builtin(__make_integer_seq) template <size_t _Ep, size_t _Sp> @@ -253,7 +253,7 @@ namespace __indexer_detail { template <size_t _Idx, class _Tp> -struct __indexed { using type _LIBCPP_NODEBUG_TYPE = _Tp; }; +struct __indexed { using type _LIBCPP_NODEBUG = _Tp; }; template <class _Types, class _Indexes> struct __indexer; @@ -268,7 +268,7 @@ } // namespace __indexer_detail template <size_t _Idx, class ..._Types> -using __type_pack_element _LIBCPP_NODEBUG_TYPE = typename decltype( +using __type_pack_element _LIBCPP_NODEBUG = typename decltype( __indexer_detail::__at_index<_Idx>( __indexer_detail::__indexer< __tuple_types<_Types...>, @@ -281,7 +281,7 @@ struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> { static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); - typedef _LIBCPP_NODEBUG_TYPE __type_pack_element<_Ip, _Types...> type; + typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type; }; @@ -301,34 +301,34 @@ }; template <> struct __apply_cv_mf<false, true, false> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const _Tp; + template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp; }; template <> struct __apply_cv_mf<false, false, true> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = volatile _Tp; + template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp; }; template <> struct __apply_cv_mf<false, true, true> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const volatile _Tp; + template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp; }; template <> struct __apply_cv_mf<true, false, false> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = _Tp&; + template <class _Tp> using __apply _LIBCPP_NODEBUG = _Tp&; }; template <> struct __apply_cv_mf<true, true, false> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const _Tp&; + template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp&; }; template <> struct __apply_cv_mf<true, false, true> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = volatile _Tp&; + template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp&; }; template <> struct __apply_cv_mf<true, true, true> { - template <class _Tp> using __apply _LIBCPP_NODEBUG_TYPE = const volatile _Tp&; + template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&; }; template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type> -using __apply_cv_t _LIBCPP_NODEBUG_TYPE = __apply_cv_mf< +using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf< is_lvalue_reference<_Tp>::value, is_const<_RawTp>::value, is_volatile<_RawTp>::value>; @@ -347,7 +347,7 @@ struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { // Specialization for pair, tuple, and __tuple_types template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> - using __apply_quals _LIBCPP_NODEBUG_TYPE = __tuple_types< + using __apply_quals _LIBCPP_NODEBUG = __tuple_types< typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>... >; }; @@ -375,12 +375,12 @@ template <class ..._Types, size_t _Ep> struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> { - typedef _LIBCPP_NODEBUG_TYPE __tuple_types<_Types...> type; + typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type; }; template <class ..._Types, size_t _Ep> struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> { - typedef _LIBCPP_NODEBUG_TYPE __tuple_types<_Types...> type; + typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type; }; template <bool ..._Preds> @@ -454,12 +454,12 @@ template <size_t _Ip, class ..._Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > { - typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; + typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; }; #if _LIBCPP_STD_VER > 11 template <size_t _Ip, class ..._Tp> -using tuple_element_t _LIBCPP_NODEBUG_TYPE = typename tuple_element <_Ip, _Tp...>::type; +using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type; #endif template <bool _IsTuple, class _SizeTrait, size_t _Expected> @@ -471,7 +471,7 @@ template <class _Tuple, size_t _ExpectedSize, class _RawTuple = typename __uncvref<_Tuple>::type> -using __tuple_like_with_size _LIBCPP_NODEBUG_TYPE = __tuple_like_with_size_imp< +using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp< __tuple_like<_RawTuple>::value, tuple_size<_RawTuple>, _ExpectedSize >; @@ -548,4 +548,4 @@ _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP___TUPLE +#endif // _LIBCPP___TUPLE
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__undef_macros b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__undef_macros index 4923ee6..40b2b64 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__undef_macros +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__undef_macros
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===------------------------ __undef_macros ------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information.
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/as_const.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/as_const.h new file mode 100644 index 0000000..52da739 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/as_const.h
@@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_AS_CONST_H +#define _LIBCPP___UTILITY_AS_CONST_H + +#include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 +template <class _Tp> +_LIBCPP_NODISCARD_EXT constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; } + +template <class _Tp> +void as_const(const _Tp&&) = delete; +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_AS_CONST_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/cmp.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/cmp.h new file mode 100644 index 0000000..4fc96b0 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/cmp.h
@@ -0,0 +1,110 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_CMP_H +#define _LIBCPP___UTILITY_CMP_H + +#include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <limits> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) +template<class _Tp, class... _Up> +struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {}; + +template<class _Tp> +concept __is_safe_integral_cmp = is_integral_v<_Tp> && + !_IsSameAsAny<_Tp, bool, char +#ifndef _LIBCPP_HAS_NO_CHAR8_T + , char8_t +#endif +#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS + , char16_t, char32_t +#endif +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS + , wchar_t +#endif + >::value; + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_equal(_Tp __t, _Up __u) noexcept +{ + if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) + return __t == __u; + else if constexpr (is_signed_v<_Tp>) + return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; + else + return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_not_equal(_Tp __t, _Up __u) noexcept +{ + return !_VSTD::cmp_equal(__t, __u); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_less(_Tp __t, _Up __u) noexcept +{ + if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) + return __t < __u; + else if constexpr (is_signed_v<_Tp>) + return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; + else + return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_greater(_Tp __t, _Up __u) noexcept +{ + return _VSTD::cmp_less(__u, __t); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_less_equal(_Tp __t, _Up __u) noexcept +{ + return !_VSTD::cmp_greater(__t, __u); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool cmp_greater_equal(_Tp __t, _Up __u) noexcept +{ + return !_VSTD::cmp_less(__t, __u); +} + +template<__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +_LIBCPP_INLINE_VISIBILITY constexpr +bool in_range(_Up __u) noexcept +{ + return _VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) && + _VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS + +#endif // _LIBCPP___UTILITY_CMP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/decay_copy.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/decay_copy.h new file mode 100644 index 0000000..5c9716a --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/decay_copy.h
@@ -0,0 +1,35 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_DECAY_COPY_H +#define _LIBCPP___UTILITY_DECAY_COPY_H + +#include <__config> +#include <__utility/forward.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR +typename decay<_Tp>::type __decay_copy(_Tp&& __t) +#if _LIBCPP_STD_VER > 17 + noexcept(is_nothrow_convertible_v<_Tp, remove_reference_t<_Tp>>) +#endif +{ + return _VSTD::forward<_Tp>(__t); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_DECAY_COPY_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/declval.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/declval.h new file mode 100644 index 0000000..6a9dcd9 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/declval.h
@@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_DECLVAL_H +#define _LIBCPP___UTILITY_DECLVAL_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +// Suppress deprecation notice for volatile-qualified return type resulting +// from volatile-qualified types _Tp. +_LIBCPP_SUPPRESS_DEPRECATED_PUSH +template <class _Tp> +_Tp&& __declval(int); +template <class _Tp> +_Tp __declval(long); +_LIBCPP_SUPPRESS_DEPRECATED_POP + +template <class _Tp> +decltype(__declval<_Tp>(0)) declval() _NOEXCEPT; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_DECLVAL_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/exchange.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/exchange.h new file mode 100644 index 0000000..f9c92c6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/exchange.h
@@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_EXCHANGE_H +#define _LIBCPP___UTILITY_EXCHANGE_H + +#include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 11 +template<class _T1, class _T2 = _T1> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +_T1 exchange(_T1& __obj, _T2&& __new_value) + noexcept(is_nothrow_move_constructible<_T1>::value && is_nothrow_assignable<_T1&, _T2>::value) +{ + _T1 __old_value = _VSTD::move(__obj); + __obj = _VSTD::forward<_T2>(__new_value); + return __old_value; +} +#endif // _LIBCPP_STD_VER > 11 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_EXCHANGE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/forward.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/forward.h new file mode 100644 index 0000000..7629a87 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/forward.h
@@ -0,0 +1,37 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_FORWARD_H +#define _LIBCPP___UTILITY_FORWARD_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&& +forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT { + return static_cast<_Tp&&>(__t); +} + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&& +forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT { + static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue"); + return static_cast<_Tp&&>(__t); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_FORWARD_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/in_place.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/in_place.h new file mode 100644 index 0000000..846b4a6 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/in_place.h
@@ -0,0 +1,58 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_IN_PLACE_H +#define _LIBCPP___UTILITY_IN_PLACE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +struct _LIBCPP_TYPE_VIS in_place_t { + explicit in_place_t() = default; +}; +inline constexpr in_place_t in_place{}; + +template <class _Tp> +struct _LIBCPP_TEMPLATE_VIS in_place_type_t { + explicit in_place_type_t() = default; +}; +template <class _Tp> +inline constexpr in_place_type_t<_Tp> in_place_type{}; + +template <size_t _Idx> +struct _LIBCPP_TEMPLATE_VIS in_place_index_t { + explicit in_place_index_t() = default; +}; +template <size_t _Idx> +inline constexpr in_place_index_t<_Idx> in_place_index{}; + +template <class _Tp> struct __is_inplace_type_imp : false_type {}; +template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {}; + +template <class _Tp> +using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>; + +template <class _Tp> struct __is_inplace_index_imp : false_type {}; +template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {}; + +template <class _Tp> +using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>; + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_IN_PLACE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/integer_sequence.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/integer_sequence.h new file mode 100644 index 0000000..738ac6c --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/integer_sequence.h
@@ -0,0 +1,78 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_INTEGER_SEQUENCE_H +#define _LIBCPP___UTILITY_INTEGER_SEQUENCE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 11 + +template<class _Tp, _Tp... _Ip> +struct _LIBCPP_TEMPLATE_VIS integer_sequence +{ + typedef _Tp value_type; + static_assert( is_integral<_Tp>::value, + "std::integer_sequence can only be instantiated with an integral type" ); + static + _LIBCPP_INLINE_VISIBILITY + constexpr + size_t + size() noexcept { return sizeof...(_Ip); } +}; + +template<size_t... _Ip> + using index_sequence = integer_sequence<size_t, _Ip...>; + +#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) + +template <class _Tp, _Tp _Ep> +using __make_integer_sequence _LIBCPP_NODEBUG = __make_integer_seq<integer_sequence, _Tp, _Ep>; + +#else + +template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked _LIBCPP_NODEBUG = + typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>; + +template <class _Tp, _Tp _Ep> +struct __make_integer_sequence_checked +{ + static_assert(is_integral<_Tp>::value, + "std::make_integer_sequence can only be instantiated with an integral type" ); + static_assert(0 <= _Ep, "std::make_integer_sequence must have a non-negative sequence length"); + // Workaround GCC bug by preventing bad installations when 0 <= _Ep + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68929 + typedef _LIBCPP_NODEBUG __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type; +}; + +template <class _Tp, _Tp _Ep> +using __make_integer_sequence _LIBCPP_NODEBUG = typename __make_integer_sequence_checked<_Tp, _Ep>::type; + +#endif + +template<class _Tp, _Tp _Np> + using make_integer_sequence = __make_integer_sequence<_Tp, _Np>; + +template<size_t _Np> + using make_index_sequence = make_integer_sequence<size_t, _Np>; + +template<class... _Tp> + using index_sequence_for = make_index_sequence<sizeof...(_Tp)>; + +#endif // _LIBCPP_STD_VER > 11 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_INTEGER_SEQUENCE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/move.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/move.h new file mode 100644 index 0000000..75d715d --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/move.h
@@ -0,0 +1,47 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_MOVE_H +#define _LIBCPP___UTILITY_MOVE_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&& +move(_Tp&& __t) _NOEXCEPT { + typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; + return static_cast<_Up&&>(__t); +} + +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp> +using __move_if_noexcept_result_t = + typename conditional<!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, const _Tp&, + _Tp&&>::type; +#else // _LIBCPP_CXX03_LANG +template <class _Tp> +using __move_if_noexcept_result_t = const _Tp&; +#endif + +template <class _Tp> +_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 __move_if_noexcept_result_t<_Tp> +move_if_noexcept(_Tp& __x) _NOEXCEPT { + return _VSTD::move(__x); +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_MOVE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/pair.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/pair.h new file mode 100644 index 0000000..f111469 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/pair.h
@@ -0,0 +1,609 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_PAIR_H +#define _LIBCPP___UTILITY_PAIR_H + +#include <__compare/common_comparison_category.h> +#include <__compare/synth_three_way.h> +#include <__config> +#include <__functional/unwrap_ref.h> +#include <__tuple> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <__utility/piecewise_construct.h> +#include <cstddef> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) +template <class, class> +struct __non_trivially_copyable_base { + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + __non_trivially_copyable_base() _NOEXCEPT {} + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {} +}; +#endif + +template <class _T1, class _T2> +struct _LIBCPP_TEMPLATE_VIS pair +#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) +: private __non_trivially_copyable_base<_T1, _T2> +#endif +{ + typedef _T1 first_type; + typedef _T2 second_type; + + _T1 first; + _T2 second; + +#if !defined(_LIBCPP_CXX03_LANG) + pair(pair const&) = default; + pair(pair&&) = default; +#else + // Use the implicitly declared copy constructor in C++03 +#endif + +#ifdef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + pair() : first(), second() {} + + _LIBCPP_INLINE_VISIBILITY + pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {} + + template <class _U1, class _U2> + _LIBCPP_INLINE_VISIBILITY + pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {} + + _LIBCPP_INLINE_VISIBILITY + pair& operator=(pair const& __p) { + first = __p.first; + second = __p.second; + return *this; + } +#else + struct _CheckArgs { + template <int&...> + static constexpr bool __enable_explicit_default() { + return is_default_constructible<_T1>::value + && is_default_constructible<_T2>::value + && !__enable_implicit_default<>(); + } + + template <int&...> + static constexpr bool __enable_implicit_default() { + return __is_implicitly_default_constructible<_T1>::value + && __is_implicitly_default_constructible<_T2>::value; + } + + template <class _U1, class _U2> + static constexpr bool __enable_explicit() { + return is_constructible<first_type, _U1>::value + && is_constructible<second_type, _U2>::value + && (!is_convertible<_U1, first_type>::value + || !is_convertible<_U2, second_type>::value); + } + + template <class _U1, class _U2> + static constexpr bool __enable_implicit() { + return is_constructible<first_type, _U1>::value + && is_constructible<second_type, _U2>::value + && is_convertible<_U1, first_type>::value + && is_convertible<_U2, second_type>::value; + } + }; + + template <bool _MaybeEnable> + using _CheckArgsDep _LIBCPP_NODEBUG = typename conditional< + _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type; + + struct _CheckTupleLikeConstructor { + template <class _Tuple> + static constexpr bool __enable_implicit() { + return __tuple_convertible<_Tuple, pair>::value; + } + + template <class _Tuple> + static constexpr bool __enable_explicit() { + return __tuple_constructible<_Tuple, pair>::value + && !__tuple_convertible<_Tuple, pair>::value; + } + + template <class _Tuple> + static constexpr bool __enable_assign() { + return __tuple_assignable<_Tuple, pair>::value; + } + }; + + template <class _Tuple> + using _CheckTLC _LIBCPP_NODEBUG = typename conditional< + __tuple_like_with_size<_Tuple, 2>::value + && !is_same<typename decay<_Tuple>::type, pair>::value, + _CheckTupleLikeConstructor, + __check_tuple_constructor_fail + >::type; + + template<bool _Dummy = true, typename enable_if< + _CheckArgsDep<_Dummy>::__enable_explicit_default() + >::type* = nullptr> + explicit _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value && + is_nothrow_default_constructible<second_type>::value) + : first(), second() {} + + template<bool _Dummy = true, typename enable_if< + _CheckArgsDep<_Dummy>::__enable_implicit_default() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value && + is_nothrow_default_constructible<second_type>::value) + : first(), second() {} + + template <bool _Dummy = true, typename enable_if< + _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit pair(_T1 const& __t1, _T2 const& __t2) + _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value && + is_nothrow_copy_constructible<second_type>::value) + : first(__t1), second(__t2) {} + + template<bool _Dummy = true, typename enable_if< + _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + pair(_T1 const& __t1, _T2 const& __t2) + _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value && + is_nothrow_copy_constructible<second_type>::value) + : first(__t1), second(__t2) {} + + template < +#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951 + class _U1 = _T1, class _U2 = _T2, +#else + class _U1, class _U2, +#endif + typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr + > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit pair(_U1&& __u1, _U2&& __u2) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value && + is_nothrow_constructible<second_type, _U2>::value)) + : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {} + + template < +#if _LIBCPP_STD_VER > 20 // http://wg21.link/P1951 + class _U1 = _T1, class _U2 = _T2, +#else + class _U1, class _U2, +#endif + typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr + > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + pair(_U1&& __u1, _U2&& __u2) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value && + is_nothrow_constructible<second_type, _U2>::value)) + : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {} + + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit pair(pair<_U1, _U2> const& __p) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value && + is_nothrow_constructible<second_type, _U2 const&>::value)) + : first(__p.first), second(__p.second) {} + + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + pair(pair<_U1, _U2> const& __p) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value && + is_nothrow_constructible<second_type, _U2 const&>::value)) + : first(__p.first), second(__p.second) {} + + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_explicit<_U1, _U2>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit pair(pair<_U1, _U2>&&__p) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value && + is_nothrow_constructible<second_type, _U2&&>::value)) + : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {} + + template<class _U1, class _U2, typename enable_if< + _CheckArgs::template __enable_implicit<_U1, _U2>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + pair(pair<_U1, _U2>&& __p) + _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value && + is_nothrow_constructible<second_type, _U2&&>::value)) + : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {} + + template<class _Tuple, typename enable_if< + _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + explicit pair(_Tuple&& __p) + : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))), + second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {} + + template<class _Tuple, typename enable_if< + _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + pair(_Tuple&& __p) + : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))), + second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {} + + template <class... _Args1, class... _Args2> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair(piecewise_construct_t __pc, + tuple<_Args1...> __first_args, tuple<_Args2...> __second_args) + _NOEXCEPT_((is_nothrow_constructible<first_type, _Args1...>::value && + is_nothrow_constructible<second_type, _Args2...>::value)) + : pair(__pc, __first_args, __second_args, + typename __make_tuple_indices<sizeof...(_Args1)>::type(), + typename __make_tuple_indices<sizeof...(_Args2) >::type()) {} + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair& operator=(typename conditional< + is_copy_assignable<first_type>::value && + is_copy_assignable<second_type>::value, + pair, __nat>::type const& __p) + _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value && + is_nothrow_copy_assignable<second_type>::value) + { + first = __p.first; + second = __p.second; + return *this; + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair& operator=(typename conditional< + is_move_assignable<first_type>::value && + is_move_assignable<second_type>::value, + pair, __nat>::type&& __p) + _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value && + is_nothrow_move_assignable<second_type>::value) + { + first = _VSTD::forward<first_type>(__p.first); + second = _VSTD::forward<second_type>(__p.second); + return *this; + } + + template <class _Tuple, typename enable_if< + _CheckTLC<_Tuple>::template __enable_assign<_Tuple>() + >::type* = nullptr> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair& operator=(_Tuple&& __p) { + first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p)); + second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p)); + return *this; + } +#endif + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void + swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value && + __is_nothrow_swappable<second_type>::value) + { + using _VSTD::swap; + swap(first, __p.first); + swap(second, __p.second); + } +private: + +#ifndef _LIBCPP_CXX03_LANG + template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2> + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + pair(piecewise_construct_t, + tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args, + __tuple_indices<_I1...>, __tuple_indices<_I2...>); +#endif +}; + +#if _LIBCPP_STD_VER >= 17 +template<class _T1, class _T2> +pair(_T1, _T2) -> pair<_T1, _T2>; +#endif + +// [pairs.spec], specialized algorithms + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator==(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return __x.first == __y.first && __x.second == __y.second; +} + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _T1, class _T2> +_LIBCPP_HIDE_FROM_ABI constexpr +common_comparison_category_t< + __synth_three_way_result<_T1>, + __synth_three_way_result<_T2> > +operator<=>(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + if (auto __c = _VSTD::__synth_three_way(__x.first, __y.first); __c != 0) { + return __c; + } + return _VSTD::__synth_three_way(__x.second, __y.second); +} + +#else // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator!=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return !(__x == __y); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator> (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return __y < __x; +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator>=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return !(__x < __y); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +bool +operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y) +{ + return !(__y < __x); +} + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS) + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +typename enable_if +< + __is_swappable<_T1>::value && + __is_swappable<_T2>::value, + void +>::type +swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) + _NOEXCEPT_((__is_nothrow_swappable<_T1>::value && + __is_nothrow_swappable<_T2>::value)) +{ + __x.swap(__y); +} + +#ifndef _LIBCPP_CXX03_LANG + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> +make_pair(_T1&& __t1, _T2&& __t2) +{ + return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type> + (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2)); +} + +#else // _LIBCPP_CXX03_LANG + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +pair<_T1,_T2> +make_pair(_T1 __x, _T2 __y) +{ + return pair<_T1, _T2>(__x, __y); +} + +#endif // _LIBCPP_CXX03_LANG + +template <class _T1, class _T2> + struct _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> > + : public integral_constant<size_t, 2> {}; + +template <size_t _Ip, class _T1, class _T2> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > +{ + static_assert(_Ip < 2, "Index out of bounds in std::tuple_element<std::pair<T1, T2>>"); +}; + +template <class _T1, class _T2> +struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > +{ + typedef _LIBCPP_NODEBUG _T1 type; +}; + +template <class _T1, class _T2> +struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> > +{ + typedef _LIBCPP_NODEBUG _T2 type; +}; + +template <size_t _Ip> struct __get_pair; + +template <> +struct __get_pair<0> +{ + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _T1& + get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;} + + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _T1& + get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;} + +#ifndef _LIBCPP_CXX03_LANG + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _T1&& + get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);} + + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _T1&& + get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);} +#endif // _LIBCPP_CXX03_LANG +}; + +template <> +struct __get_pair<1> +{ + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _T2& + get(pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;} + + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _T2& + get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;} + +#ifndef _LIBCPP_CXX03_LANG + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _T2&& + get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);} + + template <class _T1, class _T2> + static + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _T2&& + get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);} +#endif // _LIBCPP_CXX03_LANG +}; + +template <size_t _Ip, class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +typename tuple_element<_Ip, pair<_T1, _T2> >::type& +get(pair<_T1, _T2>& __p) _NOEXCEPT +{ + return __get_pair<_Ip>::get(__p); +} + +template <size_t _Ip, class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const typename tuple_element<_Ip, pair<_T1, _T2> >::type& +get(const pair<_T1, _T2>& __p) _NOEXCEPT +{ + return __get_pair<_Ip>::get(__p); +} + +#ifndef _LIBCPP_CXX03_LANG +template <size_t _Ip, class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +typename tuple_element<_Ip, pair<_T1, _T2> >::type&& +get(pair<_T1, _T2>&& __p) _NOEXCEPT +{ + return __get_pair<_Ip>::get(_VSTD::move(__p)); +} + +template <size_t _Ip, class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 +const typename tuple_element<_Ip, pair<_T1, _T2> >::type&& +get(const pair<_T1, _T2>&& __p) _NOEXCEPT +{ + return __get_pair<_Ip>::get(_VSTD::move(__p)); +} +#endif // _LIBCPP_CXX03_LANG + +#if _LIBCPP_STD_VER > 11 +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 & get(pair<_T1, _T2>& __p) _NOEXCEPT +{ + return __get_pair<0>::get(__p); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 const & get(pair<_T1, _T2> const& __p) _NOEXCEPT +{ + return __get_pair<0>::get(__p); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 && get(pair<_T1, _T2>&& __p) _NOEXCEPT +{ + return __get_pair<0>::get(_VSTD::move(__p)); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 const && get(pair<_T1, _T2> const&& __p) _NOEXCEPT +{ + return __get_pair<0>::get(_VSTD::move(__p)); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 & get(pair<_T2, _T1>& __p) _NOEXCEPT +{ + return __get_pair<1>::get(__p); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 const & get(pair<_T2, _T1> const& __p) _NOEXCEPT +{ + return __get_pair<1>::get(__p); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 && get(pair<_T2, _T1>&& __p) _NOEXCEPT +{ + return __get_pair<1>::get(_VSTD::move(__p)); +} + +template <class _T1, class _T2> +inline _LIBCPP_INLINE_VISIBILITY +constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT +{ + return __get_pair<1>::get(_VSTD::move(__p)); +} + +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_PAIR_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/piecewise_construct.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/piecewise_construct.h new file mode 100644 index 0000000..4dc44b3 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/piecewise_construct.h
@@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H +#define _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H + +#include <__config> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { explicit piecewise_construct_t() = default; }; +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_LIBRARY) +extern _LIBCPP_EXPORTED_FROM_ABI const piecewise_construct_t piecewise_construct;// = piecewise_construct_t(); +#else +/* inline */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/priority_tag.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/priority_tag.h new file mode 100644 index 0000000..45d9e5e --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/priority_tag.h
@@ -0,0 +1,26 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_PRIORITY_TAG_H +#define _LIBCPP___UTILITY_PRIORITY_TAG_H + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +template<size_t _Ip> struct __priority_tag : __priority_tag<_Ip - 1> {}; +template<> struct __priority_tag<0> {}; + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_PRIORITY_TAG_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/rel_ops.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/rel_ops.h new file mode 100644 index 0000000..c94b8fd --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/rel_ops.h
@@ -0,0 +1,62 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_REL_OPS_H +#define _LIBCPP___UTILITY_REL_OPS_H + +#include <__config> +#include <__utility/forward.h> +#include <__utility/move.h> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +namespace rel_ops +{ + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator!=(const _Tp& __x, const _Tp& __y) +{ + return !(__x == __y); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator> (const _Tp& __x, const _Tp& __y) +{ + return __y < __x; +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator<=(const _Tp& __x, const _Tp& __y) +{ + return !(__y < __x); +} + +template<class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +bool +operator>=(const _Tp& __x, const _Tp& __y) +{ + return !(__x < __y); +} + +} // rel_ops + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_REL_OPS_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/swap.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/swap.h new file mode 100644 index 0000000..6c07511 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/swap.h
@@ -0,0 +1,50 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_SWAP_H +#define _LIBCPP___UTILITY_SWAP_H + +#include <__config> +#include <__utility/declval.h> +#include <__utility/move.h> +#include <type_traits> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp> +using __swap_result_t = typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type; +#else +template <class> +using __swap_result_t = void; +#endif + +template <class _Tp> +inline _LIBCPP_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_AFTER_CXX17 swap(_Tp& __x, _Tp& __y) + _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value) { + _Tp __t(_VSTD::move(__x)); + __x = _VSTD::move(__y); + __y = _VSTD::move(__t); +} + +template <class _Tp, size_t _Np> +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if<__is_swappable<_Tp>::value>::type +swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { + for (size_t __i = 0; __i != _Np; ++__i) { + swap(__a[__i], __b[__i]); + } +} + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_SWAP_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/to_underlying.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/to_underlying.h new file mode 100644 index 0000000..54f9910 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__utility/to_underlying.h
@@ -0,0 +1,40 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___UTILITY_TO_UNDERLYING_H +#define _LIBCPP___UTILITY_TO_UNDERLYING_H + +#include <__config> +#include <type_traits> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#ifndef _LIBCPP_CXX03_LANG +template <class _Tp> +_LIBCPP_INLINE_VISIBILITY constexpr typename underlying_type<_Tp>::type +__to_underlying(_Tp __val) noexcept { + return static_cast<typename underlying_type<_Tp>::type>(__val); +} +#endif // !_LIBCPP_CXX03_LANG + +#if _LIBCPP_STD_VER > 20 +template <class _Tp> +_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY constexpr underlying_type_t<_Tp> +to_underlying(_Tp __val) noexcept { + return _VSTD::__to_underlying(__val); +} +#endif + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___UTILITY_TO_UNDERLYING_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__variant/monostate.h b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__variant/monostate.h new file mode 100644 index 0000000..d575847 --- /dev/null +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/__variant/monostate.h
@@ -0,0 +1,60 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___VARIANT_MONOSTATE_H +#define _LIBCPP___VARIANT_MONOSTATE_H + +#include <__config> +#include <__functional/hash.h> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 14 + +struct _LIBCPP_TEMPLATE_VIS monostate {}; + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator<(monostate, monostate) noexcept { return false; } + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator>(monostate, monostate) noexcept { return false; } + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator<=(monostate, monostate) noexcept { return true; } + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator>=(monostate, monostate) noexcept { return true; } + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator==(monostate, monostate) noexcept { return true; } + +inline _LIBCPP_INLINE_VISIBILITY +constexpr bool operator!=(monostate, monostate) noexcept { return false; } + +template <> +struct _LIBCPP_TEMPLATE_VIS hash<monostate> { + using argument_type = monostate; + using result_type = size_t; + + inline _LIBCPP_INLINE_VISIBILITY + result_type operator()(const argument_type&) const _NOEXCEPT { + return 66740831; // return a fundamentally attractive random value. + } +}; + +#endif // _LIBCPP_STD_VER > 14 + +_LIBCPP_END_NAMESPACE_STD + +#endif // _LIBCPP___VARIANT_MONOSTATE_H
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/algorithm b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/algorithm index 5d09b6c..b28c8cd 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/algorithm +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/algorithm
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===-------------------------- algorithm ---------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -47,16 +47,16 @@ find_if(InputIterator first, InputIterator last, Predicate pred); template<class InputIterator, class Predicate> - InputIterator // constexpr in C++20 + constexpr InputIterator // constexpr in C++20 find_if_not(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator1 // constexpr in C++20 + constexpr ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> - ForwardIterator1 // constexpr in C++20 + constexpr ForwardIterator1 // constexpr in C++20 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); @@ -185,11 +185,11 @@ BidirectionalIterator2 result); template <class ForwardIterator1, class ForwardIterator2> - ForwardIterator2 + constexpr ForwardIterator2 // constexpr in C++20 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); template <class ForwardIterator1, class ForwardIterator2> - void + constexpr void // constexpr in C++20 iter_swap(ForwardIterator1 a, ForwardIterator2 b); template <class InputIterator, class OutputIterator, class UnaryOperation> @@ -251,23 +251,23 @@ remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred); template <class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 unique(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class BinaryPredicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); template <class InputIterator, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 unique_copy(InputIterator first, InputIterator last, OutputIterator result); template <class InputIterator, class OutputIterator, class BinaryPredicate> - OutputIterator + constexpr OutputIterator // constexpr in C++20 unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred); template <class BidirectionalIterator> - void + constexpr void // constexpr in C++20 reverse(BidirectionalIterator first, BidirectionalIterator last); template <class BidirectionalIterator, class OutputIterator> @@ -275,11 +275,11 @@ reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result); template <class ForwardIterator> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last); template <class ForwardIterator, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result); template <class RandomAccessIterator> @@ -301,12 +301,22 @@ void shuffle(RandomAccessIterator first, RandomAccessIterator last, UniformRandomNumberGenerator&& g); +template<class ForwardIterator> + constexpr ForwardIterator + shift_left(ForwardIterator first, ForwardIterator last, + typename iterator_traits<ForwardIterator>::difference_type n); // C++20 + +template<class ForwardIterator> + constexpr ForwardIterator + shift_right(ForwardIterator first, ForwardIterator last, + typename iterator_traits<ForwardIterator>::difference_type n); // C++20 + template <class InputIterator, class Predicate> constexpr bool // constexpr in C++20 is_partitioned(InputIterator first, InputIterator last, Predicate pred); template <class ForwardIterator, class Predicate> - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 partition(ForwardIterator first, ForwardIterator last, Predicate pred); template <class InputIterator, class OutputIterator1, @@ -329,7 +339,7 @@ is_sorted(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> - bool + constexpr bool // constexpr in C++20 is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); template<class ForwardIterator> @@ -341,11 +351,11 @@ is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 sort(RandomAccessIterator first, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> @@ -357,29 +367,29 @@ stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); template <class InputIterator, class RandomAccessIterator> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 partial_sort_copy(InputIterator first, InputIterator last, RandomAccessIterator result_first, RandomAccessIterator result_last); template <class InputIterator, class RandomAccessIterator, class Compare> - RandomAccessIterator + constexpr RandomAccessIterator // constexpr in C++20 partial_sort_copy(InputIterator first, InputIterator last, RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); template <class ForwardIterator, class T> @@ -415,12 +425,12 @@ binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 merge(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result); template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> - OutputIterator + constexpr OutputIterator // constexpr in C++20 merge(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); @@ -441,12 +451,12 @@ includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result); template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); @@ -461,55 +471,55 @@ InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result); template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); template <class InputIterator1, class InputIterator2, class OutputIterator> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result); template <class InputIterator1, class InputIterator2, class OutputIterator, class Compare> - OutputIterator + constexpr OutputIterator // constexpr in C++20 set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 push_heap(RandomAccessIterator first, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 pop_heap(RandomAccessIterator first, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 make_heap(RandomAccessIterator first, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> - void + constexpr void // constexpr in C++20 sort_heap(RandomAccessIterator first, RandomAccessIterator last); template <class RandomAccessIterator, class Compare> - void + constexpr void // constexpr in C++20 sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); template <class RandomAccessIterator> @@ -529,82 +539,82 @@ is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp); template <class ForwardIterator> - ForwardIterator - min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + min_element(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> - ForwardIterator - min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + min_element(ForwardIterator first, ForwardIterator last, Compare comp); template <class T> - const T& - min(const T& a, const T& b); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + min(const T& a, const T& b); template <class T, class Compare> - const T& - min(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + min(const T& a, const T& b, Compare comp); template<class T> - T - min(initializer_list<T> t); // constexpr in C++14 + constexpr T // constexpr in C++14 + min(initializer_list<T> t); template<class T, class Compare> - T - min(initializer_list<T> t, Compare comp); // constexpr in C++14 + constexpr T // constexpr in C++14 + min(initializer_list<T> t, Compare comp); template<class T> - constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17 + constexpr const T& clamp(const T& v, const T& lo, const T& hi); // C++17 template<class T, class Compare> - constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17 + constexpr const T& clamp(const T& v, const T& lo, const T& hi, Compare comp); // C++17 template <class ForwardIterator> - ForwardIterator - max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + max_element(ForwardIterator first, ForwardIterator last); template <class ForwardIterator, class Compare> - ForwardIterator - max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr ForwardIterator // constexpr in C++14 + max_element(ForwardIterator first, ForwardIterator last, Compare comp); template <class T> - const T& - max(const T& a, const T& b); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + max(const T& a, const T& b); template <class T, class Compare> - const T& - max(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr const T& // constexpr in C++14 + max(const T& a, const T& b, Compare comp); template<class T> - T - max(initializer_list<T> t); // constexpr in C++14 + constexpr T // constexpr in C++14 + max(initializer_list<T> t); template<class T, class Compare> - T - max(initializer_list<T> t, Compare comp); // constexpr in C++14 + constexpr T // constexpr in C++14 + max(initializer_list<T> t, Compare comp); template<class ForwardIterator> - pair<ForwardIterator, ForwardIterator> - minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14 + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 + minmax_element(ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Compare> - pair<ForwardIterator, ForwardIterator> - minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14 + constexpr pair<ForwardIterator, ForwardIterator> // constexpr in C++14 + minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); template<class T> - pair<const T&, const T&> - minmax(const T& a, const T& b); // constexpr in C++14 + constexpr pair<const T&, const T&> // constexpr in C++14 + minmax(const T& a, const T& b); template<class T, class Compare> - pair<const T&, const T&> - minmax(const T& a, const T& b, Compare comp); // constexpr in C++14 + constexpr pair<const T&, const T&> // constexpr in C++14 + minmax(const T& a, const T& b, Compare comp); template<class T> - pair<T, T> - minmax(initializer_list<T> t); // constexpr in C++14 + constexpr pair<T, T> // constexpr in C++14 + minmax(initializer_list<T> t); template<class T, class Compare> - pair<T, T> - minmax(initializer_list<T> t, Compare comp); // constexpr in C++14 + constexpr pair<T, T> // constexpr in C++14 + minmax(initializer_list<T> t, Compare comp); template <class InputIterator1, class InputIterator2> constexpr bool // constexpr in C++20 @@ -616,19 +626,19 @@ InputIterator2 first2, InputIterator2 last2, Compare comp); template <class BidirectionalIterator> - bool + constexpr bool // constexpr in C++20 next_permutation(BidirectionalIterator first, BidirectionalIterator last); template <class BidirectionalIterator, class Compare> - bool + constexpr bool // constexpr in C++20 next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); template <class BidirectionalIterator> - bool + constexpr bool // constexpr in C++20 prev_permutation(BidirectionalIterator first, BidirectionalIterator last); template <class BidirectionalIterator, class Compare> - bool + constexpr bool // constexpr in C++20 prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); } // std @@ -636,5103 +646,120 @@ */ #include <__config> -#include <initializer_list> -#include <type_traits> +#include <__debug> +#include <__bits> // __libcpp_clz +#include <cstddef> #include <cstring> +#include <functional> +#include <initializer_list> #include <utility> // needed to provide swap_ranges. #include <memory> -#include <functional> #include <iterator> -#include <cstddef> -#include <bit> +#include <memory> +#include <type_traits> +#include <utility> // swap_ranges #include <version> -#include <__debug> +#include <__algorithm/adjacent_find.h> +#include <__algorithm/all_of.h> +#include <__algorithm/any_of.h> +#include <__algorithm/binary_search.h> +#include <__algorithm/clamp.h> +#include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> +#include <__algorithm/copy.h> +#include <__algorithm/copy_backward.h> +#include <__algorithm/copy_if.h> +#include <__algorithm/copy_n.h> +#include <__algorithm/count.h> +#include <__algorithm/count_if.h> +#include <__algorithm/equal.h> +#include <__algorithm/equal_range.h> +#include <__algorithm/fill_n.h> +#include <__algorithm/fill.h> +#include <__algorithm/find.h> +#include <__algorithm/find_end.h> +#include <__algorithm/find_first_of.h> +#include <__algorithm/find_if.h> +#include <__algorithm/find_if_not.h> +#include <__algorithm/for_each.h> +#include <__algorithm/for_each_n.h> +#include <__algorithm/generate_n.h> +#include <__algorithm/generate.h> +#include <__algorithm/half_positive.h> +#include <__algorithm/includes.h> +#include <__algorithm/inplace_merge.h> +#include <__algorithm/is_heap.h> +#include <__algorithm/is_heap_until.h> +#include <__algorithm/is_partitioned.h> +#include <__algorithm/is_permutation.h> +#include <__algorithm/is_sorted.h> +#include <__algorithm/is_sorted_until.h> +#include <__algorithm/iter_swap.h> +#include <__algorithm/lexicographical_compare.h> +#include <__algorithm/lower_bound.h> +#include <__algorithm/make_heap.h> +#include <__algorithm/max.h> +#include <__algorithm/max_element.h> +#include <__algorithm/merge.h> +#include <__algorithm/min.h> +#include <__algorithm/min_element.h> +#include <__algorithm/minmax.h> +#include <__algorithm/minmax_element.h> +#include <__algorithm/mismatch.h> +#include <__algorithm/move.h> +#include <__algorithm/move_backward.h> +#include <__algorithm/next_permutation.h> +#include <__algorithm/none_of.h> +#include <__algorithm/nth_element.h> +#include <__algorithm/partial_sort.h> +#include <__algorithm/partial_sort_copy.h> +#include <__algorithm/partition.h> +#include <__algorithm/partition_copy.h> +#include <__algorithm/partition_point.h> +#include <__algorithm/pop_heap.h> +#include <__algorithm/prev_permutation.h> +#include <__algorithm/push_heap.h> +#include <__algorithm/remove.h> +#include <__algorithm/remove_copy.h> +#include <__algorithm/remove_copy_if.h> +#include <__algorithm/remove_if.h> +#include <__algorithm/replace.h> +#include <__algorithm/replace_copy.h> +#include <__algorithm/replace_copy_if.h> +#include <__algorithm/replace_if.h> +#include <__algorithm/reverse.h> +#include <__algorithm/reverse_copy.h> +#include <__algorithm/rotate.h> +#include <__algorithm/rotate_copy.h> +#include <__algorithm/sample.h> +#include <__algorithm/search.h> +#include <__algorithm/search_n.h> +#include <__algorithm/set_difference.h> +#include <__algorithm/set_intersection.h> +#include <__algorithm/set_symmetric_difference.h> +#include <__algorithm/set_union.h> +#include <__algorithm/shift_left.h> +#include <__algorithm/shift_right.h> +#include <__algorithm/shuffle.h> +#include <__algorithm/sift_down.h> +#include <__algorithm/sort.h> +#include <__algorithm/sort_heap.h> +#include <__algorithm/stable_partition.h> +#include <__algorithm/stable_sort.h> +#include <__algorithm/swap_ranges.h> +#include <__algorithm/transform.h> +#include <__algorithm/unique_copy.h> +#include <__algorithm/unique.h> +#include <__algorithm/unwrap_iter.h> +#include <__algorithm/upper_bound.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - - -_LIBCPP_BEGIN_NAMESPACE_STD - -// I'd like to replace these with _VSTD::equal_to<void>, but can't because: -// * That only works with C++14 and later, and -// * We haven't included <functional> here. -template <class _T1, class _T2 = _T1> -struct __equal_to -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;} -}; - -template <class _T1> -struct __equal_to<_T1, _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} -}; - -template <class _T1> -struct __equal_to<const _T1, _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} -}; - -template <class _T1> -struct __equal_to<_T1, const _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;} -}; - -template <class _T1, class _T2 = _T1> -struct __less -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;} - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;} - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;} -}; - -template <class _T1> -struct __less<_T1, _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} -}; - -template <class _T1> -struct __less<const _T1, _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} -}; - -template <class _T1> -struct __less<_T1, const _T1> -{ - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;} -}; - -template <class _Predicate> -class __invert // invert the sense of a comparison -{ -private: - _Predicate __p_; -public: - _LIBCPP_INLINE_VISIBILITY __invert() {} - - _LIBCPP_INLINE_VISIBILITY - explicit __invert(_Predicate __p) : __p_(__p) {} - - template <class _T1> - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _T1& __x) {return !__p_(__x);} - - template <class _T1, class _T2> - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);} -}; - -// Perform division by two quickly for positive integers (llvm.org/PR39129) - -template <typename _Integral> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_integral<_Integral>::value, - _Integral ->::type -__half_positive(_Integral __value) -{ - return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2); -} - -template <typename _Tp> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - !is_integral<_Tp>::value, - _Tp ->::type -__half_positive(_Tp __value) -{ - return __value / 2; -} - -#ifdef _LIBCPP_DEBUG - -template <class _Compare> -struct __debug_less -{ - _Compare &__comp_; - _LIBCPP_CONSTEXPR_AFTER_CXX17 - __debug_less(_Compare& __c) : __comp_(__c) {} - - template <class _Tp, class _Up> - _LIBCPP_CONSTEXPR_AFTER_CXX17 - bool operator()(const _Tp& __x, const _Up& __y) - { - bool __r = __comp_(__x, __y); - if (__r) - __do_compare_assert(0, __y, __x); - return __r; - } - - template <class _Tp, class _Up> - _LIBCPP_CONSTEXPR_AFTER_CXX17 - bool operator()(_Tp& __x, _Up& __y) - { - bool __r = __comp_(__x, __y); - if (__r) - __do_compare_assert(0, __y, __x); - return __r; - } - - template <class _LHS, class _RHS> - _LIBCPP_CONSTEXPR_AFTER_CXX17 - inline _LIBCPP_INLINE_VISIBILITY - decltype((void)_VSTD::declval<_Compare&>()( - _VSTD::declval<_LHS &>(), _VSTD::declval<_RHS &>())) - __do_compare_assert(int, _LHS & __l, _RHS & __r) { - _LIBCPP_ASSERT(!__comp_(__l, __r), - "Comparator does not induce a strict weak ordering"); - } - - template <class _LHS, class _RHS> - _LIBCPP_CONSTEXPR_AFTER_CXX17 - inline _LIBCPP_INLINE_VISIBILITY - void __do_compare_assert(long, _LHS &, _RHS &) {} -}; - -#endif // _LIBCPP_DEBUG - -template <class _Comp> -struct __comp_ref_type { - // Pass the comparator by lvalue reference. Or in debug mode, using a - // debugging wrapper that stores a reference. -#ifndef _LIBCPP_DEBUG - typedef typename add_lvalue_reference<_Comp>::type type; -#else - typedef __debug_less<_Comp> type; -#endif -}; - -// all_of - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (!__pred(*__first)) - return false; - return true; -} - -// any_of - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (__pred(*__first)) - return true; - return false; -} - -// none_of - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (__pred(*__first)) - return false; - return true; -} - -// for_each - -template <class _InputIterator, class _Function> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_Function -for_each(_InputIterator __first, _InputIterator __last, _Function __f) -{ - for (; __first != __last; ++__first) - __f(*__first); - return __f; -} - -#if _LIBCPP_STD_VER > 14 -// for_each_n - -template <class _InputIterator, class _Size, class _Function> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_InputIterator -for_each_n(_InputIterator __first, _Size __orig_n, _Function __f) -{ - typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize; - _IntegralSize __n = __orig_n; - while (__n > 0) - { - __f(*__first); - ++__first; - --__n; - } - return __first; -} -#endif - -// find - -template <class _InputIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_InputIterator -find(_InputIterator __first, _InputIterator __last, const _Tp& __value_) -{ - for (; __first != __last; ++__first) - if (*__first == __value_) - break; - return __first; -} - -// find_if - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_InputIterator -find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (__pred(*__first)) - break; - return __first; -} - -// find_if_not - -template<class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_InputIterator -find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (!__pred(*__first)) - break; - return __first; -} - -// find_end - -template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator1 -__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, - forward_iterator_tag, forward_iterator_tag) -{ - // modeled after search algorithm - _ForwardIterator1 __r = __last1; // __last1 is the "default" answer - if (__first2 == __last2) - return __r; - while (true) - { - while (true) - { - if (__first1 == __last1) // if source exhausted return last correct answer - return __r; // (or __last1 if never found) - if (__pred(*__first1, *__first2)) - break; - ++__first1; - } - // *__first1 matches *__first2, now match elements after here - _ForwardIterator1 __m1 = __first1; - _ForwardIterator2 __m2 = __first2; - while (true) - { - if (++__m2 == __last2) - { // Pattern exhaused, record answer and search for another one - __r = __first1; - ++__first1; - break; - } - if (++__m1 == __last1) // Source exhausted, return last answer - return __r; - if (!__pred(*__m1, *__m2)) // mismatch, restart with a new __first - { - ++__first1; - break; - } // else there is a match, check next elements - } - } -} - -template <class _BinaryPredicate, class _BidirectionalIterator1, class _BidirectionalIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator1 -__find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1, - _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred, - bidirectional_iterator_tag, bidirectional_iterator_tag) -{ - // modeled after search algorithm (in reverse) - if (__first2 == __last2) - return __last1; // Everything matches an empty sequence - _BidirectionalIterator1 __l1 = __last1; - _BidirectionalIterator2 __l2 = __last2; - --__l2; - while (true) - { - // Find last element in sequence 1 that matchs *(__last2-1), with a mininum of loop checks - while (true) - { - if (__first1 == __l1) // return __last1 if no element matches *__first2 - return __last1; - if (__pred(*--__l1, *__l2)) - break; - } - // *__l1 matches *__l2, now match elements before here - _BidirectionalIterator1 __m1 = __l1; - _BidirectionalIterator2 __m2 = __l2; - while (true) - { - if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern) - return __m1; - if (__m1 == __first1) // Otherwise if source exhaused, pattern not found - return __last1; - if (!__pred(*--__m1, *--__m2)) // if there is a mismatch, restart with a new __l1 - { - break; - } // else there is a match, check next elements - } - } -} - -template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1 -__find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, - random_access_iterator_tag, random_access_iterator_tag) -{ - // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern - typename iterator_traits<_RandomAccessIterator2>::difference_type __len2 = __last2 - __first2; - if (__len2 == 0) - return __last1; - typename iterator_traits<_RandomAccessIterator1>::difference_type __len1 = __last1 - __first1; - if (__len1 < __len2) - return __last1; - const _RandomAccessIterator1 __s = __first1 + (__len2 - 1); // End of pattern match can't go before here - _RandomAccessIterator1 __l1 = __last1; - _RandomAccessIterator2 __l2 = __last2; - --__l2; - while (true) - { - while (true) - { - if (__s == __l1) - return __last1; - if (__pred(*--__l1, *__l2)) - break; - } - _RandomAccessIterator1 __m1 = __l1; - _RandomAccessIterator2 __m2 = __l2; - while (true) - { - if (__m2 == __first2) - return __m1; - // no need to check range on __m1 because __s guarantees we have enough source - if (!__pred(*--__m1, *--__m2)) - { - break; - } - } - } -} - -template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) -{ - return _VSTD::__find_end<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __last2, __pred, - typename iterator_traits<_ForwardIterator1>::iterator_category(), - typename iterator_traits<_ForwardIterator2>::iterator_category()); -} - -template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) -{ - typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; - typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; - return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); -} - -// find_first_of - -template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 -__find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) -{ - for (; __first1 != __last1; ++__first1) - for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) - if (__pred(*__first1, *__j)) - return __first1; - return __last1; -} - - -template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) -{ - return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred); -} - -template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) -{ - typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; - typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; - return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); -} - -// adjacent_find - -template <class _ForwardIterator, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) -{ - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (__pred(*__first, *__i)) - return __first; - __first = __i; - } - } - return __last; -} - -template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -adjacent_find(_ForwardIterator __first, _ForwardIterator __last) -{ - typedef typename iterator_traits<_ForwardIterator>::value_type __v; - return _VSTD::adjacent_find(__first, __last, __equal_to<__v>()); -} - -// count - -template <class _InputIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -typename iterator_traits<_InputIterator>::difference_type -count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) -{ - typename iterator_traits<_InputIterator>::difference_type __r(0); - for (; __first != __last; ++__first) - if (*__first == __value_) - ++__r; - return __r; -} - -// count_if - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -typename iterator_traits<_InputIterator>::difference_type -count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - typename iterator_traits<_InputIterator>::difference_type __r(0); - for (; __first != __last; ++__first) - if (__pred(*__first)) - ++__r; - return __r; -} - -// mismatch - -template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_InputIterator1, _InputIterator2> -mismatch(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _BinaryPredicate __pred) -{ - for (; __first1 != __last1; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - break; - return pair<_InputIterator1, _InputIterator2>(__first1, __first2); -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_InputIterator1, _InputIterator2> -mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) -{ - typedef typename iterator_traits<_InputIterator1>::value_type __v1; - typedef typename iterator_traits<_InputIterator2>::value_type __v2; - return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>()); -} - -#if _LIBCPP_STD_VER > 11 -template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_InputIterator1, _InputIterator2> -mismatch(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _BinaryPredicate __pred) -{ - for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - break; - return pair<_InputIterator1, _InputIterator2>(__first1, __first2); -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_InputIterator1, _InputIterator2> -mismatch(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) -{ - typedef typename iterator_traits<_InputIterator1>::value_type __v1; - typedef typename iterator_traits<_InputIterator2>::value_type __v2; - return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); -} -#endif - -// equal - -template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) -{ - for (; __first1 != __last1; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - return false; - return true; -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2) -{ - typedef typename iterator_traits<_InputIterator1>::value_type __v1; - typedef typename iterator_traits<_InputIterator2>::value_type __v2; - return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>()); -} - -#if _LIBCPP_STD_VER > 11 -template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -__equal(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred, - input_iterator_tag, input_iterator_tag ) -{ - for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - return false; - return __first1 == __last1 && __first2 == __last2; -} - -template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, - _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, - random_access_iterator_tag, random_access_iterator_tag ) -{ - if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2)) - return false; - return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2, - typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __pred ); -} - -template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -equal(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred ) -{ - return _VSTD::__equal<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __last2, __pred, - typename iterator_traits<_InputIterator1>::iterator_category(), - typename iterator_traits<_InputIterator2>::iterator_category()); -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -equal(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) -{ - typedef typename iterator_traits<_InputIterator1>::value_type __v1; - typedef typename iterator_traits<_InputIterator2>::value_type __v2; - return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(), - typename iterator_traits<_InputIterator1>::iterator_category(), - typename iterator_traits<_InputIterator2>::iterator_category()); -} -#endif - -// is_permutation - -template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool -is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _BinaryPredicate __pred) -{ -// shorten sequences as much as possible by lopping of any equal prefix - for (; __first1 != __last1; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - break; - if (__first1 == __last1) - return true; - -// __first1 != __last1 && *__first1 != *__first2 - typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; - _D1 __l1 = _VSTD::distance(__first1, __last1); - if (__l1 == _D1(1)) - return false; - _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1); - // For each element in [f1, l1) see if there are the same number of - // equal elements in [f2, l2) - for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) - { - // Have we already counted the number of *__i in [f1, l1)? - _ForwardIterator1 __match = __first1; - for (; __match != __i; ++__match) - if (__pred(*__match, *__i)) - break; - if (__match == __i) { - // Count number of *__i in [f2, l2) - _D1 __c2 = 0; - for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) - if (__pred(*__i, *__j)) - ++__c2; - if (__c2 == 0) - return false; - // Count number of *__i in [__i, l1) (we can start with 1) - _D1 __c1 = 1; - for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j) - if (__pred(*__i, *__j)) - ++__c1; - if (__c1 != __c2) - return false; - } - } - return true; -} - -template<class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2) -{ - typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; - typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; - return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>()); -} - -#if _LIBCPP_STD_VER > 11 -template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool -__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - _BinaryPredicate __pred, - forward_iterator_tag, forward_iterator_tag ) -{ -// shorten sequences as much as possible by lopping of any equal prefix - for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) - if (!__pred(*__first1, *__first2)) - break; - if (__first1 == __last1) - return __first2 == __last2; - else if (__first2 == __last2) - return false; - - typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1; - _D1 __l1 = _VSTD::distance(__first1, __last1); - - typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2; - _D2 __l2 = _VSTD::distance(__first2, __last2); - if (__l1 != __l2) - return false; - - // For each element in [f1, l1) see if there are the same number of - // equal elements in [f2, l2) - for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i) - { - // Have we already counted the number of *__i in [f1, l1)? - _ForwardIterator1 __match = __first1; - for (; __match != __i; ++__match) - if (__pred(*__match, *__i)) - break; - if (__match == __i) { - // Count number of *__i in [f2, l2) - _D1 __c2 = 0; - for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) - if (__pred(*__i, *__j)) - ++__c2; - if (__c2 == 0) - return false; - // Count number of *__i in [__i, l1) (we can start with 1) - _D1 __c1 = 1; - for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j) - if (__pred(*__i, *__j)) - ++__c1; - if (__c1 != __c2) - return false; - } - } - return true; -} - -template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool -__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, - _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, - _BinaryPredicate __pred, - random_access_iterator_tag, random_access_iterator_tag ) -{ - if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2)) - return false; - return _VSTD::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2, - typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __pred ); -} - -template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, - _BinaryPredicate __pred ) -{ - return _VSTD::__is_permutation<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __last2, __pred, - typename iterator_traits<_ForwardIterator1>::iterator_category(), - typename iterator_traits<_ForwardIterator2>::iterator_category()); -} - -template<class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) -{ - typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; - typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; - return _VSTD::__is_permutation(__first1, __last1, __first2, __last2, - __equal_to<__v1, __v2>(), - typename iterator_traits<_ForwardIterator1>::iterator_category(), - typename iterator_traits<_ForwardIterator2>::iterator_category()); -} -#endif - -// search -// __search is in <functional> - -template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred) -{ - return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first1, __last1, __first2, __last2, __pred, - typename iterator_traits<_ForwardIterator1>::iterator_category(), - typename iterator_traits<_ForwardIterator2>::iterator_category()) - .first; -} - -template <class _ForwardIterator1, class _ForwardIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator1 -search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2, _ForwardIterator2 __last2) -{ - typedef typename iterator_traits<_ForwardIterator1>::value_type __v1; - typedef typename iterator_traits<_ForwardIterator2>::value_type __v2; - return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>()); -} - - -#if _LIBCPP_STD_VER > 14 -template <class _ForwardIterator, class _Searcher> -_LIBCPP_NODISCARD_EXT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) -{ return __s(__f, __l).first; } -#endif - -// search_n - -template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -__search_n(_ForwardIterator __first, _ForwardIterator __last, - _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag) -{ - if (__count <= 0) - return __first; - while (true) - { - // Find first element in sequence that matchs __value_, with a mininum of loop checks - while (true) - { - if (__first == __last) // return __last if no element matches __value_ - return __last; - if (__pred(*__first, __value_)) - break; - ++__first; - } - // *__first matches __value_, now match elements after here - _ForwardIterator __m = __first; - _Size __c(0); - while (true) - { - if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern) - return __first; - if (++__m == __last) // Otherwise if source exhaused, pattern not found - return __last; - if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first - { - __first = __m; - ++__first; - break; - } // else there is a match, check next elements - } - } -} - -template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator -__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag) -{ - if (__count <= 0) - return __first; - _Size __len = static_cast<_Size>(__last - __first); - if (__len < __count) - return __last; - const _RandomAccessIterator __s = __last - (__count - 1); // Start of pattern match can't go beyond here - while (true) - { - // Find first element in sequence that matchs __value_, with a mininum of loop checks - while (true) - { - if (__first >= __s) // return __last if no element matches __value_ - return __last; - if (__pred(*__first, __value_)) - break; - ++__first; - } - // *__first matches __value_, now match elements after here - _RandomAccessIterator __m = __first; - _Size __c(0); - while (true) - { - if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern) - return __first; - ++__m; // no need to check range on __m because __s guarantees we have enough source - if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first - { - __first = __m; - ++__first; - break; - } // else there is a match, check next elements - } - } -} - -template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -search_n(_ForwardIterator __first, _ForwardIterator __last, - _Size __count, const _Tp& __value_, _BinaryPredicate __pred) -{ - return _VSTD::__search_n<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first, __last, __convert_to_integral(__count), __value_, __pred, - typename iterator_traits<_ForwardIterator>::iterator_category()); -} - -template <class _ForwardIterator, class _Size, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_) -{ - typedef typename iterator_traits<_ForwardIterator>::value_type __v; - return _VSTD::search_n(__first, __last, __convert_to_integral(__count), - __value_, __equal_to<__v, _Tp>()); -} - -// copy -template <class _Iter> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -_Iter -__unwrap_iter(_Iter __i) -{ - return __i; -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_trivially_copy_assignable<_Tp>::value, - _Tp* ->::type -__unwrap_iter(move_iterator<_Tp*> __i) -{ - return __i.base(); -} - -#if _LIBCPP_DEBUG_LEVEL < 2 - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_trivially_copy_assignable<_Tp>::value, - _Tp* ->::type -__unwrap_iter(__wrap_iter<_Tp*> __i) -{ - return __i.base(); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_trivially_copy_assignable<_Tp>::value, - const _Tp* ->::type -__unwrap_iter(__wrap_iter<const _Tp*> __i) -{ - return __i.base(); -} - -#else - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_trivially_copy_assignable<_Tp>::value, - __wrap_iter<_Tp*> ->::type -__unwrap_iter(__wrap_iter<_Tp*> __i) -{ - return __i; -} - -#endif // _LIBCPP_DEBUG_LEVEL < 2 - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -__copy_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - for (; __first != __last; ++__first, (void) ++__result) - *__result = *__first; - return __result; -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - return __copy_constexpr(__first, __last, __result); -} - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_same<typename remove_const<_Tp>::type, _Up>::value && - is_trivially_copy_assignable<_Up>::value, - _Up* ->::type -__copy(_Tp* __first, _Tp* __last, _Up* __result) -{ - const size_t __n = static_cast<size_t>(__last - __first); - if (__n > 0) - _VSTD::memmove(__result, __first, __n * sizeof(_Up)); - return __result + __n; -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED -_OutputIterator -copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - if (__libcpp_is_constant_evaluated()) { - return _VSTD::__copy_constexpr( - __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result)); - } else { - return _VSTD::__copy( - __unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result)); - } -} - -// copy_backward - -template <class _BidirectionalIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -__copy_backward_constexpr(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) -{ - while (__first != __last) - *--__result = *--__last; - return __result; -} - -template <class _BidirectionalIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) -{ - return __copy_backward_constexpr(__first, __last, __result); -} - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_same<typename remove_const<_Tp>::type, _Up>::value && - is_trivially_copy_assignable<_Up>::value, - _Up* ->::type -__copy_backward(_Tp* __first, _Tp* __last, _Up* __result) -{ - const size_t __n = static_cast<size_t>(__last - __first); - if (__n > 0) - { - __result -= __n; - _VSTD::memmove(__result, __first, __n * sizeof(_Up)); - } - return __result; -} - -template <class _BidirectionalIterator1, class _BidirectionalIterator2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED -_BidirectionalIterator2 -copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, - _BidirectionalIterator2 __result) -{ - if (__libcpp_is_constant_evaluated()) { - return _VSTD::__copy_backward_constexpr(__unwrap_iter(__first), - __unwrap_iter(__last), - __unwrap_iter(__result)); - } else { - return _VSTD::__copy_backward(__unwrap_iter(__first), - __unwrap_iter(__last), - __unwrap_iter(__result)); - } -} - -// copy_if - -template<class _InputIterator, class _OutputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -copy_if(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Predicate __pred) -{ - for (; __first != __last; ++__first) - { - if (__pred(*__first)) - { - *__result = *__first; - ++__result; - } - } - return __result; -} - -// copy_n - -template<class _InputIterator, class _Size, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED -typename enable_if -< - __is_cpp17_input_iterator<_InputIterator>::value && - !__is_cpp17_random_access_iterator<_InputIterator>::value, - _OutputIterator ->::type -copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) -{ - typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize; - _IntegralSize __n = __orig_n; - if (__n > 0) - { - *__result = *__first; - ++__result; - for (--__n; __n > 0; --__n) - { - ++__first; - *__result = *__first; - ++__result; - } - } - return __result; -} - -template<class _InputIterator, class _Size, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED -typename enable_if -< - __is_cpp17_random_access_iterator<_InputIterator>::value, - _OutputIterator ->::type -copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) -{ - typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize; - _IntegralSize __n = __orig_n; - return _VSTD::copy(__first, __first + __n, __result); -} - -// move - -// __move_constexpr exists so that __move doesn't call itself when delegating to the constexpr -// version of __move. -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -_OutputIterator -__move_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - for (; __first != __last; ++__first, (void) ++__result) - *__result = _VSTD::move(*__first); - return __result; -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -_OutputIterator -__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - return __move_constexpr(__first, __last, __result); -} - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -typename enable_if -< - is_same<typename remove_const<_Tp>::type, _Up>::value && - is_trivially_copy_assignable<_Up>::value, - _Up* ->::type -__move(_Tp* __first, _Tp* __last, _Up* __result) -{ - if (__libcpp_is_constant_evaluated()) - return __move_constexpr(__first, __last, __result); - const size_t __n = static_cast<size_t>(__last - __first); - if (__n > 0) - _VSTD::memmove(__result, __first, __n * sizeof(_Up)); - return __result + __n; -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result)); -} - -// move_backward - -// __move_backward_constexpr exists so that __move_backward doesn't call itself when delegating to -// the constexpr version of __move_backward. -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -_OutputIterator -__move_backward_constexpr(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - while (__first != __last) - *--__result = _VSTD::move(*--__last); - return __result; -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -_OutputIterator -__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - return __move_backward_constexpr(__first, __last, __result); -} - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 -typename enable_if -< - is_same<typename remove_const<_Tp>::type, _Up>::value && - is_trivially_copy_assignable<_Up>::value, - _Up* ->::type -__move_backward(_Tp* __first, _Tp* __last, _Up* __result) -{ - if (__libcpp_is_constant_evaluated()) - return __move_backward_constexpr(__first, __last, __result); - const size_t __n = static_cast<size_t>(__last - __first); - if (__n > 0) - { - __result -= __n; - _VSTD::memmove(__result, __first, __n * sizeof(_Up)); - } - return __result; -} - -template <class _BidirectionalIterator1, class _BidirectionalIterator2> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_BidirectionalIterator2 -move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, - _BidirectionalIterator2 __result) -{ - return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result)); -} - -// iter_swap - -// moved to <type_traits> for better swap / noexcept support - -// transform - -template <class _InputIterator, class _OutputIterator, class _UnaryOperation> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op) -{ - for (; __first != __last; ++__first, (void) ++__result) - *__result = __op(*__first); - return __result; -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _BinaryOperation> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, - _OutputIterator __result, _BinaryOperation __binary_op) -{ - for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result) - *__result = __binary_op(*__first1, *__first2); - return __result; -} - -// replace - -template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) -{ - for (; __first != __last; ++__first) - if (*__first == __old_value) - *__first = __new_value; -} - -// replace_if - -template <class _ForwardIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) -{ - for (; __first != __last; ++__first) - if (__pred(*__first)) - *__first = __new_value; -} - -// replace_copy - -template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, - const _Tp& __old_value, const _Tp& __new_value) -{ - for (; __first != __last; ++__first, (void) ++__result) - if (*__first == __old_value) - *__result = __new_value; - else - *__result = *__first; - return __result; -} - -// replace_copy_if - -template <class _InputIterator, class _OutputIterator, class _Predicate, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, - _Predicate __pred, const _Tp& __new_value) -{ - for (; __first != __last; ++__first, (void) ++__result) - if (__pred(*__first)) - *__result = __new_value; - else - *__result = *__first; - return __result; -} - -// fill_n - -template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) -{ - for (; __n > 0; ++__first, (void) --__n) - *__first = __value_; - return __first; -} - -template <class _OutputIterator, class _Size, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_) -{ - return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_); -} - -// fill - -template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag) -{ - for (; __first != __last; ++__first) - *__first = __value_; -} - -template <class _RandomAccessIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag) -{ - _VSTD::fill_n(__first, __last - __first, __value_); -} - -template <class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category()); -} - -// generate - -template <class _ForwardIterator, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -void -generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen) -{ - for (; __first != __last; ++__first) - *__first = __gen(); -} - -// generate_n - -template <class _OutputIterator, class _Size, class _Generator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen) -{ - typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize; - _IntegralSize __n = __orig_n; - for (; __n > 0; ++__first, (void) --__n) - *__first = __gen(); - return __first; -} - -// remove - -template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - __first = _VSTD::find(__first, __last, __value_); - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (!(*__i == __value_)) - { - *__first = _VSTD::move(*__i); - ++__first; - } - } - } - return __first; -} - -// remove_if - -template <class _ForwardIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) -{ - __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type> - (__first, __last, __pred); - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (!__pred(*__i)) - { - *__first = _VSTD::move(*__i); - ++__first; - } - } - } - return __first; -} - -// remove_copy - -template <class _InputIterator, class _OutputIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_) -{ - for (; __first != __last; ++__first) - { - if (!(*__first == __value_)) - { - *__result = *__first; - ++__result; - } - } - return __result; -} - -// remove_copy_if - -template <class _InputIterator, class _OutputIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) -{ - for (; __first != __last; ++__first) - { - if (!__pred(*__first)) - { - *__result = *__first; - ++__result; - } - } - return __result; -} - -// unique - -template <class _ForwardIterator, class _BinaryPredicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) -{ - __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type> - (__first, __last, __pred); - if (__first != __last) - { - // ... a a ? ... - // f i - _ForwardIterator __i = __first; - for (++__i; ++__i != __last;) - if (!__pred(*__first, *__i)) - *++__first = _VSTD::move(*__i); - ++__first; - } - return __first; -} - -template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -unique(_ForwardIterator __first, _ForwardIterator __last) -{ - typedef typename iterator_traits<_ForwardIterator>::value_type __v; - return _VSTD::unique(__first, __last, __equal_to<__v>()); -} - -// unique_copy - -template <class _BinaryPredicate, class _InputIterator, class _OutputIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator -__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred, - input_iterator_tag, output_iterator_tag) -{ - if (__first != __last) - { - typename iterator_traits<_InputIterator>::value_type __t(*__first); - *__result = __t; - ++__result; - while (++__first != __last) - { - if (!__pred(__t, *__first)) - { - __t = *__first; - *__result = __t; - ++__result; - } - } - } - return __result; -} - -template <class _BinaryPredicate, class _ForwardIterator, class _OutputIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator -__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred, - forward_iterator_tag, output_iterator_tag) -{ - if (__first != __last) - { - _ForwardIterator __i = __first; - *__result = *__i; - ++__result; - while (++__first != __last) - { - if (!__pred(*__i, *__first)) - { - *__result = *__first; - ++__result; - __i = __first; - } - } - } - return __result; -} - -template <class _BinaryPredicate, class _InputIterator, class _ForwardIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred, - input_iterator_tag, forward_iterator_tag) -{ - if (__first != __last) - { - *__result = *__first; - while (++__first != __last) - if (!__pred(*__result, *__first)) - *++__result = *__first; - ++__result; - } - return __result; -} - -template <class _InputIterator, class _OutputIterator, class _BinaryPredicate> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred) -{ - return _VSTD::__unique_copy<typename add_lvalue_reference<_BinaryPredicate>::type> - (__first, __last, __result, __pred, - typename iterator_traits<_InputIterator>::iterator_category(), - typename iterator_traits<_OutputIterator>::iterator_category()); -} - -template <class _InputIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) -{ - typedef typename iterator_traits<_InputIterator>::value_type __v; - return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>()); -} - -// reverse - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag) -{ - while (__first != __last) - { - if (__first == --__last) - break; - _VSTD::iter_swap(__first, __last); - ++__first; - } -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag) -{ - if (__first != __last) - for (; __first < --__last; ++__first) - _VSTD::iter_swap(__first, __last); -} - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) -{ - _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category()); -} - -// reverse_copy - -template <class _BidirectionalIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) -{ - for (; __first != __last; ++__result) - *__result = *--__last; - return __result; -} - -// rotate - -template <class _ForwardIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator -__rotate_left(_ForwardIterator __first, _ForwardIterator __last) -{ - typedef typename iterator_traits<_ForwardIterator>::value_type value_type; - value_type __tmp = _VSTD::move(*__first); - _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first); - *__lm1 = _VSTD::move(__tmp); - return __lm1; -} - -template <class _BidirectionalIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator -__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) -{ - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - _BidirectionalIterator __lm1 = _VSTD::prev(__last); - value_type __tmp = _VSTD::move(*__lm1); - _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last); - *__first = _VSTD::move(__tmp); - return __fp1; -} - -template <class _ForwardIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator -__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) -{ - _ForwardIterator __i = __middle; - while (true) - { - swap(*__first, *__i); - ++__first; - if (++__i == __last) - break; - if (__first == __middle) - __middle = __i; - } - _ForwardIterator __r = __first; - if (__first != __middle) - { - __i = __middle; - while (true) - { - swap(*__first, *__i); - ++__first; - if (++__i == __last) - { - if (__first == __middle) - break; - __i = __middle; - } - else if (__first == __middle) - __middle = __i; - } - } - return __r; -} - -template<typename _Integral> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX14 _Integral -__algo_gcd(_Integral __x, _Integral __y) -{ - do - { - _Integral __t = __x % __y; - __x = __y; - __y = __t; - } while (__y); - return __x; -} - -template<typename _RandomAccessIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator -__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - - const difference_type __m1 = __middle - __first; - const difference_type __m2 = __last - __middle; - if (__m1 == __m2) - { - _VSTD::swap_ranges(__first, __middle, __middle); - return __middle; - } - const difference_type __g = _VSTD::__algo_gcd(__m1, __m2); - for (_RandomAccessIterator __p = __first + __g; __p != __first;) - { - value_type __t(_VSTD::move(*--__p)); - _RandomAccessIterator __p1 = __p; - _RandomAccessIterator __p2 = __p1 + __m1; - do - { - *__p1 = _VSTD::move(*__p2); - __p1 = __p2; - const difference_type __d = __last - __p2; - if (__m1 < __d) - __p2 += __m1; - else - __p2 = __first + (__m1 - __d); - } while (__p2 != __p); - *__p1 = _VSTD::move(__t); - } - return __first + __m2; -} - -template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator -__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, - _VSTD::forward_iterator_tag) -{ - typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type; - if (_VSTD::is_trivially_move_assignable<value_type>::value) - { - if (_VSTD::next(__first) == __middle) - return _VSTD::__rotate_left(__first, __last); - } - return _VSTD::__rotate_forward(__first, __middle, __last); -} - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator -__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, - _VSTD::bidirectional_iterator_tag) -{ - typedef typename _VSTD::iterator_traits<_BidirectionalIterator>::value_type value_type; - if (_VSTD::is_trivially_move_assignable<value_type>::value) - { - if (_VSTD::next(__first) == __middle) - return _VSTD::__rotate_left(__first, __last); - if (_VSTD::next(__middle) == __last) - return _VSTD::__rotate_right(__first, __last); - } - return _VSTD::__rotate_forward(__first, __middle, __last); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator -__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, - _VSTD::random_access_iterator_tag) -{ - typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::value_type value_type; - if (_VSTD::is_trivially_move_assignable<value_type>::value) - { - if (_VSTD::next(__first) == __middle) - return _VSTD::__rotate_left(__first, __last); - if (_VSTD::next(__middle) == __last) - return _VSTD::__rotate_right(__first, __last); - return _VSTD::__rotate_gcd(__first, __middle, __last); - } - return _VSTD::__rotate_forward(__first, __middle, __last); -} - -template <class _ForwardIterator> -inline _LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) -{ - if (__first == __middle) - return __last; - if (__middle == __last) - return __first; - return _VSTD::__rotate(__first, __middle, __last, - typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category()); -} - -// rotate_copy - -template <class _ForwardIterator, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result) -{ - return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result)); -} - -// min_element - -template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_ForwardIterator -min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) -{ - static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, - "std::min_element requires a ForwardIterator"); - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - if (__comp(*__i, *__first)) - __first = __i; - } - return __first; -} - -template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_ForwardIterator -min_element(_ForwardIterator __first, _ForwardIterator __last) -{ - return _VSTD::min_element(__first, __last, - __less<typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// min - -template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -const _Tp& -min(const _Tp& __a, const _Tp& __b, _Compare __comp) -{ - return __comp(__b, __a) ? __b : __a; -} - -template <class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -const _Tp& -min(const _Tp& __a, const _Tp& __b) -{ - return _VSTD::min(__a, __b, __less<_Tp>()); -} - -#ifndef _LIBCPP_CXX03_LANG - -template<class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_Tp -min(initializer_list<_Tp> __t, _Compare __comp) -{ - return *_VSTD::min_element(__t.begin(), __t.end(), __comp); -} - -template<class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_Tp -min(initializer_list<_Tp> __t) -{ - return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>()); -} - -#endif // _LIBCPP_CXX03_LANG - -// max_element - -template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_ForwardIterator -max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) -{ - static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, - "std::max_element requires a ForwardIterator"); - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - if (__comp(*__first, *__i)) - __first = __i; - } - return __first; -} - - -template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_ForwardIterator -max_element(_ForwardIterator __first, _ForwardIterator __last) -{ - return _VSTD::max_element(__first, __last, - __less<typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// max - -template <class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -const _Tp& -max(const _Tp& __a, const _Tp& __b, _Compare __comp) -{ - return __comp(__a, __b) ? __b : __a; -} - -template <class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -const _Tp& -max(const _Tp& __a, const _Tp& __b) -{ - return _VSTD::max(__a, __b, __less<_Tp>()); -} - -#ifndef _LIBCPP_CXX03_LANG - -template<class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_Tp -max(initializer_list<_Tp> __t, _Compare __comp) -{ - return *_VSTD::max_element(__t.begin(), __t.end(), __comp); -} - -template<class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -_Tp -max(initializer_list<_Tp> __t) -{ - return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>()); -} - -#endif // _LIBCPP_CXX03_LANG - -#if _LIBCPP_STD_VER > 14 -// clamp -template<class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -const _Tp& -clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp) -{ - _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp"); - return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v; - -} - -template<class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -const _Tp& -clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi) -{ - return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>()); -} -#endif - -// minmax_element - -template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11 -std::pair<_ForwardIterator, _ForwardIterator> -minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) -{ - static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, - "std::minmax_element requires a ForwardIterator"); - std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first); - if (__first != __last) - { - if (++__first != __last) - { - if (__comp(*__first, *__result.first)) - __result.first = __first; - else - __result.second = __first; - while (++__first != __last) - { - _ForwardIterator __i = __first; - if (++__first == __last) - { - if (__comp(*__i, *__result.first)) - __result.first = __i; - else if (!__comp(*__i, *__result.second)) - __result.second = __i; - break; - } - else - { - if (__comp(*__first, *__i)) - { - if (__comp(*__first, *__result.first)) - __result.first = __first; - if (!__comp(*__i, *__result.second)) - __result.second = __i; - } - else - { - if (__comp(*__i, *__result.first)) - __result.first = __i; - if (!__comp(*__first, *__result.second)) - __result.second = __first; - } - } - } - } - } - return __result; -} - -template <class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -std::pair<_ForwardIterator, _ForwardIterator> -minmax_element(_ForwardIterator __first, _ForwardIterator __last) -{ - return _VSTD::minmax_element(__first, __last, - __less<typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// minmax - -template<class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -pair<const _Tp&, const _Tp&> -minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) -{ - return __comp(__b, __a) ? pair<const _Tp&, const _Tp&>(__b, __a) : - pair<const _Tp&, const _Tp&>(__a, __b); -} - -template<class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -pair<const _Tp&, const _Tp&> -minmax(const _Tp& __a, const _Tp& __b) -{ - return _VSTD::minmax(__a, __b, __less<_Tp>()); -} - -#ifndef _LIBCPP_CXX03_LANG - -template<class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -pair<_Tp, _Tp> -minmax(initializer_list<_Tp> __t, _Compare __comp) -{ - typedef typename initializer_list<_Tp>::const_iterator _Iter; - _Iter __first = __t.begin(); - _Iter __last = __t.end(); - std::pair<_Tp, _Tp> __result(*__first, *__first); - - ++__first; - if (__t.size() % 2 == 0) - { - if (__comp(*__first, __result.first)) - __result.first = *__first; - else - __result.second = *__first; - ++__first; - } - - while (__first != __last) - { - _Tp __prev = *__first++; - if (__comp(*__first, __prev)) { - if ( __comp(*__first, __result.first)) __result.first = *__first; - if (!__comp(__prev, __result.second)) __result.second = __prev; - } - else { - if ( __comp(__prev, __result.first)) __result.first = __prev; - if (!__comp(*__first, __result.second)) __result.second = *__first; - } - - __first++; - } - return __result; -} - -template<class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -pair<_Tp, _Tp> -minmax(initializer_list<_Tp> __t) -{ - return _VSTD::minmax(__t, __less<_Tp>()); -} - -#endif // _LIBCPP_CXX03_LANG - -// random_shuffle - -// __independent_bits_engine - -template <unsigned long long _Xp, size_t _Rp> -struct __log2_imp -{ - static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp - : __log2_imp<_Xp, _Rp - 1>::value; -}; - -template <unsigned long long _Xp> -struct __log2_imp<_Xp, 0> -{ - static const size_t value = 0; -}; - -template <size_t _Rp> -struct __log2_imp<0, _Rp> -{ - static const size_t value = _Rp + 1; -}; - -template <class _UIntType, _UIntType _Xp> -struct __log2 -{ - static const size_t value = __log2_imp<_Xp, - sizeof(_UIntType) * __CHAR_BIT__ - 1>::value; -}; - -template<class _Engine, class _UIntType> -class __independent_bits_engine -{ -public: - // types - typedef _UIntType result_type; - -private: - typedef typename _Engine::result_type _Engine_result_type; - typedef typename conditional - < - sizeof(_Engine_result_type) <= sizeof(result_type), - result_type, - _Engine_result_type - >::type _Working_result_type; - - _Engine& __e_; - size_t __w_; - size_t __w0_; - size_t __n_; - size_t __n0_; - _Working_result_type __y0_; - _Working_result_type __y1_; - _Engine_result_type __mask0_; - _Engine_result_type __mask1_; - -#ifdef _LIBCPP_CXX03_LANG - static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min - + _Working_result_type(1); -#else - static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min() - + _Working_result_type(1); -#endif - static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value; - static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits; - static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits; - -public: - // constructors and seeding functions - __independent_bits_engine(_Engine& __e, size_t __w); - - // generating functions - result_type operator()() {return __eval(integral_constant<bool, _Rp != 0>());} - -private: - result_type __eval(false_type); - result_type __eval(true_type); -}; - -template<class _Engine, class _UIntType> -__independent_bits_engine<_Engine, _UIntType> - ::__independent_bits_engine(_Engine& __e, size_t __w) - : __e_(__e), - __w_(__w) -{ - __n_ = __w_ / __m + (__w_ % __m != 0); - __w0_ = __w_ / __n_; - if (_Rp == 0) - __y0_ = _Rp; - else if (__w0_ < _WDt) - __y0_ = (_Rp >> __w0_) << __w0_; - else - __y0_ = 0; - if (_Rp - __y0_ > __y0_ / __n_) - { - ++__n_; - __w0_ = __w_ / __n_; - if (__w0_ < _WDt) - __y0_ = (_Rp >> __w0_) << __w0_; - else - __y0_ = 0; - } - __n0_ = __n_ - __w_ % __n_; - if (__w0_ < _WDt - 1) - __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1); - else - __y1_ = 0; - __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) : - _Engine_result_type(0); - __mask1_ = __w0_ < _EDt - 1 ? - _Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) : - _Engine_result_type(~0); -} - -template<class _Engine, class _UIntType> -inline -_UIntType -__independent_bits_engine<_Engine, _UIntType>::__eval(false_type) -{ - return static_cast<result_type>(__e_() & __mask0_); -} - -template<class _Engine, class _UIntType> -_UIntType -__independent_bits_engine<_Engine, _UIntType>::__eval(true_type) -{ - const size_t _WRt = numeric_limits<result_type>::digits; - result_type _Sp = 0; - for (size_t __k = 0; __k < __n0_; ++__k) - { - _Engine_result_type __u; - do - { - __u = __e_() - _Engine::min(); - } while (__u >= __y0_); - if (__w0_ < _WRt) - _Sp <<= __w0_; - else - _Sp = 0; - _Sp += __u & __mask0_; - } - for (size_t __k = __n0_; __k < __n_; ++__k) - { - _Engine_result_type __u; - do - { - __u = __e_() - _Engine::min(); - } while (__u >= __y1_); - if (__w0_ < _WRt - 1) - _Sp <<= __w0_ + 1; - else - _Sp = 0; - _Sp += __u & __mask1_; - } - return _Sp; -} - -// uniform_int_distribution - -template<class _IntType = int> -class uniform_int_distribution -{ -public: - // types - typedef _IntType result_type; - - class param_type - { - result_type __a_; - result_type __b_; - public: - typedef uniform_int_distribution distribution_type; - - explicit param_type(result_type __a = 0, - result_type __b = numeric_limits<result_type>::max()) - : __a_(__a), __b_(__b) {} - - result_type a() const {return __a_;} - result_type b() const {return __b_;} - - friend bool operator==(const param_type& __x, const param_type& __y) - {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} - friend bool operator!=(const param_type& __x, const param_type& __y) - {return !(__x == __y);} - }; - -private: - param_type __p_; - -public: - // constructors and reset functions - explicit uniform_int_distribution(result_type __a = 0, - result_type __b = numeric_limits<result_type>::max()) - : __p_(param_type(__a, __b)) {} - explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {} - void reset() {} - - // generating functions - template<class _URNG> result_type operator()(_URNG& __g) - {return (*this)(__g, __p_);} - template<class _URNG> result_type operator()(_URNG& __g, const param_type& __p); - - // property functions - result_type a() const {return __p_.a();} - result_type b() const {return __p_.b();} - - param_type param() const {return __p_;} - void param(const param_type& __p) {__p_ = __p;} - - result_type min() const {return a();} - result_type max() const {return b();} - - friend bool operator==(const uniform_int_distribution& __x, - const uniform_int_distribution& __y) - {return __x.__p_ == __y.__p_;} - friend bool operator!=(const uniform_int_distribution& __x, - const uniform_int_distribution& __y) - {return !(__x == __y);} -}; - -template<class _IntType> -template<class _URNG> -typename uniform_int_distribution<_IntType>::result_type -uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p) -_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK -{ - typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), - uint32_t, uint64_t>::type _UIntType; - const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1); - if (_Rp == 1) - return __p.a(); - const size_t _Dt = numeric_limits<_UIntType>::digits; - typedef __independent_bits_engine<_URNG, _UIntType> _Eng; - if (_Rp == 0) - return static_cast<result_type>(_Eng(__g, _Dt)()); - size_t __w = _Dt - __libcpp_clz(_Rp) - 1; - if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0) - ++__w; - _Eng __e(__g, __w); - _UIntType __u; - do - { - __u = __e(); - } while (__u >= _Rp); - return static_cast<result_type>(__u + __p.a()); -} - -#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \ - || defined(_LIBCPP_BUILDING_LIBRARY) -class _LIBCPP_TYPE_VIS __rs_default; - -_LIBCPP_FUNC_VIS __rs_default __rs_get(); - -class _LIBCPP_TYPE_VIS __rs_default -{ - static unsigned __c_; - - __rs_default(); -public: - typedef uint_fast32_t result_type; - - static const result_type _Min = 0; - static const result_type _Max = 0xFFFFFFFF; - - __rs_default(const __rs_default&); - ~__rs_default(); - - result_type operator()(); - - static _LIBCPP_CONSTEXPR result_type min() {return _Min;} - static _LIBCPP_CONSTEXPR result_type max() {return _Max;} - - friend _LIBCPP_FUNC_VIS __rs_default __rs_get(); -}; - -_LIBCPP_FUNC_VIS __rs_default __rs_get(); - -template <class _RandomAccessIterator> -_LIBCPP_DEPRECATED_IN_CXX14 void -random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef uniform_int_distribution<ptrdiff_t> _Dp; - typedef typename _Dp::param_type _Pp; - difference_type __d = __last - __first; - if (__d > 1) - { - _Dp __uid; - __rs_default __g = __rs_get(); - for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) - { - difference_type __i = __uid(__g, _Pp(0, __d)); - if (__i != difference_type(0)) - swap(*__first, *(__first + __i)); - } - } -} - -template <class _RandomAccessIterator, class _RandomNumberGenerator> -_LIBCPP_DEPRECATED_IN_CXX14 void -random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, -#ifndef _LIBCPP_CXX03_LANG - _RandomNumberGenerator&& __rand) -#else - _RandomNumberGenerator& __rand) -#endif -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - difference_type __d = __last - __first; - if (__d > 1) - { - for (--__last; __first < __last; ++__first, (void) --__d) - { - difference_type __i = __rand(__d); - if (__i != difference_type(0)) - swap(*__first, *(__first + __i)); - } - } -} -#endif - -template <class _PopulationIterator, class _SampleIterator, class _Distance, - class _UniformRandomNumberGenerator> -_LIBCPP_INLINE_VISIBILITY -_SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __output_iter, - _Distance __n, - _UniformRandomNumberGenerator & __g, - input_iterator_tag) { - - _Distance __k = 0; - for (; __first != __last && __k < __n; ++__first, (void) ++__k) - __output_iter[__k] = *__first; - _Distance __sz = __k; - for (; __first != __last; ++__first, (void) ++__k) { - _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g); - if (__r < __sz) - __output_iter[__r] = *__first; - } - return __output_iter + _VSTD::min(__n, __k); -} - -template <class _PopulationIterator, class _SampleIterator, class _Distance, - class _UniformRandomNumberGenerator> -_LIBCPP_INLINE_VISIBILITY -_SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __output_iter, - _Distance __n, - _UniformRandomNumberGenerator& __g, - forward_iterator_tag) { - _Distance __unsampled_sz = _VSTD::distance(__first, __last); - for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) { - _Distance __r = - _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g); - if (__r < __n) { - *__output_iter++ = *__first; - --__n; - } - } - return __output_iter; -} - -template <class _PopulationIterator, class _SampleIterator, class _Distance, - class _UniformRandomNumberGenerator> -_LIBCPP_INLINE_VISIBILITY -_SampleIterator __sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __output_iter, - _Distance __n, _UniformRandomNumberGenerator& __g) { - typedef typename iterator_traits<_PopulationIterator>::iterator_category - _PopCategory; - typedef typename iterator_traits<_PopulationIterator>::difference_type - _Difference; - static_assert(__is_cpp17_forward_iterator<_PopulationIterator>::value || - __is_cpp17_random_access_iterator<_SampleIterator>::value, - "SampleIterator must meet the requirements of RandomAccessIterator"); - typedef typename common_type<_Distance, _Difference>::type _CommonType; - _LIBCPP_ASSERT(__n >= 0, "N must be a positive number."); - return _VSTD::__sample( - __first, __last, __output_iter, _CommonType(__n), - __g, _PopCategory()); -} - -#if _LIBCPP_STD_VER > 14 -template <class _PopulationIterator, class _SampleIterator, class _Distance, - class _UniformRandomNumberGenerator> -inline _LIBCPP_INLINE_VISIBILITY -_SampleIterator sample(_PopulationIterator __first, - _PopulationIterator __last, _SampleIterator __output_iter, - _Distance __n, _UniformRandomNumberGenerator&& __g) { - return _VSTD::__sample(__first, __last, __output_iter, __n, __g); -} -#endif // _LIBCPP_STD_VER > 14 - -template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> - void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, - _UniformRandomNumberGenerator&& __g) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef uniform_int_distribution<ptrdiff_t> _Dp; - typedef typename _Dp::param_type _Pp; - difference_type __d = __last - __first; - if (__d > 1) - { - _Dp __uid; - for (--__last, (void) --__d; __first < __last; ++__first, (void) --__d) - { - difference_type __i = __uid(__g, _Pp(0, __d)); - if (__i != difference_type(0)) - swap(*__first, *(__first + __i)); - } - } -} - -template <class _InputIterator, class _Predicate> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool -is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) -{ - for (; __first != __last; ++__first) - if (!__pred(*__first)) - break; - if ( __first == __last ) - return true; - ++__first; - for (; __first != __last; ++__first) - if (__pred(*__first)) - return false; - return true; -} - -// partition - -template <class _Predicate, class _ForwardIterator> -_ForwardIterator -__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag) -{ - while (true) - { - if (__first == __last) - return __first; - if (!__pred(*__first)) - break; - ++__first; - } - for (_ForwardIterator __p = __first; ++__p != __last;) - { - if (__pred(*__p)) - { - swap(*__first, *__p); - ++__first; - } - } - return __first; -} - -template <class _Predicate, class _BidirectionalIterator> -_BidirectionalIterator -__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, - bidirectional_iterator_tag) -{ - while (true) - { - while (true) - { - if (__first == __last) - return __first; - if (!__pred(*__first)) - break; - ++__first; - } - do - { - if (__first == --__last) - return __first; - } while (!__pred(*__last)); - swap(*__first, *__last); - ++__first; - } -} - -template <class _ForwardIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY -_ForwardIterator -partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) -{ - return _VSTD::__partition<typename add_lvalue_reference<_Predicate>::type> - (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); -} - -// partition_copy - -template <class _InputIterator, class _OutputIterator1, - class _OutputIterator2, class _Predicate> -_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> -partition_copy(_InputIterator __first, _InputIterator __last, - _OutputIterator1 __out_true, _OutputIterator2 __out_false, - _Predicate __pred) -{ - for (; __first != __last; ++__first) - { - if (__pred(*__first)) - { - *__out_true = *__first; - ++__out_true; - } - else - { - *__out_false = *__first; - ++__out_false; - } - } - return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false); -} - -// partition_point - -template<class _ForwardIterator, class _Predicate> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) -{ - typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; - difference_type __len = _VSTD::distance(__first, __last); - while (__len != 0) - { - difference_type __l2 = _VSTD::__half_positive(__len); - _ForwardIterator __m = __first; - _VSTD::advance(__m, __l2); - if (__pred(*__m)) - { - __first = ++__m; - __len -= __l2 + 1; - } - else - __len = __l2; - } - return __first; -} - -// stable_partition - -template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair> -_ForwardIterator -__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, - _Distance __len, _Pair __p, forward_iterator_tag __fit) -{ - // *__first is known to be false - // __len >= 1 - if (__len == 1) - return __first; - if (__len == 2) - { - _ForwardIterator __m = __first; - if (__pred(*++__m)) - { - swap(*__first, *__m); - return __m; - } - return __first; - } - if (__len <= __p.second) - { // The buffer is big enough to use - typedef typename iterator_traits<_ForwardIterator>::value_type value_type; - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); - // Move the falses into the temporary buffer, and the trues to the front of the line - // Update __first to always point to the end of the trues - value_type* __t = __p.first; - ::new(__t) value_type(_VSTD::move(*__first)); - __d.__incr((value_type*)0); - ++__t; - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (__pred(*__i)) - { - *__first = _VSTD::move(*__i); - ++__first; - } - else - { - ::new(__t) value_type(_VSTD::move(*__i)); - __d.__incr((value_type*)0); - ++__t; - } - } - // All trues now at start of range, all falses in buffer - // Move falses back into range, but don't mess up __first which points to first false - __i = __first; - for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) - *__i = _VSTD::move(*__t2); - // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer - return __first; - } - // Else not enough buffer, do in place - // __len >= 3 - _ForwardIterator __m = __first; - _Distance __len2 = __len / 2; // __len2 >= 2 - _VSTD::advance(__m, __len2); - // recurse on [__first, __m), *__first know to be false - // F????????????????? - // f m l - typedef typename add_lvalue_reference<_Predicate>::type _PredRef; - _ForwardIterator __first_false = __stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit); - // TTTFFFFF?????????? - // f ff m l - // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true - _ForwardIterator __m1 = __m; - _ForwardIterator __second_false = __last; - _Distance __len_half = __len - __len2; - while (__pred(*__m1)) - { - if (++__m1 == __last) - goto __second_half_done; - --__len_half; - } - // TTTFFFFFTTTF?????? - // f ff m m1 l - __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit); -__second_half_done: - // TTTFFFFFTTTTTFFFFF - // f ff m sf l - return _VSTD::rotate(__first_false, __m, __second_false); - // TTTTTTTTFFFFFFFFFF - // | -} - -struct __return_temporary_buffer -{ - template <class _Tp> - _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);} -}; - -template <class _Predicate, class _ForwardIterator> -_ForwardIterator -__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, - forward_iterator_tag) -{ - const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment - // Either prove all true and return __first or point to first false - while (true) - { - if (__first == __last) - return __first; - if (!__pred(*__first)) - break; - ++__first; - } - // We now have a reduced range [__first, __last) - // *__first is known to be false - typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; - typedef typename iterator_traits<_ForwardIterator>::value_type value_type; - difference_type __len = _VSTD::distance(__first, __last); - pair<value_type*, ptrdiff_t> __p(0, 0); - unique_ptr<value_type, __return_temporary_buffer> __h; - if (__len >= __alloc_limit) - { - __p = _VSTD::get_temporary_buffer<value_type>(__len); - __h.reset(__p.first); - } - return __stable_partition<typename add_lvalue_reference<_Predicate>::type> - (__first, __last, __pred, __len, __p, forward_iterator_tag()); -} - -template <class _Predicate, class _BidirectionalIterator, class _Distance, class _Pair> -_BidirectionalIterator -__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, - _Distance __len, _Pair __p, bidirectional_iterator_tag __bit) -{ - // *__first is known to be false - // *__last is known to be true - // __len >= 2 - if (__len == 2) - { - swap(*__first, *__last); - return __last; - } - if (__len == 3) - { - _BidirectionalIterator __m = __first; - if (__pred(*++__m)) - { - swap(*__first, *__m); - swap(*__m, *__last); - return __last; - } - swap(*__m, *__last); - swap(*__first, *__m); - return __m; - } - if (__len <= __p.second) - { // The buffer is big enough to use - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h(__p.first, __d); - // Move the falses into the temporary buffer, and the trues to the front of the line - // Update __first to always point to the end of the trues - value_type* __t = __p.first; - ::new(__t) value_type(_VSTD::move(*__first)); - __d.__incr((value_type*)0); - ++__t; - _BidirectionalIterator __i = __first; - while (++__i != __last) - { - if (__pred(*__i)) - { - *__first = _VSTD::move(*__i); - ++__first; - } - else - { - ::new(__t) value_type(_VSTD::move(*__i)); - __d.__incr((value_type*)0); - ++__t; - } - } - // move *__last, known to be true - *__first = _VSTD::move(*__i); - __i = ++__first; - // All trues now at start of range, all falses in buffer - // Move falses back into range, but don't mess up __first which points to first false - for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, (void) ++__i) - *__i = _VSTD::move(*__t2); - // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer - return __first; - } - // Else not enough buffer, do in place - // __len >= 4 - _BidirectionalIterator __m = __first; - _Distance __len2 = __len / 2; // __len2 >= 2 - _VSTD::advance(__m, __len2); - // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false - // F????????????????T - // f m l - _BidirectionalIterator __m1 = __m; - _BidirectionalIterator __first_false = __first; - _Distance __len_half = __len2; - while (!__pred(*--__m1)) - { - if (__m1 == __first) - goto __first_half_done; - --__len_half; - } - // F???TFFF?????????T - // f m1 m l - typedef typename add_lvalue_reference<_Predicate>::type _PredRef; - __first_false = __stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit); -__first_half_done: - // TTTFFFFF?????????T - // f ff m l - // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true - __m1 = __m; - _BidirectionalIterator __second_false = __last; - ++__second_false; - __len_half = __len - __len2; - while (__pred(*__m1)) - { - if (++__m1 == __last) - goto __second_half_done; - --__len_half; - } - // TTTFFFFFTTTF?????T - // f ff m m1 l - __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit); -__second_half_done: - // TTTFFFFFTTTTTFFFFF - // f ff m sf l - return _VSTD::rotate(__first_false, __m, __second_false); - // TTTTTTTTFFFFFFFFFF - // | -} - -template <class _Predicate, class _BidirectionalIterator> -_BidirectionalIterator -__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, - bidirectional_iterator_tag) -{ - typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - const difference_type __alloc_limit = 4; // might want to make this a function of trivial assignment - // Either prove all true and return __first or point to first false - while (true) - { - if (__first == __last) - return __first; - if (!__pred(*__first)) - break; - ++__first; - } - // __first points to first false, everything prior to __first is already set. - // Either prove [__first, __last) is all false and return __first, or point __last to last true - do - { - if (__first == --__last) - return __first; - } while (!__pred(*__last)); - // We now have a reduced range [__first, __last] - // *__first is known to be false - // *__last is known to be true - // __len >= 2 - difference_type __len = _VSTD::distance(__first, __last) + 1; - pair<value_type*, ptrdiff_t> __p(0, 0); - unique_ptr<value_type, __return_temporary_buffer> __h; - if (__len >= __alloc_limit) - { - __p = _VSTD::get_temporary_buffer<value_type>(__len); - __h.reset(__p.first); - } - return __stable_partition<typename add_lvalue_reference<_Predicate>::type> - (__first, __last, __pred, __len, __p, bidirectional_iterator_tag()); -} - -template <class _ForwardIterator, class _Predicate> -inline _LIBCPP_INLINE_VISIBILITY -_ForwardIterator -stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) -{ - return __stable_partition<typename add_lvalue_reference<_Predicate>::type> - (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category()); -} - -// is_sorted_until - -template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) -{ - if (__first != __last) - { - _ForwardIterator __i = __first; - while (++__i != __last) - { - if (__comp(*__i, *__first)) - return __i; - __first = __i; - } - } - return __last; -} - -template<class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -is_sorted_until(_ForwardIterator __first, _ForwardIterator __last) -{ - return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// is_sorted - -template <class _ForwardIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) -{ - return _VSTD::is_sorted_until(__first, __last, __comp) == __last; -} - -template<class _ForwardIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_sorted(_ForwardIterator __first, _ForwardIterator __last) -{ - return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// sort - -// stable, 2-3 compares, 0-2 swaps - -template <class _Compare, class _ForwardIterator> -unsigned -__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c) -{ - unsigned __r = 0; - if (!__c(*__y, *__x)) // if x <= y - { - if (!__c(*__z, *__y)) // if y <= z - return __r; // x <= y && y <= z - // x <= y && y > z - swap(*__y, *__z); // x <= z && y < z - __r = 1; - if (__c(*__y, *__x)) // if x > y - { - swap(*__x, *__y); // x < y && y <= z - __r = 2; - } - return __r; // x <= y && y < z - } - if (__c(*__z, *__y)) // x > y, if y > z - { - swap(*__x, *__z); // x < y && y < z - __r = 1; - return __r; - } - swap(*__x, *__y); // x > y && y <= z - __r = 1; // x < y && x <= z - if (__c(*__z, *__y)) // if y > z - { - swap(*__y, *__z); // x <= y && y < z - __r = 2; - } - return __r; -} // x <= y && y <= z - -// stable, 3-6 compares, 0-5 swaps - -template <class _Compare, class _ForwardIterator> -unsigned -__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, - _ForwardIterator __x4, _Compare __c) -{ - unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c); - if (__c(*__x4, *__x3)) - { - swap(*__x3, *__x4); - ++__r; - if (__c(*__x3, *__x2)) - { - swap(*__x2, *__x3); - ++__r; - if (__c(*__x2, *__x1)) - { - swap(*__x1, *__x2); - ++__r; - } - } - } - return __r; -} - -// stable, 4-10 compares, 0-9 swaps - -template <class _Compare, class _ForwardIterator> -_LIBCPP_HIDDEN -unsigned -__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, - _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c) -{ - unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c); - if (__c(*__x5, *__x4)) - { - swap(*__x4, *__x5); - ++__r; - if (__c(*__x4, *__x3)) - { - swap(*__x3, *__x4); - ++__r; - if (__c(*__x3, *__x2)) - { - swap(*__x2, *__x3); - ++__r; - if (__c(*__x2, *__x1)) - { - swap(*__x1, *__x2); - ++__r; - } - } - } - } - return __r; -} - -// Assumes size > 0 -template <class _Compare, class _BirdirectionalIterator> -void -__selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp) -{ - _BirdirectionalIterator __lm1 = __last; - for (--__lm1; __first != __lm1; ++__first) - { - _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator, - typename add_lvalue_reference<_Compare>::type> - (__first, __last, __comp); - if (__i != __first) - swap(*__first, *__i); - } -} - -template <class _Compare, class _BirdirectionalIterator> -void -__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp) -{ - typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type; - if (__first != __last) - { - _BirdirectionalIterator __i = __first; - for (++__i; __i != __last; ++__i) - { - _BirdirectionalIterator __j = __i; - value_type __t(_VSTD::move(*__j)); - for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j) - *__j = _VSTD::move(*__k); - *__j = _VSTD::move(__t); - } - } -} - -template <class _Compare, class _RandomAccessIterator> -void -__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - _RandomAccessIterator __j = __first+2; - __sort3<_Compare>(__first, __first+1, __j, __comp); - for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i) - { - if (__comp(*__i, *__j)) - { - value_type __t(_VSTD::move(*__i)); - _RandomAccessIterator __k = __j; - __j = __i; - do - { - *__j = _VSTD::move(*__k); - __j = __k; - } while (__j != __first && __comp(__t, *--__k)); - *__j = _VSTD::move(__t); - } - __j = __i; - } -} - -template <class _Compare, class _RandomAccessIterator> -bool -__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - switch (__last - __first) - { - case 0: - case 1: - return true; - case 2: - if (__comp(*--__last, *__first)) - swap(*__first, *__last); - return true; - case 3: - _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp); - return true; - case 4: - _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp); - return true; - case 5: - _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp); - return true; - } - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - _RandomAccessIterator __j = __first+2; - __sort3<_Compare>(__first, __first+1, __j, __comp); - const unsigned __limit = 8; - unsigned __count = 0; - for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i) - { - if (__comp(*__i, *__j)) - { - value_type __t(_VSTD::move(*__i)); - _RandomAccessIterator __k = __j; - __j = __i; - do - { - *__j = _VSTD::move(*__k); - __j = __k; - } while (__j != __first && __comp(__t, *--__k)); - *__j = _VSTD::move(__t); - if (++__count == __limit) - return ++__i == __last; - } - __j = __i; - } - return true; -} - -template <class _Compare, class _BirdirectionalIterator> -void -__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1, - typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp) -{ - typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type; - if (__first1 != __last1) - { - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h(__first2, __d); - value_type* __last2 = __first2; - ::new(__last2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); - for (++__last2; ++__first1 != __last1; ++__last2) - { - value_type* __j2 = __last2; - value_type* __i2 = __j2; - if (__comp(*__first1, *--__i2)) - { - ::new(__j2) value_type(_VSTD::move(*__i2)); - __d.__incr((value_type*)0); - for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2) - *__j2 = _VSTD::move(*__i2); - *__j2 = _VSTD::move(*__first1); - } - else - { - ::new(__j2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); - } - } - __h.release(); - } -} - -template <class _Compare, class _RandomAccessIterator> -void -__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - // _Compare is known to be a reference type - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - const difference_type __limit = is_trivially_copy_constructible<value_type>::value && - is_trivially_copy_assignable<value_type>::value ? 30 : 6; - while (true) - { - __restart: - difference_type __len = __last - __first; - switch (__len) - { - case 0: - case 1: - return; - case 2: - if (__comp(*--__last, *__first)) - swap(*__first, *__last); - return; - case 3: - _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp); - return; - case 4: - _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp); - return; - case 5: - _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp); - return; - } - if (__len <= __limit) - { - _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp); - return; - } - // __len > 5 - _RandomAccessIterator __m = __first; - _RandomAccessIterator __lm1 = __last; - --__lm1; - unsigned __n_swaps; - { - difference_type __delta; - if (__len >= 1000) - { - __delta = __len/2; - __m += __delta; - __delta /= 2; - __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp); - } - else - { - __delta = __len/2; - __m += __delta; - __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp); - } - } - // *__m is median - // partition [__first, __m) < *__m and *__m <= [__m, __last) - // (this inhibits tossing elements equivalent to __m around unnecessarily) - _RandomAccessIterator __i = __first; - _RandomAccessIterator __j = __lm1; - // j points beyond range to be tested, *__m is known to be <= *__lm1 - // The search going up is known to be guarded but the search coming down isn't. - // Prime the downward search with a guard. - if (!__comp(*__i, *__m)) // if *__first == *__m - { - // *__first == *__m, *__first doesn't go in first part - // manually guard downward moving __j against __i - while (true) - { - if (__i == --__j) - { - // *__first == *__m, *__m <= all other elements - // Parition instead into [__first, __i) == *__first and *__first < [__i, __last) - ++__i; // __first + 1 - __j = __last; - if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1) - { - while (true) - { - if (__i == __j) - return; // [__first, __last) all equivalent elements - if (__comp(*__first, *__i)) - { - swap(*__i, *__j); - ++__n_swaps; - ++__i; - break; - } - ++__i; - } - } - // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1 - if (__i == __j) - return; - while (true) - { - while (!__comp(*__first, *__i)) - ++__i; - while (__comp(*__first, *--__j)) - ; - if (__i >= __j) - break; - swap(*__i, *__j); - ++__n_swaps; - ++__i; - } - // [__first, __i) == *__first and *__first < [__i, __last) - // The first part is sorted, sort the secod part - // _VSTD::__sort<_Compare>(__i, __last, __comp); - __first = __i; - goto __restart; - } - if (__comp(*__j, *__m)) - { - swap(*__i, *__j); - ++__n_swaps; - break; // found guard for downward moving __j, now use unguarded partition - } - } - } - // It is known that *__i < *__m - ++__i; - // j points beyond range to be tested, *__m is known to be <= *__lm1 - // if not yet partitioned... - if (__i < __j) - { - // known that *(__i - 1) < *__m - // known that __i <= __m - while (true) - { - // __m still guards upward moving __i - while (__comp(*__i, *__m)) - ++__i; - // It is now known that a guard exists for downward moving __j - while (!__comp(*--__j, *__m)) - ; - if (__i > __j) - break; - swap(*__i, *__j); - ++__n_swaps; - // It is known that __m != __j - // If __m just moved, follow it - if (__m == __i) - __m = __j; - ++__i; - } - } - // [__first, __i) < *__m and *__m <= [__i, __last) - if (__i != __m && __comp(*__m, *__i)) - { - swap(*__i, *__m); - ++__n_swaps; - } - // [__first, __i) < *__i and *__i <= [__i+1, __last) - // If we were given a perfect partition, see if insertion sort is quick... - if (__n_swaps == 0) - { - bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp); - if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp)) - { - if (__fs) - return; - __last = __i; - continue; - } - else - { - if (__fs) - { - __first = ++__i; - continue; - } - } - } - // sort smaller range with recursive call and larger with tail recursion elimination - if (__i - __first < __last - __i) - { - _VSTD::__sort<_Compare>(__first, __i, __comp); - // _VSTD::__sort<_Compare>(__i+1, __last, __comp); - __first = ++__i; - } - else - { - _VSTD::__sort<_Compare>(__i+1, __last, __comp); - // _VSTD::__sort<_Compare>(__first, __i, __comp); - __last = __i; - } - } -} - -// This forwarder keeps the top call and the recursive calls using the same instantiation, forcing a reference _Compare -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - _VSTD::__sort<_Comp_ref>(__first, __last, _Comp_ref(__comp)); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -sort(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -void -sort(_Tp** __first, _Tp** __last) -{ - _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>()); -} - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -void -sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last) -{ - _VSTD::sort(__first.base(), __last.base()); -} - -template <class _Tp, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp) -{ - typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; - _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp); -} - -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<char>&, char*>(char*, char*, __less<char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<short>&, short*>(short*, short*, __less<short>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<int>&, int*>(int*, int*, __less<int>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long>&, long*>(long*, long*, __less<long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<float>&, float*>(float*, float*, __less<float>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<double>&, double*>(double*, double*, __less<double>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&)) - -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&)) -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&)) - -_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&)) - -// lower_bound - -template <class _Compare, class _ForwardIterator, class _Tp> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; - difference_type __len = _VSTD::distance(__first, __last); - while (__len != 0) - { - difference_type __l2 = _VSTD::__half_positive(__len); - _ForwardIterator __m = __first; - _VSTD::advance(__m, __l2); - if (__comp(*__m, __value_)) - { - __first = ++__m; - __len -= __l2 + 1; - } - else - __len = __l2; - } - return __first; -} - -template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; - return __lower_bound<_Comp_ref>(__first, __last, __value_, __comp); -} - -template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - return _VSTD::lower_bound(__first, __last, __value_, - __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); -} - -// upper_bound - -template <class _Compare, class _ForwardIterator, class _Tp> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator -__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; - difference_type __len = _VSTD::distance(__first, __last); - while (__len != 0) - { - difference_type __l2 = _VSTD::__half_positive(__len); - _ForwardIterator __m = __first; - _VSTD::advance(__m, __l2); - if (__comp(__value_, *__m)) - __len = __l2; - else - { - __first = ++__m; - __len -= __l2 + 1; - } - } - return __first; -} - -template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename add_lvalue_reference<_Compare>::type _Comp_ref; - return __upper_bound<_Comp_ref>(__first, __last, __value_, __comp); -} - -template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_ForwardIterator -upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - return _VSTD::upper_bound(__first, __last, __value_, - __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>()); -} - -// equal_range - -template <class _Compare, class _ForwardIterator, class _Tp> -_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> -__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; - difference_type __len = _VSTD::distance(__first, __last); - while (__len != 0) - { - difference_type __l2 = _VSTD::__half_positive(__len); - _ForwardIterator __m = __first; - _VSTD::advance(__m, __l2); - if (__comp(*__m, __value_)) - { - __first = ++__m; - __len -= __l2 + 1; - } - else if (__comp(__value_, *__m)) - { - __last = __m; - __len = __l2; - } - else - { - _ForwardIterator __mp1 = __m; - return pair<_ForwardIterator, _ForwardIterator> - ( - __lower_bound<_Compare>(__first, __m, __value_, __comp), - __upper_bound<_Compare>(++__mp1, __last, __value_, __comp) - ); - } - } - return pair<_ForwardIterator, _ForwardIterator>(__first, __first); -} - -template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_ForwardIterator, _ForwardIterator> -equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __equal_range<_Comp_ref>(__first, __last, __value_, __comp); -} - -template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -pair<_ForwardIterator, _ForwardIterator> -equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - return _VSTD::equal_range(__first, __last, __value_, - __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); -} - -// binary_search - -template <class _Compare, class _ForwardIterator, class _Tp> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - __first = __lower_bound<_Compare>(__first, __last, __value_, __comp); - return __first != __last && !__comp(__value_, *__first); -} - -template <class _ForwardIterator, class _Tp, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __binary_search<_Comp_ref>(__first, __last, __value_, __comp); -} - -template <class _ForwardIterator, class _Tp> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_) -{ - return _VSTD::binary_search(__first, __last, __value_, - __less<typename iterator_traits<_ForwardIterator>::value_type, _Tp>()); -} - -// merge - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -__merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - for (; __first1 != __last1; ++__result) - { - if (__first2 == __last2) - return _VSTD::copy(__first1, __last1, __result); - if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__first2; - } - else - { - *__result = *__first1; - ++__first1; - } - } - return _VSTD::copy(__first2, __last2, __result); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) -{ - typedef typename iterator_traits<_InputIterator1>::value_type __v1; - typedef typename iterator_traits<_InputIterator2>::value_type __v2; - return _VSTD::merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>()); -} - -// inplace_merge - -template <class _Compare, class _InputIterator1, class _InputIterator2, - class _OutputIterator> -void __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) -{ - for (; __first1 != __last1; ++__result) - { - if (__first2 == __last2) - { - _VSTD::move(__first1, __last1, __result); - return; - } - - if (__comp(*__first2, *__first1)) - { - *__result = _VSTD::move(*__first2); - ++__first2; - } - else - { - *__result = _VSTD::move(*__first1); - ++__first1; - } - } - // __first2 through __last2 are already in the right spot. -} - -template <class _Compare, class _BidirectionalIterator> -void -__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, - _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, - typename iterator_traits<_BidirectionalIterator>::difference_type __len2, - typename iterator_traits<_BidirectionalIterator>::value_type* __buff) -{ - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); - if (__len1 <= __len2) - { - value_type* __p = __buff; - for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p) - ::new(__p) value_type(_VSTD::move(*__i)); - __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp); - } - else - { - value_type* __p = __buff; - for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, (void) ++__p) - ::new(__p) value_type(_VSTD::move(*__i)); - typedef reverse_iterator<_BidirectionalIterator> _RBi; - typedef reverse_iterator<value_type*> _Rv; - __half_inplace_merge(_Rv(__p), _Rv(__buff), - _RBi(__middle), _RBi(__first), - _RBi(__last), __invert<_Compare>(__comp)); - } -} - -template <class _Compare, class _BidirectionalIterator> -void -__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, - _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1, - typename iterator_traits<_BidirectionalIterator>::difference_type __len2, - typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size) -{ - typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; - while (true) - { - // if __middle == __last, we're done - if (__len2 == 0) - return; - if (__len1 <= __buff_size || __len2 <= __buff_size) - return __buffered_inplace_merge<_Compare> - (__first, __middle, __last, __comp, __len1, __len2, __buff); - // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0 - for (; true; ++__first, (void) --__len1) - { - if (__len1 == 0) - return; - if (__comp(*__middle, *__first)) - break; - } - // __first < __middle < __last - // *__first > *__middle - // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that - // all elements in: - // [__first, __m1) <= [__middle, __m2) - // [__middle, __m2) < [__m1, __middle) - // [__m1, __middle) <= [__m2, __last) - // and __m1 or __m2 is in the middle of its range - _BidirectionalIterator __m1; // "median" of [__first, __middle) - _BidirectionalIterator __m2; // "median" of [__middle, __last) - difference_type __len11; // distance(__first, __m1) - difference_type __len21; // distance(__middle, __m2) - // binary search smaller range - if (__len1 < __len2) - { // __len >= 1, __len2 >= 2 - __len21 = __len2 / 2; - __m2 = __middle; - _VSTD::advance(__m2, __len21); - __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp); - __len11 = _VSTD::distance(__first, __m1); - } - else - { - if (__len1 == 1) - { // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1 - // It is known *__first > *__middle - swap(*__first, *__middle); - return; - } - // __len1 >= 2, __len2 >= 1 - __len11 = __len1 / 2; - __m1 = __first; - _VSTD::advance(__m1, __len11); - __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp); - __len21 = _VSTD::distance(__middle, __m2); - } - difference_type __len12 = __len1 - __len11; // distance(__m1, __middle) - difference_type __len22 = __len2 - __len21; // distance(__m2, __last) - // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) - // swap middle two partitions - __middle = _VSTD::rotate(__m1, __middle, __m2); - // __len12 and __len21 now have swapped meanings - // merge smaller range with recurisve call and larger with tail recursion elimination - if (__len11 + __len21 < __len12 + __len22) - { - __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size); -// __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size); - __first = __middle; - __middle = __m2; - __len1 = __len12; - __len2 = __len22; - } - else - { - __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size); -// __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size); - __last = __middle; - __middle = __m1; - __len1 = __len11; - __len2 = __len21; - } - } -} - -template <class _BidirectionalIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last, - _Compare __comp) -{ - typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; - typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type; - difference_type __len1 = _VSTD::distance(__first, __middle); - difference_type __len2 = _VSTD::distance(__middle, __last); - difference_type __buf_size = _VSTD::min(__len1, __len2); - pair<value_type*, ptrdiff_t> __buf = _VSTD::get_temporary_buffer<value_type>(__buf_size); - unique_ptr<value_type, __return_temporary_buffer> __h(__buf.first); - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2, - __buf.first, __buf.second); -} - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last) -{ - _VSTD::inplace_merge(__first, __middle, __last, - __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); -} - -// stable_sort - -template <class _Compare, class _InputIterator1, class _InputIterator2> -void -__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp) -{ - typedef typename iterator_traits<_InputIterator1>::value_type value_type; - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h(__result, __d); - for (; true; ++__result) - { - if (__first1 == __last1) - { - for (; __first2 != __last2; ++__first2, ++__result, (void) __d.__incr((value_type*)0)) - ::new (__result) value_type(_VSTD::move(*__first2)); - __h.release(); - return; - } - if (__first2 == __last2) - { - for (; __first1 != __last1; ++__first1, ++__result, (void) __d.__incr((value_type*)0)) - ::new (__result) value_type(_VSTD::move(*__first1)); - __h.release(); - return; - } - if (__comp(*__first2, *__first1)) - { - ::new (__result) value_type(_VSTD::move(*__first2)); - __d.__incr((value_type*)0); - ++__first2; - } - else - { - ::new (__result) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); - ++__first1; - } - } -} - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -void -__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, - _OutputIterator __result, _Compare __comp) -{ - for (; __first1 != __last1; ++__result) - { - if (__first2 == __last2) - { - for (; __first1 != __last1; ++__first1, (void) ++__result) - *__result = _VSTD::move(*__first1); - return; - } - if (__comp(*__first2, *__first1)) - { - *__result = _VSTD::move(*__first2); - ++__first2; - } - else - { - *__result = _VSTD::move(*__first1); - ++__first1; - } - } - for (; __first2 != __last2; ++__first2, (void) ++__result) - *__result = _VSTD::move(*__first2); -} - -template <class _Compare, class _RandomAccessIterator> -void -__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len, - typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size); - -template <class _Compare, class _RandomAccessIterator> -void -__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len, - typename iterator_traits<_RandomAccessIterator>::value_type* __first2) -{ - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - switch (__len) - { - case 0: - return; - case 1: - ::new(__first2) value_type(_VSTD::move(*__first1)); - return; - case 2: - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h2(__first2, __d); - if (__comp(*--__last1, *__first1)) - { - ::new(__first2) value_type(_VSTD::move(*__last1)); - __d.__incr((value_type*)0); - ++__first2; - ::new(__first2) value_type(_VSTD::move(*__first1)); - } - else - { - ::new(__first2) value_type(_VSTD::move(*__first1)); - __d.__incr((value_type*)0); - ++__first2; - ::new(__first2) value_type(_VSTD::move(*__last1)); - } - __h2.release(); - return; - } - if (__len <= 8) - { - __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp); - return; - } - typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; - _RandomAccessIterator __m = __first1 + __l2; - __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2); - __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2); - __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp); -} - -template <class _Tp> -struct __stable_sort_switch -{ - static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value; -}; - -template <class _Compare, class _RandomAccessIterator> -void -__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len, - typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size) -{ - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - switch (__len) - { - case 0: - case 1: - return; - case 2: - if (__comp(*--__last, *__first)) - swap(*__first, *__last); - return; - } - if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value)) - { - __insertion_sort<_Compare>(__first, __last, __comp); - return; - } - typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2; - _RandomAccessIterator __m = __first + __l2; - if (__len <= __buff_size) - { - __destruct_n __d(0); - unique_ptr<value_type, __destruct_n&> __h2(__buff, __d); - __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff); - __d.__set(__l2, (value_type*)0); - __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2); - __d.__set(__len, (value_type*)0); - __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp); -// __merge<_Compare>(move_iterator<value_type*>(__buff), -// move_iterator<value_type*>(__buff + __l2), -// move_iterator<_RandomAccessIterator>(__buff + __l2), -// move_iterator<_RandomAccessIterator>(__buff + __len), -// __first, __comp); - return; - } - __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size); - __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size); - __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size); -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - difference_type __len = __last - __first; - pair<value_type*, ptrdiff_t> __buf(0, 0); - unique_ptr<value_type, __return_temporary_buffer> __h; - if (__len > static_cast<difference_type>(__stable_sort_switch<value_type>::value)) - { - __buf = _VSTD::get_temporary_buffer<value_type>(__len); - __h.reset(__buf.first); - } - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// is_heap_until - -template <class _RandomAccessIterator, class _Compare> -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator -is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type; - difference_type __len = __last - __first; - difference_type __p = 0; - difference_type __c = 1; - _RandomAccessIterator __pp = __first; - while (__c < __len) - { - _RandomAccessIterator __cp = __first + __c; - if (__comp(*__pp, *__cp)) - return __cp; - ++__c; - ++__cp; - if (__c == __len) - return __last; - if (__comp(*__pp, *__cp)) - return __cp; - ++__p; - ++__pp; - __c = 2 * __p + 1; - } - return __last; -} - -template<class _RandomAccessIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_RandomAccessIterator -is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - return _VSTD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// is_heap - -template <class _RandomAccessIterator, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - return _VSTD::is_heap_until(__first, __last, __comp) == __last; -} - -template<class _RandomAccessIterator> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// push_heap - -template <class _Compare, class _RandomAccessIterator> -void -__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len) -{ - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - if (__len > 1) - { - __len = (__len - 2) / 2; - _RandomAccessIterator __ptr = __first + __len; - if (__comp(*__ptr, *--__last)) - { - value_type __t(_VSTD::move(*__last)); - do - { - *__last = _VSTD::move(*__ptr); - __last = __ptr; - if (__len == 0) - break; - __len = (__len - 1) / 2; - __ptr = __first + __len; - } while (__comp(*__ptr, __t)); - *__last = _VSTD::move(__t); - } - } -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// pop_heap - -template <class _Compare, class _RandomAccessIterator> -void -__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/, - _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len, - _RandomAccessIterator __start) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type; - // left-child of __start is at 2 * __start + 1 - // right-child of __start is at 2 * __start + 2 - difference_type __child = __start - __first; - - if (__len < 2 || (__len - 2) / 2 < __child) - return; - - __child = 2 * __child + 1; - _RandomAccessIterator __child_i = __first + __child; - - if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) { - // right-child exists and is greater than left-child - ++__child_i; - ++__child; - } - - // check if we are in heap-order - if (__comp(*__child_i, *__start)) - // we are, __start is larger than it's largest child - return; - - value_type __top(_VSTD::move(*__start)); - do - { - // we are not in heap-order, swap the parent with it's largest child - *__start = _VSTD::move(*__child_i); - __start = __child_i; - - if ((__len - 2) / 2 < __child) - break; - - // recompute the child based off of the updated parent - __child = 2 * __child + 1; - __child_i = __first + __child; - - if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) { - // right-child exists and is greater than left-child - ++__child_i; - ++__child; - } - - // check if we are in heap-order - } while (!__comp(*__child_i, __top)); - *__start = _VSTD::move(__top); -} - -template <class _Compare, class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp, - typename iterator_traits<_RandomAccessIterator>::difference_type __len) -{ - if (__len > 1) - { - swap(*__first, *--__last); - __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first); - } -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// make_heap - -template <class _Compare, class _RandomAccessIterator> -void -__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - difference_type __n = __last - __first; - if (__n > 1) - { - // start from the first parent, there is no need to consider children - for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start) - { - __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start); - } - } -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __make_heap<_Comp_ref>(__first, __last, __comp); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// sort_heap - -template <class _Compare, class _RandomAccessIterator> -void -__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - for (difference_type __n = __last - __first; __n > 1; --__last, (void) --__n) - __pop_heap<_Compare>(__first, __last, __comp, __n); -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __sort_heap<_Comp_ref>(__first, __last, __comp); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - _VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// partial_sort - -template <class _Compare, class _RandomAccessIterator> -void -__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, - _Compare __comp) -{ - __make_heap<_Compare>(__first, __middle, __comp); - typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first; - for (_RandomAccessIterator __i = __middle; __i != __last; ++__i) - { - if (__comp(*__i, *__first)) - { - swap(*__i, *__first); - __sift_down<_Compare>(__first, __middle, __comp, __len, __first); - } - } - __sort_heap<_Compare>(__first, __middle, __comp); -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, - _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __partial_sort<_Comp_ref>(__first, __middle, __last, __comp); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) -{ - _VSTD::partial_sort(__first, __middle, __last, - __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// partial_sort_copy - -template <class _Compare, class _InputIterator, class _RandomAccessIterator> -_RandomAccessIterator -__partial_sort_copy(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) -{ - _RandomAccessIterator __r = __result_first; - if (__r != __result_last) - { - for (; __first != __last && __r != __result_last; ++__first, (void) ++__r) - *__r = *__first; - __make_heap<_Compare>(__result_first, __r, __comp); - typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first; - for (; __first != __last; ++__first) - if (__comp(*__first, *__result_first)) - { - *__result_first = *__first; - __sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first); - } - __sort_heap<_Compare>(__result_first, __r, __comp); - } - return __r; -} - -template <class _InputIterator, class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -_RandomAccessIterator -partial_sort_copy(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp); -} - -template <class _InputIterator, class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -_RandomAccessIterator -partial_sort_copy(_InputIterator __first, _InputIterator __last, - _RandomAccessIterator __result_first, _RandomAccessIterator __result_last) -{ - return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last, - __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// nth_element - -template <class _Compare, class _RandomAccessIterator> -void -__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) -{ - // _Compare is known to be a reference type - typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; - const difference_type __limit = 7; - while (true) - { - __restart: - if (__nth == __last) - return; - difference_type __len = __last - __first; - switch (__len) - { - case 0: - case 1: - return; - case 2: - if (__comp(*--__last, *__first)) - swap(*__first, *__last); - return; - case 3: - { - _RandomAccessIterator __m = __first; - _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp); - return; - } - } - if (__len <= __limit) - { - __selection_sort<_Compare>(__first, __last, __comp); - return; - } - // __len > __limit >= 3 - _RandomAccessIterator __m = __first + __len/2; - _RandomAccessIterator __lm1 = __last; - unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp); - // *__m is median - // partition [__first, __m) < *__m and *__m <= [__m, __last) - // (this inhibits tossing elements equivalent to __m around unnecessarily) - _RandomAccessIterator __i = __first; - _RandomAccessIterator __j = __lm1; - // j points beyond range to be tested, *__lm1 is known to be <= *__m - // The search going up is known to be guarded but the search coming down isn't. - // Prime the downward search with a guard. - if (!__comp(*__i, *__m)) // if *__first == *__m - { - // *__first == *__m, *__first doesn't go in first part - // manually guard downward moving __j against __i - while (true) - { - if (__i == --__j) - { - // *__first == *__m, *__m <= all other elements - // Parition instead into [__first, __i) == *__first and *__first < [__i, __last) - ++__i; // __first + 1 - __j = __last; - if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1) - { - while (true) - { - if (__i == __j) - return; // [__first, __last) all equivalent elements - if (__comp(*__first, *__i)) - { - swap(*__i, *__j); - ++__n_swaps; - ++__i; - break; - } - ++__i; - } - } - // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1 - if (__i == __j) - return; - while (true) - { - while (!__comp(*__first, *__i)) - ++__i; - while (__comp(*__first, *--__j)) - ; - if (__i >= __j) - break; - swap(*__i, *__j); - ++__n_swaps; - ++__i; - } - // [__first, __i) == *__first and *__first < [__i, __last) - // The first part is sorted, - if (__nth < __i) - return; - // __nth_element the secod part - // __nth_element<_Compare>(__i, __nth, __last, __comp); - __first = __i; - goto __restart; - } - if (__comp(*__j, *__m)) - { - swap(*__i, *__j); - ++__n_swaps; - break; // found guard for downward moving __j, now use unguarded partition - } - } - } - ++__i; - // j points beyond range to be tested, *__lm1 is known to be <= *__m - // if not yet partitioned... - if (__i < __j) - { - // known that *(__i - 1) < *__m - while (true) - { - // __m still guards upward moving __i - while (__comp(*__i, *__m)) - ++__i; - // It is now known that a guard exists for downward moving __j - while (!__comp(*--__j, *__m)) - ; - if (__i >= __j) - break; - swap(*__i, *__j); - ++__n_swaps; - // It is known that __m != __j - // If __m just moved, follow it - if (__m == __i) - __m = __j; - ++__i; - } - } - // [__first, __i) < *__m and *__m <= [__i, __last) - if (__i != __m && __comp(*__m, *__i)) - { - swap(*__i, *__m); - ++__n_swaps; - } - // [__first, __i) < *__i and *__i <= [__i+1, __last) - if (__nth == __i) - return; - if (__n_swaps == 0) - { - // We were given a perfectly partitioned sequence. Coincidence? - if (__nth < __i) - { - // Check for [__first, __i) already sorted - __j = __m = __first; - while (++__j != __i) - { - if (__comp(*__j, *__m)) - // not yet sorted, so sort - goto not_sorted; - __m = __j; - } - // [__first, __i) sorted - return; - } - else - { - // Check for [__i, __last) already sorted - __j = __m = __i; - while (++__j != __last) - { - if (__comp(*__j, *__m)) - // not yet sorted, so sort - goto not_sorted; - __m = __j; - } - // [__i, __last) sorted - return; - } - } -not_sorted: - // __nth_element on range containing __nth - if (__nth < __i) - { - // __nth_element<_Compare>(__first, __nth, __i, __comp); - __last = __i; - } - else - { - // __nth_element<_Compare>(__i+1, __nth, __last, __comp); - __first = ++__i; - } - } -} - -template <class _RandomAccessIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -void -nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - __nth_element<_Comp_ref>(__first, __nth, __last, __comp); -} - -template <class _RandomAccessIterator> -inline _LIBCPP_INLINE_VISIBILITY -void -nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last) -{ - _VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()); -} - -// includes - -template <class _Compare, class _InputIterator1, class _InputIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool -__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, - _Compare __comp) -{ - for (; __first2 != __last2; ++__first1) - { - if (__first1 == __last1 || __comp(*__first2, *__first1)) - return false; - if (!__comp(*__first1, *__first2)) - ++__first2; - } - return true; -} - -template <class _InputIterator1, class _InputIterator2, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, - _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2) -{ - return _VSTD::includes(__first1, __last1, __first2, __last2, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// set_union - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_OutputIterator -__set_union(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - for (; __first1 != __last1; ++__result) - { - if (__first2 == __last2) - return _VSTD::copy(__first1, __last1, __result); - if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__first2; - } - else - { - if (!__comp(*__first1, *__first2)) - ++__first2; - *__result = *__first1; - ++__first1; - } - } - return _VSTD::copy(__first2, __last2, __result); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_union(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_union(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) -{ - return _VSTD::set_union(__first1, __last1, __first2, __last2, __result, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// set_intersection - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator -__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - while (__first1 != __last1 && __first2 != __last2) - { - if (__comp(*__first1, *__first2)) - ++__first1; - else - { - if (!__comp(*__first2, *__first1)) - { - *__result = *__first1; - ++__result; - ++__first1; - } - ++__first2; - } - } - return __result; -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -_OutputIterator -set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) -{ - return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// set_difference - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_OutputIterator -__set_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - while (__first1 != __last1) - { - if (__first2 == __last2) - return _VSTD::copy(__first1, __last1, __result); - if (__comp(*__first1, *__first2)) - { - *__result = *__first1; - ++__result; - ++__first1; - } - else - { - if (!__comp(*__first2, *__first1)) - ++__first1; - ++__first2; - } - } - return __result; -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) -{ - return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// set_symmetric_difference - -template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator> -_OutputIterator -__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - while (__first1 != __last1) - { - if (__first2 == __last2) - return _VSTD::copy(__first1, __last1, __result); - if (__comp(*__first1, *__first2)) - { - *__result = *__first1; - ++__result; - ++__first1; - } - else - { - if (__comp(*__first2, *__first1)) - { - *__result = *__first2; - ++__result; - } - else - ++__first1; - ++__first2; - } - } - return _VSTD::copy(__first2, __last2, __result); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp); -} - -template <class _InputIterator1, class _InputIterator2, class _OutputIterator> -inline _LIBCPP_INLINE_VISIBILITY -_OutputIterator -set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result) -{ - return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// lexicographical_compare - -template <class _Compare, class _InputIterator1, class _InputIterator2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool -__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) -{ - for (; __first2 != __last2; ++__first1, (void) ++__first2) - { - if (__first1 == __last1 || __comp(*__first1, *__first2)) - return true; - if (__comp(*__first2, *__first1)) - return false; - } - return false; -} - -template <class _InputIterator1, class _InputIterator2, class _Compare> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp); -} - -template <class _InputIterator1, class _InputIterator2> -_LIBCPP_NODISCARD_EXT inline -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 -bool -lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _InputIterator2 __last2) -{ - return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2, - __less<typename iterator_traits<_InputIterator1>::value_type, - typename iterator_traits<_InputIterator2>::value_type>()); -} - -// next_permutation - -template <class _Compare, class _BidirectionalIterator> -bool -__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) -{ - _BidirectionalIterator __i = __last; - if (__first == __last || __first == --__i) - return false; - while (true) - { - _BidirectionalIterator __ip1 = __i; - if (__comp(*--__i, *__ip1)) - { - _BidirectionalIterator __j = __last; - while (!__comp(*__i, *--__j)) - ; - swap(*__i, *__j); - _VSTD::reverse(__ip1, __last); - return true; - } - if (__i == __first) - { - _VSTD::reverse(__first, __last); - return false; - } - } -} - -template <class _BidirectionalIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -bool -next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __next_permutation<_Comp_ref>(__first, __last, __comp); -} - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -bool -next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) -{ - return _VSTD::next_permutation(__first, __last, - __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); -} - -// prev_permutation - -template <class _Compare, class _BidirectionalIterator> -bool -__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) -{ - _BidirectionalIterator __i = __last; - if (__first == __last || __first == --__i) - return false; - while (true) - { - _BidirectionalIterator __ip1 = __i; - if (__comp(*__ip1, *--__i)) - { - _BidirectionalIterator __j = __last; - while (!__comp(*--__j, *__i)) - ; - swap(*__i, *__j); - _VSTD::reverse(__ip1, __last); - return true; - } - if (__i == __first) - { - _VSTD::reverse(__first, __last); - return false; - } - } -} - -template <class _BidirectionalIterator, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY -bool -prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) -{ - typedef typename __comp_ref_type<_Compare>::type _Comp_ref; - return __prev_permutation<_Comp_ref>(__first, __last, __comp); -} - -template <class _BidirectionalIterator> -inline _LIBCPP_INLINE_VISIBILITY -bool -prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last) -{ - return _VSTD::prev_permutation(__first, __last, - __less<typename iterator_traits<_BidirectionalIterator>::value_type>()); -} - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - #if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 # include <__pstl_algorithm> #endif -#endif // _LIBCPP_ALGORITHM +#endif // _LIBCPP_ALGORITHM
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/any b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/any index 51731b7..c5b7af2 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/any +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/any
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===------------------------------ any -----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -80,11 +80,13 @@ */ -#include <experimental/__config> -#include <memory> -#include <typeinfo> -#include <type_traits> +#include <__availability> +#include <__config> +#include <__utility/forward.h> #include <cstdlib> +#include <memory> +#include <type_traits> +#include <typeinfo> #include <version> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/array b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/array index da2ae2e..06884ea 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/array +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/array
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- array -----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -109,25 +109,22 @@ */ #include <__config> +#include <__debug> #include <__tuple> +#include <algorithm> +#include <cstdlib> // for _LIBCPP_UNREACHABLE +#include <iterator> +#include <stdexcept> #include <type_traits> #include <utility> -#include <iterator> -#include <algorithm> -#include <stdexcept> -#include <cstdlib> // for _LIBCPP_UNREACHABLE #include <version> -#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif - - _LIBCPP_BEGIN_NAMESPACE_STD - template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array { @@ -142,8 +139,8 @@ typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _Tp __elems_[_Size]; @@ -155,7 +152,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - std::swap_ranges(data(), data() + _Size, __a.data()); + _VSTD::swap_ranges(data(), data() + _Size, __a.data()); } // iterators: @@ -245,8 +242,8 @@ typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef std::reverse_iterator<iterator> reverse_iterator; - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; typedef typename conditional<is_const<_Tp>::value, const char, char>::type _CharType; @@ -359,9 +356,9 @@ }; -#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +#if _LIBCPP_STD_VER >= 17 template<class _Tp, class... _Args, - class = _EnableIf<__all<_IsSame<_Tp, _Args>::value...>::value> + class = enable_if_t<__all<_IsSame<_Tp, _Args>::value...>::value> > array(_Tp, _Args...) -> array<_Tp, 1 + sizeof...(_Args)>; @@ -500,7 +497,7 @@ static_assert( is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements."); - return __to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); + return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); } template <typename _Tp, size_t _Size> @@ -512,12 +509,12 @@ static_assert( is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements."); - return __to_array_rvalue_impl(_VSTD::move(__arr), - make_index_sequence<_Size>()); + return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr), + make_index_sequence<_Size>()); } #endif // _LIBCPP_STD_VER > 17 _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP_ARRAY +#endif // _LIBCPP_ARRAY
diff --git a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/atomic b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/atomic index 56bd035..cfd0e1d 100644 --- a/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/atomic +++ b/aarch64/usr/aarch64-cros-linux-gnu/usr/include/c++/v1/atomic
@@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- atomic -----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -48,6 +48,7 @@ #define ATOMIC_BOOL_LOCK_FREE unspecified #define ATOMIC_CHAR_LOCK_FREE unspecified +#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // C++20 #define ATOMIC_CHAR16_T_LOCK_FREE unspecified #define ATOMIC_CHAR32_T_LOCK_FREE unspecified #define ATOMIC_WCHAR_T_LOCK_FREE unspecified @@ -66,7 +67,8 @@ bool is_lock_free() const volatile noexcept; bool is_lock_free() const noexcept; - atomic() noexcept = default; + atomic() noexcept = default; // until C++20 + constexpr atomic() noexcept(is_nothrow_default_constructible_v<T>); // since C++20 constexpr atomic(T desr) noexcept; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; @@ -200,7 +202,8 @@ bool is_lock_free() const volatile noexcept; bool is_lock_free() const noexcept; - atomic() noexcept = default; + atomic() noexcept = default; // until C++20 + constexpr atomic() noexcept; // since C++20 constexpr atomic(T* desr) noexcept; atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; @@ -260,196 +263,137 @@ }; -template <class T> - bool atomic_is_lock_free(const volatile atomic<T>* obj) noexcept; +// [atomics.nonmembers], non-member functions +template<class T> + bool atomic_is_lock_free(const volatile atomic<T>*) noexcept; +template<class T> + bool atomic_is_lock_free(const atomic<T>*) noexcept; +template<class T> + void atomic_store(volatile atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + void atomic_store(atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + void atomic_store_explicit(volatile atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + void atomic_store_explicit(atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_load(const volatile atomic<T>*) noexcept; +template<class T> + T atomic_load(const atomic<T>*) noexcept; +template<class T> + T atomic_load_explicit(const volatile atomic<T>*, memory_order) noexcept; +template<class T> + T atomic_load_explicit(const atomic<T>*, memory_order) noexcept; +template<class T> + T atomic_exchange(volatile atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_exchange(atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_exchange_explicit(volatile atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_exchange_explicit(atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + bool atomic_compare_exchange_weak(volatile atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type) noexcept; +template<class T> + bool atomic_compare_exchange_weak(atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type) noexcept; +template<class T> + bool atomic_compare_exchange_strong(volatile atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type) noexcept; +template<class T> + bool atomic_compare_exchange_strong(atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type) noexcept; +template<class T> + bool atomic_compare_exchange_weak_explicit(volatile atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type, + memory_order, memory_order) noexcept; +template<class T> + bool atomic_compare_exchange_weak_explicit(atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type, + memory_order, memory_order) noexcept; +template<class T> + bool atomic_compare_exchange_strong_explicit(volatile atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type, + memory_order, memory_order) noexcept; +template<class T> + bool atomic_compare_exchange_strong_explicit(atomic<T>*, atomic<T>::value_type*, + atomic<T>::value_type, + memory_order, memory_order) noexcept; -template <class T> - bool atomic_is_lock_free(const atomic<T>* obj) noexcept; +template<class T> + T atomic_fetch_add(volatile atomic<T>*, atomic<T>::difference_type) noexcept; +template<class T> + T atomic_fetch_add(atomic<T>*, atomic<T>::difference_type) noexcept; +template<class T> + T atomic_fetch_add_explicit(volatile atomic<T>*, atomic<T>::difference_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_add_explicit(atomic<T>*, atomic<T>::difference_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_sub(volatile atomic<T>*, atomic<T>::difference_type) noexcept; +template<class T> + T atomic_fetch_sub(atomic<T>*, atomic<T>::difference_type) noexcept; +template<class T> + T atomic_fetch_sub_explicit(volatile atomic<T>*, atomic<T>::difference_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_sub_explicit(atomic<T>*, atomic<T>::difference_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_and(volatile atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_and(atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_and_explicit(volatile atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_and_explicit(atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_or(volatile atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_or(atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_or_explicit(volatile atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_or_explicit(atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_xor(volatile atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_xor(atomic<T>*, atomic<T>::value_type) noexcept; +template<class T> + T atomic_fetch_xor_explicit(volatile atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; +template<class T> + T atomic_fetch_xor_explicit(atomic<T>*, atomic<T>::value_type, + memory_order) noexcept; -template <class T> - void atomic_store(volatile atomic<T>* obj, T desr) noexcept; - -template <class T> - void atomic_store(atomic<T>* obj, T desr) noexcept; - -template <class T> - void atomic_store_explicit(volatile atomic<T>* obj, T desr, memory_order m) noexcept; - -template <class T> - void atomic_store_explicit(atomic<T>* obj, T desr, memory_order m) noexcept; - -template <class T> - T atomic_load(const volatile atomic<T>* obj) noexcept; - -template <class T> - T atomic_load(const atomic<T>* obj) noexcept; - -template <class T> - T atomic_load_explicit(const volatile atomic<T>* obj, memory_order m) noexcept; - -template <class T> - T atomic_load_explicit(const atomic<T>* obj, memory_order m) noexcept; - -template <class T> - T atomic_exchange(volatile atomic<T>* obj, T desr) noexcept; - -template <class T> - T atomic_exchange(atomic<T>* obj, T desr) noexcept; - -template <class T> - T atomic_exchange_explicit(volatile atomic<T>* obj, T desr, memory_order m) noexcept; - -template <class T> - T atomic_exchange_explicit(atomic<T>* obj, T desr, memory_order m) noexcept; - -template <class T> - bool atomic_compare_exchange_weak(volatile atomic<T>* obj, T* expc, T desr) noexcept; - -template <class T> - bool atomic_compare_exchange_weak(atomic<T>* obj, T* expc, T desr) noexcept; - -template <class T> - bool atomic_compare_exchange_strong(volatile atomic<T>* obj, T* expc, T desr) noexcept; - -template <class T> - bool atomic_compare_exchange_strong(atomic<T>* obj, T* expc, T desr) noexcept; - -template <class T> - bool atomic_compare_exchange_weak_explicit(volatile atomic<T>* obj, T* expc, - T desr, - memory_order s, memory_order f) noexcept; - -template <class T> - bool atomic_compare_exchange_weak_explicit(atomic<T>* obj, T* expc, T desr, - memory_order s, memory_order f) noexcept; - -template <class T> - bool atomic_compare_exchange_strong_explicit(volatile atomic<T>* obj, - T* expc, T desr, - memory_order s, memory_order f) noexcept; - -template <class T> - bool atomic_compare_exchange_strong_explicit(atomic<T>* obj, T* expc, - T desr, - memory_order s, memory_order f) noexcept; - -template <class T> - void atomic_wait(const volatile atomic<T>* obj, T old) noexcept; - -template <class T> - void atomic_wait(const atomic<T>* obj, T old) noexcept; - -template <class T> - void atomic_wait_explicit(const volatile atomic<T>* obj, T old, memory_order m) noexcept; - -template <class T> - void atomic_wait_explicit(const atomic<T>* obj, T old, memory_order m) noexcept; - -template <class T> - void atomic_one(volatile atomic<T>* obj) noexcept; - -template <class T> - void atomic_one(atomic<T>* obj) noexcept; - -template <class T> - void atomic_all(volatile atomic<T>* obj) noexcept; - -template <class T> - void atomic_all(atomic<T>* obj) noexcept; - -template <class Integral> - Integral atomic_fetch_add(volatile atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_add(atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_add_explicit(volatile atomic<Integral>* obj, Integral op, - memory_order m) noexcept; -template <class Integral> - Integral atomic_fetch_add_explicit(atomic<Integral>* obj, Integral op, - memory_order m) noexcept; -template <class Integral> - Integral atomic_fetch_sub(volatile atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_sub(atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_sub_explicit(volatile atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_sub_explicit(atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_and(volatile atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_and(atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_and_explicit(volatile atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_and_explicit(atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_or(volatile atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_or(atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_or_explicit(volatile atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_or_explicit(atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_xor(volatile atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_xor(atomic<Integral>* obj, Integral op) noexcept; - -template <class Integral> - Integral atomic_fetch_xor_explicit(volatile atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class Integral> - Integral atomic_fetch_xor_explicit(atomic<Integral>* obj, Integral op, - memory_order m) noexcept; - -template <class T> - T* atomic_fetch_add(volatile atomic<T*>* obj, ptrdiff_t op) noexcept; - -template <class T> - T* atomic_fetch_add(atomic<T*>* obj, ptrdiff_t op) noexcept; - -template <class T> - T* atomic_fetch_add_explicit(volatile atomic<T*>* obj, ptrdiff_t op, - memory_order m) noexcept; - -template <class T> - T* atomic_fetch_add_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m) noexcept; - -template <class T> - T* atomic_fetch_sub(volatile atomic<T*>* obj, ptrdiff_t op) noexcept; - -template <class T> - T* atomic_fetch_sub(atomic<T*>* obj, ptrdiff_t op) noexcept; - -template <class T> - T* atomic_fetch_sub_explicit(volatile atomic<T*>* obj, ptrdiff_t op, - memory_order m) noexcept; - -template <class T> - T* atomic_fetch_sub_explicit(atomic<T*>* obj, ptrdiff_t op, memory_order m) noexcept; +template<class T> + void atomic_wait(const volatile atomic<T>*, atomic<T>::value_type); +template<class T> + void atomic_wait(const atomic<T>*, atomic<T>::value_type); +template<class T> + void atomic_wait_explicit(const volatile atomic<T>*, atomic<T>::value_type, + memory_order); +template<class T> + void atomic_wait_explicit(const atomic<T>*, atomic<T>::value_type, + memory_order); +template<class T> + void atomic_notify_one(volatile atomic<T>*); +template<class T> + void atomic_notify_one(atomic<T>*); +template<class T> + void atomic_notify_all(volatile atomic<T>*); +template<class T> + void atomic_notify_all(atomic<T>*); // Atomics for standard typedef types @@ -465,6 +409,7 @@ typedef atomic<unsigned long> atomic_ulong; typedef atomic<long long> atomic_llong; typedef atomic<unsigned long long> atomic_ullong; +typedef atomic<char8_t> atomic_char8_t; // C++20 typedef atomic<char16_t> atomic_char16_t; typedef atomic<char32_t> atomic_char32_t; typedef atomic<wchar_t> atomic_wchar_t; @@ -482,7 +427,7 @@ typedef atomic<uint_fast8_t> atomic_uint_fast8_t; typedef atomic<int_fast16_t> atomic_int_fast16_t; typedef atomic<uint_fast16_t> atomic_uint_fast16_t; -typedef atomic<int_fast32_t> atomic_int_fast32_t; +typedef atomic<int_fast32_t> atomic_int_fast32_t; typedef atomic<uint_fast32_t> atomic_uint_fast32_t; typedef atomic<int_fast64_t> atomic_int_fast64_t; typedef atomic<uint_fast64_t> atomic_uint_fast64_t; @@ -507,7 +452,8 @@ typedef struct atomic_flag { - atomic_flag() noexcept = default; + atomic_flag() noexcept = default; // until C++20 + constexpr atomic_flag() noexcept; // since C++20 atomic_flag(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) volatile = delete; @@ -559,10 +505,10 @@ // deprecated template <class T> - void atomic_init(volatile atomic<T>* obj, typename atomic<T>::value_type desr) noexcept; + void atomic_init(volatile atomic<T>* obj, atomic<T>::value_type desr) noexcept; template <class T> - void atomic_init(atomic<T>* obj, typename atomic<T>::value_type desr) noexcept; + void atomic_init(atomic<T>* obj, atomic<T>::value_type desr) noexcept; #define ATOMIC_VAR_INIT(value) see below @@ -572,21 +518,23 @@ */ +#include <__availability> #include <__config> -#include <__threading_support> +#include <__thread/poll_with_backoff.h> #include <cstddef> #include <cstdint> #include <cstring> #include <type_traits> #include <version> +#ifndef _LIBCPP_HAS_NO_THREADS +# include <__threading_support> +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -#ifdef _LIBCPP_HAS_NO_THREADS -# error <atomic> is not supported on this single threaded system -#endif #ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER # error <atomic> is not implemented #endif @@ -659,14 +607,14 @@ template <typename _Tp> _LIBCPP_INLINE_VISIBILITY bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) { - return memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0; + return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0; } static_assert((is_same<underlying_type<memory_order>::type, __memory_order_underlying_t>::value), "unexpected underlying type for std::memory_order"); #if defined(_LIBCPP_HAS_GCC_ATOMIC_IMP) || \ - defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS) + defined(_LIBCPP_ATOMIC_ONLY_USE_BUILTINS) // [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because // the default operator= in an object is not volatile, a byte-by-byte copy @@ -1014,26 +962,33 @@ return __c11_atomic_exchange(&__a->__a_value, __value, static_cast<__memory_order_underlying_t>(__order)); } +_LIBCPP_INLINE_VISIBILITY inline _LIBCPP_CONSTEXPR memory_order __to_failure_order(memory_order __order) { + // Avoid switch statement to make this a constexpr. + return __order == memory_order_release ? memory_order_relaxed: + (__order == memory_order_acq_rel ? memory_order_acquire: + __order); +} + template<class _Tp> _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { - return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); + return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure))); } template<class _Tp> _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { - return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); + return __c11_atomic_compare_exchange_strong(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure))); } template<class _Tp> _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { - return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); + return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure))); } template<class _Tp> _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_base_impl<_Tp> * __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) _NOEXCEPT { - return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__failure)); + return __c11_atomic_compare_exchange_weak(&__a->__a_value, __expected, __value, static_cast<__memory_order_underlying_t>(__success), static_cast<__memory_order_underlying_t>(__to_failure_order(__failure))); } template<class _Tp> @@ -1124,6 +1079,9 @@ #if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE) # define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE # define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE +#ifndef _LIBCPP_HAS_NO_CHAR8_T +# define ATOMIC_CHAR8_T_LOCK_FREE __CLANG_ATOMIC_CHAR8_T_LOCK_FREE +#endif # define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE # define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE # define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE @@ -1135,6 +1093,9 @@ #elif defined(__GCC_ATOMIC_BOOL_LOCK_FREE) # define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE # define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE +#ifndef _LIBCPP_HAS_NO_CHAR8_T +# define ATOMIC_CHAR8_T_LOCK_FREE __GCC_ATOMIC_CHAR8_T_LOCK_FREE +#endif # define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE # define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE # define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE @@ -1253,7 +1214,7 @@ _Tp __temp; __a->__lock(); __cxx_atomic_assign_volatile(__temp, __a->__a_value); - bool __ret = (memcmp(&__temp, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0); if(__ret) __cxx_atomic_assign_volatile(__a->__a_value, __value); else @@ -1266,11 +1227,11 @@ bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order, memory_order) { __a->__lock(); - bool __ret = (memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); if(__ret) - memcpy(&__a->__a_value, &__value, sizeof(_Tp)); + _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp)); else - memcpy(__expected, &__a->__a_value, sizeof(_Tp)); + _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp)); __a->__unlock(); return __ret; } @@ -1282,7 +1243,7 @@ _Tp __temp; __a->__lock(); __cxx_atomic_assign_volatile(__temp, __a->__a_value); - bool __ret = (memcmp(&__temp, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0); if(__ret) __cxx_atomic_assign_volatile(__a->__a_value, __value); else @@ -1295,11 +1256,11 @@ bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order, memory_order) { __a->__lock(); - bool __ret = (memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); if(__ret) - memcpy(&__a->__a_value, &__value, sizeof(_Tp)); + _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp)); else - memcpy(__expected, &__a->__a_value, sizeof(_Tp)); + _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp)); __a->__unlock(); return __ret; } @@ -1449,9 +1410,14 @@ template<> struct __cxx_is_always_lock_free<char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free<signed char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free<unsigned char> { enum { __value = 2 == ATOMIC_CHAR_LOCK_FREE }; }; +#ifndef _LIBCPP_HAS_NO_CHAR8_T +template<> struct __cxx_is_always_lock_free<char8_t> { enum { __value = 2 == ATOMIC_CHAR8_T_LOCK_FREE }; }; +#endif template<> struct __cxx_is_always_lock_free<char16_t> { enum { __value = 2 == ATOMIC_CHAR16_T_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free<char32_t> { enum { __value = 2 == ATOMIC_CHAR32_T_LOCK_FREE }; }; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS template<> struct __cxx_is_always_lock_free<wchar_t> { enum { __value = 2 == ATOMIC_WCHAR_T_LOCK_FREE }; }; +#endif template<> struct __cxx_is_always_lock_free<short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free<unsigned short> { enum { __value = 2 == ATOMIC_SHORT_LOCK_FREE }; }; template<> struct __cxx_is_always_lock_free<int> { enum { __value = 2 == ATOMIC_INT_LOCK_FREE }; }; @@ -1474,11 +1440,8 @@ typename _Base = __cxx_atomic_base_impl<_Tp> > #endif //_LIBCPP_ATOMIC_ONLY_USE_BUILTINS struct __cxx_atomic_impl : public _Base { - -#if _GNUC_VER >= 501 static_assert(is_trivially_copyable<_Tp>::value, - "std::atomic<Tp> requires that 'Tp' be a trivially copyable type"); -#endif + "std::atomic<T> requires that 'T' be a trivially copyable type"); _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT _LIBCPP_DEFAULT _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp value) _NOEXCEPT @@ -1491,10 +1454,18 @@ using __cxx_contention_t = int64_t; #endif //__linux__ -#if _LIBCPP_STD_VER >= 11 - using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>; +#if defined(_LIBCPP_HAS_NO_THREADS) +# define _LIBCPP_HAS_NO_PLATFORM_WAIT +#endif + +// TODO: +// _LIBCPP_HAS_NO_PLATFORM_WAIT is currently a "dead" macro, in the sense that +// it is not tied anywhere into the build system or even documented. We should +// clean it up because it is technically never defined except when threads are +// disabled. We should clean it up in its own changeset in case we break "bad" +// users. #ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*); @@ -1524,7 +1495,7 @@ else if(__elapsed > chrono::microseconds(4)) __libcpp_thread_yield(); else - ; // poll + {} // poll return false; } }; @@ -1546,7 +1517,12 @@ template <class _Atp, class _Fn> _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp*, _Fn && __test_fn) { - return __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy()); +#if defined(_LIBCPP_HAS_NO_THREADS) + using _Policy = __spinning_backoff_policy; +#else + using _Policy = __libcpp_timed_backoff_policy; +#endif + return __libcpp_thread_poll_with_backoff(__test_fn, _Policy()); } #endif // _LIBCPP_HAS_NO_PLATFORM_WAIT @@ -1570,8 +1546,6 @@ return __cxx_atomic_wait(__a, __test_fn); } -#endif //_LIBCPP_STD_VER >= 11 - // general atomic<T> template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value> @@ -1665,24 +1639,23 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY void notify_all() _NOEXCEPT {__cxx_atomic_notify_all(&__a_);} +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY constexpr + __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {} +#else _LIBCPP_INLINE_VISIBILITY __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT +#endif _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {} #ifndef _LIBCPP_CXX03_LANG __atomic_base(const __atomic_base&) = delete; - __atomic_base& operator=(const __atomic_base&) = delete; - __atomic_base& operator=(const __atomic_base&) volatile = delete; #else private: _LIBCPP_INLINE_VISIBILITY __atomic_base(const __atomic_base&); - _LIBCPP_INLINE_VISIBILITY - __atomic_base& operator=(const __atomic_base&); - _LIBCPP_INLINE_VISIBILITY - __atomic_base& operator=(const __atomic_base&) volatile; #endif }; @@ -1698,8 +1671,10 @@ : public __atomic_base<_Tp, false> { typedef __atomic_base<_Tp, false> __base; - _LIBCPP_INLINE_VISIBILITY + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {} @@ -1781,8 +1756,15 @@ typedef __atomic_base<_Tp> __base; typedef _Tp value_type; typedef value_type difference_type; + +#if _LIBCPP_STD_VER > 17 + _LIBCPP_INLINE_VISIBILITY + atomic() = default; +#else _LIBCPP_INLINE_VISIBILITY atomic() _NOEXCEPT _LIBCPP_DEFAULT +#endif + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {} @@ -1792,6 +1774,9 @@ _LIBCPP_INLINE_VISIBILITY _Tp operator=(_Tp __d) _NOEXCEPT {__base::store(__d); return __d;} + + atomic& operator=(const atomic&) = delete; + atomic& operator=(const atomic&) volatile = delete; }; // atomic<T*> @@ -1803,8 +1788,10 @@ typedef __atomic_base<_Tp*> __base; typedef _Tp* value_type; typedef ptrdiff_t difference_type; + _LIBCPP_INLINE_VISIBILITY atomic() _NOEXCEPT _LIBCPP_DEFAULT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {} @@ -1816,19 +1803,32 @@ {__base::store(__d); return __d;} _LIBCPP_INLINE_VISIBILITY - _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) - volatile _NOEXCEPT - {return __cxx_atomic_fetch_add(&this->__a_, __op, __m);} + _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT { +